diff options
author | Chris Lattner <sabre@nondot.org> | 2010-04-23 00:50:50 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-04-23 00:50:50 +0000 |
commit | 95b0ff445cc4c6bbdafbc0409fb6b151911c0902 (patch) | |
tree | b8a39f0907b4e2c6eb62150a01145b84e0594f07 /llvm/lib/AsmParser/LLParser.cpp | |
parent | d8d898dbd3ed495150d1bd677d4408bc61710825 (diff) | |
download | bcm5719-llvm-95b0ff445cc4c6bbdafbc0409fb6b151911c0902.tar.gz bcm5719-llvm-95b0ff445cc4c6bbdafbc0409fb6b151911c0902.zip |
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:
llvm-svn: 102154
Diffstat (limited to 'llvm/lib/AsmParser/LLParser.cpp')
-rw-r--r-- | llvm/lib/AsmParser/LLParser.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp index aa887d21777..45b88cc2a55 100644 --- a/llvm/lib/AsmParser/LLParser.cpp +++ b/llvm/lib/AsmParser/LLParser.cpp @@ -1170,10 +1170,10 @@ bool LLParser::ParseOptionalCommaAlign(unsigned &Alignment, 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; |