summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Sparc
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2016-09-13 00:19:29 +0000
committerEric Christopher <echristo@gmail.com>2016-09-13 00:19:29 +0000
commit04c7db31e8072af2912cabc8af4b0b9347728e86 (patch)
tree89cbf6e5c1a93798a8602a6df4d847d072aa1fa5 /llvm/lib/Target/Sparc
parentf2b6883ac8d96d9c5dc2c356cae14753d7cf2c6c (diff)
downloadbcm5719-llvm-04c7db31e8072af2912cabc8af4b0b9347728e86.tar.gz
bcm5719-llvm-04c7db31e8072af2912cabc8af4b0b9347728e86.zip
Temporarily Revert "[MC] Defer asm errors to post-statement failure" as it's causing errors on the sanitizer bots.
This reverts commit r281249. llvm-svn: 281280
Diffstat (limited to 'llvm/lib/Target/Sparc')
-rw-r--r--llvm/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/llvm/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp b/llvm/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp
index 288f3c10ce9..b2003b8f101 100644
--- a/llvm/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp
+++ b/llvm/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp
@@ -84,7 +84,7 @@ class SparcAsmParser : public MCTargetAsmParser {
return getSTI().getTargetTriple().getArch() == Triple::sparcv9;
}
- bool expandSET(MCInst &Inst, SMLoc IDLoc,
+ void expandSET(MCInst &Inst, SMLoc IDLoc,
SmallVectorImpl<MCInst> &Instructions);
public:
@@ -466,7 +466,7 @@ public:
} // end namespace
-bool SparcAsmParser::expandSET(MCInst &Inst, SMLoc IDLoc,
+void SparcAsmParser::expandSET(MCInst &Inst, SMLoc IDLoc,
SmallVectorImpl<MCInst> &Instructions) {
MCOperand MCRegOp = Inst.getOperand(0);
MCOperand MCValOp = Inst.getOperand(1);
@@ -479,8 +479,8 @@ bool SparcAsmParser::expandSET(MCInst &Inst, SMLoc IDLoc,
// Allow either a signed or unsigned 32-bit immediate.
if (RawImmValue < -2147483648LL || RawImmValue > 4294967295LL) {
- return Error(IDLoc,
- "set: argument must be between -2147483648 and 4294967295");
+ Error(IDLoc, "set: argument must be between -2147483648 and 4294967295");
+ return;
}
// If the value was expressed as a large unsigned number, that's ok.
@@ -537,7 +537,6 @@ bool SparcAsmParser::expandSET(MCInst &Inst, SMLoc IDLoc,
TmpInst.addOperand(MCOperand::createExpr(Expr));
Instructions.push_back(TmpInst);
}
- return false;
}
bool SparcAsmParser::MatchAndEmitInstruction(SMLoc IDLoc, unsigned &Opcode,
@@ -557,8 +556,7 @@ bool SparcAsmParser::MatchAndEmitInstruction(SMLoc IDLoc, unsigned &Opcode,
Instructions.push_back(Inst);
break;
case SP::SET:
- if (expandSET(Inst, IDLoc, Instructions))
- return true;
+ expandSET(Inst, IDLoc, Instructions);
break;
}
@@ -628,11 +626,13 @@ bool SparcAsmParser::ParseInstruction(ParseInstructionInfo &Info,
if (getLexer().is(AsmToken::Comma)) {
if (parseBranchModifiers(Operands) != MatchOperand_Success) {
SMLoc Loc = getLexer().getLoc();
+ Parser.eatToEndOfStatement();
return Error(Loc, "unexpected token");
}
}
if (parseOperand(Operands, Name) != MatchOperand_Success) {
SMLoc Loc = getLexer().getLoc();
+ Parser.eatToEndOfStatement();
return Error(Loc, "unexpected token");
}
@@ -645,12 +645,14 @@ bool SparcAsmParser::ParseInstruction(ParseInstructionInfo &Info,
// Parse and remember the operand.
if (parseOperand(Operands, Name) != MatchOperand_Success) {
SMLoc Loc = getLexer().getLoc();
+ Parser.eatToEndOfStatement();
return Error(Loc, "unexpected token");
}
}
}
if (getLexer().isNot(AsmToken::EndOfStatement)) {
SMLoc Loc = getLexer().getLoc();
+ Parser.eatToEndOfStatement();
return Error(Loc, "unexpected token");
}
Parser.Lex(); // Consume the EndOfStatement.
OpenPOWER on IntegriCloud