From d1a6f5a384900647f3379451597b82fbd1a6bde9 Mon Sep 17 00:00:00 2001 From: Wesley Peck Date: Thu, 11 Nov 2010 18:41:33 +0000 Subject: Fixed some bugs in MBlaze asm parser that were introduced when removing OwningPtrs from the code. llvm-svn: 118807 --- llvm/lib/Target/MBlaze/AsmParser/MBlazeAsmParser.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'llvm/lib/Target') diff --git a/llvm/lib/Target/MBlaze/AsmParser/MBlazeAsmParser.cpp b/llvm/lib/Target/MBlaze/AsmParser/MBlazeAsmParser.cpp index 80d7f3935a9..2534691faf4 100644 --- a/llvm/lib/Target/MBlaze/AsmParser/MBlazeAsmParser.cpp +++ b/llvm/lib/Target/MBlaze/AsmParser/MBlazeAsmParser.cpp @@ -446,15 +446,15 @@ ParseOperand(SmallVectorImpl &Operands) { if (!Op) Op = ParseImmediate(); - // Move past the parsed token in the token stream - getLexer().Lex(); - // If the token could not be parsed then fail if (!Op) { Error(Parser.getTok().getLoc(), "unknown operand"); return 0; } + // Move past the parsed token in the token stream + getLexer().Lex(); + // Push the parsed operand into the list of operands Operands.push_back(Op); return Op; @@ -472,7 +472,7 @@ ParseInstruction(StringRef Name, SMLoc NameLoc, return false; // Parse the first operand - if (ParseOperand(Operands)) + if (!ParseOperand(Operands)) return true; while (getLexer().isNot(AsmToken::EndOfStatement) && @@ -485,7 +485,7 @@ ParseInstruction(StringRef Name, SMLoc NameLoc, getLexer().Lex(); // Parse the next operand - if (ParseOperand(Operands)) + if (!ParseOperand(Operands)) return true; } -- cgit v1.2.3