mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-25 00:24:26 +00:00
IR: Disallow function-local metadata attachments
Metadata attachments to instructions cannot be function-local. This is part of PR21532. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223574 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -62,6 +62,8 @@ bool LLParser::ValidateEndOfModule() {
|
||||
NumberedMetadata[SlotNo] == nullptr)
|
||||
return Error(MDList[i].Loc, "use of undefined metadata '!" +
|
||||
Twine(SlotNo) + "'");
|
||||
assert(!NumberedMetadata[SlotNo]->isFunctionLocal() &&
|
||||
"Unexpected function-local metadata");
|
||||
Inst->setMetadata(MDList[i].MDKind, NumberedMetadata[SlotNo]);
|
||||
}
|
||||
}
|
||||
@ -1529,6 +1531,8 @@ bool LLParser::ParseInstructionMetadata(Instruction *Inst,
|
||||
if (ParseMetadataListValue(ID, PFS))
|
||||
return true;
|
||||
assert(ID.Kind == ValID::t_MDNode);
|
||||
if (ID.MDNodeVal->isFunctionLocal())
|
||||
return TokError("unexpected function-local metadata");
|
||||
Inst->setMetadata(MDK, ID.MDNodeVal);
|
||||
} else {
|
||||
unsigned NodeID = 0;
|
||||
|
Reference in New Issue
Block a user