+/// ParseInlineMetadata:
+/// !{type %instr}
+/// !{...} MDNode
+/// !"foo" MDString
+bool LLParser::ParseInlineMetadata(Value *&V, PerFunctionState &PFS) {
+ assert(Lex.getKind() == lltok::Metadata && "Only for Metadata");
+ V = 0;
+
+ Lex.Lex();
+ if (Lex.getKind() == lltok::lbrace) {
+ Lex.Lex();
+ if (ParseTypeAndValue(V, PFS) ||
+ ParseToken(lltok::rbrace, "expected end of metadata node"))
+ return true;
+
+ Value *Vals[] = { V };
+ V = MDNode::get(Context, Vals, 1);
+ return false;
+ }
+
+ // FIXME: This can't possibly work at all. r90497
+
+ // Standalone metadata reference
+ // !{ ..., !42, ... }
+ if (!ParseMDNode((MDNode *&)V))
+ return false;
+
+ // MDString:
+ // '!' STRINGCONSTANT
+ if (ParseMDString((MDString *&)V)) return true;
+ return false;
+}
+