forked from OSchip/llvm-project
This patch checks for valid mnemonics at the beginning of parseInstruction method, thus giving the user the right error message for non-existing instructions.
llvm-svn: 186512
This commit is contained in:
parent
a0d9b6b693
commit
74593e6577
|
@ -1495,6 +1495,11 @@ MCSymbolRefExpr::VariantKind MipsAsmParser::getVariantKind(StringRef Symbol) {
|
|||
bool MipsAsmParser::
|
||||
ParseInstruction(ParseInstructionInfo &Info, StringRef Name, SMLoc NameLoc,
|
||||
SmallVectorImpl<MCParsedAsmOperand*> &Operands) {
|
||||
// Check if we have valid mnemonic
|
||||
if (!mnemonicIsValid(Name)) {
|
||||
Parser.eatToEndOfStatement();
|
||||
return Error(NameLoc, "Unknown instruction");
|
||||
}
|
||||
// First operand in MCInst is instruction mnemonic.
|
||||
Operands.push_back(MipsOperand::CreateToken(Name, NameLoc));
|
||||
|
||||
|
|
Loading…
Reference in New Issue