[PATCH] D101025: [llvm-dwarfdump] Fix abstract origin vars location stats calculation

Djordje Todorovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 11 00:13:32 PDT 2021


djtodoro added a comment.

@dblaikie Thanks!



================
Comment at: llvm/tools/llvm-dwarfdump/Statistics.cpp:461-462
   // Handle any kind of lexical scope.
+  const bool IsPotentialAbstractOrigin =
+      Die.find(dwarf::DW_AT_abstract_origin) != None;
   const bool IsFunction = Tag == dwarf::DW_TAG_subprogram;
----------------
dblaikie wrote:
> maybe more accurately named `HasAbstractOrigin`? (`IsPotentialAbstractOrigin` sounds like this DIE /is/ the one referenced by an abstract_origin, rather than being the DIE with the abstract_origin)
Sure. (originally, it was `HasAbstractOrigin` xD)


================
Comment at: llvm/tools/llvm-dwarfdump/Statistics.cpp:225-226
+static void
+collectStatsForDie(DWARFDie Die, std::string FnPrefix, std::string VarPrefix,
+                   uint64_t BytesInScope, uint32_t InlineDepth,
+                   StringMap<PerFunctionStats> &FnStatMap,
----------------
dblaikie wrote:
> djtodoro wrote:
> > dblaikie wrote:
> > > Side note: why are we passing around std::strings by value? Should these be being passed by const ref? 
> > I think we should be using const ref instead.
> > But it is existing code, and the change for that should be a separate commit, right?
> oh, sure - easier to see this is untouched now that the renaming is separated, thanks!
But I can still commit the patch for turning it into const ref, as a separate commit, right? (I guess no need to review that one)


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

https://reviews.llvm.org/D101025



More information about the llvm-commits mailing list