[clang] [Rewrite] Avoid repeated hash lookups (NFC) (PR #109605)

Kazu Hirata via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 23 06:45:21 PDT 2024


kazutakahirata wrote:

> LGTM, but it would probably make sense to make BlockByCopyDecls a SetVector, instead of having separate vector and set.
> 
> Edit: Also worth noting that this pattern also exists here: https://github.com/llvm/llvm-project/blob/50ce6d0114f8abd4b5580d2c277525eebdf25874/clang/lib/Frontend/Rewrite/RewriteObjC.cpp#L3556C42-L3556C61

Ack.  There are quite a few places within LLVM where we see `Map.try_emplace(Key, Vector.size())`.  I bet many of those can be converted to `MapVector`.

https://github.com/llvm/llvm-project/pull/109605


More information about the cfe-commits mailing list