[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 9826aaa9ed
commit f2f521f8bf
2 changed files with 21 additions and 0 deletions

View File

@@ -1337,6 +1337,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();