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

Jonas Devlieghere via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 11 03:38:08 PST 2017


JDevlieghere 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()) {
----------------
chandlerc wrote:
> 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.
Got it, thanks!


https://reviews.llvm.org/D40987





More information about the llvm-commits mailing list