diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2021-04-30 15:09:09 -0700 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2021-05-13 10:22:40 -0700 |
commit | 23e9146fba298d38142337b615e17067fb8ccb91 (patch) | |
tree | 425b760e295702b79287bb791be1d2d85fbbce24 /clang/lib/Frontend/CompilerInstance.cpp | |
parent | cd0eeb52ad37d8f55407c548f93f42a0d5b2d08b (diff) | |
download | llvm-23e9146fba298d38142337b615e17067fb8ccb91.zip llvm-23e9146fba298d38142337b615e17067fb8ccb91.tar.gz llvm-23e9146fba298d38142337b615e17067fb8ccb91.tar.bz2 |
Modules: Rename ModuleBuildFailed => DisableGeneratingGlobalModuleIndex, NFC
Rename CompilerInstance's ModuleBuildFailed field to
DisableGeneratingGlobalModuleIndex, which more precisely describes its
role. Otherwise, it's hard to suss out how it's different from
ModuleLoader::HadFatalFailure, and what sort of code simplifications are
safe.
Differential Revision: https://reviews.llvm.org/D101670
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInstance.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index 695c7e3..54917b3 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -77,7 +77,7 @@ bool CompilerInstance::shouldBuildGlobalModuleIndex() const { return (BuildGlobalModuleIndex || (TheASTReader && TheASTReader->isGlobalIndexUnavailable() && getFrontendOpts().GenerateGlobalModuleIndex)) && - !ModuleBuildFailed; + !DisableGeneratingGlobalModuleIndex; } void CompilerInstance::setDiagnostics(DiagnosticsEngine *Value) { @@ -1683,7 +1683,7 @@ ModuleLoadResult CompilerInstance::findOrCompileModuleAndReadAST( // We can't find a module, error out here. getDiagnostics().Report(ModuleNameLoc, diag::err_module_not_found) << ModuleName << SourceRange(ImportLoc, ModuleNameLoc); - ModuleBuildFailed = true; + DisableGeneratingGlobalModuleIndex = true; return nullptr; } if (ModuleFilename.empty()) { @@ -1695,7 +1695,7 @@ ModuleLoadResult CompilerInstance::findOrCompileModuleAndReadAST( getDiagnostics().Report(ModuleNameLoc, diag::err_module_build_disabled) << ModuleName; - ModuleBuildFailed = true; + DisableGeneratingGlobalModuleIndex = true; return nullptr; } @@ -1742,7 +1742,7 @@ ModuleLoadResult CompilerInstance::findOrCompileModuleAndReadAST( if (*ModuleFile == M->getASTFile()) return M; - ModuleBuildFailed = true; + DisableGeneratingGlobalModuleIndex = true; getDiagnostics().Report(ModuleNameLoc, diag::err_module_prebuilt) << ModuleName; return ModuleLoadResult(); @@ -1764,14 +1764,14 @@ ModuleLoadResult CompilerInstance::findOrCompileModuleAndReadAST( LLVM_FALLTHROUGH; case ASTReader::VersionMismatch: case ASTReader::HadErrors: - // FIXME: Should this set ModuleBuildFailed = true? + // FIXME: Should this set DisableGeneratingGlobalModuleIndex = true? ModuleLoader::HadFatalFailure = true; // FIXME: The ASTReader will already have complained, but can we shoehorn // that diagnostic information into a more useful form? return ModuleLoadResult(); case ASTReader::Failure: - // FIXME: Should this set ModuleBuildFailed = true? + // FIXME: Should this set DisableGeneratingGlobalModuleIndex = true? ModuleLoader::HadFatalFailure = true; return ModuleLoadResult(); } @@ -1781,7 +1781,7 @@ ModuleLoadResult CompilerInstance::findOrCompileModuleAndReadAST( // We don't know the desired configuration for this module and don't // necessarily even have a module map. Since ReadAST already produces // diagnostics for these two cases, we simply error out here. - ModuleBuildFailed = true; + DisableGeneratingGlobalModuleIndex = true; return ModuleLoadResult(); } @@ -1806,7 +1806,7 @@ ModuleLoadResult CompilerInstance::findOrCompileModuleAndReadAST( getDiagnostics().Report(ModuleNameLoc, diag::err_module_cycle) << ModuleName << CyclePath; - // FIXME: Should this set ModuleBuildFailed = true? + // FIXME: Should this set DisableGeneratingGlobalModuleIndex = true? return nullptr; } @@ -1816,7 +1816,7 @@ ModuleLoadResult CompilerInstance::findOrCompileModuleAndReadAST( getPreprocessorOpts().FailedModules->hasAlreadyFailed(ModuleName)) { getDiagnostics().Report(ModuleNameLoc, diag::err_module_not_built) << ModuleName << SourceRange(ImportLoc, ModuleNameLoc); - ModuleBuildFailed = true; + DisableGeneratingGlobalModuleIndex = true; return nullptr; } @@ -1827,7 +1827,7 @@ ModuleLoadResult CompilerInstance::findOrCompileModuleAndReadAST( "undiagnosed error in compileModuleAndReadAST"); if (getPreprocessorOpts().FailedModules) getPreprocessorOpts().FailedModules->addFailed(ModuleName); - ModuleBuildFailed = true; + DisableGeneratingGlobalModuleIndex = true; return nullptr; } @@ -1871,16 +1871,16 @@ CompilerInstance::loadModule(SourceLocation ImportLoc, //if (Module == nullptr) { // getDiagnostics().Report(ModuleNameLoc, diag::err_module_not_found) // << ModuleName; - // ModuleBuildFailed = true; + // DisableGeneratingGlobalModuleIndex = true; // return ModuleLoadResult(); //} MM.cacheModuleLoad(*Path[0].first, Module); } else { ModuleLoadResult Result = findOrCompileModuleAndReadAST( ModuleName, ImportLoc, ModuleNameLoc, IsInclusionDirective); - // FIXME: Can we pull 'ModuleBuildFailed = true' out of the return - // sequences for findOrCompileModuleAndReadAST and do it here (as long as - // the result is not a config mismatch)? See FIXMEs there. + // FIXME: Can we pull 'DisableGeneratingGlobalModuleIndex = true' out of + // the return sequences for findOrCompileModuleAndReadAST and do it here + // (as long as the result is not a config mismatch)? See FIXMEs there. if (!Result.isNormal()) return Result; Module = Result; |