diff options
author | Adam Czachorowski <adamcz@google.com> | 2022-02-25 17:21:32 +0100 |
---|---|---|
committer | Adam Czachorowski <adamcz@google.com> | 2022-03-01 15:56:23 +0100 |
commit | 8f4ea36bfe4caf7d08f9778ee2a347b78f02bc0f (patch) | |
tree | 7389bb16be1e62438077b85a03e87f3a2f490787 /clang/lib/Frontend/FrontendAction.cpp | |
parent | 68895098d11f5c20969f3e14b5c11633399ee19e (diff) | |
download | llvm-8f4ea36bfe4caf7d08f9778ee2a347b78f02bc0f.zip llvm-8f4ea36bfe4caf7d08f9778ee2a347b78f02bc0f.tar.gz llvm-8f4ea36bfe4caf7d08f9778ee2a347b78f02bc0f.tar.bz2 |
[clang] Improve laziness of resolving module map headers.
clang has support for lazy headers in module maps - if size and/or
modtime and provided in the cppmap file, headers are only resolved when
an include directive for a file with that size/modtime is encoutered.
Before this change, the lazy resolution was all-or-nothing per module.
That means as soon as even one file in that module potentially matched
an include, all lazy files in that module were resolved. With this
change, only files with matching size/modtime will be resolved.
The goal is to avoid unnecessary stat() calls on non-included files,
which is especially valuable on networked file systems, with higher
latency.
Differential Revision: https://reviews.llvm.org/D120569
Diffstat (limited to 'clang/lib/Frontend/FrontendAction.cpp')
-rw-r--r-- | clang/lib/Frontend/FrontendAction.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Frontend/FrontendAction.cpp b/clang/lib/Frontend/FrontendAction.cpp index c5b9e80..b8f9238 100644 --- a/clang/lib/Frontend/FrontendAction.cpp +++ b/clang/lib/Frontend/FrontendAction.cpp @@ -331,7 +331,7 @@ static std::error_code collectModuleHeaderIncludes( return std::error_code(); // Resolve all lazy header directives to header files. - ModMap.resolveHeaderDirectives(Module); + ModMap.resolveHeaderDirectives(Module, /*File=*/llvm::None); // If any headers are missing, we can't build this module. In most cases, // diagnostics for this should have already been produced; we only get here |