summaryrefslogtreecommitdiff
path: root/tools/llvm-mc/AsmParser.cpp
Commit message (Collapse)AuthorAge
* 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: 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
* 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
* 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: 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
* 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
* Added Mac OS X assembler style conditional assembly. I may come back and see ifKevin Enderby2009-08-07
| | | | | | | | | I can clean this up a bit more and do way with the TheCondState and just use the top element on the TheCondStack if not empty. Also may tweak the code around ParseConditionalAssemblyDirectives() to simplify the AsmParser code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78423 91177308-0d34-0410-b5e6-96231b3b80d8
* update for API change.Chris Lattner2009-08-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77804 91177308-0d34-0410-b5e6-96231b3b80d8
* All MCSections are now required to have a SectionKind.Chris Lattner2009-08-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77787 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: More quoted identifier support.Daniel Dunbar2009-08-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77761 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Support quoted identifiers.Daniel Dunbar2009-07-31
| | | | | | | | | | - Uses MCAsmToken::getIdentifier which returns the (sub)string representing the meaningfull contents a string or identifier token. - Directives aren't done yet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77739 91177308-0d34-0410-b5e6-96231b3b80d8
* fix some more issues where we expected GetSection to do "get or create"Chris Lattner2009-07-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77700 91177308-0d34-0410-b5e6-96231b3b80d8
* fix a bunch of failing tests now that MCContext::GetSection doesn't create ↵Chris Lattner2009-07-31
| | | | | | sections. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77689 91177308-0d34-0410-b5e6-96231b3b80d8
* Move X86 instruction parsing into X86/AsmParser.Daniel Dunbar2009-07-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77384 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch AsmLexer::Lex to returning a reference to the current token.Daniel Dunbar2009-07-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77328 91177308-0d34-0410-b5e6-96231b3b80d8
* Drop some AsmLexer methods in favor of their AsmToken equivalents.Daniel Dunbar2009-07-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77323 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Sink token enum into AsmToken.Daniel Dunbar2009-07-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77322 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Implement .abort fully in the front endDaniel Dunbar2009-07-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77272 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Move AsmLexer::getCurStrVal to StringRef based API.Daniel Dunbar2009-07-27
| | | | | | | - My DFS traversal of LLVM is, at least for now, nearly complete! :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77258 91177308-0d34-0410-b5e6-96231b3b80d8
* Removed the DumpSymbolsandMacros and LoadSymbolsandMacros MCStreamer API asKevin Enderby2009-07-20
| | | | | | | | | | the parsing of the .dump and .load should be done in the assembly parser and not have any need for an MCStreamer API. Changed the code for now so these just produce an error saying these specific directives are not yet implemented since they are likely no longer used and may never need to be implemented. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76462 91177308-0d34-0410-b5e6-96231b3b80d8
* Add MCAsmParser interface.Daniel Dunbar2009-07-20
| | | | | | | | - This provides the AsmParser interface to the target specific assembly parsers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76453 91177308-0d34-0410-b5e6-96231b3b80d8
* Removed the SubsectionsViaSymbols MCStreamer API and replaced it with a genericKevin Enderby2009-07-16
| | | | | | | | EmitAssemblerFlag API which takes a value from the added AssemblerFlag enumerated constants. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76087 91177308-0d34-0410-b5e6-96231b3b80d8
* Clean up the definition of Str in AsmParser::ParseDirectiveDarwinDumpOrLoadKevin Enderby2009-07-16
| | | | | | | so it is defined with a lifetime that is as short as possible. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76082 91177308-0d34-0410-b5e6-96231b3b80d8
* implement .include in the lexer/parser instead of passing it into the streamer.Chris Lattner2009-07-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75896 91177308-0d34-0410-b5e6-96231b3b80d8
* Added llvm-mc support for parsing the .dump and .load directives.Kevin Enderby2009-07-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75786 91177308-0d34-0410-b5e6-96231b3b80d8
* Added llvm-mc support for parsing the .include directive.Kevin Enderby2009-07-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75711 91177308-0d34-0410-b5e6-96231b3b80d8
* Added llvm-mc support for parsing the .lsym directive.Kevin Enderby2009-07-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75685 91177308-0d34-0410-b5e6-96231b3b80d8
* Added llvm-mc support for parsing the .desc directive.Kevin Enderby2009-07-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75645 91177308-0d34-0410-b5e6-96231b3b80d8
* Added llvm-mc support for parsing the .abort directive.Kevin Enderby2009-07-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75545 91177308-0d34-0410-b5e6-96231b3b80d8
* add llvm-mc support for parsing the .subsections_via_symbols directive.Kevin Enderby2009-07-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75500 91177308-0d34-0410-b5e6-96231b3b80d8
* silence vc++ warning.Chris Lattner2009-07-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75394 91177308-0d34-0410-b5e6-96231b3b80d8
* add support for .zerofill, patch by Kevin Enderby!Chris Lattner2009-07-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75301 91177308-0d34-0410-b5e6-96231b3b80d8
* add llvm-mc support for parsing the .lcomm directive, patch by Kevin Enderby!Chris Lattner2009-07-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75148 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement parsing support for the .comm directive. Patch byChris Lattner2009-07-07
| | | | | | | Kevin Enderby! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74944 91177308-0d34-0410-b5e6-96231b3b80d8
* implement error recovery in the llvm-mc parser. Feel the power!Chris Lattner2009-07-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74728 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc/x86: Fix bug in disambiguation of displacement operand, introduced by meDaniel Dunbar2009-07-02
| | | | | | | | | | | | | | (I think). - We weren't properly parsing the leading parenthesized expression in something like 'push (4)(%eax)'. - Added ParseParenRelocatableExpression to support this. I suspect we should just use lookahead, though. - Test case to follow. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74685 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Emit parsed instructions to the MCStreamer.Daniel Dunbar2009-07-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74594 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Introduce method to match a parsed x86 instruction into an MCInst.Daniel Dunbar2009-06-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74573 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Accept relocatable expressions for .org, assignments, .byte, etc.Daniel Dunbar2009-06-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74498 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Evaluation for relocatable expressions.Daniel Dunbar2009-06-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74496 91177308-0d34-0410-b5e6-96231b3b80d8
* Normalize SourceMgr messages.Daniel Dunbar2009-06-30
| | | | | | | | | | | | | - Don't print "Parsing" in front of every message. - Take additional "type" argument which is prepended to the message (with ": ") if given. - Update clients to print errors (warnings) as: <filename>:<line number>: error(warning): ... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74489 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Parse symbol attribute directives.Daniel Dunbar2009-06-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74487 91177308-0d34-0410-b5e6-96231b3b80d8