summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [ms-inline asm] Add support for parsing complex immediate expressions. TestChad Rosier2013-04-171-32/+51
| | | | | | | cases to be submitted on clang side shortly. rdar://13663768 and PR15760 llvm-svn: 179655
* Remove unused variable from previous refactor.Chad Rosier2013-04-161-3/+0
| | | | llvm-svn: 179611
* [ms-inline asm] Refactor. No functional change intended.Chad Rosier2013-04-161-405/+419
| | | | llvm-svn: 179610
* [ms-inline asm] Remove some dead code.Chad Rosier2013-04-161-8/+0
| | | | llvm-svn: 179607
* [ms-inline asm] Simplify the logic by using parsePrimaryExpr. No functionalChad Rosier2013-04-121-1/+1
| | | | | | | change intended. Test case previously added in r178568. Part of rdar://13611297 llvm-svn: 179425
* [ms-inline asm] Move this logic into a static function as it's only applicableChad Rosier2013-04-121-63/+67
| | | | | | when parsing MS-style inline assembly. No functional change intended. llvm-svn: 179407
* [ms-inline asm] Address the FIXME for ImmDisp before brackets. ThisChad Rosier2013-04-121-18/+29
| | | | | | | | is a follow on to r179393 and r179399. Test case to be added on the clang side. Part of rdar://13453209 llvm-svn: 179403
* [ms-inline asm] Have the [ Symbol ] case fall into the more general logic. ThisChad Rosier2013-04-121-46/+24
| | | | | | | is a follow on to r179393. Test case to be added on the clang side. Part of rdar://13453209 llvm-svn: 179399
* [ms-inline asm] Add support for operands that include both a symbol and anChad Rosier2013-04-121-41/+103
| | | | | | | | | immediate displacement. Specifically, add support for generating the proper IR. We've been able to parse this for some time now. Test case to be added on the clang side. Part of rdar://13453209 llvm-svn: 179393
* [ms-inline asm] Add support for using the LENGTH, TYPE, and SIZE operators withChad Rosier2013-04-111-2/+11
| | | | | | | | variables that use namespace alias qualifiers. Test case coming on clang side shortly. Part of rdar://13499009 llvm-svn: 179343
* [ms-inline asm] Add support for using offsetof operator with variables that useChad Rosier2013-04-111-3/+6
| | | | | | | namespace alias qualifiers. Test case coming on clang side shortly. Part of rdar://13499009 llvm-svn: 179339
* [ms-inline asm] Pass a StringRef reference to ParseIntelVarWithQualifier so weChad Rosier2013-04-111-15/+15
| | | | | | | | can build up the identifier string. No test case as support for looking up these type of identifiers hasn't been implemented on the clang side. Part of rdar://13499009 llvm-svn: 179336
* [ms-inline asm] Remove brackets from around a symbol reference in the targetChad Rosier2013-04-111-0/+10
| | | | | | | | specific logic. This makes the code much less fragile. Test case coming on the clang side in a moment. rdar://13634327 llvm-svn: 179323
* Tidy up, fix and simplify a few of the SMLocs. Prior to r179109 the Start SMLocChad Rosier2013-04-101-11/+13
| | | | | | | | wasn't always the start of the operand. If there was a symbol reference, then Start pointed to that token. It's very likely there are other places that need to be updated. llvm-svn: 179210
* Remove unused variable.Chad Rosier2013-04-101-1/+0
| | | | llvm-svn: 179205
* Reapply r179115, but use parsePrimaryExpression a little more judiciously.Chad Rosier2013-04-101-3/+3
| | | | | | | | | | | | | | | | | 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
* Cleanup. No functional change intended.Chad Rosier2013-04-091-5/+5
| | | | llvm-svn: 179129
* Cleanup. No functional change intended.Chad Rosier2013-04-091-16/+16
| | | | llvm-svn: 179125
* Revert r179115 as it looks to have killed the ASan tests.Chad Rosier2013-04-091-5/+5
| | | | llvm-svn: 179120
* [ms-inline asm] Use parsePrimaryExpr in lieu of parseExpression if we need toChad Rosier2013-04-091-5/+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-24/+38
| | | | | | | | | | | 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-12/+6
| | | | | | rdar://13521249 llvm-svn: 179030
* [ms-inline asm] Add support for numeric displacement expressions in bracketedChad Rosier2013-04-051-64/+246
| | | | | | | | | | | | | | | | | | | | | | memory operands. Essentially, this layers an infix calculator on top of the parsing state machine. The scale on the index register is still expected to be an immediate __asm mov eax, [eax + ebx*4] and will not work with more complex expressions. For example, __asm mov eax, [eax + ebx*(2*2)] The plus and minus binary operators assume the numeric value of a register is zero so as to not change the displacement. Register operands should never be an operand for a multiply or divide operation; the scale*indexreg expression is always replaced with a zero on the operand stack to prevent such a case. rdar://13521380 llvm-svn: 178881
* [ms-inline asm] Add support for parsing variables with namespace aliasChad Rosier2013-04-021-0/+54
| | | | | | | | | | | | | qualifiers. This patch only adds support for parsing these identifiers in the X86AsmParser. The front-end interface isn't capable of looking up these identifiers at this point in time. The end result is the compiler now errors during object file emission, rather than at parse time. Test case coming shortly. Part of rdar://13499009 and PR13340 llvm-svn: 178566
* [ms-inline asm] Add support of imm displacement before bracketed memoryChad Rosier2013-03-271-15/+52
| | | | | | | | | | | | | | expression. Specifically, this syntax: ImmDisp [ BaseReg + Scale*IndexReg + Disp ] We don't currently support: ImmDisp [ Symbol ] rdar://13518671 llvm-svn: 178186
* [ms-inline asm] Move the immediate asm rewrite into the target specificChad Rosier2013-03-191-10/+4
| | | | | | | logic as a QOI cleanup. No functional change. Tests already in place. rdar://13456414 llvm-svn: 177446
* [ms-inline asm] Create a helper function, CreateMemForInlineAsm, that createsChad Rosier2013-03-191-36/+49
| | | | | | | | | | an X86Operand, but also performs a Sema lookup and adds the sizing directive when appropriate. Use this when parsing a bracketed statement. This is necessary to get the instruction matching correct as well. Test case coming on clang side. rdar://13455408 llvm-svn: 177439
* [ms-inline asm] Move the size directive asm rewrite into the target specificChad Rosier2013-03-191-44/+33
| | | | | | | logic as a QOI cleanup. rdar://13445327 llvm-svn: 177413
* [ms-inline asm] Avoid emitting a redundant sizing directive, if we've alreadyChad Rosier2013-03-181-2/+3
| | | | | | | parsed one. Test case coming shortly. rdar://13446980 llvm-svn: 177347
* Post process ADC/SBB and use a shorter encoding if they use a sign extended ↵Craig Topper2013-03-181-0/+6
| | | | | | immediate. llvm-svn: 177243
* Refactor some duplicated code into helper functions.Craig Topper2013-03-181-229/+55
| | | | llvm-svn: 177242
* Silence anonymous type in anonymous union warnings.Eric Christopher2013-03-151-23/+28
| | | | llvm-svn: 177135
* GCC thinks that this variable might be used uninitialized (it isn't).Duncan Sands2013-03-011-1/+1
| | | | llvm-svn: 176341
* MCParser: Update method names per coding guidelines.Jim Grosbach2013-02-201-15/+15
| | | | | | | | | | | | | | | | | | | 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
* [ms-inline asm] Adjust the EndLoc to account for the ']'.Chad Rosier2013-02-151-1/+2
| | | | llvm-svn: 175312
* [ms-inline asm] Make the error message more generic now that we support the Chad Rosier2013-01-181-1/+1
| | | | | | 'SIZE' and 'LENGTH' operators. llvm-svn: 172773
* [ms-inline asm] Add support for the 'SIZE' and 'LENGTH' operators.Chad Rosier2013-01-171-36/+46
| | | | | | Part of rdar://12576868 llvm-svn: 172743
* [ms-inline asm] Extend support for parsing Intel bracketed memory operands thatChad Rosier2013-01-141-86/+277
| | | | | | | have an arbitrary ordering of the base register, index register and displacement. rdar://12527141 llvm-svn: 172484
* X86AsmParser.cpp: Fix up r172148, to add initializer in another CreateMem().NAKAMURA Takumi2013-01-111-0/+1
| | | | llvm-svn: 172157
* [ms-inline asm] Make sure we set a default value for AddressOf. Follow on toChad Rosier2013-01-101-1/+2
| | | | | | r172121. llvm-svn: 172148
* [ms-inline asm] Add support for calling functions from inline assembly.Chad Rosier2013-01-101-5/+30
| | | | | | Part of rdar://12991541 llvm-svn: 172121
* Last in the series of removing unnecessary '0' arguments forEric Christopher2013-01-091-1/+1
| | | | | | | address space. Reordered the EmitULEB128IntValue arguments to make this easier. llvm-svn: 171949
* Change SMRange to be half-open (exclusive end) instead of closed (inclusive)Jordan Rose2013-01-071-30/+26
| | | | | | | | | | This is necessary not only for representing empty ranges, but for handling multibyte characters in the input. (If the end pointer in a range refers to a multibyte character, should it point to the beginning or the end of the character in a char array?) Some of the code in the asm parsers was already assuming this anyway. llvm-svn: 171765
* Remove MCTargetAsmLexer and its derived classes now that edis,Roman Divacky2012-12-201-4/+0
| | | | | | its only user, is gone. llvm-svn: 170699
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-031-10/+10
| | | | | | | | | | | | | | | | | Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] llvm-svn: 169131
* X86: Better diagnostics for 32-bit vs. 64-bit mode mismatches.Jim Grosbach2012-11-141-7/+40
| | | | | | | | | | When an instruction as written requires 32-bit mode and we're assembling in 64-bit mode, or vice-versa, issue a more specific diagnostic about what's wrong. rdar://12700702 llvm-svn: 167937
* [ms-inline asm] Add support for the [] operator. Essentially, [expr1][expr2] isChad Rosier2012-10-291-10/+37
| | | | | | | equivalent to [expr1 + expr2]. See test cases for more examples. rdar://12470392 llvm-svn: 166949
* [ms-inline asm] Add a comment.Chad Rosier2012-10-261-0/+1
| | | | llvm-svn: 166819
* [ms-inline asm] Emit an error for unsupported SIZE and LENGTH directives.Chad Rosier2012-10-261-5/+11
| | | | | | Part of rdar://12576868 llvm-svn: 166792
* [ms-inline asm] Add support for the TYPE operator.Chad Rosier2012-10-261-1/+52
| | | | | | Part of rdar://12576868 llvm-svn: 166790
OpenPOWER on IntegriCloud