[llvm-dwarfdump][Statistics] Distinguish functions/variables with same name across...
authorKristina Bessonova <kbessonova@accesssoftek.com>
Tue, 14 Jan 2020 18:36:30 +0000 (20:36 +0200)
committerKristina Bessonova <kbessonova@accesssoftek.com>
Tue, 28 Jan 2020 17:50:46 +0000 (19:50 +0200)
commit9806b39dae18982864dc3d9cdb2871d9590e5408
tree331b7e6c9dfa9aa7e5641770ef11bd75fa9e8646
parenta928d127a52a061733d2e42c4c9159a267f7dbd4
[llvm-dwarfdump][Statistics] Distinguish functions/variables with same name across different CUs

Different variables and functions might have the same name in different CU.
To calculate 'Availability' metric more accurate (i.e. to avoid getting
availability above 100%), we need to have some additional logic to
distinguish between them.

The patch introduces a DIE identifier that consists of a function/variable name
and declaration information: a filename and a line number. This allows
distinguishing different functions/variables (different means declared in
different files/lines) with the same name, keeping duplicates counted
as duplicates.

Reviewed by: aprantl, djtodoro

Differential Revision: https://reviews.llvm.org/D72797
llvm/test/tools/llvm-dwarfdump/X86/stats-multiple-cu-same-name.ll [new file with mode: 0644]
llvm/tools/llvm-dwarfdump/Statistics.cpp