summaryrefslogtreecommitdiff
path: root/bindings
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2014-12-13 02:25:54 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2014-12-13 02:25:54 +0000
commit3a404314fe755064bbb0e5db8a2a232b11f02b6e (patch)
treef5aca0aba6cee3a9a7881fd47e8e47bf952c0a13 /bindings
parente9e0f3718cd9507c41df9b002453abb2dc11ba95 (diff)
downloadllvm-3a404314fe755064bbb0e5db8a2a232b11f02b6e.tar.gz
Go bindings: introduce llvm.TemporaryMDNode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224178 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'bindings')
-rw-r--r--bindings/go/llvm/IRBindings.cpp6
-rw-r--r--bindings/go/llvm/IRBindings.h2
-rw-r--r--bindings/go/llvm/ir.go5
3 files changed, 13 insertions, 0 deletions
diff --git a/bindings/go/llvm/IRBindings.cpp b/bindings/go/llvm/IRBindings.cpp
index 3099fa562812..e471746098ea 100644
--- a/bindings/go/llvm/IRBindings.cpp
+++ b/bindings/go/llvm/IRBindings.cpp
@@ -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);
diff --git a/bindings/go/llvm/IRBindings.h b/bindings/go/llvm/IRBindings.h
index 6bce4f71c290..fab41f228a8a 100644
--- a/bindings/go/llvm/IRBindings.h
+++ b/bindings/go/llvm/IRBindings.h
@@ -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);
diff --git a/bindings/go/llvm/ir.go b/bindings/go/llvm/ir.go
index 178eda303bee..f4b07afa53c6 100644
--- a/bindings/go/llvm/ir.go
+++ b/bindings/go/llvm/ir.go
@@ -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) {