mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user