[Lldb-commits] [lldb] b7a09de - [lldb][NFC] Add a FIXME for ClangASTSource::FindExternalLexicalDecls's unused 'decls' parameter

Raphael Isemann via lldb-commits lldb-commits at lists.llvm.org
Thu Nov 19 08:15:42 PST 2020


Author: Raphael Isemann
Date: 2020-11-19T17:15:14+01:00
New Revision: b7a09de10ffc59dec78a7d4b39bc78d07d3110eb

URL: https://github.com/llvm/llvm-project/commit/b7a09de10ffc59dec78a7d4b39bc78d07d3110eb
DIFF: https://github.com/llvm/llvm-project/commit/b7a09de10ffc59dec78a7d4b39bc78d07d3110eb.diff

LOG: [lldb][NFC] Add a FIXME for ClangASTSource::FindExternalLexicalDecls's unused 'decls' parameter

Added: 
    

Modified: 
    lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
index 6fe85a1298fc..783a5f178803 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
@@ -482,6 +482,15 @@ void ClangASTSource::FindExternalLexicalDecls(
       if (!copied_decl)
         continue;
 
+      // FIXME: We should add the copied decl to the 'decls' list. This would
+      // add the copied Decl into the DeclContext and make sure that we
+      // correctly propagate that we added some Decls back to Clang.
+      // By leaving 'decls' empty we incorrectly return false from
+      // DeclContext::LoadLexicalDeclsFromExternalStorage which might cause
+      // lookup issues later on.
+      // We can't just add them for now as the ASTImporter already added the
+      // decl into the DeclContext and this would add it twice.
+
       if (FieldDecl *copied_field = dyn_cast<FieldDecl>(copied_decl)) {
         QualType copied_field_type = copied_field->getType();
 


        


More information about the lldb-commits mailing list