diff options
author | Jan Svoboda <jan_svoboda@apple.com> | 2024-10-25 11:33:44 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-25 11:33:44 -0700 |
commit | 61946687bc68ccba763571cb420049b9a3749dfe (patch) | |
tree | eb0f357ec9a91fd89512db6df57d69692b1af631 /clang/lib/Frontend/FrontendAction.cpp | |
parent | 4ac0e7e400fe2a66d1fd5d5d1fa1c899dfb16716 (diff) | |
download | llvm-61946687bc68ccba763571cb420049b9a3749dfe.zip llvm-61946687bc68ccba763571cb420049b9a3749dfe.tar.gz llvm-61946687bc68ccba763571cb420049b9a3749dfe.tar.bz2 |
[clang][modules] Shrink the size of `Module::Headers` (#113395)
This patch shrinks the size of the `Module` class from 2112B to 1624B. I
wasn't able to get a good data on the actual impact on memory usage, but
given my `clang-scan-deps` workload at hand (with tens of thousands of
instances), I think there should be some win here. This also speeds up
my benchmark by under 0.1%.
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 81eea9c4..8264bd70 100644 --- a/clang/lib/Frontend/FrontendAction.cpp +++ b/clang/lib/Frontend/FrontendAction.cpp @@ -358,7 +358,7 @@ static std::error_code collectModuleHeaderIncludes( // Add includes for each of these headers. for (auto HK : {Module::HK_Normal, Module::HK_Private}) { - for (Module::Header &H : Module->Headers[HK]) { + for (const Module::Header &H : Module->getHeaders(HK)) { Module->addTopHeader(H.Entry); // Use the path as specified in the module map file. We'll look for this // file relative to the module build directory (the directory containing |