diff options
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInstance.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index b23baa5dbbd..1c5b3222304 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -1239,9 +1239,10 @@ void CompilerInstance::createModuleManager() { if (!hasASTContext()) createASTContext(); - // If we're not recursively building a module, check whether we - // need to prune the module cache. - if (getSourceManager().getModuleBuildStack().empty() && + // 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() && getHeaderSearchOpts().ModuleCachePruneInterval > 0 && getHeaderSearchOpts().ModuleCachePruneAfter > 0) { pruneModuleCache(getHeaderSearchOpts()); |