When converting some of the old Migrator automation to the new Migrator,

I had set up the driver to invoke a separate frontend invocation with
the "update code" mode. We sort of did this last release, except we
forked to the swift-update binary instead. This is causing problems with
testing in Xcode.

Instead, let's perform a single compile and add the remap file as an
additional output during normal compiles. The driver, seeing
-update-code, will add -emit-remap-file-path $PATH to the -c frontend
invocation.

rdar://problem/31857580
This commit is contained in:
David Farler
2017-04-27 01:03:00 -07:00
parent 62b6b3bfec
commit 63776b507b
20 changed files with 82 additions and 82 deletions

View File

@@ -460,16 +460,17 @@ static bool performCompile(std::unique_ptr<CompilerInstance> &Instance,
ASTContext &Context = Instance->getASTContext();
if (!Context.hadError() &&
Invocation.getMigratorOptions().shouldRunMigrator()) {
migrator::updateCodeAndEmitRemap(*Instance, Invocation);
}
if (Action == FrontendOptions::REPL) {
runREPL(*Instance, ProcessCmdLine(Args.begin(), Args.end()),
Invocation.getParseStdlib());
return Context.hadError();
}
if (Action == FrontendOptions::UpdateCode) {
return migrator::updateCodeAndEmitRemap(Invocation);
}
SourceFile *PrimarySourceFile = Instance->getPrimarySourceFile();
// We've been told to dump the AST (either after parsing or type-checking,