llvm-mirror/tools
Ahmed Bougacha eedbfb8aab MC: Disassembled CFG reconstruction.
This patch builds on some existing code to do CFG reconstruction from
a disassembled binary:
- MCModule represents the binary, and has a list of MCAtoms.
- MCAtom represents either disassembled instructions (MCTextAtom), or
  contiguous data (MCDataAtom), and covers a specific range of addresses.
- MCBasicBlock and MCFunction form the reconstructed CFG. An MCBB is
  backed by an MCTextAtom, and has the usual successors/predecessors.
- MCObjectDisassembler creates a module from an ObjectFile using a
  disassembler. It first builds an atom for each section. It can also
  construct the CFG, and this splits the text atoms into basic blocks.

MCModule and MCAtom were only sketched out; MCFunction and MCBB were
implemented under the experimental "-cfg" llvm-objdump -macho option.
This cleans them up for further use; llvm-objdump -d -cfg now generates
graphviz files for each function found in the binary.

In the future, MCObjectDisassembler may be the right place to do
"intelligent" disassembly: for example, handling constant islands is just
a matter of splitting the atom, using information that may be available
in the ObjectFile. Also, better initial atom formation than just using
sections is possible using symbols (and things like Mach-O's
function_starts load command).

This brings two minor regressions in llvm-objdump -macho -cfg:
- The printing of a relocation's referenced symbol.
- An annotation on loop BBs, i.e., which are their own successor.

Relocation printing is replaced by the MCSymbolizer; the basic CFG
annotation will be superseded by more related functionality.

llvm-svn: 182628
2013-05-24 01:07:04 +00:00
..
bugpoint Use only explicit bool conversion operators 2013-05-15 07:36:59 +00:00
bugpoint-passes [CMake] bugpoint-passes should not be built in "all", when LLVM_BUILD_TOOLS is OFF. 2013-01-22 01:44:00 +00:00
gold Sort the #include lines for tools/... 2012-12-04 10:44:52 +00:00
llc Replace uses of the deprecated std::auto_ptr with OwningPtr. 2013-04-12 10:56:28 +00:00
lli Print uint64_t -debug text correctly on 32-bit hosts 2013-05-19 09:55:06 +00:00
llvm-ar Move all of the header files which are involved in modelling the LLVM IR 2013-01-02 11:36:10 +00:00
llvm-as Replace uses of the deprecated std::auto_ptr with OwningPtr. 2013-04-12 10:56:28 +00:00
llvm-bcanalyzer Add static cast to unsigned char whenever a character classification function is called with a signed char argument, in order to avoid assertions in Windows Debug configuration. 2013-02-12 21:21:59 +00:00
llvm-config Re-enable support for --program-prefix. 2012-10-01 18:40:32 +00:00
llvm-cov Remove accidental commit. 2012-11-07 18:39:32 +00:00
llvm-diff Manually update the dependencies in the Makefiles. It turns out that all 2013-03-26 03:45:47 +00:00
llvm-dis Replace uses of the deprecated std::auto_ptr with OwningPtr. 2013-04-12 10:56:28 +00:00
llvm-dwarfdump Add support for the pubnames section to llvm-dwarfdump. 2013-02-12 16:20:28 +00:00
llvm-extract Replace uses of the deprecated std::auto_ptr with OwningPtr. 2013-04-12 10:56:28 +00:00
llvm-jitlistener Manually update the dependencies in the Makefiles. It turns out that all 2013-03-26 03:45:47 +00:00
llvm-link Optimize llvm-link too. 2013-05-04 05:30:49 +00:00
llvm-mc Remove the MachineMove class. 2013-05-13 01:16:13 +00:00
llvm-mcmarkup MC: Simple example parser for MC assembly markup. 2012-10-31 23:24:13 +00:00
llvm-nm [Object][Archive] Improve performance. 2013-02-03 10:48:50 +00:00
llvm-objdump MC: Disassembled CFG reconstruction. 2013-05-24 01:07:04 +00:00
llvm-prof Move all of the header files which are involved in modelling the LLVM IR 2013-01-02 11:36:10 +00:00
llvm-ranlib Replace uses of the deprecated std::auto_ptr with OwningPtr. 2013-04-12 10:56:28 +00:00
llvm-readobj Introduce convenience typedefs for the 4 ELF object types. 2013-05-09 13:13:28 +00:00
llvm-rtdyld Minor changes to the MCJITTest unittests to use the correct API for finalizing 2013-05-17 10:01:46 +00:00
llvm-shlib Add support for the OpenBSD for Bitrig. 2012-08-06 20:52:18 +00:00
llvm-size Sort the #include lines for tools/... 2012-12-04 10:44:52 +00:00
llvm-stress Manually update the dependencies in the Makefiles. It turns out that all 2013-03-26 03:45:47 +00:00
llvm-symbolizer At Jim Grosbach's request detemplate Object/MachO.h. 2013-04-18 18:08:55 +00:00
lto The command line options need to be processed before we create the TargetMachine. 2013-05-23 21:21:50 +00:00
macho-dump Use llvm/Object/MachO.h in macho-dumper. Drop the old macho parser. 2013-04-26 20:07:33 +00:00
obj2yaml Use std::list so that we have a stable iterator. 2013-05-21 18:53:50 +00:00
opt Add DebugIR pass -- emits IR file and replace source lines with IR lines in MD 2013-05-08 20:44:14 +00:00
yaml2obj Fix the configure build. 2013-05-17 23:20:58 +00:00
CMakeLists.txt Move yaml2obj to tools too. 2013-04-05 20:00:35 +00:00
LLVMBuild.txt Adding tests for the Intel JIT event listener's MCJIT support. 2012-11-21 20:38:26 +00:00
Makefile Move yaml2obj to tools too. 2013-04-05 20:00:35 +00:00