/// ::= /* empty */
/// ::= !dbg !42
bool LLParser::ParseOptionalCustomMetadata() {
-
- std::string Name;
- if (Lex.getKind() == lltok::NamedOrCustomMD) {
- Name = Lex.getStrVal();
- Lex.Lex();
- } else
+ if (Lex.getKind() != lltok::NamedOrCustomMD)
return false;
+ std::string Name = Lex.getStrVal();
+ Lex.Lex();
+
if (Lex.getKind() != lltok::Metadata)
return TokError("Expected '!' here");
Lex.Lex();
if (ParseType(Ty, true /*void allowed*/)) return true;
if (Ty->isVoidTy()) {
- if (EatIfPresent(lltok::comma))
- if (ParseOptionalCustomMetadata()) return true;
Inst = ReturnInst::Create(Context);
return false;
}
}
}
}
- if (EatIfPresent(lltok::comma))
- if (ParseOptionalCustomMetadata()) return true;
Inst = ReturnInst::Create(Context, RV);
return false;