[PATCH] D59902: [COFF] Optimize range extension thunk insertion memory usage
Rui Ueyama via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 27 17:23:55 PDT 2019
ruiu added a comment.
Nice!
================
Comment at: lld/COFF/Writer.cpp:460
+ // file. Only add each thunk once to each input file.
+ auto Insertion = ThunkSymtabIndices.insert({{File, Thunk}, ~0U});
+ uint32_t &ThunkSymbolIndex = Insertion.first->second;
----------------
mstorsjo wrote:
> Does the initial value `~0U` actually matter here? If `Insertion.second` is true (if this was the first insertion), the value will be unconditionally overwritten anyway, right? (I guess it's a good sentinel to safeguard against not updating it though, so it's probably ok as such, just trying to grasp all aspects of this.)
Yeah, it looks to me that this can be a set instead of a map, as it doesn't seem like it is using map values.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D59902/new/
https://reviews.llvm.org/D59902
More information about the llvm-commits
mailing list