Skip to content

Commit 99947c5

Browse files
zixu-wtstellar
authored andcommitted
Revert "[C++20][Modules][Serialization] Delay marking pending incompl… (#127136)
…ete decl chains until the end of `finishPendingActions`. (#121245)" This reverts commit a9e249f. Reverting this change because of issue #126973. (cherry picked from commit 912b154)
1 parent 3007684 commit 99947c5

File tree

2 files changed

+13
-105
lines changed

2 files changed

+13
-105
lines changed

clang/lib/Serialization/ASTReader.cpp

+13-12
Original file line numberDiff line numberDiff line change
@@ -10186,12 +10186,12 @@ void ASTReader::visitTopLevelModuleMaps(
1018610186
}
1018710187

1018810188
void ASTReader::finishPendingActions() {
10189-
while (!PendingIdentifierInfos.empty() ||
10190-
!PendingDeducedFunctionTypes.empty() ||
10191-
!PendingDeducedVarTypes.empty() || !PendingDeclChains.empty() ||
10192-
!PendingMacroIDs.empty() || !PendingDeclContextInfos.empty() ||
10193-
!PendingUpdateRecords.empty() ||
10194-
!PendingObjCExtensionIvarRedeclarations.empty()) {
10189+
while (
10190+
!PendingIdentifierInfos.empty() || !PendingDeducedFunctionTypes.empty() ||
10191+
!PendingDeducedVarTypes.empty() || !PendingIncompleteDeclChains.empty() ||
10192+
!PendingDeclChains.empty() || !PendingMacroIDs.empty() ||
10193+
!PendingDeclContextInfos.empty() || !PendingUpdateRecords.empty() ||
10194+
!PendingObjCExtensionIvarRedeclarations.empty()) {
1019510195
// If any identifiers with corresponding top-level declarations have
1019610196
// been loaded, load those declarations now.
1019710197
using TopLevelDeclsMap =
@@ -10239,6 +10239,13 @@ void ASTReader::finishPendingActions() {
1023910239
}
1024010240
PendingDeducedVarTypes.clear();
1024110241

10242+
// For each decl chain that we wanted to complete while deserializing, mark
10243+
// it as "still needs to be completed".
10244+
for (unsigned I = 0; I != PendingIncompleteDeclChains.size(); ++I) {
10245+
markIncompleteDeclChain(PendingIncompleteDeclChains[I]);
10246+
}
10247+
PendingIncompleteDeclChains.clear();
10248+
1024210249
// Load pending declaration chains.
1024310250
for (unsigned I = 0; I != PendingDeclChains.size(); ++I)
1024410251
loadPendingDeclChain(PendingDeclChains[I].first,
@@ -10476,12 +10483,6 @@ void ASTReader::finishPendingActions() {
1047610483
for (auto *ND : PendingMergedDefinitionsToDeduplicate)
1047710484
getContext().deduplicateMergedDefinitonsFor(ND);
1047810485
PendingMergedDefinitionsToDeduplicate.clear();
10479-
10480-
// For each decl chain that we wanted to complete while deserializing, mark
10481-
// it as "still needs to be completed".
10482-
for (Decl *D : PendingIncompleteDeclChains)
10483-
markIncompleteDeclChain(D);
10484-
PendingIncompleteDeclChains.clear();
1048510486
}
1048610487

1048710488
void ASTReader::diagnoseOdrViolations() {

clang/test/Modules/pr121245.cpp

-93
This file was deleted.

0 commit comments

Comments
 (0)