diff options
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInstance.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index 9f99edad..b2c566f 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -1473,16 +1473,18 @@ static bool compileModuleAndReadASTImpl(CompilerInstance &ImportingInstance, SourceLocation ModuleNameLoc, Module *Module, StringRef ModuleFileName) { - auto Instance = ImportingInstance.cloneForModuleCompile(ModuleNameLoc, Module, - ModuleFileName); - - if (!ImportingInstance.compileModule(ModuleNameLoc, - Module->getTopLevelModuleName(), - ModuleFileName, *Instance)) { - ImportingInstance.getDiagnostics().Report(ModuleNameLoc, - diag::err_module_not_built) - << Module->Name << SourceRange(ImportLoc, ModuleNameLoc); - return false; + { + auto Instance = ImportingInstance.cloneForModuleCompile( + ModuleNameLoc, Module, ModuleFileName); + + if (!ImportingInstance.compileModule(ModuleNameLoc, + Module->getTopLevelModuleName(), + ModuleFileName, *Instance)) { + ImportingInstance.getDiagnostics().Report(ModuleNameLoc, + diag::err_module_not_built) + << Module->Name << SourceRange(ImportLoc, ModuleNameLoc); + return false; + } } // The module is built successfully, we can update its timestamp now. |