[llvm-dwarfdump][locstats] Unify handling of inlined vars with no loc
authorDjordje Todorovic <djordje.todorovic@syrmia.com>
Mon, 8 Feb 2021 08:21:39 +0000 (00:21 -0800)
committerDjordje Todorovic <djtodoro@cisco.com>
Fri, 19 Feb 2021 13:38:01 +0000 (05:38 -0800)
commitb6db47d7e044730dc3c9b35dae6697eee0885dbf
tree67db52a5fe7eb228249c6b37206f3d95ecf93ed0
parent08331281af7bebf76d541cfb33d01dca22ed4d79
[llvm-dwarfdump][locstats] Unify handling of inlined vars with no loc

The presence or absence of an inline variable (as well as formal
parameter) with only an abstract_origin ref (without DW_AT_location)
should not change the location coverage.

It means, for both:

DW_TAG_inlined_subroutine
  DW_AT_abstract_origin (0x0000004e "f")
  DW_AT_low_pc  (0x0000000000000010)
  DW_AT_high_pc (0x0000000000000013)
  DW_TAG_formal_parameter
    DW_AT_abstract_origin       (0x0000005a "b")

and,

DW_TAG_inlined_subroutine
   DW_AT_abstract_origin (0x0000004e "f")
   DW_AT_low_pc  (0x0000000000000010)
   DW_AT_high_pc (0x0000000000000013)

we should report 0% location coverage. If we add DW_AT_location,
for both cases the coverage should be improved.

Differential Revision: https://reviews.llvm.org/D96045
llvm/test/tools/llvm-dwarfdump/X86/locstats-for-inlined-vars.yaml [new file with mode: 0644]
llvm/test/tools/llvm-dwarfdump/X86/statistics-dwo.test
llvm/test/tools/llvm-dwarfdump/X86/statistics-v3.test
llvm/test/tools/llvm-dwarfdump/X86/statistics.ll
llvm/test/tools/llvm-dwarfdump/X86/stats-scope-bytes-covered.yaml
llvm/tools/llvm-dwarfdump/Statistics.cpp