summaryrefslogtreecommitdiffstats
path: root/bindings
diff options
context:
space:
mode:
authorAndrew Wilkins <axwalk@gmail.com>2016-03-15 05:04:06 +0000
committerAndrew Wilkins <axwalk@gmail.com>2016-03-15 05:04:06 +0000
commit255ca4be009a448cc5d510e657d6e814dbbd4d50 (patch)
tree89fd530037955f7dbb152b9db84e44410b848134 /bindings
parent767c5c3079cec05ec1ba00ceaf36c93595b2f5c2 (diff)
bindings/go: reinstate TargetMachine.TargetData
Summary: LLVMGetTargetDataLayout was removed from the C API, and then TargetMachine.TargetData was removed. Later, LLVMCreateTargetMachineData was added to the C API, and we now expose this via the Go API. Reviewers: deadalnix, pcc Subscribers: cierniak, llvm-commits, axw Differential Revision: http://reviews.llvm.org/D18173 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263530 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'bindings')
-rw-r--r--bindings/go/llvm/target.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/bindings/go/llvm/target.go b/bindings/go/llvm/target.go
index 5910b9bb9246..268cc0eb1979 100644
--- a/bindings/go/llvm/target.go
+++ b/bindings/go/llvm/target.go
@@ -254,6 +254,13 @@ func (t Target) CreateTargetMachine(Triple string, CPU string, Features string,
return
}
+// CreateTargetData returns a new TargetData describing the TargetMachine's
+// data layout. The returned TargetData is owned by the caller, who is
+// responsible for disposing of it by calling the TargetData.Dispose method.
+func (tm TargetMachine) CreateTargetData() TargetData {
+ return TargetData{C.LLVMCreateTargetDataLayout(tm.C)}
+}
+
// Triple returns the triple describing the machine (arch-vendor-os).
func (tm TargetMachine) Triple() string {
cstr := C.LLVMGetTargetMachineTriple(tm.C)