summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/source/Symbol/ClangASTContext.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/lldb/source/Symbol/ClangASTContext.cpp b/lldb/source/Symbol/ClangASTContext.cpp
index 1d4d265e702..829e11afd13 100644
--- a/lldb/source/Symbol/ClangASTContext.cpp
+++ b/lldb/source/Symbol/ClangASTContext.cpp
@@ -9926,6 +9926,15 @@ ClangASTContext::CountDeclLevels (clang::DeclContext *frame_decl_ctx,
{
if (searched.find(it->second) != searched.end())
continue;
+
+ // Currently DWARF has one shared translation unit for all Decls at top level, so this
+ // would erroneously find using statements anywhere. So don't look at the top-level
+ // translation unit.
+ // TODO fix this and add a testcase that depends on it.
+
+ if (llvm::isa<clang::TranslationUnitDecl>(it->second))
+ continue;
+
searched.insert(it->second);
symbol_file->ParseDeclsForContext(CompilerDeclContext(this, it->second));
OpenPOWER on IntegriCloud