[Migrator] Make performing a fix-it run return the instance used

This CompilerInstance will be used if a fix-it run created an
error-free AST that we can continue to use in the AST passes.

rdar://problem/31926195
This commit is contained in:
David Farler
2017-05-02 21:37:17 -07:00
parent c52b2ed1e5
commit a2f48ff8c2
7 changed files with 104 additions and 41 deletions

View File

@@ -517,9 +517,8 @@ static bool performCompile(std::unique_ptr<CompilerInstance> &Instance,
ASTContext &Context = Instance->getASTContext();
if (!Context.hadError() &&
Invocation.getMigratorOptions().shouldRunMigrator()) {
migrator::updateCodeAndEmitRemap(*Instance, Invocation);
if (Invocation.getMigratorOptions().shouldRunMigrator()) {
migrator::updateCodeAndEmitRemap(Instance.get(), Invocation);
}
if (Action == FrontendOptions::REPL) {