[llvm-commits] [llvm] r102154 - /llvm/trunk/lib/AsmParser/LLParser.cpp

Chris Lattner sabre at nondot.org
Thu Apr 22 17:50:50 PDT 2010


Author: lattner
Date: Thu Apr 22 19:50:50 2010
New Revision: 102154

URL: http://llvm.org/viewvc/llvm-project?rev=102154&view=rev
Log:
reject invalid comma stuff with a message.  We reject the case in
PR6888 with:

$ llvm-as t.ll
llvm-as: t.ll:2:29: error: expected metadata or 'align'
 store <3 x i32> %x, i32 1, i32 1>, <3 x i32>* %p
                            ^

instead of:

$ llvm-as t.ll 
llvm-as: 

Modified:
    llvm/trunk/lib/AsmParser/LLParser.cpp

Modified: llvm/trunk/lib/AsmParser/LLParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLParser.cpp?rev=102154&r1=102153&r2=102154&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/LLParser.cpp (original)
+++ llvm/trunk/lib/AsmParser/LLParser.cpp Thu Apr 22 19:50:50 2010
@@ -1170,10 +1170,10 @@
       return false;
     }
     
-    if (Lex.getKind() == lltok::kw_align) {
-      if (ParseOptionalAlignment(Alignment)) return true;
-    } else
-      return true;
+    if (Lex.getKind() != lltok::kw_align)
+      return Error(Lex.getLoc(), "expected metadata or 'align'");
+    
+    if (ParseOptionalAlignment(Alignment)) return true;
   }
 
   return false;





More information about the llvm-commits mailing list