summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2013-04-18 16:28:19 +0000
committerChad Rosier <mcrosier@apple.com>2013-04-18 16:28:19 +0000
commitc3a9574eed4420985533b7223fda094d3c191f68 (patch)
tree87a0477d98a8f3d1d7dbf18891a820d1675ccc11 /lib
parent6c8afad198688649ba7fc024bd5521d6b77a7ad5 (diff)
[ms-inline asm] Simplify some logic and add a FIXME for unhandled unary minus.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179765 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/X86/AsmParser/X86AsmParser.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/lib/Target/X86/AsmParser/X86AsmParser.cpp b/lib/Target/X86/AsmParser/X86AsmParser.cpp
index 62b4559d051..da9b8b57dd5 100644
--- a/lib/Target/X86/AsmParser/X86AsmParser.cpp
+++ b/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;
}
};