Skip to content

Commit cb372bd

Browse files
committed
Revert "[NFC] [C++20] [Modules] Adjust the implementation of wasDeclEmitted to make it more clear"
This reverts commit 4399f2a. This fails with Modules/aarch64-sme-keywords.cppm
1 parent 27ed9b4 commit cb372bd

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

clang/lib/Serialization/ASTWriter.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5704,12 +5704,6 @@ void ASTWriter::WriteDeclAndTypes(ASTContext &Context) {
57045704
if (D->isFromASTFile())
57055705
continue;
57065706

5707-
// Skip writing implicit declarations not owning by the current module.
5708-
// See the implementation of PrepareWritingSpecialDecls for example.
5709-
if (isWritingStdCXXNamedModules() && !D->getOwningModule() &&
5710-
D->isImplicit())
5711-
continue;
5712-
57135707
// In reduced BMI, skip unreached declarations.
57145708
if (!wasDeclEmitted(D))
57155709
continue;
@@ -6288,7 +6282,8 @@ bool ASTWriter::wasDeclEmitted(const Decl *D) const {
62886282
return true;
62896283

62906284
bool Emitted = DeclIDs.contains(D);
6291-
assert((Emitted || GeneratingReducedBMI) &&
6285+
assert((Emitted || (!D->getOwningModule() && isWritingStdCXXNamedModules()) ||
6286+
GeneratingReducedBMI) &&
62926287
"The declaration within modules can only be omitted in reduced BMI.");
62936288
return Emitted;
62946289
}

0 commit comments

Comments
 (0)