summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-mc/AsmParser.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Added a Lex function to the AsmParser, to allow handlingSean Callanan2010-01-191-74/+78
| | | | | | | | of include directives to occur within the parser itself. This will break the lexer's dependency on a SourceMgr as input. llvm-svn: 93899
* Generalize mcasmstreamer data emission APIs to take an address spaceChris Lattner2010-01-191-5/+9
| | | | | | identifier. There is no way to work around it. llvm-svn: 93896
* add a "MCStreamer::EmitFill" method, and move the default implementationChris Lattner2010-01-191-2/+1
| | | | | | (which just iteratively emits bytes) to MCStreamer. llvm-svn: 93888
* fix parsing .comm directives on systems which do not represent alignmentsChris Lattner2010-01-191-0/+7
| | | | | | as a power of 2. This fixes MC/AsmParser/directive_comm.s llvm-svn: 93867
* fix a bug in range information for $42, eliminate an Chris Lattner2010-01-151-5/+3
| | | | | | unneeded argument from ParseExpression. llvm-svn: 93536
* extend MCAsmParser::ParseExpression and ParseParenExpressionChris Lattner2010-01-151-20/+26
| | | | | | | to return range information for subexpressions. Use this to provide range info for several new X86Operands. llvm-svn: 93534
* add virtual methods to get the start/end of a MCParsedAsmOperand,Chris Lattner2010-01-141-0/+5
| | | | | | the default implementation returns "unknown". llvm-svn: 93470
* Split the TargetAsmParser "ParseInstruction" interface in half:Chris Lattner2010-01-141-2/+21
| | | | | | | | | | | the new ParseInstruction method just parses and returns a list of target operands. A new MatchInstruction interface is used to turn the operand list into an MCInst. This requires new/deleting all the operands, but it also gives targets the ability to use polymorphic operands if they want to. llvm-svn: 93469
* prune #includes in TargetAsmParser.hChris Lattner2010-01-141-1/+1
| | | | | | | Pass in SMLoc of instr opcode into ParseInstruction. Make AsmToken be a class, not a struct. llvm-svn: 93457
* Mark some debug variables as 'unused' to quiet compiler and analyzer.Bill Wendling2009-12-281-2/+3
| | | | llvm-svn: 92183
* MC: Remove unneeded context argument to MCExpr::Evaluate*.Daniel Dunbar2009-10-161-1/+1
| | | | llvm-svn: 84233
* MC: Tweak variable assignment diagnostics, and make reassignment of non-absoluteDaniel Dunbar2009-10-161-7/+18
| | | | | | variables and symbols invalid. llvm-svn: 84232
* MC: When parsing a variable reference, substitute absolute variables immediatelyDaniel Dunbar2009-10-161-4/+15
| | | | | | since they are allowed to be redefined. llvm-svn: 84230
* add a new DirectiveMap stringmap, which allows more efficient dispatchingChris Lattner2009-09-271-12/+20
| | | | | | | | to directive handlers and allows for easier extensibility. I only switched a few over for now. llvm-svn: 82926
* 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
OpenPOWER on IntegriCloud