summaryrefslogtreecommitdiffstats
path: root/llvm/bindings
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/bindings')
-rw-r--r--llvm/bindings/go/llvm/IRBindings.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/bindings/go/llvm/IRBindings.cpp b/llvm/bindings/go/llvm/IRBindings.cpp
index fac4126acda..7c2fe60b2b9 100644
--- a/llvm/bindings/go/llvm/IRBindings.cpp
+++ b/llvm/bindings/go/llvm/IRBindings.cpp
@@ -86,7 +86,8 @@ void LLVMSetMetadata2(LLVMValueRef Inst, unsigned KindID, LLVMMetadataRef MD) {
}
void LLVMMetadataReplaceAllUsesWith(LLVMMetadataRef MD, LLVMMetadataRef New) {
- auto *Node = unwrap<MDNodeFwdDecl>(MD);
+ auto *Node = unwrap<MDTuple>(MD);
+ assert(Node->isTemporary() && "Expected temporary node");
Node->replaceAllUsesWith(unwrap<MDNode>(New));
MDNode::deleteTemporary(Node);
}
OpenPOWER on IntegriCloud