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

llvm-svn: 143510
This commit is contained in:
Jim Grosbach 2011-11-01 22:37:37 +00:00
parent 6469fc275a
commit 7f1f3bd868
1 changed files with 4 additions and 6 deletions

View File

@ -3835,13 +3835,11 @@ bool ARMAsmParser::parseOperand(SmallVectorImpl<MCParsedAsmOperand*> &Operands,
if (getParser().ParseExpression(ImmVal))
return true;
const MCConstantExpr *CE = dyn_cast<MCConstantExpr>(ImmVal);
if (!CE) {
Error(S, "constant expression expected");
return MatchOperand_ParseFail;
if (CE) {
int32_t Val = CE->getValue();
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);
Operands.push_back(ARMOperand::CreateImm(ImmVal, S, E));
return false;