diff options
author | Kazu Hirata <kazu@google.com> | 2024-09-02 18:40:47 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-02 18:40:47 -0700 |
commit | 9a1d14a8d26778a5d2d24928ba11cc557c2df24b (patch) | |
tree | 95f530ba782334f6144a482893b72defbdd4cfce /clang/lib/CodeGen/CodeGenAction.cpp | |
parent | ba3c1edcc8cf96206df259bd07001fa7ee9957cb (diff) | |
download | llvm-9a1d14a8d26778a5d2d24928ba11cc557c2df24b.zip llvm-9a1d14a8d26778a5d2d24928ba11cc557c2df24b.tar.gz llvm-9a1d14a8d26778a5d2d24928ba11cc557c2df24b.tar.bz2 |
[LTO] Don't make unnecessary copies of ImportIDTable (#106998)
Without this patch, {ImportMapTy,SortedImportList}::{begin,end} make
unnecessary copies of ImportIDTable via:
map_iterator(Imports.begin(), IDs);
The second parameter, IDs, is passed by value, so we make a copy of
MapVector inside ImportIDTable every time we call begin and end.
These begin and end show up as time-consuming functions in the
performance profile.
This patch fixes the problem by passing IDs by reference with
std::cref.
While we are at it, this patch deletes the copy constructor and
assignment operator. I cannot think of any legitimate need reason to
make a copy of the deduplication table.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenAction.cpp')
0 files changed, 0 insertions, 0 deletions