ARM label operands can have an optional '#' before them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143510 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jim Grosbach 2011-11-01 22:37:37 +00:00
parent 613b757689
commit ed6a0c5243

View File

@ -3835,13 +3835,11 @@ bool ARMAsmParser::parseOperand(SmallVectorImpl<MCParsedAsmOperand*> &Operands,
if (getParser().ParseExpression(ImmVal)) if (getParser().ParseExpression(ImmVal))
return true; return true;
const MCConstantExpr *CE = dyn_cast<MCConstantExpr>(ImmVal); const MCConstantExpr *CE = dyn_cast<MCConstantExpr>(ImmVal);
if (!CE) { if (CE) {
Error(S, "constant expression expected"); int32_t Val = CE->getValue();
return MatchOperand_ParseFail; if (isNegative && Val == 0)
ImmVal = MCConstantExpr::Create(INT32_MIN, getContext());
} }
int32_t Val = CE->getValue();
if (isNegative && Val == 0)
ImmVal = MCConstantExpr::Create(INT32_MIN, getContext());
E = SMLoc::getFromPointer(Parser.getTok().getLoc().getPointer() - 1); E = SMLoc::getFromPointer(Parser.getTok().getLoc().getPointer() - 1);
Operands.push_back(ARMOperand::CreateImm(ImmVal, S, E)); Operands.push_back(ARMOperand::CreateImm(ImmVal, S, E));
return false; return false;