[llvm-commits] [llvm] r108262 - in /llvm/trunk: lib/AsmParser/LLParser.cpp test/Feature/metadata.ll
Dan Gohman
gohman at apple.com
Tue Jul 13 12:42:44 PDT 2010
Author: djg
Date: Tue Jul 13 14:42:44 2010
New Revision: 108262
URL: http://llvm.org/viewvc/llvm-project?rev=108262&view=rev
Log:
Add support for empty named metadata too. This isn't particularly
useful, but it is nice for consistency.
Modified:
llvm/trunk/lib/AsmParser/LLParser.cpp
llvm/trunk/test/Feature/metadata.ll
Modified: llvm/trunk/lib/AsmParser/LLParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLParser.cpp?rev=108262&r1=108261&r2=108262&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/LLParser.cpp (original)
+++ llvm/trunk/lib/AsmParser/LLParser.cpp Tue Jul 13 14:42:44 2010
@@ -544,20 +544,21 @@
return true;
SmallVector<MDNode *, 8> Elts;
- do {
- // Null is a special case since it is typeless.
- if (EatIfPresent(lltok::kw_null)) {
- Elts.push_back(0);
- continue;
- }
+ if (Lex.getKind() != lltok::rbrace)
+ do {
+ // Null is a special case since it is typeless.
+ if (EatIfPresent(lltok::kw_null)) {
+ Elts.push_back(0);
+ continue;
+ }
- if (ParseToken(lltok::exclaim, "Expected '!' here"))
- return true;
+ if (ParseToken(lltok::exclaim, "Expected '!' here"))
+ return true;
- MDNode *N = 0;
- if (ParseMDNodeID(N)) return true;
- Elts.push_back(N);
- } while (EatIfPresent(lltok::comma));
+ MDNode *N = 0;
+ if (ParseMDNodeID(N)) return true;
+ Elts.push_back(N);
+ } while (EatIfPresent(lltok::comma));
if (ParseToken(lltok::rbrace, "expected end of metadata node"))
return true;
Modified: llvm/trunk/test/Feature/metadata.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Feature/metadata.ll?rev=108262&r1=108261&r2=108262&view=diff
==============================================================================
--- llvm/trunk/test/Feature/metadata.ll (original)
+++ llvm/trunk/test/Feature/metadata.ll Tue Jul 13 14:42:44 2010
@@ -9,6 +9,7 @@
declare void @llvm.zonk(metadata, i64, metadata) nounwind readnone
!named = !{!0}
+!another_named = !{}
!0 = metadata !{i8** null}
!1 = metadata !{i8* null, metadata !2}
!2 = metadata !{}
More information about the llvm-commits
mailing list