Author: Chuanqi Xu
Date: 2024-08-12T14:50:32+08:00
New Revision: cb372bd5e789a7d5f1945b476e643d4abfd18f35

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

LOG: Revert "[NFC] [C++20] [Modules] Adjust the implementation of 
wasDeclEmitted to make it more clear"

This reverts commit 4399f2a5ef38df381c2b65052621131890194d59.
This fails with Modules/aarch64-sme-keywords.cppm

Added: 
    

Modified: 
    clang/lib/Serialization/ASTWriter.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Serialization/ASTWriter.cpp 
b/clang/lib/Serialization/ASTWriter.cpp
index 87ceee172c66f1..b5d487465541b8 100644
--- a/clang/lib/Serialization/ASTWriter.cpp
+++ b/clang/lib/Serialization/ASTWriter.cpp
@@ -5704,12 +5704,6 @@ void ASTWriter::WriteDeclAndTypes(ASTContext &Context) {
     if (D->isFromASTFile())
       continue;
 
-    // Skip writing implicit declarations not owning by the current module.
-    // See the implementation of PrepareWritingSpecialDecls for example.
-    if (isWritingStdCXXNamedModules() && !D->getOwningModule() &&
-        D->isImplicit())
-      continue;
-
     // In reduced BMI, skip unreached declarations.
     if (!wasDeclEmitted(D))
       continue;
@@ -6288,7 +6282,8 @@ bool ASTWriter::wasDeclEmitted(const Decl *D) const {
     return true;
 
   bool Emitted = DeclIDs.contains(D);
-  assert((Emitted || GeneratingReducedBMI) &&
+  assert((Emitted || (!D->getOwningModule() && isWritingStdCXXNamedModules()) 
||
+          GeneratingReducedBMI) &&
          "The declaration within modules can only be omitted in reduced BMI.");
   return Emitted;
 }


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to