mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-01 00:33:09 +00:00
This patch checks for valid mnemonics at the beginning of parseInstruction method, thus giving the user the right error message for non-existing instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186512 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b0aa9e9718
commit
fce9279ac0
@ -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
Block a user