We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bb131fb commit aafc2a3Copy full SHA for aafc2a3
lib/FrontendTool/FrontendTool.cpp
@@ -1219,10 +1219,9 @@ static bool performCompileStepsPostSILGen(
1219
SILOptions &SILOpts = Invocation.getSILOptions();
1220
IRGenOptions &IRGenOpts = Invocation.getIRGenOptions();
1221
1222
- BufferIndirectlyCausingDiagnosticRAII ricd(
1223
- Context.Diags, MSF.is<SourceFile *>()
1224
- ? MSF.dyn_cast<SourceFile *>()->getFilename()
1225
- : "");
+ Optional<BufferIndirectlyCausingDiagnosticRAII> ricd;
+ if (auto *SF = MSF.dyn_cast<SourceFile *>())
+ ricd.emplace(Context.Diags, SF->getFilename());
1226
1227
if (Stats)
1228
countStatsPostSILGen(*Stats, *SM);
0 commit comments