diff options
| author | Chad Rosier <mcrosier@apple.com> | 2013-04-18 16:28:19 +0000 |
|---|---|---|
| committer | Chad Rosier <mcrosier@apple.com> | 2013-04-18 16:28:19 +0000 |
| commit | db003998fb30f0878289c18423834cbf7310b48f (patch) | |
| tree | e14c1145dc4407558ca8b59594d02baaf0bf6529 /llvm | |
| parent | c2f055d114d3e8c13ebdb03b634b5429708020d9 (diff) | |
| download | bcm5719-llvm-db003998fb30f0878289c18423834cbf7310b48f.tar.gz bcm5719-llvm-db003998fb30f0878289c18423834cbf7310b48f.zip | |
[ms-inline asm] Simplify some logic and add a FIXME for unhandled unary minus.
llvm-svn: 179765
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp b/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp index 62b4559d051..da9b8b57dd5 100644 --- a/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp +++ b/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp @@ -315,7 +315,7 @@ private: PrevState = CurrState; } void onDispExpr(const MCExpr *SymRef, StringRef SymRefName) { - IntelExprState CurrState = State; + PrevState = State; switch (State) { default: State = IES_ERROR; @@ -328,7 +328,6 @@ private: IC.pushOperand(IC_IMM); break; } - PrevState = CurrState; } void onInteger(int64_t TmpInt) { IntelExprState CurrState = State; @@ -364,7 +363,7 @@ private: PrevState = CurrState; } void onStar() { - IntelExprState CurrState = State; + PrevState = State; switch (State) { default: State = IES_ERROR; @@ -376,10 +375,9 @@ private: IC.pushOperator(IC_MULTIPLY); break; } - PrevState = CurrState; } void onDivide() { - IntelExprState CurrState = State; + PrevState = State; switch (State) { default: State = IES_ERROR; @@ -390,10 +388,9 @@ private: IC.pushOperator(IC_DIVIDE); break; } - PrevState = CurrState; } void onLBrac() { - IntelExprState CurrState = State; + PrevState = State; switch (State) { default: State = IES_ERROR; @@ -403,7 +400,6 @@ private: IC.pushOperator(IC_PLUS); break; } - PrevState = CurrState; } void onRBrac() { IntelExprState CurrState = State; @@ -441,6 +437,14 @@ private: case IES_MULTIPLY: case IES_DIVIDE: case IES_LPAREN: + // FIXME: We don't handle this type of unary minus, yet. + if ((PrevState == IES_PLUS || PrevState == IES_MINUS || + PrevState == IES_MULTIPLY || PrevState == IES_DIVIDE || + PrevState == IES_LPAREN || PrevState == IES_LBRAC) && + CurrState == IES_MINUS) { + State = IES_ERROR; + break; + } State = IES_LPAREN; IC.pushOperator(IC_LPAREN); break; @@ -448,7 +452,7 @@ private: PrevState = CurrState; } void onRParen() { - IntelExprState CurrState = State; + PrevState = State; switch (State) { default: State = IES_ERROR; @@ -460,7 +464,6 @@ private: IC.pushOperator(IC_RPAREN); break; } - PrevState = CurrState; } }; |

