diff options
author | Javier Lopez-Gomez <javier.lopez.gomez@proton.me> | 2025-02-19 16:27:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-19 15:27:16 +0000 |
commit | 4624087328961b2ad50935799e3b5eee49e90c23 (patch) | |
tree | f239f2c1ec1c0ebc33832e3c5443142dbfba9c5d /llvm/tools/llvm-dwarfdump | |
parent | 26a83994176fcdca6e77be4f221a15f561681621 (diff) | |
download | llvm-4624087328961b2ad50935799e3b5eee49e90c23.zip llvm-4624087328961b2ad50935799e3b5eee49e90c23.tar.gz llvm-4624087328961b2ad50935799e3b5eee49e90c23.tar.bz2 |
[llvm-dwarfdump] Print number of out-of-line functions described by DWARF (#127233)
Some of the functions in `#functions` may have several inlined
instances, but also an out-of-line definition.
Therefore, for complex enough DWARF input, `#functions` - `#inlined
functions` would not give us the number of out-of-line function
definitions.
`llvm-dwarfdump`, however, already keeps track of those; print it as
part of the statistics, as this number is useful in certain scenarios.
Diffstat (limited to 'llvm/tools/llvm-dwarfdump')
-rw-r--r-- | llvm/tools/llvm-dwarfdump/Statistics.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/tools/llvm-dwarfdump/Statistics.cpp b/llvm/tools/llvm-dwarfdump/Statistics.cpp index 6f29193..1670709 100644 --- a/llvm/tools/llvm-dwarfdump/Statistics.cpp +++ b/llvm/tools/llvm-dwarfdump/Statistics.cpp @@ -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; @@ -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; @@ -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); |