[llvm] r263530 - bindings/go: reinstate TargetMachine.TargetData
Andrew Wilkins via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 14 22:04:07 PDT 2016
Author: axw
Date: Tue Mar 15 00:04:06 2016
New Revision: 263530
URL: http://llvm.org/viewvc/llvm-project?rev=263530&view=rev
Log:
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
Modified:
llvm/trunk/bindings/go/llvm/target.go
Modified: llvm/trunk/bindings/go/llvm/target.go
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/go/llvm/target.go?rev=263530&r1=263529&r2=263530&view=diff
==============================================================================
--- llvm/trunk/bindings/go/llvm/target.go (original)
+++ llvm/trunk/bindings/go/llvm/target.go Tue Mar 15 00:04:06 2016
@@ -254,6 +254,13 @@ func (t Target) CreateTargetMachine(Trip
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)
More information about the llvm-commits
mailing list