[llvm-commits] [llvm] r118807 - /llvm/trunk/lib/Target/MBlaze/AsmParser/MBlazeAsmParser.cpp

Wesley Peck peckw at wesleypeck.com
Thu Nov 11 10:41:34 PST 2010


Author: peckw
Date: Thu Nov 11 12:41:33 2010
New Revision: 118807

URL: http://llvm.org/viewvc/llvm-project?rev=118807&view=rev
Log:
Fixed some bugs in MBlaze asm parser that were introduced when removing OwningPtrs from the code.

Modified:
    llvm/trunk/lib/Target/MBlaze/AsmParser/MBlazeAsmParser.cpp

Modified: llvm/trunk/lib/Target/MBlaze/AsmParser/MBlazeAsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MBlaze/AsmParser/MBlazeAsmParser.cpp?rev=118807&r1=118806&r2=118807&view=diff
==============================================================================
--- llvm/trunk/lib/Target/MBlaze/AsmParser/MBlazeAsmParser.cpp (original)
+++ llvm/trunk/lib/Target/MBlaze/AsmParser/MBlazeAsmParser.cpp Thu Nov 11 12:41:33 2010
@@ -446,15 +446,15 @@
   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 @@
     return false;
 
   // Parse the first operand
-  if (ParseOperand(Operands))
+  if (!ParseOperand(Operands))
     return true;
 
   while (getLexer().isNot(AsmToken::EndOfStatement) &&
@@ -485,7 +485,7 @@
     getLexer().Lex();
 
     // Parse the next operand
-    if (ParseOperand(Operands))
+    if (!ParseOperand(Operands))
       return true;
   }
 





More information about the llvm-commits mailing list