summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/AsmParser
Commit message (Collapse)AuthorAgeFilesLines
...
* Suppress GCC compiler warnings in release builds about variables that are onlyDuncan Sands2013-05-131-0/+1
| | | | | | read in asserts. llvm-svn: 181689
* [ms-inline asm] Fix a crasher when we fail on a direct match.Chad Rosier2013-05-101-4/+4
| | | | | | | | | | | | | | | | | | The issue was that the MatchingInlineAsm and VariantID args to the MatchInstructionImpl function weren't being set properly. Specifically, when parsing intel syntax, the parser thought it was parsing inline assembly in the at&t dialect; that will never be the case. The crash was caused when the emitter tried to emit the instruction, but the operands weren't set. When parsing inline assembly we only set the opcode, not the operands, which is used to lookup the instruction descriptor. rdar://13854391 and PR15945 Also, this commit reverts r176036. Now that we're correctly parsing the intel syntax the pushad/popad don't match properly. I've reimplemented that fix using a MnemonicAlias. llvm-svn: 181620
* [x86AsmParser] It's valid to stop parsing an operand at an immediate.Chad Rosier2013-05-091-1/+3
| | | | | | rdar://13854369 and PR15944 llvm-svn: 181564
* Add ArrayRef constructor from None, and do the cleanups that this ↵Dmitri Gribenko2013-05-051-2/+2
| | | | | | | | constructor enables Patch by Robert Wilhelm. llvm-svn: 181138
* In MC asm parsing, account for the possibility of whitespace withinJohn McCall2013-05-031-18/+22
| | | | | | | | | | | | | | the "identifier" parsed by the frontend callback by skipping forward until we've consumed a token that ends at the point dictated by the callback. In addition, inform the callback when it's parsing an unevaluated operand (e.g. mov eax, LENGTH A::x) as opposed to an evaluated one (e.g. mov eax, [A::x]). This commit depends on a clang commit. llvm-svn: 180978
* [ms-inline asm] Removed this unnecessary check. In the current implementation,Chad Rosier2013-04-221-1/+1
| | | | | | Disp will always be one of MCSymbolRefExpr or MCConstantExpr, and never NULL. llvm-svn: 180059
* [ms-inline asm] Add the OpDecl to the InlineAsmIdentifierInfo struct and in turnChad Rosier2013-04-221-13/+18
| | | | | | | the MCParsedAsmOperand. Part of rdar://13663589 llvm-svn: 180054
* Fix unused variable warning.Chad Rosier2013-04-221-1/+1
| | | | llvm-svn: 180044
* [ms-inline asm] Remove the identifier parsing logic from the AsmParser. This isChad Rosier2013-04-221-61/+55
| | | | | | | | now taken care of by the frontend, which allows us to parse arbitrary C/C++ variables. Part of rdar://13663589 llvm-svn: 180037
* [ms-inline asm] Refactor/clean up the SemaLookup interface. No functionalChad Rosier2013-04-221-34/+23
| | | | | | | change indended. Part of rdar://13663589 llvm-svn: 180028
* [ms-inline asm] Make code layout more canonical with iniline asm handled last.Chad Rosier2013-04-191-13/+13
| | | | llvm-svn: 179875
* [ms-inline asm] Refactor the parsing of identifiers. No functional changeChad Rosier2013-04-191-39/+33
| | | | | | | indended. Part of rdar://13663589 llvm-svn: 179871
* [ms-inline asm] Remove these asserts. C++ variables that use namespaceChad Rosier2013-04-191-2/+0
| | | | | | qualifiers don't necessarily begin with an identifier (e.g., ::foo::bar). llvm-svn: 179867
* [ms-inline asm] Move this variable into the scope in which it is used.Chad Rosier2013-04-191-1/+1
| | | | llvm-svn: 179866
* [ms-inline asm] Make this a hard error.Chad Rosier2013-04-191-4/+4
| | | | llvm-svn: 179865
* [ms-inline asm] Cleanup the dot operator implementation.Chad Rosier2013-04-191-29/+15
| | | | llvm-svn: 179856
* [ms-inline asm] Simplify some logic and add a FIXME for unhandled unary minus.Chad Rosier2013-04-181-10/+13
| | | | llvm-svn: 179765
* Make this private method.Chad Rosier2013-04-181-4/+4
| | | | llvm-svn: 179764
* [ms-inline asm] These should be int64_t, not uint64_t.Chad Rosier2013-04-171-6/+6
| | | | llvm-svn: 179724
* [ms-inline asm] Add support for the minus unary operator. Previously, we wereChad Rosier2013-04-171-72/+106
| | | | | | | | | | | unable to handle cases such as __asm mov eax, 8*-8. This patch also attempts to simplify the state machine. Further, the error reporting has been improved. Test cases included, but more will be added to the clang side shortly. rdar://13668445 llvm-svn: 179719
* [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
OpenPOWER on IntegriCloud