summaryrefslogtreecommitdiff
path: root/tools/llvm-mc/llvm-mc.cpp
Commit message (Collapse)AuthorAge
...
* fix an ugly wart in the MCInstPrinter api where theChris Lattner2010-04-04
| | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100307 91177308-0d34-0410-b5e6-96231b3b80d8
* remove some extraneous castsChris Lattner2010-04-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100287 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Add a -mc-relax-all option, which relaxes every fixup. We always needDaniel Dunbar2010-03-25
| | | | | | | exactly two passes in that case, and don't ever need to recompute any layout, so this is a nice baseline for relaxation performance. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99563 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Support -filetype=null, for timing purposes.Daniel Dunbar2010-03-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99349 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Fix memory leak of MCAsmInfo.Daniel Dunbar2010-03-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99098 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Fix target selection for --disassemble to use GetTarget.Daniel Dunbar2010-03-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98973 91177308-0d34-0410-b5e6-96231b3b80d8
* fix an MCInstPrinter leak that jyasskin pointed out:Chris Lattner2010-03-19
| | | | | | | createAsmStreamer now takes ownership of the instprinter. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98939 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Delete output files on error.Daniel Dunbar2010-03-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98445 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Support -n, useful for comparing -integrated-as output since theDaniel Dunbar2010-03-13
| | | | | | compiler may not lead with the text section. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98418 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Support -arch as a simplified form of -triple.Daniel Dunbar2010-03-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98417 91177308-0d34-0410-b5e6-96231b3b80d8
* remove MAI argument from createAsmStreamer since itChris Lattner2010-03-12
| | | | | | | can get it from the context now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98361 91177308-0d34-0410-b5e6-96231b3b80d8
* change MCContext to always have an MCAsmInfo.Chris Lattner2010-03-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98293 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Provide MCAssembler with a TargetAsmBackend.Daniel Dunbar2010-03-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98222 91177308-0d34-0410-b5e6-96231b3b80d8
* give MCCodeEmitters access to the current MCContext.Chris Lattner2010-02-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96038 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Remove --show-fixups and always show as part of --show-encoding.Daniel Dunbar2010-02-10
| | | | | | Also, fix a silly memory leak. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95752 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Add --show-fixups option, for displaying the instruction fixup ↵Daniel Dunbar2010-02-09
| | | | | | information in the asm comments. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95710 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Add --show-inst option, for showing the MCInst inline with the assemblyDaniel Dunbar2010-02-03
| | | | | | output. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95227 91177308-0d34-0410-b5e6-96231b3b80d8
* pass "-fasm-verbose" into createAsmStreamer.Chris Lattner2010-01-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94165 91177308-0d34-0410-b5e6-96231b3b80d8
* move some files out of the llvm-mc tool into the MCParser library soChris Lattner2010-01-22
| | | | | | | other tools can link it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94131 91177308-0d34-0410-b5e6-96231b3b80d8
* create a new MCParser library and move some stuff into it.Chris Lattner2010-01-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94129 91177308-0d34-0410-b5e6-96231b3b80d8
* Moved handling of inclusion from the AsmLexer toSean Callanan2010-01-21
| | | | | | | | the AsmParser, breaking AsmLexer's dependence on SourceMgr. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94054 91177308-0d34-0410-b5e6-96231b3b80d8
* Changed the AsmParser to handle error messages itselfSean Callanan2010-01-20
| | | | | | | | | rather than passing them off to the AsmLexer to handle. This means the AsmLexer no longer requires a SourceMgr to do error handling. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94047 91177308-0d34-0410-b5e6-96231b3b80d8
* give createAsmStreamer an 'isLittleEndian' argument.Chris Lattner2010-01-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93986 91177308-0d34-0410-b5e6-96231b3b80d8
* rename HexDisassembler -> Disassembler, it works on any inputChris Lattner2009-12-22
| | | | | | | integer encoding (0123, 0b10101, 42, etc). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91934 91177308-0d34-0410-b5e6-96231b3b80d8
* Test harness for the LLVM disassembler. When invokedSean Callanan2009-12-17
| | | | | | | | | | | with -disassemble, llvm-mc now accepts lines of the form 0x00 0x00 and passes the resulting bytes to the disassembler for the chosen (or default) target, printing the result. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91579 91177308-0d34-0410-b5e6-96231b3b80d8
* Line this up as well.Nick Lewycky2009-11-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85748 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix whitespace.Nick Lewycky2009-11-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85747 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an intel syntax MCInstPrinter implementation. You can nowChris Lattner2009-09-20
| | | | | | | | transcode from AT&T to intel syntax with "llvm-mc foo.s -output-asm-variant=1" git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82385 91177308-0d34-0410-b5e6-96231b3b80d8
* Change MCAsmStreamer to take an MCInstPrinter instead of a Chris Lattner2009-09-14
| | | | | | | | | | | | | full AsmPrinter, and change TargetRegistry to keep track of registered MCInstPrinters. llvm-mc is still linking in the entire target foo to get the code emitter stuff, but this is an important step in the right direction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81754 91177308-0d34-0410-b5e6-96231b3b80d8
* Added the ParseInstruction() hook for target specific assembler directives soKevin Enderby2009-09-10
| | | | | | | | | that things like .word can be parsed as target specific. Moved parsing .word out of AsmParser.cpp into X86AsmParser.cpp as it is 2 bytes on X86 and 4 bytes for other targets that support the .word directive. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81461 91177308-0d34-0410-b5e6-96231b3b80d8
* Added the AsmToken::Hash enum constant to MCAsmLexer.h in preparation ofKevin Enderby2009-09-04
| | | | | | | | | supporting other targets. Changed the code to pass MCAsmInfo to the parser and the lexer. Then changed the lexer to use CommentString from MCAsmInfo instead of a literal '#' character. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81046 91177308-0d34-0410-b5e6-96231b3b80d8
* Removed the non-target independent AsmToken::Register enum constantKevin Enderby2009-09-03
| | | | | | | | | | | from MCAsmLexer.h in preparation of supporting other targets. Changed the X86AsmParser code to reflect this by removing AsmLexer::LexPercent and looking for AsmToken::Percent when parsing in places that used AsmToken::Register. Then changed X86ATTAsmParser::ParseRegister to parse out registers as an AsmToken::Percent followed by an AsmToken::Identifier. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80929 91177308-0d34-0410-b5e6-96231b3b80d8
* TAI -> MAIChris Lattner2009-09-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80899 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc/Mach-O: Add MCCodeEmitter support, for encoding instructions.Daniel Dunbar2009-08-27
| | | | | | | - No relocations yet, of course. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80235 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Only show instruction encodings with --show-encoding.Daniel Dunbar2009-08-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80230 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Tweak MCCodeEmitter skeleton.Daniel Dunbar2009-08-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80193 91177308-0d34-0410-b5e6-96231b3b80d8
* Sketch TargetRegistry support for MCCodeEmitter abstract interface.Daniel Dunbar2009-08-27
| | | | | | | - Of course, nothing actually can provide this interface yet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80188 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc/Mach-O: Unique sections properly, so we don't get duplicate textDaniel Dunbar2009-08-26
| | | | | | | | | sections, etc. - The quick and dirty way, just clone the TargetLoweringObjectFile code. Eventually this should be shared... somehow. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80168 91177308-0d34-0410-b5e6-96231b3b80d8
* Make LLVM command-line tools overwrite their output files without -f.Dan Gohman2009-08-25
| | | | | | | | | | | | | | | | | This is conventional command-line tool behavior. -f now just means "enable binary output on terminals". Add a -f option to llvm-extract and llvm-link, for consistency. Remove F_Force from raw_fd_ostream and enable overwriting and truncating by default. Introduce an F_Excl flag to permit users to enable a failure when the file already exists. This flag is currently unused. Update Makefiles and documentation accordingly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79990 91177308-0d34-0410-b5e6-96231b3b80d8
* Change raw_fd_ostream to take flags as an optional bitmask Chris Lattner2009-08-23
| | | | | | | | | | | | | | | | | | | instead of as two bools. Use this to add a F_Append flag which has the obvious behavior. Other unrelated changes conflated into this patch: 1. REmove EH stuff from llvm-dis and llvm-as, the try blocks are dead. 2. Simplify the filename inference code in llvm-as/llvm-dis, because raw_fd_ostream does the right thing with '-'. 3. Switch machine verifier to use raw_ostream instead of ostream (Which is the thing that needed append in the first place). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79807 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename TargetAsmInfo (and its subclasses) to MCAsmInfo.Chris Lattner2009-08-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79763 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Start MCAssembler and MCMachOStreamer.Daniel Dunbar2009-08-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Together these form the (Mach-O) back end of the assembler. - MCAssembler is the actual assembler backend, which is designed to have a reasonable API. This will eventually grow to support multiple object file implementations, but for now its Mach-O/i386 only. - MCMachOStreamer adapts the MCStreamer "actions" API to the MCAssembler API, e.g. converting the various directives into fragments, managing state like the current section, and so on. - llvm-mc will use the new backend via '-filetype=obj', which may eventually be, but is not yet, since I hear that people like assemblers which actually assemble. - The only thing that works at the moment is changing sections. For the time being I have a Python Mach-O dumping tool in test/scripts so this stuff can be easily tested, eventually I expect to replace this with a real LLVM tool. - More doxyments to come. I assume that since this stuff doesn't touch any of the things which are part of 2.6 that it is ok to put this in not so long before the freeze, but if someone objects let me know, I can pull it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79612 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a commento.Daniel Dunbar2009-08-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79427 91177308-0d34-0410-b5e6-96231b3b80d8
* give MCAsmStreamer a TargetAsmInfo.Chris Lattner2009-08-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79222 91177308-0d34-0410-b5e6-96231b3b80d8
* Update llvm-mc / MCAsmStreamer to print the instruction using the actual targetDaniel Dunbar2009-08-14
| | | | | | | | | | | | specific printer (this only works on x86, for now). - This makes it possible to do some correctness checking of the parsing and matching, since we can compare the results of 'as' on the original input, to those of 'as' on the output from llvm-mc. - In theory, we could now have an easy ATT -> Intel syntax converter. :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78986 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Honor -o option (and add -f).Daniel Dunbar2009-08-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78640 91177308-0d34-0410-b5e6-96231b3b80d8
* split MachO section handling stuff out to its out .h/.cpp file.Chris Lattner2009-08-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78576 91177308-0d34-0410-b5e6-96231b3b80d8
* Make the big switch: Change MCSectionMachO to represent a section *semantically*Chris Lattner2009-08-10
| | | | | | | | | | | | | | | | | | instead of syntactically as a string. This means that it keeps track of the segment, section, flags, etc directly and asmprints them in the right format. This also includes parsing and validation support for llvm-mc and "attribute(section)", so we should now start getting errors about invalid section attributes from the compiler instead of the assembler on darwin. Still todo: 1) Uniquing of darwin mcsections 2) Move all the Darwin stuff out to MCSectionMachO.[cpp|h] 3) there are a few FIXMEs, for example what is the syntax to get the S_GB_ZEROFILL segment type? git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78547 91177308-0d34-0410-b5e6-96231b3b80d8
* sink the 'name' and 'isdirective' state out of MCSection into its derived ↵Chris Lattner2009-08-08
| | | | | | | | | classes. This totally optimizes PIC16 sections by not having an 'isdirective' bit anymore!! ;-) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78517 91177308-0d34-0410-b5e6-96231b3b80d8
* switch this to create coff sections for now, it doesn't really matter for Chris Lattner2009-08-08
| | | | | | | | llvm-mc's purpose yet and we'll want to switch to creating semantic sections at some point. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78509 91177308-0d34-0410-b5e6-96231b3b80d8