summaryrefslogtreecommitdiff
path: root/tools/llvm-mc/llvm-mc.cpp
Commit message (Collapse)AuthorAge
...
* 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
* 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
* 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
* 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
* Merge System into Support.Michael J. Spencer2010-11-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120298 91177308-0d34-0410-b5e6-96231b3b80d8
* Add registry hook for assembly text outputChe-Liang Chiou2010-11-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118394 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow specifying a CPU to llvm-mc, so that we can properly set up subtargetJim Grosbach2010-10-30
| | | | | | feature lists for instruction pattern predicates. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117788 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Teach -as-lex to print the raw token string as well.Daniel Dunbar2010-10-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117296 91177308-0d34-0410-b5e6-96231b3b80d8
* Move tool_output_file into its own file.Dan Gohman2010-10-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115973 91177308-0d34-0410-b5e6-96231b3b80d8
* MC/Lexer: Add 'Real' token type for floating point literals.Daniel Dunbar2010-09-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114718 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Teach -as-lex to print more token kinds.Daniel Dunbar2010-09-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114051 91177308-0d34-0410-b5e6-96231b3b80d8
* Make tool_output_file's raw_ostream instance a member variable insteadDan Gohman2010-09-01
| | | | | | | | | | | of a base class. This makes it possible to unregister the file from FilesToRemove when the file is done. Also, this eliminates the need for formatted_tool_output_file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112706 91177308-0d34-0410-b5e6-96231b3b80d8
* tidy upChris Lattner2010-08-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112385 91177308-0d34-0410-b5e6-96231b3b80d8
* Straighten out any triple strings passed on the command line beforeDuncan Sands2010-08-28
| | | | | | | they hit the rest of the system. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112344 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the new tool_output_file in several tools. This fixes a varietyDan Gohman2010-08-20
| | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111603 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Add -show-inst-operands, for dumping the parsed instruction ↵Daniel Dunbar2010-08-11
| | | | | | representation before matching. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110791 91177308-0d34-0410-b5e6-96231b3b80d8
* Plug the remaining MC leaks by giving MCObjectStreamer/MCAsmStreamer ↵Benjamin Kramer2010-07-29
| | | | | | ownership of the TargetAsmBackend and the MCCodeEmitter. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109767 91177308-0d34-0410-b5e6-96231b3b80d8
* Target: Give the TargetAsmParser access to the TargetMachine.Daniel Dunbar2010-07-19
| | | | | | - Unfortunate, but necessary for now to handle subtarget instruction matching. Eventually we should factor out the lower level target machine information so we don't need to do this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108664 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Move several clients to using AsmParser constructor function.Daniel Dunbar2010-07-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108645 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Fix llvm-mc -as-lex.Daniel Dunbar2010-07-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108644 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Pass the target instance to the AsmParser constructor.Daniel Dunbar2010-07-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107426 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid calling outs() and fouts() when the stream isn't really needed.Dan Gohman2010-05-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104873 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Add an MCLoggingStreamer, for use in debugging integrated-as mismatches.Daniel Dunbar2010-05-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104463 91177308-0d34-0410-b5e6-96231b3b80d8
* Currently, createMachOStreamer() is invoked directly in llvm-mc whichMatt Fleming2010-05-21
| | | | | | | | | | | isn't ideal if we want to be able to use another object file format. Add a createObjectStreamer() factory method so that the correct object file streamer can be instantiated for a given target triple. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104318 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove dead option.Daniel Dunbar2010-05-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104303 91177308-0d34-0410-b5e6-96231b3b80d8
* Second try at integrating the edis tester. ThisSean Callanan2010-04-12
| | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101058 91177308-0d34-0410-b5e6-96231b3b80d8
* revert r100842 which broke several of the build bots.Chris Lattner2010-04-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100848 91177308-0d34-0410-b5e6-96231b3b80d8
* Added a tester for the enhanced disassembler,Sean Callanan2010-04-09
| | | | | | | integrated into the llvm-mc testing tool. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100842 91177308-0d34-0410-b5e6-96231b3b80d8
* tidy #includes.Chris Lattner2010-04-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100489 91177308-0d34-0410-b5e6-96231b3b80d8