Go bindings: introduce llvm.TemporaryMDNode.
authorPeter Collingbourne <peter@pcc.me.uk>
Sat, 13 Dec 2014 02:25:54 +0000 (02:25 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Sat, 13 Dec 2014 02:25:54 +0000 (02:25 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224178 91177308-0d34-0410-b5e6-96231b3b80d8

bindings/go/llvm/IRBindings.cpp
bindings/go/llvm/IRBindings.h
bindings/go/llvm/ir.go

index 3099fa5..e471746 100644 (file)
@@ -60,6 +60,12 @@ LLVMMetadataRef LLVMMDNode2(LLVMContextRef C, LLVMMetadataRef *MDs,
       MDNode::get(*unwrap(C), ArrayRef<Metadata *>(unwrap(MDs), Count)));
 }
 
+LLVMMetadataRef LLVMTemporaryMDNode(LLVMContextRef C, LLVMMetadataRef *MDs,
+                                    unsigned Count) {
+  return wrap(MDNode::getTemporary(*unwrap(C),
+                                   ArrayRef<Metadata *>(unwrap(MDs), Count)));
+}
+
 void LLVMAddNamedMetadataOperand2(LLVMModuleRef M, const char *name,
                                   LLVMMetadataRef Val) {
   NamedMDNode *N = unwrap(M)->getOrInsertNamedMetadata(name);
index 6bce4f7..fab41f2 100644 (file)
@@ -40,6 +40,8 @@ void LLVMRemoveFunctionAttr2(LLVMValueRef Fn, uint64_t PA);
 LLVMMetadataRef LLVMMDString2(LLVMContextRef C, const char *Str, unsigned SLen);
 LLVMMetadataRef LLVMMDNode2(LLVMContextRef C, LLVMMetadataRef *MDs,
                             unsigned Count);
+LLVMMetadataRef LLVMTemporaryMDNode(LLVMContextRef C, LLVMMetadataRef *MDs,
+                                    unsigned Count);
 
 void LLVMAddNamedMetadataOperand2(LLVMModuleRef M, const char *name,
                                   LLVMMetadataRef Val);
index 178eda3..f4b07af 100644 (file)
@@ -749,6 +749,11 @@ func (c Context) MDNode(mds []Metadata) (md Metadata) {
        md.C = C.LLVMMDNode2(c.C, ptr, nvals)
        return
 }
+func (c Context) TemporaryMDNode(mds []Metadata) (md Metadata) {
+       ptr, nvals := llvmMetadataRefs(mds)
+       md.C = C.LLVMTemporaryMDNode(c.C, ptr, nvals)
+       return
+}
 
 // Operations on scalar constants
 func ConstInt(t Type, n uint64, signExtend bool) (v Value) {