[PATCH] D18677: [OCaml] Reinstate data_layout
Jeroen Ketema via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 1 00:59:46 PDT 2016
This revision was automatically updated to reflect the committed changes.
Closed by commit rL265115: [OCaml] Reinstate data_layout (authored by jketema).
Changed prior to commit:
http://reviews.llvm.org/D18677?vs=52301&id=52334#toc
Repository:
rL LLVM
http://reviews.llvm.org/D18677
Files:
llvm/trunk/bindings/ocaml/target/llvm_target.ml
llvm/trunk/bindings/ocaml/target/llvm_target.mli
llvm/trunk/bindings/ocaml/target/target_ocaml.c
llvm/trunk/test/Bindings/OCaml/target.ml
Index: llvm/trunk/test/Bindings/OCaml/target.ml
===================================================================
--- llvm/trunk/test/Bindings/OCaml/target.ml
+++ llvm/trunk/test/Bindings/OCaml/target.ml
@@ -81,6 +81,7 @@
assert_equal (TM.triple machine) (Target.default_triple ());
assert_equal (TM.cpu machine) "";
assert_equal (TM.features machine) "";
+ ignore (TM.data_layout machine);
TM.set_verbose_asm true machine;
let pm = PassManager.create () in
TM.add_analysis_passes pm machine
Index: llvm/trunk/bindings/ocaml/target/llvm_target.ml
===================================================================
--- llvm/trunk/bindings/ocaml/target/llvm_target.ml
+++ llvm/trunk/bindings/ocaml/target/llvm_target.ml
@@ -121,6 +121,8 @@
= "llvm_targetmachine_cpu"
external features : t -> string
= "llvm_targetmachine_features"
+ external data_layout : t -> DataLayout.t
+ = "llvm_targetmachine_data_layout"
external add_analysis_passes : [< Llvm.PassManager.any ] Llvm.PassManager.t -> t -> unit
= "llvm_targetmachine_add_analysis_passes"
external set_verbose_asm : bool -> t -> unit
Index: llvm/trunk/bindings/ocaml/target/target_ocaml.c
===================================================================
--- llvm/trunk/bindings/ocaml/target/target_ocaml.c
+++ llvm/trunk/bindings/ocaml/target/target_ocaml.c
@@ -296,6 +296,12 @@
TargetMachine_val(Machine)));
}
+/* TargetMachine.t -> DataLayout.t */
+CAMLprim value llvm_targetmachine_data_layout(value Machine) {
+ return llvm_alloc_data_layout(LLVMCreateTargetDataLayout(
+ TargetMachine_val(Machine)));
+}
+
/* bool -> TargetMachine.t -> unit */
CAMLprim value llvm_targetmachine_set_verbose_asm(value Verb, value Machine) {
LLVMSetTargetMachineAsmVerbosity(TargetMachine_val(Machine), Bool_val(Verb));
Index: llvm/trunk/bindings/ocaml/target/llvm_target.mli
===================================================================
--- llvm/trunk/bindings/ocaml/target/llvm_target.mli
+++ llvm/trunk/bindings/ocaml/target/llvm_target.mli
@@ -194,6 +194,9 @@
[llvm::TargetMachine::getCPU]. *)
val cpu : t -> string
+ (** Returns the data layout of this target machine. *)
+ val data_layout : t -> DataLayout.t
+
(** Returns the feature string used while creating this target machine. See
[llvm::TargetMachine::getFeatureString]. *)
val features : t -> string
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18677.52334.patch
Type: text/x-patch
Size: 2534 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160401/5e6f15a0/attachment.bin>
More information about the llvm-commits
mailing list