diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-05-03 20:26:55 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-05-03 20:26:55 +0000 |
commit | 52fd8de56a8a12201c1e6188e1f34d28c3d3398d (patch) | |
tree | 69810dbf8f7743a20c29413ac665494c713276b3 /source | |
parent | 773dd0e6e632d48d7123a321ba86f50847b9afc0 (diff) | |
download | src-test2-52fd8de56a8a12201c1e6188e1f34d28c3d3398d.tar.gz src-test2-52fd8de56a8a12201c1e6188e1f34d28c3d3398d.zip |
Notes
Diffstat (limited to 'source')
-rw-r--r-- | source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp | 4 | ||||
-rw-r--r-- | source/Symbol/Symtab.cpp | 35 |
2 files changed, 19 insertions, 20 deletions
diff --git a/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp b/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp index 3c3a2cd9c3fc..7622791778ba 100644 --- a/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp +++ b/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp @@ -348,7 +348,7 @@ void ClangASTSource::CompleteType(clang::ObjCInterfaceDecl *interface_decl) { GetCompleteObjCInterface(original_iface_decl); if (complete_iface_decl && (complete_iface_decl != original_iface_decl)) { - m_ast_importer_sp->SetDeclOrigin(interface_decl, original_iface_decl); + m_ast_importer_sp->SetDeclOrigin(interface_decl, complete_iface_decl); } } } @@ -472,7 +472,7 @@ void ClangASTSource::FindExternalLexicalDecls( original_decl = complete_iface_decl; original_ctx = &complete_iface_decl->getASTContext(); - m_ast_importer_sp->SetDeclOrigin(context_decl, original_iface_decl); + m_ast_importer_sp->SetDeclOrigin(context_decl, complete_iface_decl); } } diff --git a/source/Symbol/Symtab.cpp b/source/Symbol/Symtab.cpp index 1e241df0d90a..e0710aa4e6b9 100644 --- a/source/Symbol/Symtab.cpp +++ b/source/Symbol/Symtab.cpp @@ -299,17 +299,24 @@ void Symtab::InitNameIndexes() { const char *const_context = ConstString(cxx_method.GetContext()).GetCString(); - entry_ref = entry.cstring.GetStringRef(); - if (entry_ref[0] == '~' || - !cxx_method.GetQualifiers().empty()) { - // The first character of the demangled basename is '~' which - // means we have a class destructor. We can use this information - // to help us know what is a class and what isn't. - if (class_contexts.find(const_context) == class_contexts.end()) - class_contexts.insert(const_context); - m_method_to_index.Append(entry); + if (!const_context || const_context[0] == 0) { + // No context for this function so this has to be a basename + m_basename_to_index.Append(entry); + // If there is no context (no namespaces or class scopes that + // come before the function name) then this also could be a + // fullname. + m_name_to_index.Append(entry); } else { - if (const_context && const_context[0]) { + entry_ref = entry.cstring.GetStringRef(); + if (entry_ref[0] == '~' || + !cxx_method.GetQualifiers().empty()) { + // The first character of the demangled basename is '~' which + // means we have a class destructor. We can use this information + // to help us know what is a class and what isn't. + if (class_contexts.find(const_context) == class_contexts.end()) + class_contexts.insert(const_context); + m_method_to_index.Append(entry); + } else { if (class_contexts.find(const_context) != class_contexts.end()) { // The current decl context is in our "class_contexts" which @@ -326,14 +333,6 @@ void Symtab::InitNameIndexes() { mangled_name_to_index.Append(entry); symbol_contexts[entry.value] = const_context; } - } else { - // No context for this function so this has to be a basename - m_basename_to_index.Append(entry); - // If there is no context (no namespaces or class scopes that - // come before the function name) then this also could be a - // fullname. - if (cxx_method.GetContext().empty()) - m_name_to_index.Append(entry); } } } |