diff --git a/clang/include/clang/Lex/ModuleLoader.h b/clang/include/clang/Lex/ModuleLoader.h index c1f7f068c0f1..bf044e0e5f50 100644 --- a/clang/include/clang/Lex/ModuleLoader.h +++ b/clang/include/clang/Lex/ModuleLoader.h @@ -45,9 +45,6 @@ public: // The module exists but cannot be imported due to a configuration mismatch. ConfigMismatch, - - // We failed to load the module, but we shouldn't cache the failure. - OtherUncachedFailure, }; llvm::PointerIntPair Storage; diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index bcf9f9694f88..695c7e335fb4 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -1684,8 +1684,7 @@ ModuleLoadResult CompilerInstance::findOrCompileModuleAndReadAST( getDiagnostics().Report(ModuleNameLoc, diag::err_module_not_found) << ModuleName << SourceRange(ImportLoc, ModuleNameLoc); ModuleBuildFailed = true; - // FIXME: Why is this not cached? - return ModuleLoadResult::OtherUncachedFailure; + return nullptr; } if (ModuleFilename.empty()) { if (M && M->HasIncompatibleModuleFile) { @@ -1697,8 +1696,7 @@ ModuleLoadResult CompilerInstance::findOrCompileModuleAndReadAST( getDiagnostics().Report(ModuleNameLoc, diag::err_module_build_disabled) << ModuleName; ModuleBuildFailed = true; - // FIXME: Why is this not cached? - return ModuleLoadResult::OtherUncachedFailure; + return nullptr; } // Create an ASTReader on demand. @@ -1809,8 +1807,7 @@ ModuleLoadResult CompilerInstance::findOrCompileModuleAndReadAST( getDiagnostics().Report(ModuleNameLoc, diag::err_module_cycle) << ModuleName << CyclePath; // FIXME: Should this set ModuleBuildFailed = true? - // FIXME: Why is this not cached? - return ModuleLoadResult::OtherUncachedFailure; + return nullptr; } // Check whether we have already attempted to build this module (but @@ -1820,8 +1817,7 @@ ModuleLoadResult CompilerInstance::findOrCompileModuleAndReadAST( getDiagnostics().Report(ModuleNameLoc, diag::err_module_not_built) << ModuleName << SourceRange(ImportLoc, ModuleNameLoc); ModuleBuildFailed = true; - // FIXME: Why is this not cached? - return ModuleLoadResult::OtherUncachedFailure; + return nullptr; } // Try to compile and then read the AST. @@ -1832,8 +1828,7 @@ ModuleLoadResult CompilerInstance::findOrCompileModuleAndReadAST( if (getPreprocessorOpts().FailedModules) getPreprocessorOpts().FailedModules->addFailed(ModuleName); ModuleBuildFailed = true; - // FIXME: Why is this not cached? - return ModuleLoadResult::OtherUncachedFailure; + return nullptr; } // Okay, we've rebuilt and now loaded the module.