diff options
author | Ben Langmuir <blangmuir@apple.com> | 2022-11-16 16:07:34 -0800 |
---|---|---|
committer | Ben Langmuir <blangmuir@apple.com> | 2022-11-17 13:47:46 -0800 |
commit | c4436f675d8f5903303fc13d2c2eff2c5800d49b (patch) | |
tree | 93f7a10005bd76fcd5bc61e439df6a9a6ae2cb8e /clang/lib/Frontend/FrontendAction.cpp | |
parent | 7052164f98a389d06a22ea54b673b25d634aa98a (diff) | |
download | llvm-c4436f675d8f5903303fc13d2c2eff2c5800d49b.zip llvm-c4436f675d8f5903303fc13d2c2eff2c5800d49b.tar.gz llvm-c4436f675d8f5903303fc13d2c2eff2c5800d49b.tar.bz2 |
[clang] Use InMemoryModuleCache for readASTFileControlBlock NFC
When a pcm has already been loaded from disk, reuse it from the
InMemoryModuleCache in readASTFileControlBlock. This avoids potentially
reading it again.
As noted in the FIXME, ideally we would also add the module to the cache
if it will be used again later, but that could modify its build state
and we do not have enough context currenlty to know if it's correct.
Differential Revision: https://reviews.llvm.org/D138160
Diffstat (limited to 'clang/lib/Frontend/FrontendAction.cpp')
-rw-r--r-- | clang/lib/Frontend/FrontendAction.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Frontend/FrontendAction.cpp b/clang/lib/Frontend/FrontendAction.cpp index 76ef0cb..8fa96be2 100644 --- a/clang/lib/Frontend/FrontendAction.cpp +++ b/clang/lib/Frontend/FrontendAction.cpp @@ -778,8 +778,9 @@ bool FrontendAction::BeginSourceFile(CompilerInstance &CI, Dir != DirEnd && !EC; Dir.increment(EC)) { // Check whether this is an acceptable AST file. if (ASTReader::isAcceptableASTFile( - Dir->path(), FileMgr, CI.getPCHContainerReader(), - CI.getLangOpts(), CI.getTargetOpts(), CI.getPreprocessorOpts(), + Dir->path(), FileMgr, CI.getModuleCache(), + CI.getPCHContainerReader(), CI.getLangOpts(), + CI.getTargetOpts(), CI.getPreprocessorOpts(), SpecificModuleCachePath, /*RequireStrictOptionMatches=*/true)) { PPOpts.ImplicitPCHInclude = std::string(Dir->path()); Found = true; |