summaryrefslogtreecommitdiff
path: root/tools/llvm-mc
Commit message (Collapse)AuthorAge
* build: Tidy up a bunch of tool Makefiles, and simplify where possible using theDaniel Dunbar2011-10-18
| | | | | | new all-targets pseudo-component. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142401 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for a new extension to the .file directive:Nick Lewycky2011-10-17
| | | | | | | | | | | .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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142300 91177308-0d34-0410-b5e6-96231b3b80d8
* Make SMDiagnostic a little more sane. Instead of passing around ↵Chris Lattner2011-10-16
| | | | | | | | | note/warning/error as a string, pass it around as an enum. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142107 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't attach annotations to MCInst's. Instead, have the disassembler ↵Owen Anderson2011-09-15
| | | | | | return, and the printer accept, an annotation string which can be passed through if the client cares about annotations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139876 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor instprinter and mcdisassembler to take a SubtargetInfo. Add -mattr= ↵James Molloy2011-09-07
| | | | | | handling to llvm-mc. Reviewed by Owen Anderson. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139237 91177308-0d34-0410-b5e6-96231b3b80d8
* Move TargetRegistry and TargetSelect from Target to Support where they belong.Evan Cheng2011-08-24
| | | | | | | These are strictly utilities for registering targets and components. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138450 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow the MCDisassembler to return a "soft fail" status code, indicating an ↵Owen Anderson2011-08-17
| | | | | | | | | instruction that is disassemblable, but invalid. Only used for ARM UNPREDICTABLE instructions at the moment. Patch by James Molloy. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137830 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused Target argument from AsmParser construction methods.Jim Grosbach2011-08-16
| | | | | | | The argument is unused, and is a layering violation in any case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137735 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix llvm-mc target detection code to match llc.Evan Cheng2011-07-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136115 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename createCodeEmitter to createMCCodeEmitter; createObjectStreamer to ↵Evan Cheng2011-07-26
| | | | | | createMCObjectStreamer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136031 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename TargetAsmParser to MCTargetAsmParser and TargetAsmLexer to ↵Evan Cheng2011-07-26
| | | | | | MCTargetAsmLexer; rename createAsmLexer to createMCAsmLexer and createAsmParser to createMCAsmParser. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136027 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename TargetAsmBackend to MCAsmBackend; rename createAsmBackend to ↵Evan Cheng2011-07-25
| | | | | | createMCAsmBackend. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136010 91177308-0d34-0410-b5e6-96231b3b80d8
* Separate MCInstPrinter registration from AsmPrinter registration.Evan Cheng2011-07-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135974 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix last bits of MC layer issues. llvm-mc doesn't need to initialize ↵Evan Cheng2011-07-25
| | | | | | TargetMachine's anymore. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135963 91177308-0d34-0410-b5e6-96231b3b80d8
* Move TargetAsmParser.h TargetAsmBackend.h and TargetAsmLexer.h to MC where ↵Evan Cheng2011-07-23
| | | | | | they belong. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135833 91177308-0d34-0410-b5e6-96231b3b80d8
* Combine all MC initialization routines into one. e.g. InitializeX86MCAsmInfo,Evan Cheng2011-07-22
| | | | | | | InitializeX86MCInstrInfo, etc. are combined into InitializeX86TargetMC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135812 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the registered target printing in version strings completely out ofChandler Carruth2011-07-22
| | | | | | | | | | | | | | | | | the Support library. Now its part of the TargetRegistry, and the three commands that care about this explicitly register this extra bit of version information. The set of commands which care was computed by intersecting those which use the Support library's version string printing and those that initialize all the registered targets in a way that produces a meaningful list. The only odd ball out is that 'clang -cc1as -version' no longer prints the registered targets. I don't think anyone is really interested in that (especially as the fact that llvm-mc does so is under a FIXME), but if someone really does want this back I'll happily apply the same patch there. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135757 91177308-0d34-0410-b5e6-96231b3b80d8
* Goodbye TargetAsmInfo. This eliminate last bit of CodeGen and Target in llvm-mc.Evan Cheng2011-07-20
| | | | | | | | There is still a bit more refactoring left to do in Targets. But we are now very close to fixing all the layering issues in MC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135611 91177308-0d34-0410-b5e6-96231b3b80d8
* - Move CodeModel from a TargetMachine global option to MCCodeGenInfo.Evan Cheng2011-07-20
| | | | | | | | | - Introduce JITDefault code model. This tells targets to set different default code model for JIT. This eliminates the ugly hack in TargetMachine where code model is changed after construction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135580 91177308-0d34-0410-b5e6-96231b3b80d8
* Add MCObjectFileInfo and sink the MCSections initialization code fromEvan Cheng2011-07-20
| | | | | | | | | TargetLoweringObjectFileImpl down to MCObjectFileInfo. TargetAsmInfo is done to one last method. It's *almost* gone! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135569 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce MCCodeGenInfo, which keeps information that can affect codegenEvan Cheng2011-07-19
| | | | | | | | (including compilation, assembly). Move relocation model Reloc::Model from TargetMachine to MCCodeGenInfo so it's accessible even without TargetMachine. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135468 91177308-0d34-0410-b5e6-96231b3b80d8
* Sink getDwarfRegNum, getLLVMRegNum, getSEHRegNum from TargetRegisterInfo downEvan Cheng2011-07-18
| | | | | | | | | | to MCRegisterInfo. Also initialize the mapping at construction time. This patch eliminate TargetRegisterInfo from TargetAsmInfo. It's another step towards fixing the layering violation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135424 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename createAsmInfo to createMCAsmInfo and move registration code to ↵Evan Cheng2011-07-14
| | | | | | MCTargetDesc to prepare for next round of changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135219 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert accidental commit.Evan Cheng2011-07-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135059 91177308-0d34-0410-b5e6-96231b3b80d8
* It's not safe to fold (fptrunc (sqrt (fpext x))) to (sqrtf x) if there is ↵Evan Cheng2011-07-13
| | | | | | another use of sqrt. rdar://9763193 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135058 91177308-0d34-0410-b5e6-96231b3b80d8
* Disassembler doesn't need TargetMachine anymore.Evan Cheng2011-07-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134920 91177308-0d34-0410-b5e6-96231b3b80d8
* - Eliminate MCCodeEmitter's dependency on TargetMachine. It now uses MCInstrInfoEvan Cheng2011-07-11
| | | | | | | | | | | | | and MCSubtargetInfo. - Added methods to update subtarget features (used when targets automatically detect subtarget features or switch modes). - Teach X86Subtarget to update MCSubtargetInfo features bits since the MCSubtargetInfo layer can be shared with other modules. - These fixes .code 16 / .code 32 support since mode switch is updated in MCSubtargetInfo so MC code emitter can do the right thing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134884 91177308-0d34-0410-b5e6-96231b3b80d8
* Change createAsmParser to take a MCSubtargetInfo instead of triple,Evan Cheng2011-07-09
| | | | | | | | | | CPU, and feature string. Parsing some asm directives can change subtarget state (e.g. .code 16) and it must be reflected in other modules (e.g. MCCodeEmitter). That is, the MCSubtargetInfo instance must be shared. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134795 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate asm parser's dependency on TargetMachine:Evan Cheng2011-07-08
| | | | | | | | | | | - Each target asm parser now creates its own MCSubtatgetInfo (if needed). - Changed AssemblerPredicate to take subtarget features which tablegen uses to generate asm matcher subtarget feature queries. e.g. "ModeThumb,FeatureThumb2" is translated to "(Bits & ModeThumb) != 0 && (Bits & FeatureThumb2) != 0". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134678 91177308-0d34-0410-b5e6-96231b3b80d8
* createMCInstPrinter doesn't need TargetMachine anymore.Evan Cheng2011-07-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134525 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the ridiculous SubtargetFeatures API where it implicitly expects CPU name toEvan Cheng2011-06-30
| | | | | | | | | | | be the first encoded as the first feature. It then uses the CPU name to look up features / scheduling itineray even though clients know full well the CPU name being used to query these properties. The fix is to just have the clients explictly pass the CPU name! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134127 91177308-0d34-0410-b5e6-96231b3b80d8
* Sink SubtargetFeature and TargetInstrItineraries (renamed ↵Evan Cheng2011-06-29
| | | | | | MCInstrItineraries) into MC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134049 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the verbose asm flag instead of a new flag for decoding the LSDA.Bill Wendling2011-06-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133292 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an option that allows one to "decode" the LSDA.Bill Wendling2011-06-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The LSDA is a bit difficult for the non-initiated to read. Even with comments, it's not always clear what's going on. This wraps the ASM streamer in a class that retains the LSDA and then emits a human-readable description of what's going on in it. So instead of having to make sense of: Lexception1: .byte 255 .byte 155 .byte 168 .space 1 .byte 3 .byte 26 Lset0 = Ltmp7-Leh_func_begin1 .long Lset0 Lset1 = Ltmp812-Ltmp7 .long Lset1 Lset2 = Ltmp913-Leh_func_begin1 .long Lset2 .byte 3 Lset3 = Ltmp812-Leh_func_begin1 .long Lset3 Lset4 = Leh_func_end1-Ltmp812 .long Lset4 .long 0 .byte 0 .byte 1 .byte 0 .byte 2 .byte 125 .long __ZTIi@GOTPCREL+4 .long __ZTIPKc@GOTPCREL+4 you can read this instead: ## Exception Handling Table: Lexception1 ## @LPStart Encoding: omit ## @TType Encoding: indirect pcrel sdata4 ## @TType Base: 40 bytes ## @CallSite Encoding: udata4 ## @Action Table Size: 26 bytes ## Action 1: ## A throw between Ltmp7 and Ltmp812 jumps to Ltmp913 on an exception. ## For type(s): __ZTIi@GOTPCREL+4 __ZTIPKc@GOTPCREL+4 ## Action 2: ## A throw between Ltmp812 and Leh_func_end1 does not have a landing pad. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133286 91177308-0d34-0410-b5e6-96231b3b80d8
* Tidy up. 80-column and whitespace.Jim Grosbach2011-05-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131094 91177308-0d34-0410-b5e6-96231b3b80d8
* Add all the plumbing needed for MC to expand cfi to the old tables inRafael Espindola2011-04-30
| | | | | | | the final assembly. It is the same technique used when targeting assemblers that don't support .loc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130587 91177308-0d34-0410-b5e6-96231b3b80d8
* Moved an access to an object past a NULL check,Sean Callanan2011-04-09
| | | | | | | making the MC disassembler tester more robust. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129175 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Add support for disabling "temporary label" behavior. Useful for debuggingDaniel Dunbar2011-03-28
| | | | | | on Darwin. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128430 91177308-0d34-0410-b5e6-96231b3b80d8
* We need to pass the TargetMachine object to the InstPrinter if we are printingBill Wendling2011-03-21
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127986 91177308-0d34-0410-b5e6-96231b3b80d8
* Plug some leaks in edis.Benjamin Kramer2011-02-24
| | | | | | | - Don't leak parsed operands during tokenization. - Don't leak printed insts in llvm-mc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126381 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed a bug in the enhanced disassembly tester thatSean Callanan2011-02-23
| | | | | | | caused it to only parse one line of input. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126301 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed llvm-mc in edis mode to use the result ofSean Callanan2011-02-22
| | | | | | | | operand.evaluate as an error code, not as the contents of the operand. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126181 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for the --noexecstack option.Rafael Espindola2011-01-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124077 91177308-0d34-0410-b5e6-96231b3b80d8
* Correctly disassemble truncated asm.Rafael Espindola2011-01-06
| | | | | | Patch by Richard Simth. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122962 91177308-0d34-0410-b5e6-96231b3b80d8
* MemoryBuffer now return an error_code and returns a OwningPtr<MemoryBuffer> ↵Michael J. Spencer2010-12-16
| | | | | | via an out parm. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121958 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Make TargetAsmBackend available to the AsmStreamer.Daniel Dunbar2010-12-16
| | | | | | - Treaty talks on the non-proliferation of MC objects broke down. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121949 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed version of 121434 with no new memory leaks.Rafael Espindola2010-12-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121471 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert my previous patch to make the valgrind bots happy.Rafael Espindola2010-12-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121461 91177308-0d34-0410-b5e6-96231b3b80d8
* Initial support for the cfi directives. This is just enough to getRafael Espindola2010-12-09
| | | | | | | | | | | f: .cfi_startproc nop .cfi_endproc assembled (on ELF). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121434 91177308-0d34-0410-b5e6-96231b3b80d8
* Support/MemoryBuffer: Replace all uses of std::string *ErrMsg with ↵Michael J. Spencer2010-12-09
| | | | | | error_code &ec. And fix clients. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121379 91177308-0d34-0410-b5e6-96231b3b80d8