diff options
| author | Tamas Berghammer <tberghammer@google.com> | 2017-01-10 11:13:59 +0000 |
|---|---|---|
| committer | Tamas Berghammer <tberghammer@google.com> | 2017-01-10 11:13:59 +0000 |
| commit | 556b1611cdc9704655403ba529cf29fb32cac9fc (patch) | |
| tree | 357a22a5b598e929d79a859a879900619c3caeb6 /lldb/source/Core/Module.cpp | |
| parent | 8e32aebe80accc69acb8de009bfe370de1ec0c5d (diff) | |
| download | bcm5719-llvm-556b1611cdc9704655403ba529cf29fb32cac9fc.tar.gz bcm5719-llvm-556b1611cdc9704655403ba529cf29fb32cac9fc.zip | |
Improve Type::GetTypeScopeAndBasenameHelper and add unit tests
Previously it failed to handle nested types inside templated classes
making it impossible to look up these types using the fully qualified
name.
Differential revision: https://reviews.llvm.org/D28466
llvm-svn: 291559
Diffstat (limited to 'lldb/source/Core/Module.cpp')
| -rw-r--r-- | lldb/source/Core/Module.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp index 220773b5ad4..28f140b41e1 100644 --- a/lldb/source/Core/Module.cpp +++ b/lldb/source/Core/Module.cpp @@ -995,8 +995,8 @@ size_t Module::FindTypes( TypeList &types) { size_t num_matches = 0; const char *type_name_cstr = name.GetCString(); - std::string type_scope; - std::string type_basename; + llvm::StringRef type_scope; + llvm::StringRef type_basename; const bool append = true; TypeClass type_class = eTypeClassAny; TypeMap typesmap; @@ -1006,13 +1006,9 @@ size_t Module::FindTypes( // from the root namespace and implies and exact match. The typenames we // get back from clang do not start with "::" so we need to strip this off // in order to get the qualified names to match + exact_match = type_scope.consume_front("::"); - if (type_scope.size() >= 2 && type_scope[0] == ':' && - type_scope[1] == ':') { - type_scope.erase(0, 2); - exact_match = true; - } - ConstString type_basename_const_str(type_basename.c_str()); + ConstString type_basename_const_str(type_basename); if (FindTypes_Impl(sc, type_basename_const_str, nullptr, append, max_matches, searched_symbol_files, typesmap)) { typesmap.RemoveMismatchedTypes(type_scope, type_basename, type_class, |

