Go bindings: use MDNode::replaceAllUsesWith instead of MDTuple::replaceAllUsesWith.
[oota-llvm.git] / bindings / go / llvm / IRBindings.cpp
index 402407eaf8d09537d5220b26a49dc01d18090610..fd0cb8006a4fe1b3f359f4448b128310943a35cd 100644 (file)
@@ -12,7 +12,6 @@
 //===----------------------------------------------------------------------===//
 
 #include "IRBindings.h"
-
 #include "llvm/IR/Attributes.h"
 #include "llvm/IR/DebugLoc.h"
 #include "llvm/IR/Function.h"
@@ -87,9 +86,8 @@ void LLVMSetMetadata2(LLVMValueRef Inst, unsigned KindID, LLVMMetadataRef MD) {
 }
 
 void LLVMMetadataReplaceAllUsesWith(LLVMMetadataRef MD, LLVMMetadataRef New) {
-  auto *Node = unwrap<MDTuple>(MD);
-  assert(Node->isTemporary() && "Expected temporary node");
-  Node->replaceAllUsesWith(unwrap<MDNode>(New));
+  auto *Node = unwrap<MDNode>(MD);
+  Node->replaceAllUsesWith(unwrap<Metadata>(New));
   MDNode::deleteTemporary(Node);
 }