//===----------------------------------------------------------------------===//
#include "IRBindings.h"
-
#include "llvm/IR/Attributes.h"
#include "llvm/IR/DebugLoc.h"
#include "llvm/IR/Function.h"
LLVMMetadataRef LLVMTemporaryMDNode(LLVMContextRef C, LLVMMetadataRef *MDs,
unsigned Count) {
- return wrap(MDNode::getTemporary(*unwrap(C),
- ArrayRef<Metadata *>(unwrap(MDs), Count)));
+ return wrap(MDTuple::getTemporary(*unwrap(C),
+ ArrayRef<Metadata *>(unwrap(MDs), Count))
+ .release());
}
void LLVMAddNamedMetadataOperand2(LLVMModuleRef M, const char *name,
}
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);
}