aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-mc/Disassembler.cpp
AgeCommit message (Collapse)AuthorFilesLines
2016-08-17Replace a few more "fall through" comments with LLVM_FALLTHROUGHJustin Bogner1-1/+1
Follow up to r278902. I had missed "fall through", with a space. llvm-svn: 278970
2016-01-26Reflect the MC/MCDisassembler split on the include/ level.Benjamin Kramer1-1/+1
No functional change, just moving code around. llvm-svn: 258818
2014-12-17Remove unused includes and out of date comment. NFC.Rafael Espindola1-1/+0
llvm-svn: 224413
2014-11-12Remove the now unused StringRefMemoryObject.h.Rafael Espindola1-1/+0
llvm-svn: 221755
2014-11-12Pass an ArrayRef to MCDisassembler::getInstruction.Rafael Espindola1-3/+2
With this patch MCDisassembler::getInstruction takes an ArrayRef<uint8_t> instead of a MemoryObject. Even on X86 there is a maximum size an instruction can have. Given that, it seems way simpler and more efficient to just pass an ArrayRef to the disassembler instead of a MemoryObject and have it do a virtual call every time it wants some extra bytes. llvm-svn: 221751
2014-11-11[llvm-mc] Fixing case where if a file ended with non-newline whitespace or a ↵Colin LeMahieu1-15/+9
comma it would access invalid memory. Cleaned up parse loop. llvm-svn: 221707
2014-11-07Use StringRefMemoryObject in llvm-mc. NFC.Rafael Espindola1-29/+15
llvm-svn: 221536
2014-10-15Simplify handling of --noexecstack by using getNonexecutableStackSection.Rafael Espindola1-1/+1
llvm-svn: 219799
2014-04-25[C++] Use 'nullptr'. Tools edition.Craig Topper1-1/+1
llvm-svn: 207176
2014-04-15[MC] Require an MCContext when constructing an MCDisassembler.Lang Hames1-1/+21
This patch re-introduces the MCContext member that was removed from MCDisassembler in r206063, and requires that an MCContext be passed in at MCDisassembler construction time. (Previously the MCContext member had been initialized in an ad-hoc fashion after construction). The MCCContext member can be used by MCDisassembler sub-classes to construct constant or target-specific MCExprs. This patch updates disassemblers for in-tree targets, and provides the MCRegisterInfo instance that some disassemblers were using through the MCContext (previously those backends were constructing their own MCRegisterInfo instances). llvm-svn: 206241
2014-03-08[C++11] Add 'override' keyword to virtual methods that override their base ↵Craig Topper1-3/+3
class. llvm-svn: 203345
2014-03-06Replace OwningPtr<T> with std::unique_ptr<T>.Ahmed Charles1-2/+1
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. llvm-svn: 203083
2014-01-28Change MCStreamer EmitInstruction interface to take subtarget infoDavid Woodhouse1-3/+4
llvm-svn: 200345
2013-07-19Improve llvm-mc disassembler mode and refactor ARM tests to use itTim Northover1-12/+60
This allows "llvm-mc -disassemble" to accept two new features: + Using comma as a byte separator + Grouping bytes with '[' and ']' pairs. The behaviour outside a [...] group is unchanged. But within the group once llvm-mc encounters a true error, it stops rather than trying to resynchronise the stream at the next byte. This is more useful for disassembly tests, where we have an almost-instruction in mind and don't care what the misaligned interpretation would be. Particularly if it means llvm-mc won't actually see the next intended almost-instruction. As a side effect, this means llvm-mc can disassemble its own -show-encoding output if copy-pasted. llvm-svn: 186661
2012-12-19Remove edis - the enhanced disassembler. Fixes PR14654.Roman Divacky1-176/+0
llvm-svn: 170578
2012-12-04Sort the #include lines for tools/...Chandler Carruth1-2/+2
Again, tools are trickier to pick the main module header for than library source files. I've started to follow the pattern of using LLVMContext.h when it is included as a stub for program source files. llvm-svn: 169252
2012-04-16Add -disassemble support for -show-inst and -show-encode capability llvm-mc. ↵Richard Barton1-53/+14
Also refactor so all MC paraphernalia are created once for all uses as much as possible. The test change is to account for the fact that the default disassembler behaviour has changed with regards to specifying the assembly syntax to use. llvm-svn: 154809
2012-04-02Make MCInstrInfo available to the MCInstPrinter. This will be used to remove ↵Craig Topper1-3/+11
getInstructionName and the static data it contains since the same tables are already in MCInstrInfo. llvm-svn: 153860
2012-03-05Make MCRegisterInfo available to the the MCInstPrinter.Jim Grosbach1-2/+9
Used to allow context sensitive printing of super-register or sub-register references. llvm-svn: 152043
2012-02-29Make MemoryObject accessor members const againDerek Schuff1-3/+2
llvm-svn: 151687
2012-02-06Enable streaming of bitcodeDerek Schuff1-2/+2
This CL delays reading of function bodies from initial parse until materialization, allowing overlap of compilation with bitcode download. llvm-svn: 149918
2012-01-10Remove unnecessary default cases in switches that cover all enum values.David Blaikie1-1/+0
llvm-svn: 147855
2011-11-11Clients are responsible for initializing the targets, remove it from the ↵Benjamin Kramer1-1/+0
disassembler API. This will break users of the LLVMCreateDisasm API (not that I know of any). They have to call the LLVMInitializeAll* functions from llvm-c/Target.h themselves now. edis' C API in all its horribleness should be unaffected. llvm-svn: 144385
2011-10-16Make SMDiagnostic a little more sane. Instead of passing around ↵Chris Lattner1-4/+6
note/warning/error as a string, pass it around as an enum. llvm-svn: 142107
2011-09-15Don't attach annotations to MCInst's. Instead, have the disassembler ↵Owen Anderson1-2/+2
return, and the printer accept, an annotation string which can be passed through if the client cares about annotations. llvm-svn: 139876
2011-09-07Refactor instprinter and mcdisassembler to take a SubtargetInfo. Add -mattr= ↵James Molloy1-2/+11
handling to llvm-mc. Reviewed by Owen Anderson. llvm-svn: 139237
2011-08-24Move TargetRegistry and TargetSelect from Target to Support where they belong.Evan Cheng1-2/+2
These are strictly utilities for registering targets and components. llvm-svn: 138450
2011-08-17Allow the MCDisassembler to return a "soft fail" status code, indicating an ↵Owen Anderson1-5/+16
instruction that is disassemblable, but invalid. Only used for ARM UNPREDICTABLE instructions at the moment. Patch by James Molloy. llvm-svn: 137830
2011-07-14Rename createAsmInfo to createMCAsmInfo and move registration code to ↵Evan Cheng1-1/+1
MCTargetDesc to prepare for next round of changes. llvm-svn: 135219
2011-07-06createMCInstPrinter doesn't need TargetMachine anymore.Evan Cheng1-2/+2
llvm-svn: 134525
2011-05-09Tidy up. 80-column and whitespace.Jim Grosbach1-57/+58
llvm-svn: 131094
2011-04-09Moved an access to an object past a NULL check,Sean Callanan1-2/+2
making the MC disassembler tester more robust. llvm-svn: 129175
2011-03-21We need to pass the TargetMachine object to the InstPrinter if we are printingBill Wendling1-2/+3
the alias of an InstAlias instead of the thing being aliased. Because we need to know the features that are valid for an InstAlias. This is part of a work-in-progress. llvm-svn: 127986
2011-02-24Plug some leaks in edis.Benjamin Kramer1-5/+5
- Don't leak parsed operands during tokenization. - Don't leak printed insts in llvm-mc. llvm-svn: 126381
2011-02-23Fixed a bug in the enhanced disassembly tester thatSean Callanan1-82/+86
caused it to only parse one line of input. llvm-svn: 126301
2011-02-22Fixed llvm-mc in edis mode to use the result ofSean Callanan1-1/+4
operand.evaluate as an error code, not as the contents of the operand. llvm-svn: 126181
2011-01-06Correctly disassemble truncated asm.Rafael Espindola1-1/+1
Patch by Richard Simth. llvm-svn: 122962
2010-09-27Push twines deeper into SourceMgr's error handling methods.Benjamin Kramer1-0/+1
llvm-svn: 114847
2010-08-20Use the new tool_output_file in several tools. This fixes a varietyDan Gohman1-33/+36
of problems with output files being left behind or output streams being left unclosed. Fix llvm-mc to respect the -o option in all modes, rather than hardcoding outs() in some cases. llvm-svn: 111603
2010-07-20start straightening out libedis's dependencies and make it fitChris Lattner1-82/+57
better in the llvm world. Among other things, this changes: 1. The guts of libedis are now moved into lib/MC/MCDisassembler 2. llvm-mc now depends on lib/MC/MCDisassembler, not tools/edis, so edis and mc don't have to be built in series. 3. lib/MC/MCDisassembler no longer depends on the C api, the C API depends on it. 4. Various code cleanup changes. There is still a lot to be done to make edis fit with the llvm design, but this is an incremental step in the right direction. llvm-svn: 108869
2010-05-11Extended the edis "IsBranch" property to callSean Callanan1-0/+5
instructions as well. Added support for checking this to the llvm-mc tester as well. llvm-svn: 103454
2010-05-05Fixed a sign-extension bug in the X86 disassemblerSean Callanan1-0/+2
that was causing PC-relative branch targets to be evaluated incorrectly. Also added support for checking operand values to the llvm-mc tester. llvm-svn: 103128
2010-04-13Make the disassembler respect the assembler dialect when printing instructions,Chris Lattner1-1/+3
patch by Marius Wachtler! llvm-svn: 101160
2010-04-12Second try at integrating the edis tester. ThisSean Callanan1-37/+232
time I use the LIBS variable, which is not subject to a %.a -> -l% transformation, to link llvm-mc against libEnhancedDisassembly. llvm-mc -edis works the same as llvm-mc -disassemble, but outputs tokens and operands. llvm-svn: 101058
2010-04-09revert r100842 which broke several of the build bots.Chris Lattner1-232/+37
llvm-svn: 100848
2010-04-09Added a tester for the enhanced disassembler,Sean Callanan1-37/+232
integrated into the llvm-mc testing tool. llvm-svn: 100842
2010-04-04fix an ugly wart in the MCInstPrinter api where theChris Lattner1-4/+4
raw_ostream to print an instruction to had to be specified at MCInstPrinter construction time instead of being able to pick at each call to printInstruction. llvm-svn: 100307
2010-03-20llvm-mc: Fix MCInstPrinter memory leaks.Daniel Dunbar1-9/+8
llvm-svn: 99101
2010-02-03Fixed the disassembler so it accepts multipleSean Callanan1-28/+20
instructions on a single line. Also made it a bit more forgiving when it reports errors. llvm-svn: 95197
2009-12-22rename HexDisassembler -> Disassembler, it works on any inputChris Lattner1-0/+165
integer encoding (0123, 0b10101, 42, etc). llvm-svn: 91934