summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCModule.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Move CFG building code to a new lib/MC/MCAnalysis library.Rafael Espindola2014-07-021-142/+0
| | | | | | | The new library is 150KB on a Release+Asserts build, so it is quiet a bit of code that regular users of MC don't need to link with now. llvm-svn: 212209
* Use unique_ptr to own MCFunctions within MCModule.David Blaikie2014-04-151-6/+6
| | | | | | | | MCModule's ctor had to be moved out of line so the definition of MCFunction was available. (ctor requires the dtor of members (in case the ctor throws) which required access to the dtor of MCFunction) llvm-svn: 206244
* [C++11] More 'nullptr' conversion or in some cases just using a boolean ↵Craig Topper2014-04-131-2/+2
| | | | | | check instead of comparing to nullptr. llvm-svn: 206129
* MC CFG: Split MCBasicBlocks to mirror atom splitting.Ahmed Bougacha2013-08-211-0/+27
| | | | | | | | When an MCTextAtom is split, all MCBasicBlocks backed by it are automatically split, with a fallthrough between both blocks, and the successors moved to the second block. llvm-svn: 188881
* MC CFG: Add a few needed methods, mainly MCModule::findFirstAtomAfter.Ahmed Bougacha2013-08-211-3/+17
| | | | | | While there, do some minor cleanup. llvm-svn: 188880
* MC CFG: Keep pointer to parent MCModule in created MCFunctions.Ahmed Bougacha2013-08-211-2/+6
| | | | | | Also, drive-by cleaning around createFunction. llvm-svn: 188875
* Revert "Remove use of asymmetric std::lower_bound comparator."Ahmed Bougacha2013-07-231-18/+12
| | | | | | | This reverts commit r185676. Originally done because of VS 2008. llvm-svn: 186969
* Remove use of asymmetric std::lower_bound comparator.Ahmed Bougacha2013-07-041-12/+18
| | | | | | VS 2008 doesn't like it when in debug mode. llvm-svn: 185676
* Allow creation of single-byte MCAtoms.Ahmed Bougacha2013-06-191-1/+1
| | | | llvm-svn: 184344
* Fix unused warning in opt builds.Daniel Jasper2013-05-241-4/+3
| | | | | | | | In these builds, the asserts() are completely compiled out of the code leaving "End" unused. Directly accessing it, should not have a performance impact, as it is just a data member. llvm-svn: 182634
* MC: Disassembled CFG reconstruction.Ahmed Bougacha2013-05-241-13/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Tidy up. 80 columns.Jim Grosbach2011-11-151-1/+1
| | | | llvm-svn: 144649
* Start stubbing out MCModule and MCAtom, which provide an API for accessing ↵Owen Anderson2011-09-221-0/+45
the rich disassembly of a complete object or executable. These are very much a work in progress, and not really useful yet. llvm-svn: 140345
OpenPOWER on IntegriCloud