[Lldb-commits] [PATCH] D87675: [lldb/DWARF] Refactor to prefer emplace_back() vs. push_back()

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Sep 15 05:37:04 PDT 2020

labath added a comment.

In D87675#2273831 <https://reviews.llvm.org/D87675#2273831>, @dmantipov wrote:

> Use std::pair rather than an ad-hoc two-member trivial structures. Since std::pair provides the default constructor to initialize both members, no extra C++ glue is required for emplace_back()'ing the pairs into containers.

I am sorry, but I don't consider that an improvement. The reason these were not pairs in the first place is because the first/second accessors are very nondescript. If you can demonstrate that these actually improve performance, then we can talk about the best way to do this. However, I'd be very surprised if any of these show up in a profile.

  rG LLVM Github Monorepo



More information about the lldb-commits mailing list