summaryrefslogtreecommitdiff
path: root/lib/MC/MCDisassembler.cpp
Commit message (Collapse)AuthorAge
* Remove redundant symbolization support from MCDisassembler interface.Lang Hames2014-04-11
| | | | | | | | | | | | | | | | | | | MCDisassembler has an MCSymbolizer member that is meant to take care of symbolizing during disassembly, but it also has several methods that enable the disassembler to do symbolization internally (i.e. without an attached symbolizer object). There is no need for this duplication, but ARM64 had been making use of it. This patch moves the ARM64 symbolization logic out of ARM64Disassembler and into an ARM64ExternalSymbolizer class, and removes the duplicated MCSymbolizer functionality from the MCDisassembler interface. Symbolization will now be done exclusively through MCSymbolizers. There should be no impact on disassembly for any platform, but this allows us to tidy up the MCDisassembler interface and simplify the process of (and invariants related to) disassembler setup. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206063 91177308-0d34-0410-b5e6-96231b3b80d8
* [MC] Remove an unused (and broken) variant of the setupForSymbolicDisassemblyLang Hames2014-03-30
| | | | | | | method in MCDisassembler. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205123 91177308-0d34-0410-b5e6-96231b3b80d8
* Update MCSymbolizer and its subclasses' constructors to reflect the fact thatLang Hames2014-03-27
| | | | | | | | they take ownership of the RelocationInfo they're constructed with. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204891 91177308-0d34-0410-b5e6-96231b3b80d8
* Change MCDisassembler::setSymbolizer to take unique_ptr by value.Ahmed Charles2014-03-07
| | | | | | | This changes the interface to be more explicit that ownership is being transferred. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203223 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace OwningPtr<T> with std::unique_ptr<T>.Ahmed Charles2014-03-06
| | | | | | | | | | This compiles with no changes to clang/lld/lldb with MSVC and includes overloads to various functions which are used by those projects and llvm which have OwningPtr's as parameters. This should allow out of tree projects some time to move. There are also no changes to libs/Target, which should help out of tree targets have time to move, if necessary. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203083 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Add overloads for externally used OwningPtr functions.Ahmed Charles2014-03-05
| | | | | | | | This will allow external callers of these functions to switch over time rather than forcing a breaking change all a once. These particular functions were determined by building clang/lld/lldb. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202959 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Replace OwningPtr::take() with OwningPtr::release().Ahmed Charles2014-03-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202957 91177308-0d34-0410-b5e6-96231b3b80d8
* Follow up of the introduction of MCSymbolizer.Quentin Colombet2013-05-24
| | | | | | | | - Ressurect old MCDisassemble API to soften transition. - Extend MCTargetDesc to set target specific symbolizer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182688 91177308-0d34-0410-b5e6-96231b3b80d8
* Add MCSymbolizer for symbolic/annotated disassembly.Ahmed Bougacha2013-05-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a basic first step towards symbolization of disassembled instructions. This used to be done using externally provided (C API) callbacks. This patch introduces: - the MCSymbolizer class, that mimics the same functions that were used in the X86 and ARM disassemblers to symbolize immediate operands and to annotate loads based off PC (for things like c string literals). - the MCExternalSymbolizer class, which implements the old C API. - the MCRelocationInfo class, which provides a way for targets to translate relocations (either object::RelocationRef, or disassembler C API VariantKinds) to MCExprs. - the MCObjectSymbolizer class, which does symbolization using what it finds in an object::ObjectFile. This makes simple symbolization (with no fancy relocation stuff) work for all object formats! - x86-64 Mach-O and ELF MCRelocationInfos. - A basic ARM Mach-O MCRelocationInfo, that provides just enough to support the C API VariantKinds. Most of what works in otool (the only user of the old symbolization API that I know of) for x86-64 symbolic disassembly (-tvV) works, namely: - symbol references: call _foo; jmp 15 <_foo+50> - relocations: call _foo-_bar; call _foo-4 - __cf?string: leaq 193(%rip), %rax ## literal pool for "hello" Stub support is the main missing part (because libObject doesn't know, among other things, about mach-o indirect symbols). As for the MCSymbolizer API, instead of relying on the disassemblers to call the tryAdding* methods, maybe this could be done automagically using InstrInfo? For instance, even though PC-relative LEAs are used to get the address of string literals in a typical Mach-O file, a MOV would be used in an ELF file. And right now, the explicit symbolization only recognizes PC-relative LEAs. InstrInfo should have already have most of what is needed to know what to symbolize, so this can definitely be improved. I'd also like to remove object::RelocationRef::getValueString (it seems only used by relocation printing in objdump), as simply printing the created MCExpr is definitely enough (and cleaner than string concats). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182625 91177308-0d34-0410-b5e6-96231b3b80d8
* No newline at end of files.Edward O'Callaghan2009-10-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83318 91177308-0d34-0410-b5e6-96231b3b80d8
* add a new MCInstPrinter class, move the (trivial) MCDisassmbler ctor inline.Chris Lattner2009-09-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81745 91177308-0d34-0410-b5e6-96231b3b80d8
* canonicalize namespace gymnasticsChris Lattner2009-09-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81402 91177308-0d34-0410-b5e6-96231b3b80d8
* Added an abstract superclass, MCDisassembler, forSean Callanan2009-09-09
all disassemblers. Modified the MemoryObject to support 64-bit address spaces, regardless of the LLVM process's address width. Modified the Target class to allow extraction of a MCDisassembler. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81392 91177308-0d34-0410-b5e6-96231b3b80d8