Fixed edis to tokenize instructions with no

operands correctly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102227 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Sean Callanan 2010-04-24 01:00:16 +00:00
parent 37ff5c66db
commit a870256d7d

View File

@ -368,12 +368,14 @@ int EDDisassembler::parseInst(SmallVectorImpl<MCParsedAsmOperand*> &operands,
OwningPtr<TargetAsmParser> TargetParser(Tgt->createAsmParser(genericParser));
AsmToken OpcodeToken = genericParser.Lex();
genericParser.Lex(); // consume next token, because specificParser expects us to
AsmToken NextToken = genericParser.Lex(); // consume next token, because specificParser expects us to
if (OpcodeToken.is(AsmToken::Identifier)) {
instName = OpcodeToken.getString();
instLoc = OpcodeToken.getLoc();
if (TargetParser->ParseInstruction(instName, instLoc, operands))
if (NextToken.isNot(AsmToken::Eof) &&
TargetParser->ParseInstruction(instName, instLoc, operands))
ret = -1;
} else {
ret = -1;