Skip to content

Commit 7fbd10f

Browse files
committed
Parser: disable delayed member decl parsing when parsing SIL.
1 parent e0c1fea commit 7fbd10f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/Parse/ParseDecl.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,9 @@ void PersistentParserState::parseMembers(IterableDeclContext *IDC) {
186186
SourceFile &SF = *IDC->getDecl()->getDeclContext()->getParentSourceFile();
187187
assert(!SF.hasInterfaceHash() &&
188188
"Cannot delay parsing if we care about the interface hash.");
189+
assert(SF.Kind != SourceFileKind::SIL && "cannot delay parsing SIL");
189190
unsigned BufferID = *SF.getBufferID();
191+
190192
// MarkedPos is not useful for delayed parsing because we know where we should
191193
// jump the parser to. However, we should recover the MarkedPos here in case
192194
// the PersistentParserState will be used to continuously parse the rest of
@@ -3362,6 +3364,10 @@ bool Parser::parseDeclList(SourceLoc LBLoc, SourceLoc &RBLoc,
33623364
}
33633365

33643366
bool Parser::canDelayMemberDeclParsing() {
3367+
// There's no fundamental reasons that SIL cannnot be lasily parsed. We need
3368+
// to keep SILParserTUStateBase persistent to make it happen.
3369+
if (isInSILMode())
3370+
return false;
33653371
// Calculating interface hash requires tokens consumed in the original order.
33663372
if (SF.hasInterfaceHash())
33673373
return false;

0 commit comments

Comments
 (0)