[Lldb-commits] [lldb] 9c3f1f4 - [lldb][ClangASTImporter][NFC] Remove redundant calls to ASTImporter::Imported

Michael Buch via lldb-commits lldb-commits at lists.llvm.org
Thu Aug 17 09:55:10 PDT 2023


Author: Michael Buch
Date: 2023-08-17T17:54:51+01:00
New Revision: 9c3f1f42cbed0fa6184cd2047b34ab5090503e9e

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

LOG: [lldb][ClangASTImporter][NFC] Remove redundant calls to ASTImporter::Imported

The ASTImporter::Imported base method has been made a no-op in
26f72a96559f2acd6799c363f1ca88ef3238c601. So all calls to it from
a base-class are now redundant. The API is now only used to notify
subclasses that an import occurred and not for any other
bookkeeping (which is done in MapImported which we call properly).

Differential Revision: https://reviews.llvm.org/D158172

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.cpp
index 2826b102625fe5..5d109feb3d39fa 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.cpp
@@ -902,7 +902,6 @@ void ClangASTImporter::ASTImporterDelegate::ImportDefinitionTo(
   // We want that 'to' is actually complete after this function so let's
   // tell the ASTImporter that 'to' was imported from 'from'.
   MapImported(from, to);
-  ASTImporter::Imported(from, to);
 
   Log *log = GetLog(LLDBLog::Expressions);
 
@@ -1028,7 +1027,7 @@ void ClangASTImporter::ASTImporterDelegate::Imported(clang::Decl *from,
   // Some decls shouldn't be tracked here because they were not created by
   // copying 'from' to 'to'. Just exit early for those.
   if (m_decls_to_ignore.count(to))
-    return clang::ASTImporter::Imported(from, to);
+    return;
 
   // Transfer module ownership information.
   auto *from_source = llvm::dyn_cast_or_null<ClangExternalASTSourceCallbacks>(
@@ -1081,12 +1080,6 @@ void ClangASTImporter::ASTImporterDelegate::Imported(clang::Decl *from,
         if (!to_context_md->hasOrigin(to) || user_id != LLDB_INVALID_UID)
           to_context_md->setOrigin(to, origin);
 
-        ImporterDelegateSP direct_completer =
-            m_main.GetDelegate(&to->getASTContext(), origin.ctx);
-
-        if (direct_completer.get() != this)
-          direct_completer->ASTImporter::Imported(origin.decl, to);
-
         LLDB_LOG(log,
                  "    [ClangASTImporter] Propagated origin "
                  "(Decl*){0}/(ASTContext*){1} from (ASTContext*){2} to "


        


More information about the lldb-commits mailing list