[LLVM-C][OCaml] Add LowerAtomic pass to C and OCaml APIs

Summary:
Adds LLVMAddLowerAtomicPass to expose createLowerAtomicPass in the C
and OCaml APIs.

Reviewers: whitequark, deadalnix

Reviewed By: whitequark

Subscribers: jfb, llvm-commits

Differential Revision: https://reviews.llvm.org/D52211

llvm-svn: 342475
This commit is contained in:
whitequark 2018-09-18 13:35:50 +00:00
parent 1598b84403
commit 0d2f668e5a
5 changed files with 21 additions and 0 deletions

View File

@ -64,6 +64,9 @@ external add_memcpy_opt
external add_partially_inline_lib_calls
: [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
= "llvm_add_partially_inline_lib_calls"
external add_lower_atomic
: [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
= "llvm_add_lower_atomic"
external add_lower_switch
: [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
= "llvm_add_lower_switch"

View File

@ -107,6 +107,11 @@ external add_partially_inline_lib_calls
: [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
= "llvm_add_partially_inline_lib_calls"
(** See the [llvm::createLowerAtomicPass] function. *)
external add_lower_atomic
: [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
= "llvm_add_lower_atomic"
(** See the [llvm::createLowerSwitchPass] function. *)
external add_lower_switch
: [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit

View File

@ -134,6 +134,12 @@ CAMLprim value llvm_add_partially_inline_lib_calls(LLVMPassManagerRef PM) {
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_lower_atomic(LLVMPassManagerRef PM) {
LLVMAddLowerAtomicPass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_lower_switch(LLVMPassManagerRef PM) {
LLVMAddLowerSwitchPass(PM);

View File

@ -92,6 +92,9 @@ void LLVMAddLoopUnrollAndJamPass(LLVMPassManagerRef PM);
/** See llvm::createLoopUnswitchPass function. */
void LLVMAddLoopUnswitchPass(LLVMPassManagerRef PM);
/** See llvm::createLowerAtomicPass function. */
void LLVMAddLowerAtomicPass(LLVMPassManagerRef PM);
/** See llvm::createMemCpyOptPass function. */
void LLVMAddMemCpyOptPass(LLVMPassManagerRef PM);

View File

@ -194,6 +194,10 @@ void LLVMAddLoopUnswitchPass(LLVMPassManagerRef PM) {
unwrap(PM)->add(createLoopUnswitchPass());
}
void LLVMAddLowerAtomicPass(LLVMPassManagerRef PM) {
unwrap(PM)->add(createLowerAtomicPass());
}
void LLVMAddMemCpyOptPass(LLVMPassManagerRef PM) {
unwrap(PM)->add(createMemCpyOptPass());
}