Skip to content

Commit

Permalink
Remove LLVMGetTargetMachineData leftovers.
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260720 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
d0k committed Feb 12, 2016
1 parent f365222 commit 06016cc
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 28 deletions.
2 changes: 0 additions & 2 deletions bindings/ocaml/target/llvm_target.ml
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,6 @@ 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
Expand Down
3 changes: 0 additions & 3 deletions bindings/ocaml/target/llvm_target.mli
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,6 @@ module TargetMachine : sig
[llvm::TargetMachine::getFeatureString]. *)
val features : t -> string

(** Returns the data layout of this target machine. *)
val data_layout : t -> DataLayout.t

(** Adds the target-specific analysis passes to the pass manager.
See [llvm::TargetMachine::addAnalysisPasses]. *)
val add_analysis_passes : [< Llvm.PassManager.any ] Llvm.PassManager.t -> t -> unit
Expand Down
19 changes: 0 additions & 19 deletions bindings/ocaml/target/target_ocaml.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,25 +302,6 @@ CAMLprim value llvm_targetmachine_features(value Machine) {
TargetMachine_val(Machine)));
}

/* TargetMachine.t -> DataLayout.t */
CAMLprim value llvm_targetmachine_data_layout(value Machine) {
CAMLparam1(Machine);
CAMLlocal1(DataLayout);
char *TargetDataCStr;

/* LLVMGetTargetMachineData returns a pointer owned by the TargetMachine,
so it is impossible to wrap it with llvm_alloc_target_data, which assumes
that OCaml owns the pointer. */
LLVMTargetDataRef OrigDataLayout;
OrigDataLayout = LLVMGetTargetMachineData(TargetMachine_val(Machine));

TargetDataCStr = LLVMCopyStringRepOfTargetData(OrigDataLayout);
DataLayout = llvm_alloc_data_layout(LLVMCreateTargetData(TargetDataCStr));
LLVMDisposeMessage(TargetDataCStr);

CAMLreturn(DataLayout);
}

/* bool -> TargetMachine.t -> unit */
CAMLprim value llvm_targetmachine_set_verbose_asm(value Verb, value Machine) {
LLVMSetTargetMachineAsmVerbosity(TargetMachine_val(Machine), Bool_val(Verb));
Expand Down
3 changes: 0 additions & 3 deletions include/llvm-c/TargetMachine.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,6 @@ char *LLVMGetTargetMachineCPU(LLVMTargetMachineRef T);
LLVMDisposeMessage. */
char *LLVMGetTargetMachineFeatureString(LLVMTargetMachineRef T);

/** Returns the llvm::DataLayout used for this llvm:TargetMachine. */
LLVMTargetDataRef LLVMGetTargetMachineData(LLVMTargetMachineRef T);

/** Set the target machine's ASM verbosity. */
void LLVMSetTargetMachineAsmVerbosity(LLVMTargetMachineRef T,
LLVMBool VerboseAsm);
Expand Down
1 change: 0 additions & 1 deletion test/Bindings/OCaml/target.ml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ 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
Expand Down

0 comments on commit 06016cc

Please sign in to comment.