diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-08-15 00:34:15 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-08-15 00:34:15 +0000 |
commit | 3938f0c728b483fdb1123e7e756c81816d653892 (patch) | |
tree | d628638a6f5ff6f1fb46fd92124ca56b0099b9d7 /clang/lib/Frontend/CompilerInstance.cpp | |
parent | 297ae311cebbf250590e70749a5021174cd41545 (diff) | |
download | bcm5719-llvm-3938f0c728b483fdb1123e7e756c81816d653892.tar.gz bcm5719-llvm-3938f0c728b483fdb1123e7e756c81816d653892.zip |
[modules] Stop dropping 'module.timestamp' files into the current directory
when building with implicit modules disabled.
llvm-svn: 245136
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInstance.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index a31b33ec379..c678da982ed 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -331,7 +331,7 @@ void CompilerInstance::createPreprocessor(TranslationUnitKind TUKind) { PP->setPreprocessedOutput(getPreprocessorOutputOpts().ShowCPP); - if (PP->getLangOpts().Modules) + if (PP->getLangOpts().Modules && PP->getLangOpts().ImplicitModules) PP->getHeaderSearchInfo().setModuleCachePath(getSpecificModuleCachePath()); // Handle generating dependencies, if requested. @@ -1154,6 +1154,7 @@ static void pruneModuleCache(const HeaderSearchOptions &HSOpts) { struct stat StatBuf; llvm::SmallString<128> TimestampFile; TimestampFile = HSOpts.ModuleCachePath; + assert(!TimestampFile.empty()); llvm::sys::path::append(TimestampFile, "modules.timestamp"); // Try to stat() the timestamp file. @@ -1232,8 +1233,8 @@ void CompilerInstance::createModuleManager() { // If we're implicitly building modules but not currently recursively // building a module, check whether we need to prune the module cache. - if (getLangOpts().ImplicitModules && - getSourceManager().getModuleBuildStack().empty() && + if (getSourceManager().getModuleBuildStack().empty() && + !getPreprocessor().getHeaderSearchInfo().getModuleCachePath().empty() && getHeaderSearchOpts().ModuleCachePruneInterval > 0 && getHeaderSearchOpts().ModuleCachePruneAfter > 0) { pruneModuleCache(getHeaderSearchOpts()); @@ -1600,6 +1601,8 @@ void CompilerInstance::makeModuleVisible(Module *Mod, GlobalModuleIndex *CompilerInstance::loadGlobalModuleIndex( SourceLocation TriggerLoc) { + if (getPreprocessor().getHeaderSearchInfo().getModuleCachePath().empty()) + return nullptr; if (!ModuleManager) createModuleManager(); // Can't do anything if we don't have the module manager. |