Skip to content

Commit 45acc5b

Browse files
committed
[Parse] Remove unneeded DiagnosticEngine field from SILParserTUState.
No functionality change.
1 parent e4794e8 commit 45acc5b

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

lib/Parse/ParseSIL.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,15 @@ SILParserState::SILParserState(SILModule *M)
4141
SILParserState::~SILParserState() = default;
4242

4343
SILParserTUState::~SILParserTUState() {
44-
if (!ForwardRefFns.empty())
45-
for (auto Entry : ForwardRefFns)
46-
if (Entry.second.second.isValid())
47-
Diags->diagnose(Entry.second.second, diag::sil_use_of_undefined_value,
48-
Entry.first.str());
44+
if (!ForwardRefFns.empty()) {
45+
for (auto Entry : ForwardRefFns) {
46+
if (Entry.second.second.isValid()) {
47+
M.getASTContext().Diags.diagnose(Entry.second.second,
48+
diag::sil_use_of_undefined_value,
49+
Entry.first.str());
50+
}
51+
}
52+
}
4953

5054
// Turn any debug-info-only function declarations into zombies.
5155
for (auto *Fn : PotentialZombieFns)
@@ -516,7 +520,6 @@ SILFunction *SILParser::getGlobalNameForReference(Identifier Name,
516520
IsNotTransparent, IsNotSerialized);
517521
Fn->setDebugScope(new (SILMod) SILDebugScope(loc, Fn));
518522
TUState.ForwardRefFns[Name] = { Fn, IgnoreFwdRef ? SourceLoc() : Loc };
519-
TUState.Diags = &P.Diags;
520523
return Fn;
521524
}
522525

lib/Parse/ParseSIL.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ namespace swift {
4444

4545
/// Did we parse a sil_stage for this module?
4646
bool DidParseSILStage = false;
47-
48-
DiagnosticEngine *Diags = nullptr;
4947
};
5048
} // end namespace swift
5149

0 commit comments

Comments
 (0)