llvm.org GIT mirror llvm / 9dc8ae1
Add support for empty named metadata too. This isn't particularly useful, but it is nice for consistency. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108262 91177308-0d34-0410-b5e6-96231b3b80d8 Dan Gohman 10 years ago
2 changed file(s) with 15 addition(s) and 13 deletion(s). Raw diff Collapse all Expand all
543543 return true;
544544
545545 SmallVector Elts;
546 do {
547 // Null is a special case since it is typeless.
548 if (EatIfPresent(lltok::kw_null)) {
549 Elts.push_back(0);
550 continue;
551 }
552
553 if (ParseToken(lltok::exclaim, "Expected '!' here"))
554 return true;
546 if (Lex.getKind() != lltok::rbrace)
547 do {
548 // Null is a special case since it is typeless.
549 if (EatIfPresent(lltok::kw_null)) {
550 Elts.push_back(0);
551 continue;
552 }
553
554 if (ParseToken(lltok::exclaim, "Expected '!' here"))
555 return true;
555556
556 MDNode *N = 0;
557 if (ParseMDNodeID(N)) return true;
558 Elts.push_back(N);
559 } while (EatIfPresent(lltok::comma));
557 MDNode *N = 0;
558 if (ParseMDNodeID(N)) return true;
559 Elts.push_back(N);
560 } while (EatIfPresent(lltok::comma));
560561
561562 if (ParseToken(lltok::rbrace, "expected end of metadata node"))
562563 return true;
88 declare void @llvm.zonk(metadata, i64, metadata) nounwind readnone
99
1010 !named = !{!0}
11 !another_named = !{}
1112 !0 = metadata !{i8** null}
1213 !1 = metadata !{i8* null, metadata !2}
1314 !2 = metadata !{}