summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-mc/AsmParser.cpp
Commit message (Collapse)AuthorAgeFilesLines
* use an accessor to simplify code.Chris Lattner2009-09-161-5/+2
| | | | llvm-svn: 81997
* Added the ParseInstruction() hook for target specific assembler directives soKevin Enderby2009-09-101-2/+5
| | | | | | | | 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. llvm-svn: 81461
* Fix an integer truncation noticed by MSVC.Benjamin Kramer2009-09-061-1/+1
| | | | llvm-svn: 81109
* llvm-mc: Pass values to MCStreamer as MCExprs, not MCValues.Daniel Dunbar2009-08-311-27/+10
| | | | llvm-svn: 80578
* llvm-mc: Simplify EmitAssignment ('.set' is identical to '=').Daniel Dunbar2009-08-311-4/+4
| | | | llvm-svn: 80577
* llvm-mc: Remove MCAsmParser::Parse[Paren]RelocatableExpression.Daniel Dunbar2009-08-311-33/+27
| | | | llvm-svn: 80576
* llvm-mc: Add MCAsmParser::Parse[Paren]Expression forms which return an MCExpr.Daniel Dunbar2009-08-311-0/+8
| | | | llvm-svn: 80574
* llvm-mc: Add MCAsmParser::getContext.Daniel Dunbar2009-08-311-8/+9
| | | | llvm-svn: 80571
* llvm-mc: Switch MCExpr construction to using static member functions, and ↵Daniel Dunbar2009-08-311-15/+15
| | | | | | taking the MCContext (which now owns all MCExprs). llvm-svn: 80569
* llvm-mc: Move AsmExpr into MC lib (as MCExpr).Daniel Dunbar2009-08-311-37/+37
| | | | llvm-svn: 80567
* llvm-mc: MCStreamer cleanups. - Remove EmitLocalSymbol, this is unsupported ↵Daniel Dunbar2009-08-301-9/+12
| | | | | | | | for now. - Switch Emit{CommonSymbol,Zerofill} to take alignment in bytes (for consistency). llvm-svn: 80484
* llvm-mc: Emit .lcomm as .zerofill.Daniel Dunbar2009-08-281-1/+7
| | | | llvm-svn: 80343
* llvm-mc: Unique zero fill sections.Daniel Dunbar2009-08-281-17/+9
| | | | llvm-svn: 80342
* Revert r80305, I forgot a dependent change.Daniel Dunbar2009-08-271-9/+17
| | | | | | | --- Reverse-merging r80305 into '.': U tools/llvm-mc/AsmParser.cpp llvm-svn: 80309
* llvm-mc: Unique sections in .zerofill.Daniel Dunbar2009-08-271-17/+9
| | | | llvm-svn: 80305
* llvm-mc/Mach-O: Unique sections properly, so we don't get duplicate textDaniel Dunbar2009-08-261-15/+56
| | | | | | | | sections, etc. - The quick and dirty way, just clone the TargetLoweringObjectFile code. Eventually this should be shared... somehow. llvm-svn: 80168
* llvm-mc/Mach-O: Don't put assembler temporary labels in the symbol table.Daniel Dunbar2009-08-261-11/+20
| | | | | | | | - 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). llvm-svn: 80162
* llvm-mc: Make non-sensical max bytes to .align an error.Daniel Dunbar2009-08-261-5/+10
| | | | | | Also, warn about overflow in alignment values. llvm-svn: 80077
* llvm-mc: Clean up some handling of symbol/section association to be more correctDaniel Dunbar2009-08-221-21/+5
| | | | | | | | | (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. llvm-svn: 79733
* llvm-mc: Improve handling of implicit alignment for magic section directivesDaniel Dunbar2009-08-211-1/+12
| | | | | | | | (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. llvm-svn: 79697
* llvm-mc: In a .fill directive, still honor .align even if invalid maximum bytesDaniel Dunbar2009-08-211-3/+4
| | | | | | count is given (this matches 'as'). llvm-svn: 79683
* llvm-mc: Accept .fill size of 8.Daniel Dunbar2009-08-211-2/+2
| | | | llvm-svn: 79635
* llvm-mc: Various section parsing fixes.Daniel Dunbar2009-08-211-43/+82
| | | | | | | | | | | | | | | - 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. llvm-svn: 79611
* llvm-mc: Support escaped characters in string literals (for .ascii and .asciz)Daniel Dunbar2009-08-141-5/+63
| | | | llvm-svn: 79010
* llvm-mc: Accept .word as a synonym for .shortDaniel Dunbar2009-08-111-1/+1
| | | | llvm-svn: 78641
* llvm-mc: Sketch parsing for .file, .line, and .loc. No streamer hooks for theseDaniel Dunbar2009-08-111-0/+97
| | | | | | yet (I'm not even sure what they do). llvm-svn: 78639
* llvm-mc: Fix darwin .section parsing. It was skipping the section name and a ','Daniel Dunbar2009-08-111-4/+14
| | | | | | | (and outputting a diagnostic pointing at the wrong place), all of which lead to much confusion. llvm-svn: 78637
* split MachO section handling stuff out to its out .h/.cpp file.Chris Lattner2009-08-101-1/+1
| | | | llvm-svn: 78576
* add a fixmeChris Lattner2009-08-101-0/+4
| | | | llvm-svn: 78575
* Make the big switch: Change MCSectionMachO to represent a section *semantically*Chris Lattner2009-08-101-92/+96
| | | | | | | | | | | | | | | | 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? llvm-svn: 78547
* sink the 'name' and 'isdirective' state out of MCSection into its derived ↵Chris Lattner2009-08-081-4/+4
| | | | | | | | classes. This totally optimizes PIC16 sections by not having an 'isdirective' bit anymore!! ;-) llvm-svn: 78517
* switch this to create coff sections for now, it doesn't really matter for Chris Lattner2009-08-081-4/+4
| | | | | | | llvm-mc's purpose yet and we'll want to switch to creating semantic sections at some point. llvm-svn: 78509
* Added Mac OS X assembler style conditional assembly. I may come back and see ifKevin Enderby2009-08-071-1/+158
| | | | | | | | 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. llvm-svn: 78423
* update for API change.Chris Lattner2009-08-011-4/+4
| | | | llvm-svn: 77804
* All MCSections are now required to have a SectionKind.Chris Lattner2009-08-011-4/+4
| | | | llvm-svn: 77787
* llvm-mc: More quoted identifier support.Daniel Dunbar2009-08-011-43/+59
| | | | llvm-svn: 77761
* llvm-mc: Support quoted identifiers.Daniel Dunbar2009-07-311-5/+7
| | | | | | | | | - Uses MCAsmToken::getIdentifier which returns the (sub)string representing the meaningfull contents a string or identifier token. - Directives aren't done yet. llvm-svn: 77739
* fix some more issues where we expected GetSection to do "get or create"Chris Lattner2009-07-311-2/+12
| | | | llvm-svn: 77700
* fix a bunch of failing tests now that MCContext::GetSection doesn't create ↵Chris Lattner2009-07-311-2/+13
| | | | | | sections. llvm-svn: 77689
* Move X86 instruction parsing into X86/AsmParser.Daniel Dunbar2009-07-281-2/+1
| | | | llvm-svn: 77384
* Switch AsmLexer::Lex to returning a reference to the current token.Daniel Dunbar2009-07-281-2/+2
| | | | llvm-svn: 77328
* Drop some AsmLexer methods in favor of their AsmToken equivalents.Daniel Dunbar2009-07-281-19/+18
| | | | llvm-svn: 77323
* llvm-mc: Sink token enum into AsmToken.Daniel Dunbar2009-07-281-98/+98
| | | | llvm-svn: 77322
* llvm-mc: Implement .abort fully in the front endDaniel Dunbar2009-07-271-5/+12
| | | | llvm-svn: 77272
* llvm-mc: Move AsmLexer::getCurStrVal to StringRef based API.Daniel Dunbar2009-07-271-90/+91
| | | | | | - My DFS traversal of LLVM is, at least for now, nearly complete! :) llvm-svn: 77258
* Removed the DumpSymbolsandMacros and LoadSymbolsandMacros MCStreamer API asKevin Enderby2009-07-201-6/+8
| | | | | | | | | 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. llvm-svn: 76462
* Add MCAsmParser interface.Daniel Dunbar2009-07-201-1/+3
| | | | | | | - This provides the AsmParser interface to the target specific assembly parsers. llvm-svn: 76453
* Removed the SubsectionsViaSymbols MCStreamer API and replaced it with a genericKevin Enderby2009-07-161-1/+1
| | | | | | | EmitAssemblerFlag API which takes a value from the added AssemblerFlag enumerated constants. llvm-svn: 76087
* Clean up the definition of Str in AsmParser::ParseDirectiveDarwinDumpOrLoadKevin Enderby2009-07-161-3/+1
| | | | | | so it is defined with a lifetime that is as short as possible. llvm-svn: 76082
* implement .include in the lexer/parser instead of passing it into the streamer.Chris Lattner2009-07-161-7/+13
| | | | llvm-svn: 75896
OpenPOWER on IntegriCloud