mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-16 12:24:03 +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:
@ -639,6 +639,8 @@ void Instruction::setMetadata(unsigned KindID, MDNode *Node) {
|
||||
|
||||
// Handle the case when we're adding/updating metadata on an instruction.
|
||||
if (Node) {
|
||||
assert(!Node->isFunctionLocal() &&
|
||||
"Function-local metadata cannot be attached to instructions");
|
||||
LLVMContextImpl::MDMapTy &Info = getContext().pImpl->MetadataStore[this];
|
||||
assert(!Info.empty() == hasMetadataHashEntry() &&
|
||||
"HasMetadata bit is wonked");
|
||||
|
Reference in New Issue
Block a user