[PATCH] D125784: [llvm-dva] 09 - CodeView Reader

Carlos Alberto Enciso via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 19 01:06:37 PDT 2022


CarlosAlbertoEnciso added a comment.

In D125784#3572568 <https://reviews.llvm.org/D125784#3572568>, @psamolysov wrote:

> There are numerous patterns such as `Map.insert(std::make_pair(Key,ValuePair(Element1, Element2))`. I prefer using `emplace` and `std::picewise_construct` (example: https://reviews.llvm.org/D125783#inline-1215434) to eliminate unnecessary copying even though not so much information is actually copied in this case (the key and two elements, usually pointers, this is about 24 bytes but it can be more if an `Element` in the value is a struct.)

I have replaced all patterns `insert(std::make_pair(...)` with your suggested change (`emplace` and `std::picewise_construct`).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D125784/new/

https://reviews.llvm.org/D125784



More information about the llvm-commits mailing list