[PATCH] D40987: Rewrite the cached map used for locating the most precise DIE among inlined subroutines for a given address.

Chandler Carruth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 8 11:54:01 PST 2017


chandlerc marked an inline comment as done.
chandlerc added inline comments.


================
Comment at: llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp:378
+    int DIEIndex = SubprogramDIEAddrInfos.size();
+    SubprogramDIEAddrInfos.push_back({Die, (uint64_t)-1, {}});
     for (const auto &R : Die.getAddressRanges()) {
----------------
JDevlieghere wrote:
> I'm curious if there is any particular reason you prefer `::push_back({})` over `::emplace_back`? 
Unless the code will only compile with emplace_back, I strongly prefer push_back.

- I find the code substanitally easier to read and failures easier to debug. Forwarding is a horrifically complicated thing in C++ and it tends to not be worth the cost it imposes.
- We generally insist upon cheap-to-move objects making push_back's "extra" move not an important consideration.


https://reviews.llvm.org/D40987





More information about the llvm-commits mailing list