/// ParseInstructionMetadata
/// ::= !dbg !42 (',' !dbg !57)*
-bool LLParser::ParseInstructionMetadata(Instruction *Inst,
- PerFunctionState *PFS) {
+bool LLParser::ParseInstructionMetadata(Instruction &Inst) {
do {
if (Lex.getKind() != lltok::MetadataVar)
return TokError("expected metadata after comma");
if (ParseMetadataAttachment(MDK, N))
return true;
- Inst->setMetadata(MDK, N);
+ Inst.setMetadata(MDK, N);
if (MDK == LLVMContext::MD_tbaa)
- InstsWithTBAATag.push_back(Inst);
+ InstsWithTBAATag.push_back(&Inst);
// If this is the end of the list, we're done.
} while (EatIfPresent(lltok::comma));
// With a normal result, we check to see if the instruction is followed by
// a comma and metadata.
if (EatIfPresent(lltok::comma))
- if (ParseInstructionMetadata(Inst, &PFS))
+ if (ParseInstructionMetadata(*Inst))
return true;
break;
case InstExtraComma:
// If the instruction parser ate an extra comma at the end of it, it
// *must* be followed by metadata.
- if (ParseInstructionMetadata(Inst, &PFS))
+ if (ParseInstructionMetadata(*Inst))
return true;
break;
}
bool ParseMDNodeTail(MDNode *&MD);
bool ParseMDNodeVector(SmallVectorImpl<Metadata *> &MDs);
bool ParseMetadataAttachment(unsigned &Kind, MDNode *&MD);
- bool ParseInstructionMetadata(Instruction *Inst, PerFunctionState *PFS);
+ bool ParseInstructionMetadata(Instruction &Inst);
template <class FieldTy>
bool ParseMDField(LocTy Loc, StringRef Name, FieldTy &Result);