[PATCH] D73004: llvm-dwarfdump][Statistics] Make calculations of vars in global scope more accurate
Kristina Bessonova via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 22 11:37:46 PST 2020
krisb added inline comments.
================
Comment at: llvm/tools/llvm-dwarfdump/Statistics.cpp:330
+ if (Die.getTag() == dwarf::DW_TAG_member) {
FnStats.ConstantMembers++;
+ return;
----------------
aprantl wrote:
> How does this condition ensure that this is a constant member now?
The function returns on lines 259-262 (of original code) if Die is a member, but not a constant one, so it's not possible to reach this 'if' for a non-constant member.
But, yeah, it's a bit unclear. I moved the check for constantness to the top of the function, to be clear we do not consider non-constant members at all. This looks better to me.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D73004/new/
https://reviews.llvm.org/D73004
More information about the llvm-commits
mailing list