[llvm] r265115 - [OCaml] Reinstate data_layout
Jeroen Ketema via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 1 00:54:27 PDT 2016
Author: jketema
Date: Fri Apr 1 02:54:24 2016
New Revision: 265115
URL: http://llvm.org/viewvc/llvm-project?rev=265115&view=rev
Log:
[OCaml] Reinstate data_layout
Expose LLVMCreateTargetMachineData as data_layout.
As r263530 did for go. From that commit: "LLVMGetTargetDataLayout was
removed from the C API, and then TargetMachine.TargetData was removed.
Later, LLVMCreateTargetMachineData was added to the C API"
Differential Revision: http://reviews.llvm.org/D18677
Modified:
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
Modified: llvm/trunk/bindings/ocaml/target/llvm_target.ml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/target/llvm_target.ml?rev=265115&r1=265114&r2=265115&view=diff
==============================================================================
--- llvm/trunk/bindings/ocaml/target/llvm_target.ml (original)
+++ llvm/trunk/bindings/ocaml/target/llvm_target.ml Fri Apr 1 02:54:24 2016
@@ -121,6 +121,8 @@ module TargetMachine = struct
= "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
Modified: llvm/trunk/bindings/ocaml/target/llvm_target.mli
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/target/llvm_target.mli?rev=265115&r1=265114&r2=265115&view=diff
==============================================================================
--- llvm/trunk/bindings/ocaml/target/llvm_target.mli (original)
+++ llvm/trunk/bindings/ocaml/target/llvm_target.mli Fri Apr 1 02:54:24 2016
@@ -194,6 +194,9 @@ module TargetMachine : sig
[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
Modified: llvm/trunk/bindings/ocaml/target/target_ocaml.c
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/target/target_ocaml.c?rev=265115&r1=265114&r2=265115&view=diff
==============================================================================
--- llvm/trunk/bindings/ocaml/target/target_ocaml.c (original)
+++ llvm/trunk/bindings/ocaml/target/target_ocaml.c Fri Apr 1 02:54:24 2016
@@ -296,6 +296,12 @@ CAMLprim value llvm_targetmachine_featur
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));
Modified: llvm/trunk/test/Bindings/OCaml/target.ml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bindings/OCaml/target.ml?rev=265115&r1=265114&r2=265115&view=diff
==============================================================================
--- llvm/trunk/test/Bindings/OCaml/target.ml (original)
+++ llvm/trunk/test/Bindings/OCaml/target.ml Fri Apr 1 02:54:24 2016
@@ -81,6 +81,7 @@ let test_target_machine () =
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
More information about the llvm-commits
mailing list