Skip to content

[llvm-dwarfdump] Print number of out-of-line functions described by DWARF #127233

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions llvm/test/tools/llvm-dwarfdump/X86/statistics-dwo.test
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ RUN: llvm-dwarfdump --statistics statistics-fib.split-dwarf.o | FileCheck %s
CHECK: "version": 9,
CHECK: "#functions": 3,
CHECK: "#functions with location": 3,
CHECK: "#out-of-line functions": 3,
CHECK: "#inlined functions": 7,
CHECK: "#inlined functions with abstract origins": 7,
CHECK: "#unique source variables": 9,
Expand Down
1 change: 1 addition & 0 deletions llvm/test/tools/llvm-dwarfdump/X86/statistics-v3.test
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ RUN: llvm-dwarfdump --statistics %t-statistics-fib.o | FileCheck %s
CHECK: "version": 9,
CHECK: "#functions": 3,
CHECK: "#functions with location": 3,
CHECK: "#out-of-line functions": 3,
CHECK: "#inlined functions": 8,
CHECK: "#inlined functions with abstract origins": 8,
CHECK: "#unique source variables": 9,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
; Test that abstract origins in multiple CUs are uniqued.

; CHECK: "#functions": 4,
; CHECK: "#out-of-line functions": 3,
; CHECK: "#inlined functions": 2,
; CHECK: "#unique source variables": 4,
; CHECK-NEXT: "#source variables": 6,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
; The results for both tests should be identical.

; CHECK: "#functions": 4,
; CHECK: "#out-of-line functions": 3,
; CHECK: "#inlined functions": 2,
; CHECK: "#unique source variables": 4,
; CHECK-NEXT: "#source variables": 6,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

; CHECK: "#functions": 3,
; CHECK-NEXT: "#functions with location": 3,
; CHECK-NEXT: "#out-of-line functions": 4,
; CHECK-NEXT: "#inlined functions": 0,
; CHECK-NEXT: "#inlined functions with abstract origins": 0,
; CHECK-NEXT: "#unique source variables": 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
; Test that statistics distinguish functions with the same name.

; CHECK: "#functions": 4,
; CHECK: "#out-of-line functions": 4,
; CHECK: "#unique source variables": 2,
; CHECK-NEXT: "#source variables": 2,

Expand Down
3 changes: 3 additions & 0 deletions llvm/tools/llvm-dwarfdump/Statistics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -971,6 +971,7 @@ bool dwarfdump::collectStatsForObjectFile(ObjectFile &Obj, DWARFContext &DICtx,
SaturatingUINT64 VarParamUnique = 0;
SaturatingUINT64 VarParamWithLoc = 0;
SaturatingUINT64 NumFunctions = 0;
SaturatingUINT64 NumOutOfLineFunctions = 0;
SaturatingUINT64 NumInlinedFunctions = 0;
SaturatingUINT64 NumFuncsWithSrcLoc = 0;
SaturatingUINT64 NumAbstractOrigins = 0;
Expand Down Expand Up @@ -999,6 +1000,7 @@ bool dwarfdump::collectStatsForObjectFile(ObjectFile &Obj, DWARFContext &DICtx,
<< Entry.getKey() << ": " << V.getKey() << "\n");
NumFunctions += Stats.IsFunction;
NumFuncsWithSrcLoc += Stats.HasSourceLocation;
NumOutOfLineFunctions += Stats.IsFunction * Stats.NumFnOutOfLine;
NumInlinedFunctions += Stats.IsFunction * Stats.NumFnInlined;
NumAbstractOrigins += Stats.IsFunction * Stats.NumAbstractOrigins;
ParamTotal += Stats.NumParams;
Expand All @@ -1024,6 +1026,7 @@ bool dwarfdump::collectStatsForObjectFile(ObjectFile &Obj, DWARFContext &DICtx,

printDatum(J, "#functions", NumFunctions.Value);
printDatum(J, "#functions with location", NumFuncsWithSrcLoc.Value);
printDatum(J, "#out-of-line functions", NumOutOfLineFunctions.Value);
printDatum(J, "#inlined functions", NumInlinedFunctions.Value);
printDatum(J, "#inlined functions with abstract origins",
NumAbstractOrigins.Value);
Expand Down