summaryrefslogtreecommitdiff
path: root/tools/llvm-mc
Commit message (Collapse)AuthorAge
* 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
* MC: Give target specific parsers access to the MCStreamer.Daniel Dunbar2009-09-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81416 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix an integer truncation noticed by MSVC.Benjamin Kramer2009-09-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81109 91177308-0d34-0410-b5e6-96231b3b80d8
* Added AsmToken enum constants to MCAsmLexer.h for '[', ']', '{', and '}' inKevin Enderby2009-09-04
| | | | | | | | preparation of supporting other targets. Then changed the lexer to parse these as tokens. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81050 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: Pass values to MCStreamer as MCExprs, not MCValues.Daniel Dunbar2009-08-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80578 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Simplify EmitAssignment ('.set' is identical to '=').Daniel Dunbar2009-08-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80577 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Remove MCAsmParser::Parse[Paren]RelocatableExpression.Daniel Dunbar2009-08-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80576 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Add MCAsmParser::Parse[Paren]Expression forms which return an MCExpr.Daniel Dunbar2009-08-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80574 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Add MCAsmParser::getContext.Daniel Dunbar2009-08-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80571 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Switch MCExpr construction to using static member functions, and ↵Daniel Dunbar2009-08-31
| | | | | | taking the MCContext (which now owns all MCExprs). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80569 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Move AsmExpr into MC lib (as MCExpr).Daniel Dunbar2009-08-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80567 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: MCStreamer cleanups. - Remove EmitLocalSymbol, this is unsupported ↵Daniel Dunbar2009-08-30
| | | | | | | | for now. - Switch Emit{CommonSymbol,Zerofill} to take alignment in bytes (for consistency). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80484 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Emit .lcomm as .zerofill.Daniel Dunbar2009-08-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80343 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Unique zero fill sections.Daniel Dunbar2009-08-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80342 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r80305, I forgot a dependent change.Daniel Dunbar2009-08-27
| | | | | | | | --- Reverse-merging r80305 into '.': U tools/llvm-mc/AsmParser.cpp git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80309 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Unique sections in .zerofill.Daniel Dunbar2009-08-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80305 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
* llvm-mc/Mach-O: Don't put assembler temporary labels in the symbol table.Daniel Dunbar2009-08-26
| | | | | | | | | - I moved section creation back into AsmParser. I think policy decisions like this should be pushed higher, not lower, when possible (in addition the assembler has flags which change this behavior, for example). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80162 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Make MCValue take const MCSymbol*s.Daniel Dunbar2009-08-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80078 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Make non-sensical max bytes to .align an error.Daniel Dunbar2009-08-26
| | | | | | Also, warn about overflow in alignment values. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80077 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: Clean up some handling of symbol/section association to be more correctDaniel Dunbar2009-08-22
| | | | | | | | | (external was really undefined and there wasn't an explicit representation for absolute symbols). - This still needs some cleanup to how the absolute "pseudo" section is dealt with, but I haven't figured out the nicest approach yet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79733 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Improve handling of implicit alignment for magic section directivesDaniel Dunbar2009-08-21
| | | | | | | | | (e.g., .objc_message_refs). - Just emit a .align when we see the directive; this isn't exactly what 'as' does but in practice it should be ok, at least for now. See FIXME. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79697 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: In a .fill directive, still honor .align even if invalid maximum bytesDaniel Dunbar2009-08-21
| | | | | | | count is given (this matches 'as'). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79683 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Accept .fill size of 8.Daniel Dunbar2009-08-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79635 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
* llvm-mc: Various section parsing fixes.Daniel Dunbar2009-08-21
| | | | | | | | | | | | | | | | - Add missing flags for various Objective-C sections. - Fix names for [non_]lazy_symbol_pointer (these are misspelled in the manual). - .symbol_stub does not have the self modifying code flag set (this appears to be wrong in the manual?). - Add implicit alignment values; not yet used. Also, call MCStreamer::Finish at the end of a successful parse. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79611 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't install llvm-mc by default.Daniel Dunbar2009-08-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79604 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
* llvm-mc: Support escaped characters in string literals (for .ascii and .asciz)Daniel Dunbar2009-08-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79010 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: Move MCAsmToken::getLoc() into MC library where it belongs.Daniel Dunbar2009-08-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78980 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Fix a crash on invalid due to a typo in relocatable expressionDaniel Dunbar2009-08-11
| | | | | | | evaluation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78692 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Accept .word as a synonym for .shortDaniel Dunbar2009-08-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78641 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
* llvm-mc: Sketch parsing for .file, .line, and .loc. No streamer hooks for theseDaniel Dunbar2009-08-11
| | | | | | | yet (I'm not even sure what they do). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78639 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Fix darwin .section parsing. It was skipping the section name and a ','Daniel Dunbar2009-08-11
| | | | | | | | (and outputting a diagnostic pointing at the wrong place), all of which lead to much confusion. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78637 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
* add a fixmeChris Lattner2009-08-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78575 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