mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-12 13:38:21 +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:
@ -2359,8 +2359,12 @@ std::error_code BitcodeReader::ParseMetadataAttachment() {
|
||||
MDKindMap.find(Kind);
|
||||
if (I == MDKindMap.end())
|
||||
return Error(BitcodeError::InvalidID);
|
||||
Value *Node = MDValueList.getValueFwdRef(Record[i+1]);
|
||||
Inst->setMetadata(I->second, cast<MDNode>(Node));
|
||||
MDNode *Node = cast<MDNode>(MDValueList.getValueFwdRef(Record[i+1]));
|
||||
if (Node->isFunctionLocal())
|
||||
// Drop the attachment. This used to be legal, but there's no
|
||||
// upgrade path.
|
||||
break;
|
||||
Inst->setMetadata(I->second, Node);
|
||||
if (I->second == LLVMContext::MD_tbaa)
|
||||
InstsWithTBAATag.push_back(Inst);
|
||||
}
|
||||
|
Reference in New Issue
Block a user