summaryrefslogtreecommitdiffstats
path: root/llvm/bindings/go
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
commit36761bf92427846ce40fdd849615732c852e44dd (patch)
treeb5a84a00ca1d4469a7cc4a7bf85262332dd21486 /llvm/bindings/go
parente2a35c728cc3cc62d4b8bd637e96a9a78df87cd7 (diff)
downloadbcm5719-llvm-36761bf92427846ce40fdd849615732c852e44dd.tar.gz
bcm5719-llvm-36761bf92427846ce40fdd849615732c852e44dd.zip
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 llvm-svn: 263530
Diffstat (limited to 'llvm/bindings/go')
-rw-r--r--llvm/bindings/go/llvm/target.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/bindings/go/llvm/target.go b/llvm/bindings/go/llvm/target.go
index 5910b9bb924..268cc0eb197 100644
--- a/llvm/bindings/go/llvm/target.go
+++ b/llvm/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)
OpenPOWER on IntegriCloud