[FrondEnd] Wrap RunInmediately() in a pretty stack trace indicating we are running user code

This commit is contained in:
Tapan Thaker
2019-11-15 07:28:50 -08:00
parent d2e1f09169
commit 322ad482b6
2 changed files with 25 additions and 0 deletions

View File

@@ -1376,6 +1376,12 @@ static bool processCommandLineAndRunImmediately(CompilerInvocation &Invocation,
ProcessCmdLine(opts.ImmediateArgv.begin(), opts.ImmediateArgv.end());
Instance.setSILModule(std::move(SM));
PrettyStackTraceStringAction trace(
"running user code",
MSF.is<SourceFile *>() ? MSF.get<SourceFile *>()->getFilename()
: MSF.get<ModuleDecl *>()->getModuleFilename());
ReturnValue =
RunImmediately(Instance, CmdLine, IRGenOpts, Invocation.getSILOptions());
return Instance.getASTContext().hadError();