Skip to content

Commit e0efe46

Browse files
alan-j-huaeubanks
authored andcommitted
[OCaml] Remove all PassManager-related functions
Reviewed By: aeubanks, nikic Differential Revision: https://reviews.llvm.org/D144751
1 parent be4aca6 commit e0efe46

31 files changed

+2
-1320
lines changed

llvm/bindings/ocaml/llvm/llvm.ml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1392,21 +1392,3 @@ module MemoryBuffer = struct
13921392
external as_string : llmemorybuffer -> string = "llvm_memorybuffer_as_string"
13931393
external dispose : llmemorybuffer -> unit = "llvm_memorybuffer_dispose"
13941394
end
1395-
1396-
1397-
(*===-- Pass Manager ------------------------------------------------------===*)
1398-
1399-
module PassManager = struct
1400-
type 'a t
1401-
type any = [ `Module | `Function ]
1402-
external create : unit -> [ `Module ] t = "llvm_passmanager_create"
1403-
external create_function : llmodule -> [ `Function ] t
1404-
= "LLVMCreateFunctionPassManager"
1405-
external run_module : llmodule -> [ `Module ] t -> bool
1406-
= "llvm_passmanager_run_module"
1407-
external initialize : [ `Function ] t -> bool = "llvm_passmanager_initialize"
1408-
external run_function : llvalue -> [ `Function ] t -> bool
1409-
= "llvm_passmanager_run_function"
1410-
external finalize : [ `Function ] t -> bool = "llvm_passmanager_finalize"
1411-
external dispose : [< any ] t -> unit = "llvm_passmanager_dispose"
1412-
end

llvm/bindings/ocaml/llvm/llvm.mli

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -2622,54 +2622,3 @@ module MemoryBuffer : sig
26222622
(** Disposes of a memory buffer. *)
26232623
val dispose : llmemorybuffer -> unit
26242624
end
2625-
2626-
2627-
(** {6 Pass Managers} *)
2628-
2629-
module PassManager : sig
2630-
(** *)
2631-
type 'a t
2632-
type any = [ `Module | `Function ]
2633-
2634-
(** [PassManager.create ()] constructs a new whole-module pass pipeline. This
2635-
type of pipeline is suitable for link-time optimization and whole-module
2636-
transformations.
2637-
See the constructor of [llvm::PassManager]. *)
2638-
val create : unit -> [ `Module ] t
2639-
2640-
(** [PassManager.create_function m] constructs a new function-by-function
2641-
pass pipeline over the module [m]. It does not take ownership of [m].
2642-
This type of pipeline is suitable for code generation and JIT compilation
2643-
tasks.
2644-
See the constructor of [llvm::FunctionPassManager]. *)
2645-
val create_function : llmodule -> [ `Function ] t
2646-
2647-
(** [run_module m pm] initializes, executes on the module [m], and finalizes
2648-
all of the passes scheduled in the pass manager [pm]. Returns [true] if
2649-
any of the passes modified the module, [false] otherwise.
2650-
See the [llvm::PassManager::run] method. *)
2651-
val run_module : llmodule -> [ `Module ] t -> bool
2652-
2653-
(** [initialize fpm] initializes all of the function passes scheduled in the
2654-
function pass manager [fpm]. Returns [true] if any of the passes modified
2655-
the module, [false] otherwise.
2656-
See the [llvm::FunctionPassManager::doInitialization] method. *)
2657-
val initialize : [ `Function ] t -> bool
2658-
2659-
(** [run_function f fpm] executes all of the function passes scheduled in the
2660-
function pass manager [fpm] over the function [f]. Returns [true] if any
2661-
of the passes modified [f], [false] otherwise.
2662-
See the [llvm::FunctionPassManager::run] method. *)
2663-
val run_function : llvalue -> [ `Function ] t -> bool
2664-
2665-
(** [finalize fpm] finalizes all of the function passes scheduled in the
2666-
function pass manager [fpm]. Returns [true] if any of the passes
2667-
modified the module, [false] otherwise.
2668-
See the [llvm::FunctionPassManager::doFinalization] method. *)
2669-
val finalize : [ `Function ] t -> bool
2670-
2671-
(** Frees the memory of a pass pipeline. For function pipelines, does not free
2672-
the module.
2673-
See the destructor of [llvm::BasePassManager]. *)
2674-
val dispose : [< any ] t -> unit
2675-
end

llvm/bindings/ocaml/llvm/llvm_ocaml.c

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2339,36 +2339,3 @@ value llvm_memorybuffer_dispose(LLVMMemoryBufferRef MemBuf) {
23392339
LLVMDisposeMemoryBuffer(MemBuf);
23402340
return Val_unit;
23412341
}
2342-
2343-
/*===-- Pass Managers -----------------------------------------------------===*/
2344-
2345-
/* unit -> [ `Module ] PassManager.t */
2346-
LLVMPassManagerRef llvm_passmanager_create(value Unit) {
2347-
return LLVMCreatePassManager();
2348-
}
2349-
2350-
/* llmodule -> [ `Function ] PassManager.t -> bool */
2351-
value llvm_passmanager_run_module(LLVMModuleRef M, LLVMPassManagerRef PM) {
2352-
return Val_bool(LLVMRunPassManager(PM, M));
2353-
}
2354-
2355-
/* [ `Function ] PassManager.t -> bool */
2356-
value llvm_passmanager_initialize(LLVMPassManagerRef FPM) {
2357-
return Val_bool(LLVMInitializeFunctionPassManager(FPM));
2358-
}
2359-
2360-
/* llvalue -> [ `Function ] PassManager.t -> bool */
2361-
value llvm_passmanager_run_function(LLVMValueRef F, LLVMPassManagerRef FPM) {
2362-
return Val_bool(LLVMRunFunctionPassManager(FPM, F));
2363-
}
2364-
2365-
/* [ `Function ] PassManager.t -> bool */
2366-
value llvm_passmanager_finalize(LLVMPassManagerRef FPM) {
2367-
return Val_bool(LLVMFinalizeFunctionPassManager(FPM));
2368-
}
2369-
2370-
/* PassManager.any PassManager.t -> unit */
2371-
value llvm_passmanager_dispose(LLVMPassManagerRef PM) {
2372-
LLVMDisposePassManager(PM);
2373-
return Val_unit;
2374-
}

llvm/bindings/ocaml/target/llvm_target.ml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,6 @@ module TargetMachine = struct
122122
= "llvm_targetmachine_features"
123123
external data_layout : t -> DataLayout.t
124124
= "llvm_targetmachine_data_layout"
125-
external add_analysis_passes : [< Llvm.PassManager.any ] Llvm.PassManager.t -> t -> unit
126-
= "llvm_targetmachine_add_analysis_passes"
127125
external set_verbose_asm : bool -> t -> unit
128126
= "llvm_targetmachine_set_verbose_asm"
129127
external emit_to_file : Llvm.llmodule -> CodeGenFileType.t -> string ->

llvm/bindings/ocaml/target/llvm_target.mli

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,6 @@ module TargetMachine : sig
200200
[llvm::TargetMachine::getFeatureString]. *)
201201
val features : t -> string
202202

203-
(** Adds the target-specific analysis passes to the pass manager.
204-
See [llvm::TargetMachine::addAnalysisPasses]. *)
205-
val add_analysis_passes : [< Llvm.PassManager.any ] Llvm.PassManager.t -> t -> unit
206-
207203
(** Sets the assembly verbosity of this target machine.
208204
See [llvm::TargetMachine::setAsmVerbosity]. *)
209205
val set_verbose_asm : bool -> t -> unit

llvm/bindings/ocaml/target/target_ocaml.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -327,10 +327,3 @@ llvm_targetmachine_emit_to_memory_buffer(LLVMModuleRef Module, value FileType,
327327

328328
return Buffer;
329329
}
330-
331-
/* TargetMachine.t -> Llvm.PassManager.t -> unit */
332-
value llvm_targetmachine_add_analysis_passes(LLVMPassManagerRef PM,
333-
value Machine) {
334-
LLVMAddAnalysisPasses(TargetMachine_val(Machine), PM);
335-
return Val_unit;
336-
}
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
1-
add_subdirectory(ipo)
2-
add_subdirectory(passmgr_builder)
3-
add_subdirectory(scalar_opts)
41
add_subdirectory(utils)
5-
add_subdirectory(vectorize)
2+

llvm/bindings/ocaml/transforms/ipo/CMakeLists.txt

Lines changed: 0 additions & 5 deletions
This file was deleted.

llvm/bindings/ocaml/transforms/ipo/ipo_ocaml.c

Lines changed: 0 additions & 50 deletions
This file was deleted.

llvm/bindings/ocaml/transforms/ipo/llvm_ipo.ml

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)