diff options
author | Peter Zotov <whitequark@whitequark.org> | 2014-10-29 08:16:14 +0000 |
---|---|---|
committer | Peter Zotov <whitequark@whitequark.org> | 2014-10-29 08:16:14 +0000 |
commit | 57d796af1f71ebb60386d27944b6c63b3bb02edd (patch) | |
tree | 9f901fa8735b0441755ae242d086d3f11b597cc6 /bindings/ocaml | |
parent | 2e9579037de6b05ea436abf6d4bf24d9a278942b (diff) |
[OCaml] Expose Llvm_target.TargetMachine.add_analysis_passes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220846 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'bindings/ocaml')
-rw-r--r-- | bindings/ocaml/target/llvm_target.ml | 2 | ||||
-rw-r--r-- | bindings/ocaml/target/llvm_target.mli | 4 | ||||
-rw-r--r-- | bindings/ocaml/target/target_ocaml.c | 7 |
3 files changed, 13 insertions, 0 deletions
diff --git a/bindings/ocaml/target/llvm_target.ml b/bindings/ocaml/target/llvm_target.ml index aadd90f5518..bd7388e29fa 100644 --- a/bindings/ocaml/target/llvm_target.ml +++ b/bindings/ocaml/target/llvm_target.ml @@ -126,6 +126,8 @@ module TargetMachine = struct = "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 = "llvm_targetmachine_set_verbose_asm" external emit_to_file : Llvm.llmodule -> CodeGenFileType.t -> string -> diff --git a/bindings/ocaml/target/llvm_target.mli b/bindings/ocaml/target/llvm_target.mli index ca91e0d9105..676bc613c64 100644 --- a/bindings/ocaml/target/llvm_target.mli +++ b/bindings/ocaml/target/llvm_target.mli @@ -207,6 +207,10 @@ module TargetMachine : sig (** 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 + (** Sets the assembly verbosity of this target machine. See [llvm::TargetMachine::setAsmVerbosity]. *) val set_verbose_asm : bool -> t -> unit diff --git a/bindings/ocaml/target/target_ocaml.c b/bindings/ocaml/target/target_ocaml.c index fea3eff174a..efb5d9bd51e 100644 --- a/bindings/ocaml/target/target_ocaml.c +++ b/bindings/ocaml/target/target_ocaml.c @@ -374,3 +374,10 @@ CAMLprim LLVMMemoryBufferRef llvm_targetmachine_emit_to_memory_buffer( return Buffer; } + +/* TargetMachine.t -> Llvm.PassManager.t -> unit */ +CAMLprim value llvm_targetmachine_add_analysis_passes(LLVMPassManagerRef PM, + value Machine) { + LLVMAddAnalysisPasses(TargetMachine_val(Machine), PM); + return Val_unit; +} |