Skip to content

Commit 3c2638d

Browse files
committed
Revert "[Serialization] Read the initializer for interesting static variables before consuming it (#92218)"
This reverts commit 3a4c1b9. This breaks a bot on clang-s390x-linux
1 parent afce597 commit 3c2638d

File tree

3 files changed

+126
-216
lines changed

3 files changed

+126
-216
lines changed

clang/lib/Serialization/ASTReaderDecl.cpp

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4186,35 +4186,12 @@ void ASTReader::PassInterestingDeclsToConsumer() {
41864186
GetDecl(ID);
41874187
EagerlyDeserializedDecls.clear();
41884188

4189-
auto ConsumingPotentialInterestingDecls = [this]() {
4190-
while (!PotentiallyInterestingDecls.empty()) {
4191-
Decl *D = PotentiallyInterestingDecls.front();
4192-
PotentiallyInterestingDecls.pop_front();
4193-
if (isConsumerInterestedIn(D))
4194-
PassInterestingDeclToConsumer(D);
4195-
}
4196-
};
4197-
std::deque<Decl *> MaybeInterestingDecls =
4198-
std::move(PotentiallyInterestingDecls);
4199-
assert(PotentiallyInterestingDecls.empty());
4200-
while (!MaybeInterestingDecls.empty()) {
4201-
Decl *D = MaybeInterestingDecls.front();
4202-
MaybeInterestingDecls.pop_front();
4203-
// Since we load the variable's initializers lazily, it'd be problematic
4204-
// if the initializers dependent on each other. So here we try to load the
4205-
// initializers of static variables to make sure they are passed to code
4206-
// generator by order. If we read anything interesting, we would consume
4207-
// that before emitting the current declaration.
4208-
if (auto *VD = dyn_cast<VarDecl>(D);
4209-
VD && VD->isFileVarDecl() && !VD->isExternallyVisible())
4210-
VD->getInit();
4211-
ConsumingPotentialInterestingDecls();
4189+
while (!PotentiallyInterestingDecls.empty()) {
4190+
Decl *D = PotentiallyInterestingDecls.front();
4191+
PotentiallyInterestingDecls.pop_front();
42124192
if (isConsumerInterestedIn(D))
42134193
PassInterestingDeclToConsumer(D);
42144194
}
4215-
4216-
// If we add any new potential interesting decl in the last call, consume it.
4217-
ConsumingPotentialInterestingDecls();
42184195
}
42194196

42204197
void ASTReader::loadDeclUpdateRecords(PendingUpdateRecord &Record) {

clang/test/Modules/pr91418.cppm

Lines changed: 0 additions & 67 deletions
This file was deleted.

0 commit comments

Comments
 (0)