[clang] d29f8a5 - [Clang] Override method ModuleImportRead in MultiplexASTDeserializationListener

Nico Weber via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 11 05:38:43 PDT 2022


Author: Guoxiong Li
Date: 2022-04-11T08:38:37-04:00
New Revision: d29f8a5f83501f69621687c09ba4b3c75033bada

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

LOG: [Clang] Override method ModuleImportRead in MultiplexASTDeserializationListener

Fixes https://llvm.org/PR54521

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

Added: 
    

Modified: 
    clang/include/clang/Frontend/MultiplexConsumer.h
    clang/lib/Frontend/MultiplexConsumer.cpp

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/Frontend/MultiplexConsumer.h b/clang/include/clang/Frontend/MultiplexConsumer.h
index 3054e1842811d..7f8d2858b3863 100644
--- a/clang/include/clang/Frontend/MultiplexConsumer.h
+++ b/clang/include/clang/Frontend/MultiplexConsumer.h
@@ -40,6 +40,8 @@ class MultiplexASTDeserializationListener : public ASTDeserializationListener {
   void MacroDefinitionRead(serialization::PreprocessedEntityID,
                            MacroDefinitionRecord *MD) override;
   void ModuleRead(serialization::SubmoduleID ID, Module *Mod) override;
+  void ModuleImportRead(serialization::SubmoduleID ID,
+                        SourceLocation ImportLoc) override;
 
 private:
   std::vector<ASTDeserializationListener *> Listeners;

diff  --git a/clang/lib/Frontend/MultiplexConsumer.cpp b/clang/lib/Frontend/MultiplexConsumer.cpp
index 34bbc365e6476..737877329c9ce 100644
--- a/clang/lib/Frontend/MultiplexConsumer.cpp
+++ b/clang/lib/Frontend/MultiplexConsumer.cpp
@@ -73,6 +73,12 @@ void MultiplexASTDeserializationListener::ModuleRead(
     Listener->ModuleRead(ID, Mod);
 }
 
+void MultiplexASTDeserializationListener::ModuleImportRead(
+    serialization::SubmoduleID ID, SourceLocation ImportLoc) {
+  for (auto &Listener : Listeners)
+    Listener->ModuleImportRead(ID, ImportLoc);
+}
+
 // This ASTMutationListener forwards its notifications to a set of
 // child listeners.
 class MultiplexASTMutationListener : public ASTMutationListener {


        


More information about the cfe-commits mailing list