forked from OSchip/llvm-project
Add support for empty named metadata too. This isn't particularly
useful, but it is nice for consistency. llvm-svn: 108262
This commit is contained in:
parent
b43455feaf
commit
afd69cf5b7
|
@ -544,20 +544,21 @@ bool LLParser::ParseNamedMetadata() {
|
|||
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;
|
||||
|
|
|
@ -9,6 +9,7 @@ define void @foo() {
|
|||
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 !{}
|
||||
|
|
Loading…
Reference in New Issue