aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-mc
AgeCommit message (Collapse)AuthorFilesLines
2013-09-12Add an instruction deprecation feature to TableGen.Joey Gouly1-3/+3
The 'Deprecated' class allows you to specify a SubtargetFeature that the instruction is deprecated on. The 'ComplexDeprecationPredicate' class allows you to define a custom predicate that is called to check for deprecation. For example: ComplexDeprecationPredicate<"MCR"> would mean you would have to define the following function: bool getMCRDeprecationInfo(MCInst &MI, MCSubtargetInfo &STI, std::string &Info) Which returns 'false' for not deprecated, and 'true' for deprecated and store the warning message in 'Info'. The MCTargetAsmParser constructor was chaned to take an extra argument of the MCInstrInfo class, so out-of-tree targets will need to be changed. llvm-svn: 190598
2013-09-09Generate compact unwind encoding from CFI directives.Bill Wendling1-2/+2
We used to generate the compact unwind encoding from the machine instructions. However, this had the problem that if the user used `-save-temps' or compiled their hand-written `.s' file (with CFI directives), we wouldn't generate the compact unwind encoding. Move the algorithm that generates the compact unwind encoding into the MCAsmBackend. This way we can generate the encoding whether the code is from a `.ll' or `.s' file. <rdar://problem/13623355> llvm-svn: 190290
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
2013-07-16Add a wrapper for open.Rafael Espindola1-2/+2
This centralizes the handling of O_BINARY and opens the way for hiding more differences (like how open behaves with directories). llvm-svn: 186447
2013-06-18Use pointers to the MCAsmInfo and MCRegInfo.Bill Wendling1-1/+1
Someone may want to do something crazy, like replace these objects if they change or something. No functionality change intended. llvm-svn: 184175
2013-05-13Remove the MachineMove class.Rafael Espindola1-3/+3
It was just a less powerful and more confusing version of MCCFIInstruction. A side effect is that, since MCCFIInstruction uses dwarf register numbers, calls to getDwarfRegNum are pushed out, which should allow further simplifications. I left the MachineModuleInfo::addFrameMove interface unchanged since this patch was already fairly big. llvm-svn: 181680
2013-05-06Remove some redundant includes in llvm-mc.cpp.Rafael Espindola1-3/+0
Patch by Jun Koi! llvm-svn: 181231
2013-02-26Try to get rid of a -wunitialized warning: explicitly initialize the pointerEli Bendersky1-1/+3
to NULL and use asserts to check in relevant places. llvm-svn: 176134
2013-01-16Remove unneeded include and empty lineEli Bendersky1-2/+0
llvm-svn: 172642
2013-01-16We want the dwarf AT_producer for assembly source files to match clang'sKevin Enderby1-0/+11
AT_producer. Which includes clang's version information so we can tell which version of the compiler was used. This is the first of two steps to allow us to do that. This is the llvm-mc change to provide a method to set the AT_producer string. The second step, coming soon to a clang near you, will have the clang driver pass the value of getClangFullVersion() via an flag when invoking the integrated assembler on assembly source files. rdar://12955296 llvm-svn: 172630
2012-12-20Remove MCTargetAsmLexer and its derived classes now that edis,Roman Divacky1-3/+0
its only user, is gone. llvm-svn: 170699
2012-12-19Remove edis - the enhanced disassembler. Fixes PR14654.Roman Divacky3-187/+0
llvm-svn: 170578
2012-12-18Add support for passing -main-file-name all the way through toEric Christopher1-0/+6
the assembler. Part of PR14624 llvm-svn: 170390
2012-12-17Prepare LLVM to fix PR14625, exposing a hook in MCContext to manage theChandler Carruth1-1/+7
compilation directory. This defaults to the current working directory, just as it always has, but now an assembler can choose to override it with a custom directory. I've taught llvm-mc about this option and added a test case. llvm-svn: 170371
2012-12-05Added a option to the disassembler to print immediates as hex.Kevin Enderby1-4/+16
This is for the lldb team so most of but not all of the values are to be printed as hex with this option. Some small values like the scale in an X86 address were requested to printed in decimal without the leading 0x. There may be some tweaks need to places that may still be in decimal that they want in hex. Specially for arm. I made my best guess. Any tweaks from here should be simple. I also did the best I know now with help from the C++ gurus creating the cleanest formatImm() utility function and containing the changes. But if someone has a better idea to make something cleaner I'm all ears and game for changing the implementation. rdar://8109283 llvm-svn: 169393
2012-12-04Sort the #include lines for tools/...Chandler Carruth2-10/+10
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-11-23Add a -disable-cfi option to llvm-mc. This is useful for debugging asRafael Espindola1-1/+5
it will expand any .cfi_* directives in the input assembly. Unfortunately this cannot replace elf-dump in tests as the asm streamer cannot relax the line advance opcodes. llvm-svn: 168522
2012-10-22Add support for annotated disassembly output for X86 and arm.Kevin Enderby1-2/+9
Per the October 12, 2012 Proposal for annotated disassembly output sent out by Jim Grosbach this set of changes implements this for X86 and arm. The llvm-mc tool now has a -mdis option to produced the marked up disassembly and a couple of small example test cases have been added. rdar://11764962 llvm-svn: 166445
2012-09-18When creating MCAsmBackend pass the CPU string as well. In X86AsmBackendRoman Divacky1-2/+2
store this and use it to not emit long nops when the CPU is geode which doesnt support them. Fixes PR11212. llvm-svn: 164132
2012-05-15Allow MCCodeEmitter access to the target MCRegisterInfo.Jim Grosbach1-2/+2
Add the MCRegisterInfo to the factories and constructors. Patch by Tom Stellard <Tom.Stellard@amd.com>. llvm-svn: 156828
2012-05-08Fix it so llvm-objdump -arch does accept x86 and x86-64 as valid arch names.Kevin Enderby1-30/+8
PR12731. Patch by Meador Inge! llvm-svn: 156444
2012-04-16Add -disassemble support for -show-inst and -show-encode capability llvm-mc. ↵Richard Barton3-174/+80
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-15Make member variables of AsmToken private. Remove unnecessary forward ↵Craig Topper1-0/+1
declarations. Remove an unnecessary include. llvm-svn: 154775
2012-04-02Make MCInstrInfo available to the MCInstPrinter. This will be used to remove ↵Craig Topper2-4/+12
getInstructionName and the static data it contains since the same tables are already in MCInstrInfo. llvm-svn: 153860
2012-03-08Have llvm-mc --version print the list of registered targets like llc does.Duncan Sands1-0/+3
Patch by jey. llvm-svn: 152315
2012-03-05Make MCRegisterInfo available to the the MCInstPrinter.Jim Grosbach2-3/+10
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-26llvm-mc pass through SourceMgr to MCContext.Jim Grosbach1-1/+1
llvm-svn: 149091
2012-01-17Remove unreachable code. (replace with llvm_unreachable to help GCC where ↵David Blaikie1-2/+0
necessary) llvm-svn: 148284
2012-01-10Remove unnecessary default cases in switches that cover all enum values.David Blaikie2-2/+0
llvm-svn: 147855
2012-01-10Remove the logging streamer.Rafael Espindola1-7/+0
llvm-svn: 147820
2011-12-12LLVMBuild: Remove trailing newline, which irked me.Daniel Dunbar1-1/+0
llvm-svn: 146409
2011-12-09The second part of support for generating dwarf for assembly source files. ThisKevin Enderby1-0/+14
generates the dwarf Compile Unit DIE and a dwarf subprogram DIE for each non-temporary label. The next part will be to get the clang driver to enable this when assembling a .s file. rdar://9275556 llvm-svn: 146262
2011-12-05Tidy up.Jim Grosbach1-1/+1
llvm-svn: 145870
2011-11-11LLVMBuild: Add description files for the LLVM tools.Daniel Dunbar1-0/+23
llvm-svn: 144417
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-11-01First part of support for generating dwarf for assembly source files with theKevin Enderby1-0/+6
-g flag. In this part we generate the .file for the source being assembled and the .loc's for the assembled instructions. The next part will be to generate the dwarf Compile Unit DIE and a dwarf subprogram DIE for each non-temporary label. Once the next part is done test cases will be added. rdar://9275556 llvm-svn: 143509
2011-11-01rename getHostTriple into getDefaultTargetTripleSebastian Pop1-1/+1
llvm-svn: 143502
2011-10-18build: Tidy up a bunch of tool Makefiles, and simplify where possible using theDaniel Dunbar1-12/+5
new all-targets pseudo-component. llvm-svn: 142401
2011-10-17Add support for a new extension to the .file directive:Nick Lewycky1-3/+4
.file filenumber "directory" "filename" This removes one join+split of the directory+filename in MC internals. Because bitcode files have independent fields for directory and filenames in debug info, this patch may change the .o files written by existing .bc files. llvm-svn: 142300
2011-10-16Make SMDiagnostic a little more sane. Instead of passing around ↵Chris Lattner2-5/+8
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 Molloy3-7/+39
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 Cheng2-4/+4
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-08-16Remove unused Target argument from AsmParser construction methods.Jim Grosbach1-2/+2
The argument is unused, and is a layering violation in any case. llvm-svn: 137735
2011-07-26Fix llvm-mc target detection code to match llc.Evan Cheng1-12/+33
llvm-svn: 136115
2011-07-26Rename createCodeEmitter to createMCCodeEmitter; createObjectStreamer to ↵Evan Cheng1-5/+5
createMCObjectStreamer. llvm-svn: 136031
2011-07-26Rename TargetAsmParser to MCTargetAsmParser and TargetAsmLexer to ↵Evan Cheng1-2/+2
MCTargetAsmLexer; rename createAsmLexer to createMCAsmLexer and createAsmParser to createMCAsmParser. llvm-svn: 136027