This is an archive of the discontinued LLVM Phabricator instance.

[llvm-objdump][CallGraphInfo] Add CallGraphInfo option, extract functions
AcceptedPublic

Authored by necipfazil on Jul 28 2021, 9:50 PM.

Details

Summary

Add llvm-objdump --call-graph-info option to disassemble the binary and parse
the .callgraph section for call graph information.

This patch extracts and prints function entry address to name mapping.
This can be used to annotate function nodes on a reconstructed call
graph. Upcoming patches will add the rest of the functionality (call
site info and .callgraph section parsing).

Patch 2/6: Extract call graph information from binary

Original RFC: https://lists.llvm.org/pipermail/llvm-dev/2021-June/151044.html
Updated RFC: https://lists.llvm.org/pipermail/llvm-dev/2021-July/151739.html

Diff Detail

Event Timeline

necipfazil created this revision.Jul 28 2021, 9:50 PM
necipfazil requested review of this revision.Jul 28 2021, 9:50 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 28 2021, 9:50 PM
This revision is now accepted and ready to land.Jul 29 2021, 3:23 PM
morehouse requested changes to this revision.Jul 29 2021, 3:28 PM
morehouse added inline comments.
llvm/test/tools/llvm-objdump/ELF/call-graph-info-functions.test
11

Will these tests break if DenseMap changes its hash function?

We should probably use a sorted map.

This revision now requires changes to proceed.Jul 29 2021, 3:28 PM
necipfazil marked an inline comment as done.

Use stable iteration order for functions

Use MapVector instead of DenseMap to store the functions.

This revision is now accepted and ready to land.Jul 29 2021, 3:47 PM