File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -84,6 +84,14 @@ ParseSILModuleRequest::evaluate(Evaluator &evaluator,
84
84
if (hadError) {
85
85
// The rest of the SIL pipeline expects well-formed SIL, so if we encounter
86
86
// a parsing error, just return an empty SIL module.
87
+ //
88
+ // Because the SIL parser's notion of failing with an error is distinct from
89
+ // the ASTContext's notion of having emitted a diagnostic, it's possible for
90
+ // the parser to fail silently without emitting a diagnostic. This assertion
91
+ // ensures that +asserts builds will fail fast. If you crash here, please go
92
+ // back and add a diagnostic after identifying where the SIL parser failed.
93
+ assert (SF->getASTContext ().hadError () &&
94
+ " Failed to parse SIL but did not emit any errors!" );
87
95
return SILModule::createEmptyModule (desc.context , desc.conv , desc.opts );
88
96
}
89
97
return silMod;
You can’t perform that action at this time.
0 commit comments