[PATCH] D113465: [llvm-dwarfdump][Statistics] Handle LTO cases with cross CU referencing
Orlando Cazalet-Hyams via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 10 03:55:47 PST 2021
Orlando added a comment.
Hi,
> Note that each entry within the concrete inlined instance tree in the main.c CU has a DW_AT_abstract_origin attribute which refers to a corresponding entry within the abstract instance tree in the sum.c CU.
> llvm-dwarfdump (its --statistics option, to be precise) did not properly report DW_TAG_formal_parameters/DW_TAG_variables which had 0% location coverage, mainly because information about abstract instance trees and their parameters/variables was stored locally - just for the currently processed CU, rather than globally - for all CUs.
You state that the variables should have "0% location coverage", but the variables in your example each have a location that covers the entirety of its inlined scope (100% coverage):
0x0000006d: DW_TAG_inlined_subroutine
DW_AT_abstract_origin (0x00000000000000b0 "sum")
DW_AT_low_pc (0x00000000002016ef)
DW_AT_high_pc (0x00000000002016f1)
DW_AT_call_file ("main.c")
DW_AT_call_line (5)
DW_AT_call_column (0x19)
0x00000081: DW_TAG_formal_parameter
DW_AT_location (DW_OP_reg0 RAX)
DW_AT_abstract_origin (0x00000000000000bc "a")
Am I missing something?
I added just one inline nit/question but I haven't fully reviewed this - please don't let my questions block the review process.
================
Comment at: llvm/tools/llvm-dwarfdump/Statistics.cpp:48
+using CrossCUReferencingDIELocationTy =
+ llvm::SmallVector<std::unique_ptr<DIELocation>>;
+
----------------
Is there a reason that this cannot be just `llvm::SmallVector<DIELocation>` (i.e. drop the unique_ptr wrapper)?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D113465/new/
https://reviews.llvm.org/D113465
More information about the llvm-commits
mailing list