1ac7ddfbfSEd Maste //===-- CPPLanguageRuntime.cpp -------------------------------------------------*- C++ -*-===// 2ac7ddfbfSEd Maste // 3ac7ddfbfSEd Maste // The LLVM Compiler Infrastructure 4ac7ddfbfSEd Maste // 5ac7ddfbfSEd Maste // This file is distributed under the University of Illinois Open Source 6ac7ddfbfSEd Maste // License. See LICENSE.TXT for details. 7ac7ddfbfSEd Maste // 8ac7ddfbfSEd Maste //===----------------------------------------------------------------------===// 9ac7ddfbfSEd Maste 10ac7ddfbfSEd Maste #include "lldb/Target/CPPLanguageRuntime.h" 11ac7ddfbfSEd Maste 12ac7ddfbfSEd Maste #include <string.h> 13ac7ddfbfSEd Maste 147aa51b79SEd Maste #include "llvm/ADT/StringRef.h" 157aa51b79SEd Maste 16ac7ddfbfSEd Maste #include "lldb/Core/PluginManager.h" 17ac7ddfbfSEd Maste #include "lldb/Core/UniqueCStringMap.h" 18ac7ddfbfSEd Maste #include "lldb/Target/ExecutionContext.h" 19ac7ddfbfSEd Maste 20ac7ddfbfSEd Maste using namespace lldb; 21ac7ddfbfSEd Maste using namespace lldb_private; 22ac7ddfbfSEd Maste 23ac7ddfbfSEd Maste class CPPRuntimeEquivalents 24ac7ddfbfSEd Maste { 25ac7ddfbfSEd Maste public: 26ac7ddfbfSEd Maste CPPRuntimeEquivalents () 27ac7ddfbfSEd Maste { 28ac7ddfbfSEd Maste 29ac7ddfbfSEd Maste m_impl.Append(ConstString("std::basic_string<char, std::char_traits<char>, std::allocator<char> >").AsCString(), ConstString("basic_string<char>")); 30ac7ddfbfSEd Maste 31ac7ddfbfSEd Maste // these two (with a prefixed std::) occur when c++stdlib string class occurs as a template argument in some STL container 32ac7ddfbfSEd Maste m_impl.Append(ConstString("std::basic_string<char, std::char_traits<char>, std::allocator<char> >").AsCString(), ConstString("std::basic_string<char>")); 33ac7ddfbfSEd Maste 34ac7ddfbfSEd Maste m_impl.Sort(); 35ac7ddfbfSEd Maste } 36ac7ddfbfSEd Maste 37ac7ddfbfSEd Maste void 38ac7ddfbfSEd Maste Add (ConstString& type_name, 39ac7ddfbfSEd Maste ConstString& type_equivalent) 40ac7ddfbfSEd Maste { 41ac7ddfbfSEd Maste m_impl.Insert(type_name.AsCString(), type_equivalent); 42ac7ddfbfSEd Maste } 43ac7ddfbfSEd Maste 44ac7ddfbfSEd Maste uint32_t 45ac7ddfbfSEd Maste FindExactMatches (ConstString& type_name, 46ac7ddfbfSEd Maste std::vector<ConstString>& equivalents) 47ac7ddfbfSEd Maste { 48ac7ddfbfSEd Maste 49ac7ddfbfSEd Maste uint32_t count = 0; 50ac7ddfbfSEd Maste 51ac7ddfbfSEd Maste for (ImplData match = m_impl.FindFirstValueForName(type_name.AsCString()); 52ac7ddfbfSEd Maste match != NULL; 53ac7ddfbfSEd Maste match = m_impl.FindNextValueForName(match)) 54ac7ddfbfSEd Maste { 55ac7ddfbfSEd Maste equivalents.push_back(match->value); 56ac7ddfbfSEd Maste count++; 57ac7ddfbfSEd Maste } 58ac7ddfbfSEd Maste 59ac7ddfbfSEd Maste return count; 60ac7ddfbfSEd Maste } 61ac7ddfbfSEd Maste 62ac7ddfbfSEd Maste // partial matches can occur when a name with equivalents is a template argument. 63ac7ddfbfSEd Maste // e.g. we may have "class Foo" be a match for "struct Bar". if we have a typename 64ac7ddfbfSEd Maste // such as "class Templatized<class Foo, Anything>" we want this to be replaced with 65ac7ddfbfSEd Maste // "class Templatized<struct Bar, Anything>". Since partial matching is time consuming 66ac7ddfbfSEd Maste // once we get a partial match, we add it to the exact matches list for faster retrieval 67ac7ddfbfSEd Maste uint32_t 68ac7ddfbfSEd Maste FindPartialMatches (ConstString& type_name, 69ac7ddfbfSEd Maste std::vector<ConstString>& equivalents) 70ac7ddfbfSEd Maste { 71ac7ddfbfSEd Maste 72ac7ddfbfSEd Maste uint32_t count = 0; 73ac7ddfbfSEd Maste 74ac7ddfbfSEd Maste const char* type_name_cstr = type_name.AsCString(); 75ac7ddfbfSEd Maste 76ac7ddfbfSEd Maste size_t items_count = m_impl.GetSize(); 77ac7ddfbfSEd Maste 78ac7ddfbfSEd Maste for (size_t item = 0; item < items_count; item++) 79ac7ddfbfSEd Maste { 80ac7ddfbfSEd Maste const char* key_cstr = m_impl.GetCStringAtIndex(item); 81ac7ddfbfSEd Maste if ( strstr(type_name_cstr,key_cstr) ) 82ac7ddfbfSEd Maste { 83ac7ddfbfSEd Maste count += AppendReplacements(type_name_cstr, 84ac7ddfbfSEd Maste key_cstr, 85ac7ddfbfSEd Maste equivalents); 86ac7ddfbfSEd Maste } 87ac7ddfbfSEd Maste } 88ac7ddfbfSEd Maste 89ac7ddfbfSEd Maste return count; 90ac7ddfbfSEd Maste 91ac7ddfbfSEd Maste } 92ac7ddfbfSEd Maste 93ac7ddfbfSEd Maste private: 94ac7ddfbfSEd Maste 95ac7ddfbfSEd Maste std::string& replace (std::string& target, 96ac7ddfbfSEd Maste std::string& pattern, 97ac7ddfbfSEd Maste std::string& with) 98ac7ddfbfSEd Maste { 99ac7ddfbfSEd Maste size_t pos; 100ac7ddfbfSEd Maste size_t pattern_len = pattern.size(); 101ac7ddfbfSEd Maste 102ac7ddfbfSEd Maste while ( (pos = target.find(pattern)) != std::string::npos ) 103ac7ddfbfSEd Maste target.replace(pos, pattern_len, with); 104ac7ddfbfSEd Maste 105ac7ddfbfSEd Maste return target; 106ac7ddfbfSEd Maste } 107ac7ddfbfSEd Maste 108ac7ddfbfSEd Maste uint32_t 109ac7ddfbfSEd Maste AppendReplacements (const char* original, 110ac7ddfbfSEd Maste const char *matching_key, 111ac7ddfbfSEd Maste std::vector<ConstString>& equivalents) 112ac7ddfbfSEd Maste { 113ac7ddfbfSEd Maste 114ac7ddfbfSEd Maste std::string matching_key_str(matching_key); 115ac7ddfbfSEd Maste ConstString original_const(original); 116ac7ddfbfSEd Maste 117ac7ddfbfSEd Maste uint32_t count = 0; 118ac7ddfbfSEd Maste 119ac7ddfbfSEd Maste for (ImplData match = m_impl.FindFirstValueForName(matching_key); 120ac7ddfbfSEd Maste match != NULL; 121ac7ddfbfSEd Maste match = m_impl.FindNextValueForName(match)) 122ac7ddfbfSEd Maste { 123ac7ddfbfSEd Maste std::string target(original); 124ac7ddfbfSEd Maste std::string equiv_class(match->value.AsCString()); 125ac7ddfbfSEd Maste 126ac7ddfbfSEd Maste replace (target, matching_key_str, equiv_class); 127ac7ddfbfSEd Maste 128ac7ddfbfSEd Maste ConstString target_const(target.c_str()); 129ac7ddfbfSEd Maste 130ac7ddfbfSEd Maste // you will most probably want to leave this off since it might make this map grow indefinitely 131ac7ddfbfSEd Maste #ifdef ENABLE_CPP_EQUIVALENTS_MAP_TO_GROW 132ac7ddfbfSEd Maste Add(original_const, target_const); 133ac7ddfbfSEd Maste #endif 134ac7ddfbfSEd Maste equivalents.push_back(target_const); 135ac7ddfbfSEd Maste 136ac7ddfbfSEd Maste count++; 137ac7ddfbfSEd Maste } 138ac7ddfbfSEd Maste 139ac7ddfbfSEd Maste return count; 140ac7ddfbfSEd Maste } 141ac7ddfbfSEd Maste 142ac7ddfbfSEd Maste typedef UniqueCStringMap<ConstString> Impl; 143ac7ddfbfSEd Maste typedef const Impl::Entry* ImplData; 144ac7ddfbfSEd Maste Impl m_impl; 145ac7ddfbfSEd Maste }; 146ac7ddfbfSEd Maste 147ac7ddfbfSEd Maste static CPPRuntimeEquivalents& 148ac7ddfbfSEd Maste GetEquivalentsMap () 149ac7ddfbfSEd Maste { 150ac7ddfbfSEd Maste static CPPRuntimeEquivalents g_equivalents_map; 151ac7ddfbfSEd Maste return g_equivalents_map; 152ac7ddfbfSEd Maste } 153ac7ddfbfSEd Maste 154ac7ddfbfSEd Maste //---------------------------------------------------------------------- 155ac7ddfbfSEd Maste // Destructor 156ac7ddfbfSEd Maste //---------------------------------------------------------------------- 157ac7ddfbfSEd Maste CPPLanguageRuntime::~CPPLanguageRuntime() 158ac7ddfbfSEd Maste { 159ac7ddfbfSEd Maste } 160ac7ddfbfSEd Maste 161ac7ddfbfSEd Maste CPPLanguageRuntime::CPPLanguageRuntime (Process *process) : 162ac7ddfbfSEd Maste LanguageRuntime (process) 163ac7ddfbfSEd Maste { 164ac7ddfbfSEd Maste 165ac7ddfbfSEd Maste } 166ac7ddfbfSEd Maste 167ac7ddfbfSEd Maste bool 168ac7ddfbfSEd Maste CPPLanguageRuntime::GetObjectDescription (Stream &str, ValueObject &object) 169ac7ddfbfSEd Maste { 170ac7ddfbfSEd Maste // C++ has no generic way to do this. 171ac7ddfbfSEd Maste return false; 172ac7ddfbfSEd Maste } 173ac7ddfbfSEd Maste 174ac7ddfbfSEd Maste bool 175ac7ddfbfSEd Maste CPPLanguageRuntime::GetObjectDescription (Stream &str, Value &value, ExecutionContextScope *exe_scope) 176ac7ddfbfSEd Maste { 177ac7ddfbfSEd Maste // C++ has no generic way to do this. 178ac7ddfbfSEd Maste return false; 179ac7ddfbfSEd Maste } 180ac7ddfbfSEd Maste 181ac7ddfbfSEd Maste bool 182ac7ddfbfSEd Maste CPPLanguageRuntime::IsCPPMangledName (const char *name) 183ac7ddfbfSEd Maste { 184ac7ddfbfSEd Maste // FIXME, we should really run through all the known C++ Language plugins and ask each one if 185ac7ddfbfSEd Maste // this is a C++ mangled name, but we can put that off till there is actually more than one 186ac7ddfbfSEd Maste // we care about. 187ac7ddfbfSEd Maste 188ac7ddfbfSEd Maste if (name && name[0] == '_' && name[1] == 'Z') 189ac7ddfbfSEd Maste return true; 190ac7ddfbfSEd Maste else 191ac7ddfbfSEd Maste return false; 192ac7ddfbfSEd Maste } 193ac7ddfbfSEd Maste 194ac7ddfbfSEd Maste bool 1957aa51b79SEd Maste CPPLanguageRuntime::ExtractContextAndIdentifier (const char *name, llvm::StringRef &context, llvm::StringRef &identifier) 196ac7ddfbfSEd Maste { 1977aa51b79SEd Maste static RegularExpression g_basename_regex("^(([A-Za-z_][A-Za-z_0-9]*::)*)([A-Za-z_][A-Za-z_0-9]*)$"); 1987aa51b79SEd Maste RegularExpression::Match match(4); 1997aa51b79SEd Maste if (g_basename_regex.Execute (name, &match)) 200ac7ddfbfSEd Maste { 2017aa51b79SEd Maste match.GetMatchAtIndex(name, 1, context); 2027aa51b79SEd Maste match.GetMatchAtIndex(name, 3, identifier); 203ac7ddfbfSEd Maste return true; 204ac7ddfbfSEd Maste } 205ac7ddfbfSEd Maste return false; 206ac7ddfbfSEd Maste } 207ac7ddfbfSEd Maste 208ac7ddfbfSEd Maste uint32_t 209ac7ddfbfSEd Maste CPPLanguageRuntime::FindEquivalentNames(ConstString type_name, std::vector<ConstString>& equivalents) 210ac7ddfbfSEd Maste { 211ac7ddfbfSEd Maste uint32_t count = GetEquivalentsMap().FindExactMatches(type_name, equivalents); 212ac7ddfbfSEd Maste 213ac7ddfbfSEd Maste bool might_have_partials= 214ac7ddfbfSEd Maste ( count == 0 ) // if we have a full name match just use it 215ac7ddfbfSEd Maste && (strchr(type_name.AsCString(), '<') != NULL // we should only have partial matches when templates are involved, check that we have 216ac7ddfbfSEd Maste && strchr(type_name.AsCString(), '>') != NULL); // angle brackets in the type_name before trying to scan for partial matches 217ac7ddfbfSEd Maste 218ac7ddfbfSEd Maste if ( might_have_partials ) 219ac7ddfbfSEd Maste count = GetEquivalentsMap().FindPartialMatches(type_name, equivalents); 220ac7ddfbfSEd Maste 221ac7ddfbfSEd Maste return count; 222ac7ddfbfSEd Maste } 223ac7ddfbfSEd Maste 224ac7ddfbfSEd Maste void 225ac7ddfbfSEd Maste CPPLanguageRuntime::MethodName::Clear() 226ac7ddfbfSEd Maste { 227ac7ddfbfSEd Maste m_full.Clear(); 228ac7ddfbfSEd Maste m_basename = llvm::StringRef(); 229ac7ddfbfSEd Maste m_context = llvm::StringRef(); 230ac7ddfbfSEd Maste m_arguments = llvm::StringRef(); 231ac7ddfbfSEd Maste m_qualifiers = llvm::StringRef(); 232ac7ddfbfSEd Maste m_type = eTypeInvalid; 233ac7ddfbfSEd Maste m_parsed = false; 234ac7ddfbfSEd Maste m_parse_error = false; 235ac7ddfbfSEd Maste } 236ac7ddfbfSEd Maste 237ac7ddfbfSEd Maste bool 238ac7ddfbfSEd Maste ReverseFindMatchingChars (const llvm::StringRef &s, 239ac7ddfbfSEd Maste const llvm::StringRef &left_right_chars, 240ac7ddfbfSEd Maste size_t &left_pos, 241ac7ddfbfSEd Maste size_t &right_pos, 242ac7ddfbfSEd Maste size_t pos = llvm::StringRef::npos) 243ac7ddfbfSEd Maste { 244ac7ddfbfSEd Maste assert (left_right_chars.size() == 2); 245ac7ddfbfSEd Maste left_pos = llvm::StringRef::npos; 246ac7ddfbfSEd Maste const char left_char = left_right_chars[0]; 247ac7ddfbfSEd Maste const char right_char = left_right_chars[1]; 248ac7ddfbfSEd Maste pos = s.find_last_of(left_right_chars, pos); 249ac7ddfbfSEd Maste if (pos == llvm::StringRef::npos || s[pos] == left_char) 250ac7ddfbfSEd Maste return false; 251ac7ddfbfSEd Maste right_pos = pos; 252ac7ddfbfSEd Maste uint32_t depth = 1; 253ac7ddfbfSEd Maste while (pos > 0 && depth > 0) 254ac7ddfbfSEd Maste { 255ac7ddfbfSEd Maste pos = s.find_last_of(left_right_chars, pos); 256ac7ddfbfSEd Maste if (pos == llvm::StringRef::npos) 257ac7ddfbfSEd Maste return false; 258ac7ddfbfSEd Maste if (s[pos] == left_char) 259ac7ddfbfSEd Maste { 260ac7ddfbfSEd Maste if (--depth == 0) 261ac7ddfbfSEd Maste { 262ac7ddfbfSEd Maste left_pos = pos; 263ac7ddfbfSEd Maste return left_pos < right_pos; 264ac7ddfbfSEd Maste } 265ac7ddfbfSEd Maste } 266ac7ddfbfSEd Maste else if (s[pos] == right_char) 267ac7ddfbfSEd Maste { 268ac7ddfbfSEd Maste ++depth; 269ac7ddfbfSEd Maste } 270ac7ddfbfSEd Maste } 271ac7ddfbfSEd Maste return false; 272ac7ddfbfSEd Maste } 273ac7ddfbfSEd Maste 2747aa51b79SEd Maste 275ac7ddfbfSEd Maste void 276ac7ddfbfSEd Maste CPPLanguageRuntime::MethodName::Parse() 277ac7ddfbfSEd Maste { 278ac7ddfbfSEd Maste if (!m_parsed && m_full) 279ac7ddfbfSEd Maste { 280ac7ddfbfSEd Maste // ConstString mangled; 281ac7ddfbfSEd Maste // m_full.GetMangledCounterpart(mangled); 282ac7ddfbfSEd Maste // printf ("\n parsing = '%s'\n", m_full.GetCString()); 283ac7ddfbfSEd Maste // if (mangled) 284ac7ddfbfSEd Maste // printf (" mangled = '%s'\n", mangled.GetCString()); 285ac7ddfbfSEd Maste m_parse_error = false; 286ac7ddfbfSEd Maste m_parsed = true; 287ac7ddfbfSEd Maste llvm::StringRef full (m_full.GetCString()); 288ac7ddfbfSEd Maste 289ac7ddfbfSEd Maste size_t arg_start, arg_end; 290ac7ddfbfSEd Maste llvm::StringRef parens("()", 2); 291ac7ddfbfSEd Maste if (ReverseFindMatchingChars (full, parens, arg_start, arg_end)) 292ac7ddfbfSEd Maste { 293ac7ddfbfSEd Maste m_arguments = full.substr(arg_start, arg_end - arg_start + 1); 294ac7ddfbfSEd Maste if (arg_end + 1 < full.size()) 295ac7ddfbfSEd Maste m_qualifiers = full.substr(arg_end + 1); 296ac7ddfbfSEd Maste if (arg_start > 0) 297ac7ddfbfSEd Maste { 298ac7ddfbfSEd Maste size_t basename_end = arg_start; 2997aa51b79SEd Maste size_t context_start = 0; 300ac7ddfbfSEd Maste size_t context_end = llvm::StringRef::npos; 301ac7ddfbfSEd Maste if (basename_end > 0 && full[basename_end-1] == '>') 302ac7ddfbfSEd Maste { 303ac7ddfbfSEd Maste // TODO: handle template junk... 304ac7ddfbfSEd Maste // Templated function 305ac7ddfbfSEd Maste size_t template_start, template_end; 306ac7ddfbfSEd Maste llvm::StringRef lt_gt("<>", 2); 307ac7ddfbfSEd Maste if (ReverseFindMatchingChars (full, lt_gt, template_start, template_end, basename_end)) 3087aa51b79SEd Maste { 309ac7ddfbfSEd Maste context_end = full.rfind(':', template_start); 310ac7ddfbfSEd Maste if (context_end == llvm::StringRef::npos) 3117aa51b79SEd Maste { 3127aa51b79SEd Maste // Check for templated functions that include return type like: 3137aa51b79SEd Maste // 'void foo<Int>()' 3147aa51b79SEd Maste context_end = full.rfind(' ', template_start); 3157aa51b79SEd Maste if (context_end != llvm::StringRef::npos) 3167aa51b79SEd Maste { 3177aa51b79SEd Maste context_start = context_end; 3187aa51b79SEd Maste } 3197aa51b79SEd Maste } 3207aa51b79SEd Maste } 3217aa51b79SEd Maste else 3227aa51b79SEd Maste { 323ac7ddfbfSEd Maste context_end = full.rfind(':', basename_end); 3247aa51b79SEd Maste } 3257aa51b79SEd Maste } 3267aa51b79SEd Maste else if (context_end == llvm::StringRef::npos) 3277aa51b79SEd Maste { 3287aa51b79SEd Maste context_end = full.rfind(':', basename_end); 3297aa51b79SEd Maste } 330ac7ddfbfSEd Maste 331ac7ddfbfSEd Maste if (context_end == llvm::StringRef::npos) 332ac7ddfbfSEd Maste m_basename = full.substr(0, basename_end); 333ac7ddfbfSEd Maste else 334ac7ddfbfSEd Maste { 3357aa51b79SEd Maste if (context_start < context_end) 3367aa51b79SEd Maste m_context = full.substr(context_start, context_end - 1); 337ac7ddfbfSEd Maste const size_t basename_begin = context_end + 1; 338ac7ddfbfSEd Maste m_basename = full.substr(basename_begin, basename_end - basename_begin); 339ac7ddfbfSEd Maste } 340ac7ddfbfSEd Maste m_type = eTypeUnknownMethod; 341ac7ddfbfSEd Maste } 342ac7ddfbfSEd Maste else 343ac7ddfbfSEd Maste { 344ac7ddfbfSEd Maste m_parse_error = true; 345ac7ddfbfSEd Maste return; 346ac7ddfbfSEd Maste } 347ac7ddfbfSEd Maste 348ac7ddfbfSEd Maste // if (!m_context.empty()) 349ac7ddfbfSEd Maste // printf (" context = '%s'\n", m_context.str().c_str()); 350ac7ddfbfSEd Maste // if (m_basename) 351ac7ddfbfSEd Maste // printf (" basename = '%s'\n", m_basename.GetCString()); 352ac7ddfbfSEd Maste // if (!m_arguments.empty()) 353ac7ddfbfSEd Maste // printf (" arguments = '%s'\n", m_arguments.str().c_str()); 354ac7ddfbfSEd Maste // if (!m_qualifiers.empty()) 355ac7ddfbfSEd Maste // printf ("qualifiers = '%s'\n", m_qualifiers.str().c_str()); 3567aa51b79SEd Maste 3577aa51b79SEd Maste // Make sure we have a valid C++ basename with optional template args 3587aa51b79SEd Maste static RegularExpression g_identifier_regex("^~?([A-Za-z_][A-Za-z_0-9]*)(<.*>)?$"); 3597aa51b79SEd Maste std::string basename_str(m_basename.str()); 3607aa51b79SEd Maste bool basename_is_valid = g_identifier_regex.Execute (basename_str.c_str(), NULL); 3617aa51b79SEd Maste if (!basename_is_valid) 3627aa51b79SEd Maste { 3637aa51b79SEd Maste // Check for C++ operators 3647aa51b79SEd Maste if (m_basename.startswith("operator")) 3657aa51b79SEd Maste { 3667aa51b79SEd Maste static RegularExpression g_operator_regex("^(operator)( ?)([A-Za-z_][A-Za-z_0-9]*|\\(\\)|\\[\\]|[\\^<>=!\\/*+-]+)(<.*>)?(\\[\\])?$"); 3677aa51b79SEd Maste basename_is_valid = g_operator_regex.Execute(basename_str.c_str(), NULL); 3687aa51b79SEd Maste } 3697aa51b79SEd Maste } 3707aa51b79SEd Maste if (!basename_is_valid) 3717aa51b79SEd Maste { 3727aa51b79SEd Maste // The C++ basename doesn't match our regular expressions so this can't 3737aa51b79SEd Maste // be a valid C++ method, clear everything out and indicate an error 3747aa51b79SEd Maste m_context = llvm::StringRef(); 3757aa51b79SEd Maste m_basename = llvm::StringRef(); 3767aa51b79SEd Maste m_arguments = llvm::StringRef(); 3777aa51b79SEd Maste m_qualifiers = llvm::StringRef(); 3787aa51b79SEd Maste m_parse_error = true; 3797aa51b79SEd Maste } 380ac7ddfbfSEd Maste } 381ac7ddfbfSEd Maste else 382ac7ddfbfSEd Maste { 383ac7ddfbfSEd Maste m_parse_error = true; 384ac7ddfbfSEd Maste // printf ("error: didn't find matching parens for arguments\n"); 385ac7ddfbfSEd Maste } 386ac7ddfbfSEd Maste } 387ac7ddfbfSEd Maste } 388ac7ddfbfSEd Maste 389ac7ddfbfSEd Maste llvm::StringRef 390ac7ddfbfSEd Maste CPPLanguageRuntime::MethodName::GetBasename () 391ac7ddfbfSEd Maste { 392ac7ddfbfSEd Maste if (!m_parsed) 393ac7ddfbfSEd Maste Parse(); 394ac7ddfbfSEd Maste return m_basename; 395ac7ddfbfSEd Maste } 396ac7ddfbfSEd Maste 397ac7ddfbfSEd Maste llvm::StringRef 398ac7ddfbfSEd Maste CPPLanguageRuntime::MethodName::GetContext () 399ac7ddfbfSEd Maste { 400ac7ddfbfSEd Maste if (!m_parsed) 401ac7ddfbfSEd Maste Parse(); 402ac7ddfbfSEd Maste return m_context; 403ac7ddfbfSEd Maste } 404ac7ddfbfSEd Maste 405ac7ddfbfSEd Maste llvm::StringRef 406ac7ddfbfSEd Maste CPPLanguageRuntime::MethodName::GetArguments () 407ac7ddfbfSEd Maste { 408ac7ddfbfSEd Maste if (!m_parsed) 409ac7ddfbfSEd Maste Parse(); 410ac7ddfbfSEd Maste return m_arguments; 411ac7ddfbfSEd Maste } 412ac7ddfbfSEd Maste 413ac7ddfbfSEd Maste llvm::StringRef 414ac7ddfbfSEd Maste CPPLanguageRuntime::MethodName::GetQualifiers () 415ac7ddfbfSEd Maste { 416ac7ddfbfSEd Maste if (!m_parsed) 417ac7ddfbfSEd Maste Parse(); 418ac7ddfbfSEd Maste return m_qualifiers; 419ac7ddfbfSEd Maste } 420ac7ddfbfSEd Maste 421