aboutsummaryrefslogtreecommitdiffstats
path: root/lib/AsmParser/LLParser.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-04-23 00:50:50 +0000
committerChris Lattner <sabre@nondot.org>2010-04-23 00:50:50 +0000
commitef67a041a5032bdb153b0c7a5c9401690975f883 (patch)
treefb789c33192119729f64044b32a44d1c355b5a87 /lib/AsmParser/LLParser.cpp
parent93ff359d75526a97df918f4b59085b992e302658 (diff)
downloadexternal_llvm-ef67a041a5032bdb153b0c7a5c9401690975f883.zip
external_llvm-ef67a041a5032bdb153b0c7a5c9401690975f883.tar.gz
external_llvm-ef67a041a5032bdb153b0c7a5c9401690975f883.tar.bz2
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: git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102154 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AsmParser/LLParser.cpp')
-rw-r--r--lib/AsmParser/LLParser.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/AsmParser/LLParser.cpp b/lib/AsmParser/LLParser.cpp
index aa887d2..45b88cc 100644
--- a/lib/AsmParser/LLParser.cpp
+++ b/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;