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/Basic/Module.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/Basic/Module.cpp')
-rw-r--r-- | clang/lib/Basic/Module.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Basic/Module.cpp b/clang/lib/Basic/Module.cpp index ad52fcc..a7a3f6b 100644 --- a/clang/lib/Basic/Module.cpp +++ b/clang/lib/Basic/Module.cpp @@ -528,7 +528,7 @@ void Module::print(raw_ostream &OS, unsigned Indent, bool Dump) const { for (auto &K : Kinds) { assert(&K == &Kinds[K.Kind] && "kinds in wrong order"); - for (auto &H : Headers[K.Kind]) { + for (auto &H : getHeaders(K.Kind)) { OS.indent(Indent + 2); OS << K.Prefix << "header \""; OS.write_escaped(H.NameAsWritten); |