summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCParser
Commit message (Collapse)AuthorAgeFilesLines
...
* [MC] Support @ variants with directional labelsUlrich Weigand2013-06-201-2/+12
| | | | | | | | | | | The assembler parser common code supports recognizing symbol variants using the @ modifer. On PowerPC, it should also be possible to use (some of) those modifiers with directional labels, like "1f@l". This patch adds support for accepting symbol variants on directional labels as well. llvm-svn: 184437
* Use pointers to the MCAsmInfo and MCRegInfo.Bill Wendling2013-06-182-5/+5
| | | | | | | | | Someone may want to do something crazy, like replace these objects if they change or something. No functionality change intended. llvm-svn: 184175
* Fix two typoSylvestre Ledru2013-05-141-1/+1
| | | | llvm-svn: 181848
* Fix a bug in the MC asm parser evaluating expressions. It was treating:Kevin Enderby2013-05-071-1/+1
| | | | | | | | | A = 9 B = 3 * A - 2 * A + 1 as B = 3 * A - (2 * A + 1) rdar://13816516 llvm-svn: 181366
* Add ArrayRef constructor from None, and do the cleanups that this ↵Dmitri Gribenko2013-05-051-3/+3
| | | | | | | | constructor enables Patch by Robert Wilhelm. llvm-svn: 181138
* [ms-inline asm] Get the OpDecl and remove a redundant lookup.Chad Rosier2013-04-221-2/+1
| | | | | | Part of rdar://13663589 llvm-svn: 180057
* [ms-inline asm] Refactor/clean up the SemaLookup interface. No functionalChad Rosier2013-04-221-5/+2
| | | | | | | change indended. Part of rdar://13663589 llvm-svn: 180028
* Fix indentation. No functional change.Craig Topper2013-04-221-5/+5
| | | | llvm-svn: 179994
* Put 'else' on same line as preceding curly brace per coding standards. No ↵Craig Topper2013-04-221-12/+6
| | | | | | functional change. llvm-svn: 179993
* Remove an unreachable 'break' following a 'return'.Craig Topper2013-04-221-1/+0
| | | | llvm-svn: 179991
* Add support for subsections to the ELF assembler. Fixes PR8717.Peter Collingbourne2013-04-173-16/+52
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D598 llvm-svn: 179725
* [ms-inline asm] Add the implementation for the AOK_Delete kind, which was addedChad Rosier2013-04-121-3/+5
| | | | | | | in r179325. Test case coming shortly on the clang side. Part of rdar://13453209 llvm-svn: 179383
* [ms-inline asm] Remove brackets from around a symbol reference in the targetChad Rosier2013-04-111-10/+1
| | | | | | | | specific logic. This makes the code much less fragile. Test case coming on the clang side in a moment. rdar://13634327 llvm-svn: 179323
* Reapply r179115, but use parsePrimaryExpression a little more judiciously.Chad Rosier2013-04-101-0/+5
| | | | | | | | | | | | | | | | | Test cases that regressed due to r179115, plus a few more, were added in r179182. Original commit message below: [ms-inline asm] Use parsePrimaryExpr in lieu of parseExpression if we need to parse an identifier. Otherwise, parseExpression may parse multiple tokens, which makes it impossible to properly compute an immediate displacement. An example of such a case is the source operand (i.e., [Symbol + ImmDisp]) in the below example: __asm mov eax, [Symbol + ImmDisp] Part of rdar://13611297 llvm-svn: 179187
* Revert r179115 as it looks to have killed the ASan tests.Chad Rosier2013-04-091-5/+0
| | | | llvm-svn: 179120
* [ms-inline asm] Use parsePrimaryExpr in lieu of parseExpression if we need toChad Rosier2013-04-091-0/+5
| | | | | | | | | | | | | | parse an identifier. Otherwise, parseExpression may parse multiple tokens, which makes it impossible to properly compute an immediate displacement. An example of such a case is the source operand (i.e., [Symbol + ImmDisp]) in the below example: __asm mov eax, [Symbol + ImmDisp] The existing test cases exercise this patch. rdar://13611297 llvm-svn: 179115
* [ms-inline asm] Maintain a StringRef to reference a symbol in a parsed operand,Chad Rosier2013-04-091-5/+8
| | | | | | | | | | | rather than deriving the StringRef from the Start and End SMLocs. Using the Start and End SMLocs works fine for operands such as [Symbol], but not for operands such as [Symbol + ImmDisp]. All existing test cases that reference a variable exercise this patch. rdar://13602265 llvm-svn: 179109
* [ms-inline asm] Add support for ImmDisp [ Symbol ] memory operands.Chad Rosier2013-04-081-11/+9
| | | | | | rdar://13521249 llvm-svn: 179030
* Dead code.Chad Rosier2013-03-191-2/+0
| | | | llvm-svn: 177451
* [ms-inline asm] Move the immediate asm rewrite into the target specificChad Rosier2013-03-191-5/+1
| | | | | | | logic as a QOI cleanup. No functional change. Tests already in place. rdar://13456414 llvm-svn: 177446
* [ms-inline asm] Remove the brackets from X86Operand in the IR. These will beChad Rosier2013-03-191-8/+19
| | | | | | | | | | | | | | | | | | | | added back in by X86AsmPrinter::printIntelMemReference() during codegen. Previously, this following example void t() { int i; __asm mov eax, [i] } would generate the below assembly mov eax, dword ptr [[eax]] which resulted in a fatal error when compiling. Test case coming on the clang side. rdar://13444264 llvm-svn: 177440
* [ms-inline asm] Move the size directive asm rewrite into the target specificChad Rosier2013-03-191-12/+4
| | | | | | | logic as a QOI cleanup. rdar://13445327 llvm-svn: 177413
* Debug Info: use SmallVector instead of std::vector in MCDwarfDirsCUMap and ↵Manman Ren2013-03-121-2/+2
| | | | | | MCDwarfFilesCUMap llvm-svn: 176893
* AsmParser: More generic support for integer type suffices.Jim Grosbach2013-02-261-6/+9
| | | | | | | | | | For integer constants, allow 'L', 'UL' as well as 'ULL' and 'LL'. This provides better support for shared headers between .s and .c files that define bunches of constant values. rdar://9321056 llvm-svn: 176118
* 'Hexadecimal' has two 'a's and only one 'i'.Matt Beaumont-Gay2013-02-251-1/+1
| | | | llvm-svn: 176031
* MCParser: Update method names per coding guidelines.Jim Grosbach2013-02-205-270/+270
| | | | | | | | | | | | | | | | | | | s/AddDirectiveHandler/addDirectiveHandler/ s/ParseMSInlineAsm/parseMSInlineAsm/ s/ParseIdentifier/parseIdentifier/ s/ParseStringToEndOfStatement/parseStringToEndOfStatement/ s/ParseEscapedString/parseEscapedString/ s/EatToEndOfStatement/eatToEndOfStatement/ s/ParseExpression/parseExpression/ s/ParseParenExpression/parseParenExpression/ s/ParseAbsoluteExpression/parseAbsoluteExpression/ s/CheckForValidSection/checkForValidSection/ http://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly No functional change intended. llvm-svn: 175675
* MCParser: Reject .balign with non-pow2 alignments.Benjamin Kramer2013-02-161-0/+4
| | | | | | | | GNU as rejects them and there are configure scripts in the wild that check if the assembler rejects ".align 3" to determine whether the alignment is in bytes or powers of two. llvm-svn: 175360
* Derive ELF section type from the name in some cases where GNU as doesJoerg Sonnenberger2013-02-161-1/+10
| | | | | | so. llvm-svn: 175327
* c[ms-inline asm] It's possible to have a SizeDirective rewrite and anChad Rosier2013-02-151-1/+16
| | | | | | | Input/Output rewrite to the same location. Make sure the SizeDirective rewrite is performed first. This also ensure the sort algorithm is stable. llvm-svn: 175317
* AsmParser: Reformat the MS asm parser to reduce nesting.Benjamin Kramer2013-02-151-85/+86
| | | | | | | While there postpone register name printing after uniquing. No intended functionality change. llvm-svn: 175292
* Revert r15266. This fixes llvm.org/pr15266.Rafael Espindola2013-02-141-40/+19
| | | | llvm-svn: 175173
* [ms-inline asm] Add a comment about the determinism of the rewrite sort.Chad Rosier2013-02-131-0/+2
| | | | llvm-svn: 175082
* [ms-inline-asm] Use an array_pod_sort, rather than a std:sort.Chad Rosier2013-02-131-3/+10
| | | | llvm-svn: 175063
* [ms-inline-asm] Make sure the AsmRewrite list is sorted in lexical order.Chad Rosier2013-02-131-0/+5
| | | | | | rdar://13202662 llvm-svn: 175021
* [ms-inline-asm] Implement align directive (which is roughly equivalent to ↵Chad Rosier2013-02-121-9/+43
| | | | | | | | | | .align). Also, allow _EMIT and __EMIT for the emit directive. We already do the same for TYPE, SIZE, and LENGTH. rdar://13200215 llvm-svn: 175008
* Add static cast to unsigned char whenever a character classification ↵Guy Benyei2013-02-121-3/+6
| | | | | | function is called with a signed char argument, in order to avoid assertions in Windows Debug configuration. llvm-svn: 175006
* [ms-inline asm] Pass the length of the IDVal, so we can do a proper AsmRewrite.Chad Rosier2013-02-121-4/+5
| | | | llvm-svn: 174999
* [ms-inline asm] Accept the emit directive as either _emit or __emit.Chad Rosier2013-02-121-2/+2
| | | | llvm-svn: 174998
* [ms-inline asm] Add support for lexing binary integers with a [bB] suffix.Chad Rosier2013-02-121-19/+40
| | | | | | | | | | | | | | This is complicated by backward labels (e.g., 0b can be both a backward label and a binary zero). The current implementation assumes [0-9]b is always a label and thus it's possible for 0b and 1b to not be interpreted correctly for ms-style inline assembly. However, this is relatively simple to fix in the inline assembly (i.e., drop the [bB]). This patch also limits backward labels to [0-9]b, so that only 0b and 1b are ambiguous. Part of rdar://12470373 llvm-svn: 174983
* Update error message due to previous commit, r174926.Chad Rosier2013-02-121-1/+3
| | | | llvm-svn: 174927
* [ms-inline asm] Add support for lexing hexidecimal integers with a [hH] suffix.Chad Rosier2013-02-121-14/+47
| | | | | | Part of rdar://12470373 llvm-svn: 174926
* Add a warning when there is a macro defintion that has named parameters butKevin Enderby2013-01-221-0/+104
| | | | | | | | | | | | | the body does not use them and it appears the body has positional parameters. This can cause unexpected results as in the added test case. As the darwin version of gas(1) which only supported positional parameters, happened to ignore the named parameters. Now that we want to support both styles of macros we issue a warning in this specific case. rdar://12861644 llvm-svn: 173199
* Have the integrated assembler give an error if $1 is used as an identifier inKevin Enderby2013-01-221-2/+7
| | | | | | | | | an expression. Currently this bug causes the line to be ignored in a release build and an assert in a debug build. rdar://13062484 llvm-svn: 173195
* [MC/Mach-O] Add AsmParser support for .linker_option directive.Daniel Dunbar2013-01-181-0/+30
| | | | llvm-svn: 172778
* [MC] Expose ParseEscapedString to target AsmParser implementations.Daniel Dunbar2013-01-181-4/+1
| | | | llvm-svn: 172777
* [MC] Fix 80-col violas.Daniel Dunbar2013-01-181-41/+89
| | | | llvm-svn: 172776
* [ms-inline asm] Add support for the 'SIZE' and 'LENGTH' operators.Chad Rosier2013-01-171-2/+2
| | | | | | Part of rdar://12576868 llvm-svn: 172743
* Some small (and mostly cosmetic) fixes.Eli Bendersky2013-01-161-22/+17
| | | | llvm-svn: 172640
* Now that GenericAsmParser was folded into AsmParser, some methods and types canEli Bendersky2013-01-161-17/+57
| | | | | | return into the safe harbor of AsmParser's private areas. llvm-svn: 172637
* Use the ExtensionDirectiveHandler type in other places where it makes sense.Eli Bendersky2013-01-164-15/+16
| | | | | | | Since we already have this type it's a shame to keep dragging a pair of object and method around explicitly. llvm-svn: 172584
OpenPOWER on IntegriCloud