[sledge][llvm] Remove vestigial CAMLprim declarations

Summary:
The CAMLprim macro has not been needed since OCaml 3.11, and is
defined to the empty string. This diff removes all instances of it.

Upstream Differential Revision: https://reviews.llvm.org/D99476

Reviewed By: ngorogiannis

Differential Revision: D27564877

fbshipit-source-id: 14745646b
master
Josh Berdine 4 years ago committed by Facebook GitHub Bot
parent 5ef9245ea5
commit 83421103cf

@ -22,7 +22,7 @@
#include "caml/custom.h"
/* unit -> unit */
CAMLprim value llvm_initialize_all(value Unit) {
value llvm_initialize_all(value Unit) {
LLVMInitializeAllTargetInfos();
LLVMInitializeAllTargets();
LLVMInitializeAllTargetMCs();

@ -23,7 +23,7 @@
#include "llvm_ocaml.h"
/* Llvm.llmodule -> string option */
CAMLprim value llvm_verify_module(LLVMModuleRef M) {
value llvm_verify_module(LLVMModuleRef M) {
CAMLparam0();
CAMLlocal2(String, Option);
@ -43,30 +43,30 @@ CAMLprim value llvm_verify_module(LLVMModuleRef M) {
}
/* Llvm.llvalue -> bool */
CAMLprim value llvm_verify_function(LLVMValueRef Fn) {
value llvm_verify_function(LLVMValueRef Fn) {
return Val_bool(LLVMVerifyFunction(Fn, LLVMReturnStatusAction) == 0);
}
/* Llvm.llmodule -> unit */
CAMLprim value llvm_assert_valid_module(LLVMModuleRef M) {
value llvm_assert_valid_module(LLVMModuleRef M) {
LLVMVerifyModule(M, LLVMAbortProcessAction, 0);
return Val_unit;
}
/* Llvm.llvalue -> unit */
CAMLprim value llvm_assert_valid_function(LLVMValueRef Fn) {
value llvm_assert_valid_function(LLVMValueRef Fn) {
LLVMVerifyFunction(Fn, LLVMAbortProcessAction);
return Val_unit;
}
/* Llvm.llvalue -> unit */
CAMLprim value llvm_view_function_cfg(LLVMValueRef Fn) {
value llvm_view_function_cfg(LLVMValueRef Fn) {
LLVMViewFunctionCFG(Fn);
return Val_unit;
}
/* Llvm.llvalue -> unit */
CAMLprim value llvm_view_function_cfg_only(LLVMValueRef Fn) {
value llvm_view_function_cfg_only(LLVMValueRef Fn) {
LLVMViewFunctionCFGOnly(Fn);
return Val_unit;
}

@ -26,7 +26,7 @@
*/
#define INITIALIZER1(target) \
CAMLprim value llvm_initialize_ ## target(value Unit) { \
value llvm_initialize_ ## target(value Unit) { \
LLVMInitialize ## target ## TargetInfo(); \
LLVMInitialize ## target ## Target(); \
LLVMInitialize ## target ## TargetMC(); \

@ -22,7 +22,7 @@
void llvm_raise(value Prototype, char *Message);
/* Llvm.llcontext -> Llvm.llmemorybuffer -> Llvm.llmodule */
CAMLprim LLVMModuleRef llvm_get_module(LLVMContextRef C, LLVMMemoryBufferRef MemBuf) {
LLVMModuleRef llvm_get_module(LLVMContextRef C, LLVMMemoryBufferRef MemBuf) {
LLVMModuleRef M;
if (LLVMGetBitcodeModuleInContext2(C, MemBuf, &M))
@ -32,7 +32,7 @@ CAMLprim LLVMModuleRef llvm_get_module(LLVMContextRef C, LLVMMemoryBufferRef Mem
}
/* Llvm.llcontext -> Llvm.llmemorybuffer -> Llvm.llmodule */
CAMLprim LLVMModuleRef llvm_parse_bitcode(LLVMContextRef C, LLVMMemoryBufferRef MemBuf) {
LLVMModuleRef llvm_parse_bitcode(LLVMContextRef C, LLVMMemoryBufferRef MemBuf) {
LLVMModuleRef M;
if (LLVMParseBitcodeInContext2(C, MemBuf, &M))

@ -22,13 +22,13 @@
#include "caml/memory.h"
/* Llvm.llmodule -> string -> bool */
CAMLprim value llvm_write_bitcode_file(LLVMModuleRef M, value Path) {
value llvm_write_bitcode_file(LLVMModuleRef M, value Path) {
int Result = LLVMWriteBitcodeToFile(M, String_val(Path));
return Val_bool(Result == 0);
}
/* ?unbuffered:bool -> Llvm.llmodule -> Unix.file_descr -> bool */
CAMLprim value llvm_write_bitcode_to_fd(value U, LLVMModuleRef M, value FD) {
value llvm_write_bitcode_to_fd(value U, LLVMModuleRef M, value FD) {
int Unbuffered;
int Result;
@ -43,6 +43,6 @@ CAMLprim value llvm_write_bitcode_to_fd(value U, LLVMModuleRef M, value FD) {
}
/* Llvm.llmodule -> Llvm.llmemorybuffer */
CAMLprim LLVMMemoryBufferRef llvm_write_bitcode_to_memory_buffer(LLVMModuleRef M) {
LLVMMemoryBufferRef llvm_write_bitcode_to_memory_buffer(LLVMModuleRef M) {
return LLVMWriteBitcodeToMemoryBuffer(M);
}

@ -139,11 +139,11 @@ static LLVMDIFlags map_DIFlag(LLVMDIFlag_i DIF) {
}
}
CAMLprim value llvm_debug_metadata_version(value Unit) {
value llvm_debug_metadata_version(value Unit) {
return Val_int(LLVMDebugMetadataVersion());
}
CAMLprim value llvm_get_module_debug_metadata_version(LLVMModuleRef Module) {
value llvm_get_module_debug_metadata_version(LLVMModuleRef Module) {
return Val_int(LLVMGetModuleDebugMetadataVersion(Module));
}
@ -161,17 +161,17 @@ static value alloc_diflags(LLVMDIFlags Flags) {
return V;
}
CAMLprim LLVMDIFlags llvm_diflags_get(value i_Flag) {
LLVMDIFlags llvm_diflags_get(value i_Flag) {
LLVMDIFlags Flags = map_DIFlag(Int_val(i_Flag));
return alloc_diflags(Flags);
}
CAMLprim LLVMDIFlags llvm_diflags_set(value Flags, value i_Flag) {
LLVMDIFlags llvm_diflags_set(value Flags, value i_Flag) {
LLVMDIFlags FlagsNew = DIFlags_val(Flags) | map_DIFlag(Int_val(i_Flag));
return alloc_diflags(FlagsNew);
}
CAMLprim value llvm_diflags_test(value Flags, value i_Flag) {
value llvm_diflags_test(value Flags, value i_Flag) {
LLVMDIFlags Flag = map_DIFlag(Int_val(i_Flag));
return Val_bool((DIFlags_val(Flags) & Flag) == Flag);
}
@ -196,16 +196,16 @@ static value alloc_dibuilder(LLVMDIBuilderRef B) {
}
/* llmodule -> lldibuilder */
CAMLprim value llvm_dibuilder(LLVMModuleRef M) {
value llvm_dibuilder(LLVMModuleRef M) {
return alloc_dibuilder(LLVMCreateDIBuilder(M));
}
CAMLprim value llvm_dibuild_finalize(value Builder) {
value llvm_dibuild_finalize(value Builder) {
LLVMDIBuilderFinalize(DIBuilder_val(Builder));
return Val_unit;
}
CAMLprim LLVMMetadataRef llvm_dibuild_create_compile_unit_native(
LLVMMetadataRef llvm_dibuild_create_compile_unit_native(
value Builder, value Lang, LLVMMetadataRef FileRef, value Producer,
value IsOptimized, value Flags, value RuntimeVer, value SplitName,
value Kind, value DWOId, value SplitDebugInline,
@ -218,7 +218,7 @@ CAMLprim LLVMMetadataRef llvm_dibuild_create_compile_unit_native(
Bool_val(SplitDebugInline), Bool_val(DebugInfoForProfiling));
}
CAMLprim LLVMMetadataRef llvm_dibuild_create_compile_unit_bytecode(value *argv,
LLVMMetadataRef llvm_dibuild_create_compile_unit_bytecode(value *argv,
int argn) {
return llvm_dibuild_create_compile_unit_native(
argv[0], // Builder
@ -238,7 +238,7 @@ CAMLprim LLVMMetadataRef llvm_dibuild_create_compile_unit_bytecode(value *argv,
);
}
CAMLprim LLVMMetadataRef llvm_dibuild_create_file(value Builder, value Filename,
LLVMMetadataRef llvm_dibuild_create_file(value Builder, value Filename,
value Directory) {
return LLVMDIBuilderCreateFile(DIBuilder_val(Builder), String_val(Filename),
caml_string_length(Filename),
@ -246,7 +246,7 @@ CAMLprim LLVMMetadataRef llvm_dibuild_create_file(value Builder, value Filename,
caml_string_length(Directory));
}
CAMLprim LLVMMetadataRef llvm_dibuild_create_module_native(
LLVMMetadataRef llvm_dibuild_create_module_native(
value Builder, LLVMMetadataRef ParentScope, value Name, value ConfigMacros,
value IncludePath, value SysRoot) {
return LLVMDIBuilderCreateModule(
@ -257,7 +257,7 @@ CAMLprim LLVMMetadataRef llvm_dibuild_create_module_native(
caml_string_length(SysRoot));
}
CAMLprim LLVMMetadataRef llvm_dibuild_create_module_bytecode(value *argv,
LLVMMetadataRef llvm_dibuild_create_module_bytecode(value *argv,
int argn) {
return llvm_dibuild_create_module_native(
argv[0], // Builder
@ -269,7 +269,7 @@ CAMLprim LLVMMetadataRef llvm_dibuild_create_module_bytecode(value *argv,
);
}
CAMLprim LLVMMetadataRef
LLVMMetadataRef
llvm_dibuild_create_namespace(value Builder, LLVMMetadataRef ParentScope,
value Name, value ExportSymbols) {
return LLVMDIBuilderCreateNameSpace(
@ -277,7 +277,7 @@ llvm_dibuild_create_namespace(value Builder, LLVMMetadataRef ParentScope,
caml_string_length(Name), Bool_val(ExportSymbols));
}
CAMLprim LLVMMetadataRef llvm_dibuild_create_function_native(
LLVMMetadataRef llvm_dibuild_create_function_native(
value Builder, LLVMMetadataRef Scope, value Name, value LinkageName,
LLVMMetadataRef File, value LineNo, LLVMMetadataRef Ty, value IsLocalToUnit,
value IsDefinition, value ScopeLine, value Flags, value IsOptimized) {
@ -288,7 +288,7 @@ CAMLprim LLVMMetadataRef llvm_dibuild_create_function_native(
Int_val(ScopeLine), DIFlags_val(Flags), Bool_val(IsOptimized));
}
CAMLprim LLVMMetadataRef llvm_dibuild_create_function_bytecode(value *argv,
LLVMMetadataRef llvm_dibuild_create_function_bytecode(value *argv,
int argn) {
return llvm_dibuild_create_function_native(argv[0], // Builder,
(LLVMMetadataRef)argv[1], // Scope
@ -305,61 +305,61 @@ CAMLprim LLVMMetadataRef llvm_dibuild_create_function_bytecode(value *argv,
);
}
CAMLprim LLVMMetadataRef llvm_dibuild_create_lexical_block(
LLVMMetadataRef llvm_dibuild_create_lexical_block(
value Builder, LLVMMetadataRef Scope, LLVMMetadataRef File, value Line,
value Column) {
return LLVMDIBuilderCreateLexicalBlock(DIBuilder_val(Builder), Scope, File,
Int_val(Line), Int_val(Column));
}
CAMLprim LLVMMetadataRef llvm_metadata_null() { return (LLVMMetadataRef)NULL; }
LLVMMetadataRef llvm_metadata_null() { return (LLVMMetadataRef)NULL; }
CAMLprim LLVMMetadataRef llvm_dibuild_create_debug_location(
LLVMMetadataRef llvm_dibuild_create_debug_location(
LLVMContextRef Ctx, value Line, value Column, LLVMMetadataRef Scope,
LLVMMetadataRef InlinedAt) {
return LLVMDIBuilderCreateDebugLocation(Ctx, Int_val(Line), Int_val(Column),
Scope, InlinedAt);
}
CAMLprim value llvm_di_location_get_line(LLVMMetadataRef Location) {
value llvm_di_location_get_line(LLVMMetadataRef Location) {
return Val_int(LLVMDILocationGetLine(Location));
}
CAMLprim value llvm_di_location_get_column(LLVMMetadataRef Location) {
value llvm_di_location_get_column(LLVMMetadataRef Location) {
return Val_int(LLVMDILocationGetColumn(Location));
}
CAMLprim LLVMMetadataRef llvm_di_location_get_scope(LLVMMetadataRef Location) {
LLVMMetadataRef llvm_di_location_get_scope(LLVMMetadataRef Location) {
return LLVMDILocationGetScope(Location);
}
CAMLprim value llvm_di_location_get_inlined_at(LLVMMetadataRef Location) {
value llvm_di_location_get_inlined_at(LLVMMetadataRef Location) {
return (ptr_to_option(LLVMDILocationGetInlinedAt(Location)));
}
CAMLprim value llvm_di_scope_get_file(LLVMMetadataRef Scope) {
value llvm_di_scope_get_file(LLVMMetadataRef Scope) {
return (ptr_to_option(LLVMDIScopeGetFile(Scope)));
}
CAMLprim value llvm_di_file_get_directory(LLVMMetadataRef File) {
value llvm_di_file_get_directory(LLVMMetadataRef File) {
unsigned Len;
const char *Directory = LLVMDIFileGetDirectory(File, &Len);
return cstr_to_string(Directory, Len);
}
CAMLprim value llvm_di_file_get_filename(LLVMMetadataRef File) {
value llvm_di_file_get_filename(LLVMMetadataRef File) {
unsigned Len;
const char *Filename = LLVMDIFileGetFilename(File, &Len);
return cstr_to_string(Filename, Len);
}
CAMLprim value llvm_di_file_get_source(LLVMMetadataRef File) {
value llvm_di_file_get_source(LLVMMetadataRef File) {
unsigned Len;
const char *Source = LLVMDIFileGetSource(File, &Len);
return cstr_to_string(Source, Len);
}
CAMLprim LLVMMetadataRef llvm_dibuild_get_or_create_type_array(value Builder,
LLVMMetadataRef llvm_dibuild_get_or_create_type_array(value Builder,
value Data) {
return LLVMDIBuilderGetOrCreateTypeArray(DIBuilder_val(Builder),
@ -367,7 +367,7 @@ CAMLprim LLVMMetadataRef llvm_dibuild_get_or_create_type_array(value Builder,
Wosize_val(Data));
}
CAMLprim LLVMMetadataRef llvm_dibuild_get_or_create_array(value Builder,
LLVMMetadataRef llvm_dibuild_get_or_create_array(value Builder,
value Data) {
return LLVMDIBuilderGetOrCreateArray(DIBuilder_val(Builder),
@ -375,7 +375,7 @@ CAMLprim LLVMMetadataRef llvm_dibuild_get_or_create_array(value Builder,
Wosize_val(Data));
}
CAMLprim LLVMMetadataRef llvm_dibuild_create_subroutine_type(
LLVMMetadataRef llvm_dibuild_create_subroutine_type(
value Builder, LLVMMetadataRef File, value ParameterTypes, value Flags) {
return LLVMDIBuilderCreateSubroutineType(
@ -383,7 +383,7 @@ CAMLprim LLVMMetadataRef llvm_dibuild_create_subroutine_type(
Wosize_val(ParameterTypes), DIFlags_val(Flags));
}
CAMLprim LLVMMetadataRef llvm_dibuild_create_enumerator(value Builder,
LLVMMetadataRef llvm_dibuild_create_enumerator(value Builder,
value Name, value Value,
value IsUnsigned) {
return LLVMDIBuilderCreateEnumerator(
@ -391,7 +391,7 @@ CAMLprim LLVMMetadataRef llvm_dibuild_create_enumerator(value Builder,
(int64_t)Int_val(Value), Bool_val(IsUnsigned));
}
CAMLprim LLVMMetadataRef llvm_dibuild_create_enumeration_type_native(
LLVMMetadataRef llvm_dibuild_create_enumeration_type_native(
value Builder, LLVMMetadataRef Scope, value Name, LLVMMetadataRef File,
value LineNumber, value SizeInBits, value AlignInBits, value Elements,
LLVMMetadataRef ClassTy) {
@ -402,7 +402,7 @@ CAMLprim LLVMMetadataRef llvm_dibuild_create_enumeration_type_native(
Wosize_val(Elements), ClassTy);
}
CAMLprim LLVMMetadataRef
LLVMMetadataRef
llvm_dibuild_create_enumeration_type_bytecode(value *argv, int argn) {
return llvm_dibuild_create_enumeration_type_native(
argv[0], // Builder
@ -417,7 +417,7 @@ llvm_dibuild_create_enumeration_type_bytecode(value *argv, int argn) {
);
}
CAMLprim LLVMMetadataRef llvm_dibuild_create_union_type_native(
LLVMMetadataRef llvm_dibuild_create_union_type_native(
value Builder, LLVMMetadataRef Scope, value Name, LLVMMetadataRef File,
value LineNumber, value SizeInBits, value AlignInBits, value Flags,
value Elements, value RunTimeLanguage, value UniqueId) {
@ -431,7 +431,7 @@ CAMLprim LLVMMetadataRef llvm_dibuild_create_union_type_native(
caml_string_length(UniqueId));
}
CAMLprim LLVMMetadataRef llvm_dibuild_create_union_type_bytecode(value *argv,
LLVMMetadataRef llvm_dibuild_create_union_type_bytecode(value *argv,
int argn) {
return llvm_dibuild_create_union_type_native(
argv[0], // Builder
@ -448,7 +448,7 @@ CAMLprim LLVMMetadataRef llvm_dibuild_create_union_type_bytecode(value *argv,
);
}
CAMLprim LLVMMetadataRef llvm_dibuild_create_array_type(value Builder,
LLVMMetadataRef llvm_dibuild_create_array_type(value Builder,
value Size,
value AlignInBits,
LLVMMetadataRef Ty,
@ -458,7 +458,7 @@ CAMLprim LLVMMetadataRef llvm_dibuild_create_array_type(value Builder,
(LLVMMetadataRef *)Op_val(Subscripts), Wosize_val(Subscripts));
}
CAMLprim LLVMMetadataRef llvm_dibuild_create_vector_type(value Builder,
LLVMMetadataRef llvm_dibuild_create_vector_type(value Builder,
value Size,
value AlignInBits,
LLVMMetadataRef Ty,
@ -468,13 +468,13 @@ CAMLprim LLVMMetadataRef llvm_dibuild_create_vector_type(value Builder,
(LLVMMetadataRef *)Op_val(Subscripts), Wosize_val(Subscripts));
}
CAMLprim LLVMMetadataRef llvm_dibuild_create_unspecified_type(value Builder,
LLVMMetadataRef llvm_dibuild_create_unspecified_type(value Builder,
value Name) {
return LLVMDIBuilderCreateUnspecifiedType(
DIBuilder_val(Builder), String_val(Name), caml_string_length(Name));
}
CAMLprim LLVMMetadataRef llvm_dibuild_create_basic_type(
LLVMMetadataRef llvm_dibuild_create_basic_type(
value Builder, value Name, value SizeInBits, value Encoding, value Flags) {
return LLVMDIBuilderCreateBasicType(
@ -482,7 +482,7 @@ CAMLprim LLVMMetadataRef llvm_dibuild_create_basic_type(
(uint64_t)Int_val(SizeInBits), Int_val(Encoding), DIFlags_val(Flags));
}
CAMLprim LLVMMetadataRef llvm_dibuild_create_pointer_type_native(
LLVMMetadataRef llvm_dibuild_create_pointer_type_native(
value Builder, LLVMMetadataRef PointeeTy, value SizeInBits,
value AlignInBits, value AddressSpace, value Name) {
return LLVMDIBuilderCreatePointerType(
@ -491,7 +491,7 @@ CAMLprim LLVMMetadataRef llvm_dibuild_create_pointer_type_native(
caml_string_length(Name));
}
CAMLprim LLVMMetadataRef llvm_dibuild_create_pointer_type_bytecode(value *argv,
LLVMMetadataRef llvm_dibuild_create_pointer_type_bytecode(value *argv,
int argn) {
return llvm_dibuild_create_pointer_type_native(
argv[0], // Builder
@ -503,7 +503,7 @@ CAMLprim LLVMMetadataRef llvm_dibuild_create_pointer_type_bytecode(value *argv,
);
}
CAMLprim LLVMMetadataRef llvm_dibuild_create_struct_type_native(
LLVMMetadataRef llvm_dibuild_create_struct_type_native(
value Builder, LLVMMetadataRef Scope, value Name, LLVMMetadataRef File,
value LineNumber, value SizeInBits, value AlignInBits, value Flags,
LLVMMetadataRef DerivedFrom, value Elements, value RunTimeLanguage,
@ -518,7 +518,7 @@ CAMLprim LLVMMetadataRef llvm_dibuild_create_struct_type_native(
caml_string_length(UniqueId));
}
CAMLprim LLVMMetadataRef llvm_dibuild_create_struct_type_bytecode(value *argv,
LLVMMetadataRef llvm_dibuild_create_struct_type_bytecode(value *argv,
int argn) {
return llvm_dibuild_create_struct_type_native(
argv[0], // Builder
@ -537,7 +537,7 @@ CAMLprim LLVMMetadataRef llvm_dibuild_create_struct_type_bytecode(value *argv,
);
}
CAMLprim LLVMMetadataRef llvm_dibuild_create_member_type_native(
LLVMMetadataRef llvm_dibuild_create_member_type_native(
value Builder, LLVMMetadataRef Scope, value Name, LLVMMetadataRef File,
value LineNumber, value SizeInBits, value AlignInBits, value OffsetInBits,
value Flags, LLVMMetadataRef Ty) {
@ -549,7 +549,7 @@ CAMLprim LLVMMetadataRef llvm_dibuild_create_member_type_native(
Ty);
}
CAMLprim LLVMMetadataRef llvm_dibuild_create_member_type_bytecode(value *argv,
LLVMMetadataRef llvm_dibuild_create_member_type_bytecode(value *argv,
int argn) {
return llvm_dibuild_create_member_type_native(
argv[0], // Builder
@ -565,7 +565,7 @@ CAMLprim LLVMMetadataRef llvm_dibuild_create_member_type_bytecode(value *argv,
);
}
CAMLprim LLVMMetadataRef llvm_dibuild_create_static_member_type_native(
LLVMMetadataRef llvm_dibuild_create_static_member_type_native(
value Builder, LLVMMetadataRef Scope, value Name, LLVMMetadataRef File,
value LineNumber, LLVMMetadataRef Type, value Flags,
LLVMValueRef ConstantVal, value AlignInBits) {
@ -576,7 +576,7 @@ CAMLprim LLVMMetadataRef llvm_dibuild_create_static_member_type_native(
Int_val(AlignInBits));
}
CAMLprim LLVMMetadataRef
LLVMMetadataRef
llvm_dibuild_create_static_member_type_bytecode(value *argv, int argn) {
return llvm_dibuild_create_static_member_type_native(
argv[0], // Builder
@ -591,7 +591,7 @@ llvm_dibuild_create_static_member_type_bytecode(value *argv, int argn) {
);
}
CAMLprim LLVMMetadataRef llvm_dibuild_create_member_pointer_type_native(
LLVMMetadataRef llvm_dibuild_create_member_pointer_type_native(
value Builder, LLVMMetadataRef PointeeType, LLVMMetadataRef ClassType,
uint64_t SizeInBits, uint32_t AlignInBits, LLVMDIFlags Flags) {
@ -600,7 +600,7 @@ CAMLprim LLVMMetadataRef llvm_dibuild_create_member_pointer_type_native(
(uint64_t)Int_val(SizeInBits), Int_val(AlignInBits), Flags);
}
CAMLprim LLVMMetadataRef
LLVMMetadataRef
llvm_dibuild_create_member_pointer_type_bytecode(value *argv, int argn) {
return llvm_dibuild_create_member_pointer_type_native(
argv[0], // Builder
@ -612,31 +612,31 @@ llvm_dibuild_create_member_pointer_type_bytecode(value *argv, int argn) {
);
}
CAMLprim LLVMMetadataRef
LLVMMetadataRef
llvm_dibuild_create_object_pointer_type(value Builder, LLVMMetadataRef Type) {
return LLVMDIBuilderCreateObjectPointerType(DIBuilder_val(Builder), Type);
}
CAMLprim LLVMMetadataRef llvm_dibuild_create_qualified_type(
LLVMMetadataRef llvm_dibuild_create_qualified_type(
value Builder, value Tag, LLVMMetadataRef Type) {
return LLVMDIBuilderCreateQualifiedType(DIBuilder_val(Builder), Int_val(Tag),
Type);
}
CAMLprim LLVMMetadataRef llvm_dibuild_create_reference_type(
LLVMMetadataRef llvm_dibuild_create_reference_type(
value Builder, value Tag, LLVMMetadataRef Type) {
return LLVMDIBuilderCreateReferenceType(DIBuilder_val(Builder), Int_val(Tag),
Type);
}
CAMLprim LLVMMetadataRef llvm_dibuild_create_null_ptr_type(value Builder) {
LLVMMetadataRef llvm_dibuild_create_null_ptr_type(value Builder) {
return LLVMDIBuilderCreateNullPtrType(DIBuilder_val(Builder));
}
CAMLprim LLVMMetadataRef llvm_dibuild_create_typedef_native(
LLVMMetadataRef llvm_dibuild_create_typedef_native(
value Builder, LLVMMetadataRef Type, value Name, LLVMMetadataRef File,
value LineNo, LLVMMetadataRef Scope, value AlignInBits) {
@ -645,7 +645,7 @@ CAMLprim LLVMMetadataRef llvm_dibuild_create_typedef_native(
File, Int_val(LineNo), Scope, Int_val(AlignInBits));
}
CAMLprim LLVMMetadataRef llvm_dibuild_create_typedef_bytecode(value *argv,
LLVMMetadataRef llvm_dibuild_create_typedef_bytecode(value *argv,
int argn) {
return llvm_dibuild_create_typedef_native(argv[0], // Builder
@ -658,7 +658,7 @@ CAMLprim LLVMMetadataRef llvm_dibuild_create_typedef_bytecode(value *argv,
);
}
CAMLprim LLVMMetadataRef llvm_dibuild_create_inheritance_native(
LLVMMetadataRef llvm_dibuild_create_inheritance_native(
value Builder, LLVMMetadataRef Ty, LLVMMetadataRef BaseTy, value BaseOffset,
value VBPtrOffset, value Flags) {
@ -667,7 +667,7 @@ CAMLprim LLVMMetadataRef llvm_dibuild_create_inheritance_native(
Int_val(VBPtrOffset), Flags);
}
CAMLprim LLVMMetadataRef llvm_dibuild_create_inheritance_bytecode(value *argv,
LLVMMetadataRef llvm_dibuild_create_inheritance_bytecode(value *argv,
int arg) {
return llvm_dibuild_create_inheritance_native(
@ -680,7 +680,7 @@ CAMLprim LLVMMetadataRef llvm_dibuild_create_inheritance_bytecode(value *argv,
);
}
CAMLprim LLVMMetadataRef llvm_dibuild_create_forward_decl_native(
LLVMMetadataRef llvm_dibuild_create_forward_decl_native(
value Builder, value Tag, value Name, LLVMMetadataRef Scope,
LLVMMetadataRef File, value Line, value RuntimeLang, value SizeInBits,
value AlignInBits, value UniqueIdentifier) {
@ -691,7 +691,7 @@ CAMLprim LLVMMetadataRef llvm_dibuild_create_forward_decl_native(
String_val(UniqueIdentifier), caml_string_length(UniqueIdentifier));
}
CAMLprim LLVMMetadataRef llvm_dibuild_create_forward_decl_bytecode(value *argv,
LLVMMetadataRef llvm_dibuild_create_forward_decl_bytecode(value *argv,
int arg) {
return llvm_dibuild_create_forward_decl_native(
@ -708,7 +708,7 @@ CAMLprim LLVMMetadataRef llvm_dibuild_create_forward_decl_bytecode(value *argv,
);
}
CAMLprim LLVMMetadataRef llvm_dibuild_create_replaceable_composite_type_native(
LLVMMetadataRef llvm_dibuild_create_replaceable_composite_type_native(
value Builder, value Tag, value Name, LLVMMetadataRef Scope,
LLVMMetadataRef File, value Line, value RuntimeLang, value SizeInBits,
value AlignInBits, value Flags, value UniqueIdentifier) {
@ -721,7 +721,7 @@ CAMLprim LLVMMetadataRef llvm_dibuild_create_replaceable_composite_type_native(
caml_string_length(UniqueIdentifier));
}
CAMLprim LLVMMetadataRef
LLVMMetadataRef
llvm_dibuild_create_replaceable_composite_type_bytecode(value *argv, int arg) {
return llvm_dibuild_create_replaceable_composite_type_native(
@ -739,7 +739,7 @@ llvm_dibuild_create_replaceable_composite_type_bytecode(value *argv, int arg) {
);
}
CAMLprim LLVMMetadataRef llvm_dibuild_create_bit_field_member_type_native(
LLVMMetadataRef llvm_dibuild_create_bit_field_member_type_native(
value Builder, LLVMMetadataRef Scope, value Name, LLVMMetadataRef File,
value LineNum, value SizeInBits, value OffsetInBits,
value StorageOffsetInBits, value Flags, LLVMMetadataRef Ty) {
@ -751,7 +751,7 @@ CAMLprim LLVMMetadataRef llvm_dibuild_create_bit_field_member_type_native(
DIFlags_val(Flags), Ty);
}
CAMLprim LLVMMetadataRef
LLVMMetadataRef
llvm_dibuild_create_bit_field_member_type_bytecode(value *argv, int arg) {
return llvm_dibuild_create_bit_field_member_type_native(
@ -768,7 +768,7 @@ llvm_dibuild_create_bit_field_member_type_bytecode(value *argv, int arg) {
);
}
CAMLprim LLVMMetadataRef llvm_dibuild_create_class_type_native(
LLVMMetadataRef llvm_dibuild_create_class_type_native(
value Builder, LLVMMetadataRef Scope, value Name, LLVMMetadataRef File,
value LineNumber, value SizeInBits, value AlignInBits, value OffsetInBits,
value Flags, LLVMMetadataRef DerivedFrom, value Elements,
@ -784,7 +784,7 @@ CAMLprim LLVMMetadataRef llvm_dibuild_create_class_type_native(
caml_string_length(UniqueIdentifier));
}
CAMLprim LLVMMetadataRef llvm_dibuild_create_class_type_bytecode(value *argv,
LLVMMetadataRef llvm_dibuild_create_class_type_bytecode(value *argv,
int arg) {
return llvm_dibuild_create_class_type_native(
@ -805,72 +805,72 @@ CAMLprim LLVMMetadataRef llvm_dibuild_create_class_type_bytecode(value *argv,
);
}
CAMLprim LLVMMetadataRef
LLVMMetadataRef
llvm_dibuild_create_artificial_type(value Builder, LLVMMetadataRef Type) {
return LLVMDIBuilderCreateArtificialType(DIBuilder_val(Builder), Type);
}
CAMLprim value llvm_di_type_get_name(LLVMMetadataRef DType) {
value llvm_di_type_get_name(LLVMMetadataRef DType) {
size_t Len;
const char *Name = LLVMDITypeGetName(DType, &Len);
return cstr_to_string(Name, Len);
}
CAMLprim value llvm_di_type_get_size_in_bits(LLVMMetadataRef DType) {
value llvm_di_type_get_size_in_bits(LLVMMetadataRef DType) {
uint64_t Size = LLVMDITypeGetSizeInBits(DType);
return Val_int((int)Size);
}
CAMLprim value llvm_di_type_get_offset_in_bits(LLVMMetadataRef DType) {
value llvm_di_type_get_offset_in_bits(LLVMMetadataRef DType) {
uint64_t Size = LLVMDITypeGetOffsetInBits(DType);
return Val_int((int)Size);
}
CAMLprim value llvm_di_type_get_align_in_bits(LLVMMetadataRef DType) {
value llvm_di_type_get_align_in_bits(LLVMMetadataRef DType) {
uint32_t Size = LLVMDITypeGetAlignInBits(DType);
return Val_int(Size);
}
CAMLprim value llvm_di_type_get_line(LLVMMetadataRef DType) {
value llvm_di_type_get_line(LLVMMetadataRef DType) {
unsigned Line = LLVMDITypeGetLine(DType);
return Val_int(Line);
}
CAMLprim value llvm_di_type_get_flags(LLVMMetadataRef DType) {
value llvm_di_type_get_flags(LLVMMetadataRef DType) {
LLVMDIFlags Flags = LLVMDITypeGetLine(DType);
return alloc_diflags(Flags);
}
CAMLprim value llvm_get_subprogram(LLVMValueRef Func) {
value llvm_get_subprogram(LLVMValueRef Func) {
return (ptr_to_option(LLVMGetSubprogram(Func)));
}
CAMLprim value llvm_set_subprogram(LLVMValueRef Func, LLVMMetadataRef SP) {
value llvm_set_subprogram(LLVMValueRef Func, LLVMMetadataRef SP) {
LLVMSetSubprogram(Func, SP);
return Val_unit;
}
CAMLprim value llvm_di_subprogram_get_line(LLVMMetadataRef Subprogram) {
value llvm_di_subprogram_get_line(LLVMMetadataRef Subprogram) {
return Val_int(LLVMDISubprogramGetLine(Subprogram));
}
CAMLprim value llvm_instr_get_debug_loc(LLVMValueRef Inst) {
value llvm_instr_get_debug_loc(LLVMValueRef Inst) {
return (ptr_to_option(LLVMInstructionGetDebugLoc(Inst)));
}
CAMLprim value llvm_instr_set_debug_loc(LLVMValueRef Inst,
value llvm_instr_set_debug_loc(LLVMValueRef Inst,
LLVMMetadataRef Loc) {
LLVMInstructionSetDebugLoc(Inst, Loc);
return Val_unit;
}
CAMLprim LLVMMetadataRef
LLVMMetadataRef
llvm_dibuild_create_constant_value_expression(value Builder, value Value) {
return LLVMDIBuilderCreateConstantValueExpression(DIBuilder_val(Builder),
(int64_t)Int_val(Value));
}
CAMLprim LLVMMetadataRef llvm_dibuild_create_global_variable_expression_native(
LLVMMetadataRef llvm_dibuild_create_global_variable_expression_native(
value Builder, LLVMMetadataRef Scope, value Name, value Linkage,
LLVMMetadataRef File, value Line, LLVMMetadataRef Ty, value LocalToUnit,
LLVMMetadataRef Expr, LLVMMetadataRef Decl, value AlignInBits) {
@ -880,7 +880,7 @@ CAMLprim LLVMMetadataRef llvm_dibuild_create_global_variable_expression_native(
Bool_val(LocalToUnit), Expr, Decl, Int_val(AlignInBits));
}
CAMLprim LLVMMetadataRef
LLVMMetadataRef
llvm_dibuild_create_global_variable_expression_bytecode(value *argv, int arg) {
return llvm_dibuild_create_global_variable_expression_native(
@ -898,19 +898,19 @@ llvm_dibuild_create_global_variable_expression_bytecode(value *argv, int arg) {
);
}
CAMLprim value
value
llvm_di_global_variable_expression_get_variable(LLVMMetadataRef GVE) {
return (ptr_to_option(LLVMDIGlobalVariableExpressionGetVariable(GVE)));
}
CAMLprim value llvm_di_variable_get_line(LLVMMetadataRef Variable) {
value llvm_di_variable_get_line(LLVMMetadataRef Variable) {
return Val_int(LLVMDIVariableGetLine(Variable));
}
CAMLprim value llvm_di_variable_get_file(LLVMMetadataRef Variable) {
value llvm_di_variable_get_file(LLVMMetadataRef Variable) {
return (ptr_to_option(LLVMDIVariableGetFile(Variable)));
}
CAMLprim value llvm_get_metadata_kind(LLVMMetadataRef Metadata) {
value llvm_get_metadata_kind(LLVMMetadataRef Metadata) {
return Val_int(LLVMGetMetadataKind(Metadata));
}

@ -29,7 +29,7 @@
void llvm_raise(value Prototype, char *Message);
/* unit -> bool */
CAMLprim value llvm_ee_initialize(value Unit) {
value llvm_ee_initialize(value Unit) {
LLVMLinkInMCJIT();
return Val_bool(!LLVMInitializeNativeTarget() &&
@ -38,7 +38,7 @@ CAMLprim value llvm_ee_initialize(value Unit) {
}
/* llmodule -> llcompileroption -> ExecutionEngine.t */
CAMLprim LLVMExecutionEngineRef llvm_ee_create(value OptRecordOpt, LLVMModuleRef M) {
LLVMExecutionEngineRef llvm_ee_create(value OptRecordOpt, LLVMModuleRef M) {
value OptRecord;
LLVMExecutionEngineRef MCJIT;
char *Error;
@ -61,19 +61,19 @@ CAMLprim LLVMExecutionEngineRef llvm_ee_create(value OptRecordOpt, LLVMModuleRef
}
/* ExecutionEngine.t -> unit */
CAMLprim value llvm_ee_dispose(LLVMExecutionEngineRef EE) {
value llvm_ee_dispose(LLVMExecutionEngineRef EE) {
LLVMDisposeExecutionEngine(EE);
return Val_unit;
}
/* llmodule -> ExecutionEngine.t -> unit */
CAMLprim value llvm_ee_add_module(LLVMModuleRef M, LLVMExecutionEngineRef EE) {
value llvm_ee_add_module(LLVMModuleRef M, LLVMExecutionEngineRef EE) {
LLVMAddModule(EE, M);
return Val_unit;
}
/* llmodule -> ExecutionEngine.t -> llmodule */
CAMLprim value llvm_ee_remove_module(LLVMModuleRef M, LLVMExecutionEngineRef EE) {
value llvm_ee_remove_module(LLVMModuleRef M, LLVMExecutionEngineRef EE) {
LLVMModuleRef RemovedModule;
char *Error;
if (LLVMRemoveModule(EE, M, &RemovedModule, &Error))
@ -82,13 +82,13 @@ CAMLprim value llvm_ee_remove_module(LLVMModuleRef M, LLVMExecutionEngineRef EE)
}
/* ExecutionEngine.t -> unit */
CAMLprim value llvm_ee_run_static_ctors(LLVMExecutionEngineRef EE) {
value llvm_ee_run_static_ctors(LLVMExecutionEngineRef EE) {
LLVMRunStaticConstructors(EE);
return Val_unit;
}
/* ExecutionEngine.t -> unit */
CAMLprim value llvm_ee_run_static_dtors(LLVMExecutionEngineRef EE) {
value llvm_ee_run_static_dtors(LLVMExecutionEngineRef EE) {
LLVMRunStaticDestructors(EE);
return Val_unit;
}
@ -96,7 +96,7 @@ CAMLprim value llvm_ee_run_static_dtors(LLVMExecutionEngineRef EE) {
extern value llvm_alloc_data_layout(LLVMTargetDataRef TargetData);
/* ExecutionEngine.t -> Llvm_target.DataLayout.t */
CAMLprim value llvm_ee_get_data_layout(LLVMExecutionEngineRef EE) {
value llvm_ee_get_data_layout(LLVMExecutionEngineRef EE) {
value DataLayout;
LLVMTargetDataRef OrigDataLayout;
char* TargetDataCStr;
@ -110,18 +110,18 @@ CAMLprim value llvm_ee_get_data_layout(LLVMExecutionEngineRef EE) {
}
/* Llvm.llvalue -> int64 -> llexecutionengine -> unit */
CAMLprim value llvm_ee_add_global_mapping(LLVMValueRef Global, value Ptr,
value llvm_ee_add_global_mapping(LLVMValueRef Global, value Ptr,
LLVMExecutionEngineRef EE) {
LLVMAddGlobalMapping(EE, Global, (void*) (Int64_val(Ptr)));
return Val_unit;
}
CAMLprim value llvm_ee_get_global_value_address(value Name,
value llvm_ee_get_global_value_address(value Name,
LLVMExecutionEngineRef EE) {
return caml_copy_int64((int64_t) LLVMGetGlobalValueAddress(EE, String_val(Name)));
}
CAMLprim value llvm_ee_get_function_address(value Name,
value llvm_ee_get_function_address(value Name,
LLVMExecutionEngineRef EE) {
return caml_copy_int64((int64_t) LLVMGetFunctionAddress(EE, String_val(Name)));
}

@ -21,7 +21,7 @@
void llvm_raise(value Prototype, char *Message);
/* Llvm.llcontext -> Llvm.llmemorybuffer -> Llvm.llmodule */
CAMLprim value llvm_parse_ir(LLVMContextRef C,
value llvm_parse_ir(LLVMContextRef C,
LLVMMemoryBufferRef MemBuf) {
CAMLparam0();
CAMLlocal2(Variant, MessageVal);

@ -25,7 +25,7 @@
void llvm_raise(value Prototype, char *Message);
/* llmodule -> llmodule -> unit */
CAMLprim value llvm_link_modules(LLVMModuleRef Dst, LLVMModuleRef Src) {
value llvm_link_modules(LLVMModuleRef Dst, LLVMModuleRef Src) {
if (LLVMLinkModules2(Dst, Src))
llvm_raise(*caml_named_value("Llvm_linker.Error"), LLVMCreateMessage("Linking failed"));

@ -33,9 +33,9 @@ value caml_alloc_some(value);
#endif
/* Convert a C pointer to an OCaml option */
CAMLprim value ptr_to_option(void *Ptr);
value ptr_to_option(void *Ptr);
/* Convert a C string into an OCaml string */
CAMLprim value cstr_to_string(const char *Str, mlsize_t Len);
value cstr_to_string(const char *Str, mlsize_t Len);
#endif // LLVM_LLVM_OCAML_H

@ -54,12 +54,12 @@ value llvm_alloc_data_layout(LLVMTargetDataRef DataLayout) {
}
/* string -> DataLayout.t */
CAMLprim value llvm_datalayout_of_string(value StringRep) {
value llvm_datalayout_of_string(value StringRep) {
return llvm_alloc_data_layout(LLVMCreateTargetData(String_val(StringRep)));
}
/* DataLayout.t -> string */
CAMLprim value llvm_datalayout_as_string(value TD) {
value llvm_datalayout_as_string(value TD) {
char *StringRep = LLVMCopyStringRepOfTargetData(DataLayout_val(TD));
value Copy = copy_string(StringRep);
LLVMDisposeMessage(StringRep);
@ -67,77 +67,77 @@ CAMLprim value llvm_datalayout_as_string(value TD) {
}
/* DataLayout.t -> Endian.t */
CAMLprim value llvm_datalayout_byte_order(value DL) {
value llvm_datalayout_byte_order(value DL) {
return Val_int(LLVMByteOrder(DataLayout_val(DL)));
}
/* DataLayout.t -> int */
CAMLprim value llvm_datalayout_pointer_size(value DL) {
value llvm_datalayout_pointer_size(value DL) {
return Val_int(LLVMPointerSize(DataLayout_val(DL)));
}
/* Llvm.llcontext -> DataLayout.t -> Llvm.lltype */
CAMLprim LLVMTypeRef llvm_datalayout_intptr_type(LLVMContextRef C, value DL) {
LLVMTypeRef llvm_datalayout_intptr_type(LLVMContextRef C, value DL) {
return LLVMIntPtrTypeInContext(C, DataLayout_val(DL));
}
/* int -> DataLayout.t -> int */
CAMLprim value llvm_datalayout_qualified_pointer_size(value AS, value DL) {
value llvm_datalayout_qualified_pointer_size(value AS, value DL) {
return Val_int(LLVMPointerSizeForAS(DataLayout_val(DL), Int_val(AS)));
}
/* Llvm.llcontext -> int -> DataLayout.t -> Llvm.lltype */
CAMLprim LLVMTypeRef llvm_datalayout_qualified_intptr_type(LLVMContextRef C,
LLVMTypeRef llvm_datalayout_qualified_intptr_type(LLVMContextRef C,
value AS,
value DL) {
return LLVMIntPtrTypeForASInContext(C, DataLayout_val(DL), Int_val(AS));
}
/* Llvm.lltype -> DataLayout.t -> Int64.t */
CAMLprim value llvm_datalayout_size_in_bits(LLVMTypeRef Ty, value DL) {
value llvm_datalayout_size_in_bits(LLVMTypeRef Ty, value DL) {
return caml_copy_int64(LLVMSizeOfTypeInBits(DataLayout_val(DL), Ty));
}
/* Llvm.lltype -> DataLayout.t -> Int64.t */
CAMLprim value llvm_datalayout_store_size(LLVMTypeRef Ty, value DL) {
value llvm_datalayout_store_size(LLVMTypeRef Ty, value DL) {
return caml_copy_int64(LLVMStoreSizeOfType(DataLayout_val(DL), Ty));
}
/* Llvm.lltype -> DataLayout.t -> Int64.t */
CAMLprim value llvm_datalayout_abi_size(LLVMTypeRef Ty, value DL) {
value llvm_datalayout_abi_size(LLVMTypeRef Ty, value DL) {
return caml_copy_int64(LLVMABISizeOfType(DataLayout_val(DL), Ty));
}
/* Llvm.lltype -> DataLayout.t -> int */
CAMLprim value llvm_datalayout_abi_align(LLVMTypeRef Ty, value DL) {
value llvm_datalayout_abi_align(LLVMTypeRef Ty, value DL) {
return Val_int(LLVMABIAlignmentOfType(DataLayout_val(DL), Ty));
}
/* Llvm.lltype -> DataLayout.t -> int */
CAMLprim value llvm_datalayout_stack_align(LLVMTypeRef Ty, value DL) {
value llvm_datalayout_stack_align(LLVMTypeRef Ty, value DL) {
return Val_int(LLVMCallFrameAlignmentOfType(DataLayout_val(DL), Ty));
}
/* Llvm.lltype -> DataLayout.t -> int */
CAMLprim value llvm_datalayout_preferred_align(LLVMTypeRef Ty, value DL) {
value llvm_datalayout_preferred_align(LLVMTypeRef Ty, value DL) {
return Val_int(LLVMPreferredAlignmentOfType(DataLayout_val(DL), Ty));
}
/* Llvm.llvalue -> DataLayout.t -> int */
CAMLprim value llvm_datalayout_preferred_align_of_global(LLVMValueRef GlobalVar,
value llvm_datalayout_preferred_align_of_global(LLVMValueRef GlobalVar,
value DL) {
return Val_int(LLVMPreferredAlignmentOfGlobal(DataLayout_val(DL), GlobalVar));
}
/* Llvm.lltype -> Int64.t -> DataLayout.t -> int */
CAMLprim value llvm_datalayout_element_at_offset(LLVMTypeRef Ty, value Offset,
value llvm_datalayout_element_at_offset(LLVMTypeRef Ty, value Offset,
value DL) {
return Val_int(LLVMElementAtOffset(DataLayout_val(DL), Ty,
Int64_val(Offset)));
}
/* Llvm.lltype -> int -> DataLayout.t -> Int64.t */
CAMLprim value llvm_datalayout_offset_of_element(LLVMTypeRef Ty, value Index,
value llvm_datalayout_offset_of_element(LLVMTypeRef Ty, value Index,
value DL) {
return caml_copy_int64(LLVMOffsetOfElement(DataLayout_val(DL), Ty,
Int_val(Index)));
@ -146,7 +146,7 @@ CAMLprim value llvm_datalayout_offset_of_element(LLVMTypeRef Ty, value Index,
/*===---- Target ----------------------------------------------------------===*/
/* unit -> string */
CAMLprim value llvm_target_default_triple(value Unit) {
value llvm_target_default_triple(value Unit) {
char *TripleCStr = LLVMGetDefaultTargetTriple();
value TripleStr = caml_copy_string(TripleCStr);
LLVMDisposeMessage(TripleCStr);
@ -155,22 +155,22 @@ CAMLprim value llvm_target_default_triple(value Unit) {
}
/* unit -> Target.t option */
CAMLprim value llvm_target_first(value Unit) {
value llvm_target_first(value Unit) {
return ptr_to_option(LLVMGetFirstTarget());
}
/* Target.t -> Target.t option */
CAMLprim value llvm_target_succ(LLVMTargetRef Target) {
value llvm_target_succ(LLVMTargetRef Target) {
return ptr_to_option(LLVMGetNextTarget(Target));
}
/* string -> Target.t option */
CAMLprim value llvm_target_by_name(value Name) {
value llvm_target_by_name(value Name) {
return ptr_to_option(LLVMGetTargetFromName(String_val(Name)));
}
/* string -> Target.t */
CAMLprim LLVMTargetRef llvm_target_by_triple(value Triple) {
LLVMTargetRef llvm_target_by_triple(value Triple) {
LLVMTargetRef T;
char *Error;
@ -181,27 +181,27 @@ CAMLprim LLVMTargetRef llvm_target_by_triple(value Triple) {
}
/* Target.t -> string */
CAMLprim value llvm_target_name(LLVMTargetRef Target) {
value llvm_target_name(LLVMTargetRef Target) {
return caml_copy_string(LLVMGetTargetName(Target));
}
/* Target.t -> string */
CAMLprim value llvm_target_description(LLVMTargetRef Target) {
value llvm_target_description(LLVMTargetRef Target) {
return caml_copy_string(LLVMGetTargetDescription(Target));
}
/* Target.t -> bool */
CAMLprim value llvm_target_has_jit(LLVMTargetRef Target) {
value llvm_target_has_jit(LLVMTargetRef Target) {
return Val_bool(LLVMTargetHasJIT(Target));
}
/* Target.t -> bool */
CAMLprim value llvm_target_has_target_machine(LLVMTargetRef Target) {
value llvm_target_has_target_machine(LLVMTargetRef Target) {
return Val_bool(LLVMTargetHasTargetMachine(Target));
}
/* Target.t -> bool */
CAMLprim value llvm_target_has_asm_backend(LLVMTargetRef Target) {
value llvm_target_has_asm_backend(LLVMTargetRef Target) {
return Val_bool(LLVMTargetHasAsmBackend(Target));
}
@ -233,7 +233,7 @@ static value llvm_alloc_targetmachine(LLVMTargetMachineRef Machine) {
/* triple:string -> ?cpu:string -> ?features:string
?level:CodeGenOptLevel.t -> ?reloc_mode:RelocMode.t
?code_model:CodeModel.t -> Target.t -> TargetMachine.t */
CAMLprim value llvm_create_targetmachine_native(value Triple, value CPU,
value llvm_create_targetmachine_native(value Triple, value CPU,
value Features, value OptLevel, value RelocMode,
value CodeModel, LLVMTargetRef Target) {
LLVMTargetMachineRef Machine;
@ -259,48 +259,48 @@ CAMLprim value llvm_create_targetmachine_native(value Triple, value CPU,
return llvm_alloc_targetmachine(Machine);
}
CAMLprim value llvm_create_targetmachine_bytecode(value *argv, int argn) {
value llvm_create_targetmachine_bytecode(value *argv, int argn) {
return llvm_create_targetmachine_native(argv[0], argv[1], argv[2], argv[3],
argv[4], argv[5], (LLVMTargetRef) argv[6]);
}
/* TargetMachine.t -> Target.t */
CAMLprim LLVMTargetRef llvm_targetmachine_target(value Machine) {
LLVMTargetRef llvm_targetmachine_target(value Machine) {
return LLVMGetTargetMachineTarget(TargetMachine_val(Machine));
}
/* TargetMachine.t -> string */
CAMLprim value llvm_targetmachine_triple(value Machine) {
value llvm_targetmachine_triple(value Machine) {
return llvm_string_of_message(LLVMGetTargetMachineTriple(
TargetMachine_val(Machine)));
}
/* TargetMachine.t -> string */
CAMLprim value llvm_targetmachine_cpu(value Machine) {
value llvm_targetmachine_cpu(value Machine) {
return llvm_string_of_message(LLVMGetTargetMachineCPU(
TargetMachine_val(Machine)));
}
/* TargetMachine.t -> string */
CAMLprim value llvm_targetmachine_features(value Machine) {
value llvm_targetmachine_features(value Machine) {
return llvm_string_of_message(LLVMGetTargetMachineFeatureString(
TargetMachine_val(Machine)));
}
/* TargetMachine.t -> DataLayout.t */
CAMLprim value llvm_targetmachine_data_layout(value Machine) {
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) {
value llvm_targetmachine_set_verbose_asm(value Verb, value Machine) {
LLVMSetTargetMachineAsmVerbosity(TargetMachine_val(Machine), Bool_val(Verb));
return Val_unit;
}
/* Llvm.llmodule -> CodeGenFileType.t -> string -> TargetMachine.t -> unit */
CAMLprim value llvm_targetmachine_emit_to_file(LLVMModuleRef Module,
value llvm_targetmachine_emit_to_file(LLVMModuleRef Module,
value FileType, value FileName, value Machine) {
char *ErrorMessage;
@ -315,7 +315,7 @@ CAMLprim value llvm_targetmachine_emit_to_file(LLVMModuleRef Module,
/* Llvm.llmodule -> CodeGenFileType.t -> TargetMachine.t ->
Llvm.llmemorybuffer */
CAMLprim LLVMMemoryBufferRef llvm_targetmachine_emit_to_memory_buffer(
LLVMMemoryBufferRef llvm_targetmachine_emit_to_memory_buffer(
LLVMModuleRef Module, value FileType,
value Machine) {
char *ErrorMessage;
@ -331,7 +331,7 @@ CAMLprim LLVMMemoryBufferRef llvm_targetmachine_emit_to_memory_buffer(
}
/* TargetMachine.t -> Llvm.PassManager.t -> unit */
CAMLprim value llvm_targetmachine_add_analysis_passes(LLVMPassManagerRef PM,
value llvm_targetmachine_add_analysis_passes(LLVMPassManagerRef PM,
value Machine) {
LLVMAddAnalysisPasses(TargetMachine_val(Machine), PM);
return Val_unit;

@ -25,73 +25,73 @@
#include "caml/mlvalues.h"
/* [`Module] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_argument_promotion(LLVMPassManagerRef PM) {
value llvm_add_argument_promotion(LLVMPassManagerRef PM) {
LLVMAddArgumentPromotionPass(PM);
return Val_unit;
}
/* [`Module] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_constant_merge(LLVMPassManagerRef PM) {
value llvm_add_constant_merge(LLVMPassManagerRef PM) {
LLVMAddConstantMergePass(PM);
return Val_unit;
}
/* [`Module] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_merge_functions(LLVMPassManagerRef PM) {
value llvm_add_merge_functions(LLVMPassManagerRef PM) {
LLVMAddMergeFunctionsPass(PM);
return Val_unit;
}
/* [`Module] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_dead_arg_elimination(LLVMPassManagerRef PM) {
value llvm_add_dead_arg_elimination(LLVMPassManagerRef PM) {
LLVMAddDeadArgEliminationPass(PM);
return Val_unit;
}
/* [`Module] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_function_attrs(LLVMPassManagerRef PM) {
value llvm_add_function_attrs(LLVMPassManagerRef PM) {
LLVMAddFunctionAttrsPass(PM);
return Val_unit;
}
/* [`Module] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_function_inlining(LLVMPassManagerRef PM) {
value llvm_add_function_inlining(LLVMPassManagerRef PM) {
LLVMAddFunctionInliningPass(PM);
return Val_unit;
}
/* [`Module] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_always_inliner(LLVMPassManagerRef PM) {
value llvm_add_always_inliner(LLVMPassManagerRef PM) {
LLVMAddAlwaysInlinerPass(PM);
return Val_unit;
}
/* [`Module] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_global_dce(LLVMPassManagerRef PM) {
value llvm_add_global_dce(LLVMPassManagerRef PM) {
LLVMAddGlobalDCEPass(PM);
return Val_unit;
}
/* [`Module] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_global_optimizer(LLVMPassManagerRef PM) {
value llvm_add_global_optimizer(LLVMPassManagerRef PM) {
LLVMAddGlobalOptimizerPass(PM);
return Val_unit;
}
/* [`Module] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_prune_eh(LLVMPassManagerRef PM) {
value llvm_add_prune_eh(LLVMPassManagerRef PM) {
LLVMAddPruneEHPass(PM);
return Val_unit;
}
/* [`Module] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_ipsccp(LLVMPassManagerRef PM) {
value llvm_add_ipsccp(LLVMPassManagerRef PM) {
LLVMAddIPSCCPPass(PM);
return Val_unit;
}
/* [`Module] Llvm.PassManager.t -> all_but_main:bool -> unit */
CAMLprim value llvm_add_internalize(LLVMPassManagerRef PM, value AllButMain) {
value llvm_add_internalize(LLVMPassManagerRef PM, value AllButMain) {
LLVMAddInternalizePass(PM, Bool_val(AllButMain));
return Val_unit;
}
@ -116,7 +116,7 @@ LLVMBool MustPreserveCallBack(LLVMValueRef Val, void* Ctx) {
}
/* [`Module] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_internalize_predicate(LLVMPassManagerRef PM) {
value llvm_add_internalize_predicate(LLVMPassManagerRef PM) {
predicate_f = (value *)caml_named_value("LLVMInternalizePredicateCallback");
LLVMAddInternalizePassWithMustPreservePredicate(PM, NULL,
&MustPreserveCallBack);
@ -124,13 +124,13 @@ CAMLprim value llvm_add_internalize_predicate(LLVMPassManagerRef PM) {
}
/* [`Module] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_strip_dead_prototypes(LLVMPassManagerRef PM) {
value llvm_add_strip_dead_prototypes(LLVMPassManagerRef PM) {
LLVMAddStripDeadPrototypesPass(PM);
return Val_unit;
}
/* [`Module] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_strip_symbols(LLVMPassManagerRef PM) {
value llvm_add_strip_symbols(LLVMPassManagerRef PM) {
LLVMAddStripSymbolsPass(PM);
return Val_unit;
}

@ -44,31 +44,31 @@ static value alloc_pmbuilder(LLVMPassManagerBuilderRef Ref) {
}
/* t -> unit */
CAMLprim value llvm_pmbuilder_create(value Unit) {
value llvm_pmbuilder_create(value Unit) {
return alloc_pmbuilder(LLVMPassManagerBuilderCreate());
}
/* int -> t -> unit */
CAMLprim value llvm_pmbuilder_set_opt_level(value OptLevel, value PMB) {
value llvm_pmbuilder_set_opt_level(value OptLevel, value PMB) {
LLVMPassManagerBuilderSetOptLevel(PMBuilder_val(PMB), Int_val(OptLevel));
return Val_unit;
}
/* int -> t -> unit */
CAMLprim value llvm_pmbuilder_set_size_level(value SizeLevel, value PMB) {
value llvm_pmbuilder_set_size_level(value SizeLevel, value PMB) {
LLVMPassManagerBuilderSetSizeLevel(PMBuilder_val(PMB), Int_val(SizeLevel));
return Val_unit;
}
/* int -> t -> unit */
CAMLprim value llvm_pmbuilder_use_inliner_with_threshold(
value llvm_pmbuilder_use_inliner_with_threshold(
value Threshold, value PMB) {
LLVMPassManagerBuilderSetOptLevel(PMBuilder_val(PMB), Int_val(Threshold));
return Val_unit;
}
/* bool -> t -> unit */
CAMLprim value llvm_pmbuilder_set_disable_unit_at_a_time(
value llvm_pmbuilder_set_disable_unit_at_a_time(
value DisableUnitAtATime, value PMB) {
LLVMPassManagerBuilderSetDisableUnitAtATime(
PMBuilder_val(PMB), Bool_val(DisableUnitAtATime));
@ -76,7 +76,7 @@ CAMLprim value llvm_pmbuilder_set_disable_unit_at_a_time(
}
/* bool -> t -> unit */
CAMLprim value llvm_pmbuilder_set_disable_unroll_loops(
value llvm_pmbuilder_set_disable_unroll_loops(
value DisableUnroll, value PMB) {
LLVMPassManagerBuilderSetDisableUnrollLoops(
PMBuilder_val(PMB), Bool_val(DisableUnroll));
@ -84,7 +84,7 @@ CAMLprim value llvm_pmbuilder_set_disable_unroll_loops(
}
/* [ `Function ] Llvm.PassManager.t -> t -> unit */
CAMLprim value llvm_pmbuilder_populate_function_pass_manager(
value llvm_pmbuilder_populate_function_pass_manager(
LLVMPassManagerRef PM, value PMB) {
LLVMPassManagerBuilderPopulateFunctionPassManager(
PMBuilder_val(PMB), PM);
@ -92,7 +92,7 @@ CAMLprim value llvm_pmbuilder_populate_function_pass_manager(
}
/* [ `Module ] Llvm.PassManager.t -> t -> unit */
CAMLprim value llvm_pmbuilder_populate_module_pass_manager(
value llvm_pmbuilder_populate_module_pass_manager(
LLVMPassManagerRef PM, value PMB) {
LLVMPassManagerBuilderPopulateModulePassManager(
PMBuilder_val(PMB), PM);
@ -101,7 +101,7 @@ CAMLprim value llvm_pmbuilder_populate_module_pass_manager(
/* [ `Module ] Llvm.PassManager.t ->
internalize:bool -> run_inliner:bool -> t -> unit */
CAMLprim value llvm_pmbuilder_populate_lto_pass_manager(
value llvm_pmbuilder_populate_lto_pass_manager(
LLVMPassManagerRef PM, value Internalize, value RunInliner,
value PMB) {
LLVMPassManagerBuilderPopulateLTOPassManager(

@ -21,241 +21,241 @@
#include "caml/misc.h"
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_aggressive_dce(LLVMPassManagerRef PM) {
value llvm_add_aggressive_dce(LLVMPassManagerRef PM) {
LLVMAddAggressiveDCEPass(PM);
return Val_unit;
}
CAMLprim value llvm_add_dce(LLVMPassManagerRef PM) {
value llvm_add_dce(LLVMPassManagerRef PM) {
LLVMAddDCEPass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_alignment_from_assumptions(LLVMPassManagerRef PM) {
value llvm_add_alignment_from_assumptions(LLVMPassManagerRef PM) {
LLVMAddAlignmentFromAssumptionsPass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_cfg_simplification(LLVMPassManagerRef PM) {
value llvm_add_cfg_simplification(LLVMPassManagerRef PM) {
LLVMAddCFGSimplificationPass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_dead_store_elimination(LLVMPassManagerRef PM) {
value llvm_add_dead_store_elimination(LLVMPassManagerRef PM) {
LLVMAddDeadStoreEliminationPass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_scalarizer(LLVMPassManagerRef PM) {
value llvm_add_scalarizer(LLVMPassManagerRef PM) {
LLVMAddScalarizerPass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_merged_load_store_motion(LLVMPassManagerRef PM) {
value llvm_add_merged_load_store_motion(LLVMPassManagerRef PM) {
LLVMAddMergedLoadStoreMotionPass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_gvn(LLVMPassManagerRef PM) {
value llvm_add_gvn(LLVMPassManagerRef PM) {
LLVMAddGVNPass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_ind_var_simplify(LLVMPassManagerRef PM) {
value llvm_add_ind_var_simplify(LLVMPassManagerRef PM) {
LLVMAddIndVarSimplifyPass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_instruction_combining(LLVMPassManagerRef PM) {
value llvm_add_instruction_combining(LLVMPassManagerRef PM) {
LLVMAddInstructionCombiningPass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_jump_threading(LLVMPassManagerRef PM) {
value llvm_add_jump_threading(LLVMPassManagerRef PM) {
LLVMAddJumpThreadingPass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_licm(LLVMPassManagerRef PM) {
value llvm_add_licm(LLVMPassManagerRef PM) {
LLVMAddLICMPass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_loop_deletion(LLVMPassManagerRef PM) {
value llvm_add_loop_deletion(LLVMPassManagerRef PM) {
LLVMAddLoopDeletionPass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_loop_idiom(LLVMPassManagerRef PM) {
value llvm_add_loop_idiom(LLVMPassManagerRef PM) {
LLVMAddLoopIdiomPass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_loop_rotate(LLVMPassManagerRef PM) {
value llvm_add_loop_rotate(LLVMPassManagerRef PM) {
LLVMAddLoopRotatePass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_loop_reroll(LLVMPassManagerRef PM) {
value llvm_add_loop_reroll(LLVMPassManagerRef PM) {
LLVMAddLoopRerollPass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_loop_unroll(LLVMPassManagerRef PM) {
value llvm_add_loop_unroll(LLVMPassManagerRef PM) {
LLVMAddLoopUnrollPass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_loop_unswitch(LLVMPassManagerRef PM) {
value llvm_add_loop_unswitch(LLVMPassManagerRef PM) {
LLVMAddLoopUnswitchPass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_memcpy_opt(LLVMPassManagerRef PM) {
value llvm_add_memcpy_opt(LLVMPassManagerRef PM) {
LLVMAddMemCpyOptPass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_partially_inline_lib_calls(LLVMPassManagerRef PM) {
value llvm_add_partially_inline_lib_calls(LLVMPassManagerRef PM) {
LLVMAddPartiallyInlineLibCallsPass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_lower_atomic(LLVMPassManagerRef PM) {
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) {
value llvm_add_lower_switch(LLVMPassManagerRef PM) {
LLVMAddLowerSwitchPass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_promote_memory_to_register(LLVMPassManagerRef PM) {
value llvm_add_promote_memory_to_register(LLVMPassManagerRef PM) {
LLVMAddPromoteMemoryToRegisterPass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_reassociation(LLVMPassManagerRef PM) {
value llvm_add_reassociation(LLVMPassManagerRef PM) {
LLVMAddReassociatePass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_sccp(LLVMPassManagerRef PM) {
value llvm_add_sccp(LLVMPassManagerRef PM) {
LLVMAddSCCPPass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_scalar_repl_aggregates(LLVMPassManagerRef PM) {
value llvm_add_scalar_repl_aggregates(LLVMPassManagerRef PM) {
LLVMAddScalarReplAggregatesPass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_scalar_repl_aggregates_ssa(LLVMPassManagerRef PM) {
value llvm_add_scalar_repl_aggregates_ssa(LLVMPassManagerRef PM) {
LLVMAddScalarReplAggregatesPassSSA(PM);
return Val_unit;
}
/* int -> [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_scalar_repl_aggregates_with_threshold(value threshold,
value llvm_add_scalar_repl_aggregates_with_threshold(value threshold,
LLVMPassManagerRef PM) {
LLVMAddScalarReplAggregatesPassWithThreshold(PM, Int_val(threshold));
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_simplify_lib_calls(LLVMPassManagerRef PM) {
value llvm_add_simplify_lib_calls(LLVMPassManagerRef PM) {
LLVMAddSimplifyLibCallsPass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_tail_call_elimination(LLVMPassManagerRef PM) {
value llvm_add_tail_call_elimination(LLVMPassManagerRef PM) {
LLVMAddTailCallEliminationPass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_demote_memory_to_register(LLVMPassManagerRef PM) {
value llvm_add_demote_memory_to_register(LLVMPassManagerRef PM) {
LLVMAddDemoteMemoryToRegisterPass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_verifier(LLVMPassManagerRef PM) {
value llvm_add_verifier(LLVMPassManagerRef PM) {
LLVMAddVerifierPass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_correlated_value_propagation(LLVMPassManagerRef PM) {
value llvm_add_correlated_value_propagation(LLVMPassManagerRef PM) {
LLVMAddCorrelatedValuePropagationPass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_early_cse(LLVMPassManagerRef PM) {
value llvm_add_early_cse(LLVMPassManagerRef PM) {
LLVMAddEarlyCSEPass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_lower_expect_intrinsic(LLVMPassManagerRef PM) {
value llvm_add_lower_expect_intrinsic(LLVMPassManagerRef PM) {
LLVMAddLowerExpectIntrinsicPass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_lower_constant_intrinsics(LLVMPassManagerRef PM) {
value llvm_add_lower_constant_intrinsics(LLVMPassManagerRef PM) {
LLVMAddLowerConstantIntrinsicsPass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_type_based_alias_analysis(LLVMPassManagerRef PM) {
value llvm_add_type_based_alias_analysis(LLVMPassManagerRef PM) {
LLVMAddTypeBasedAliasAnalysisPass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_scoped_no_alias_aa(LLVMPassManagerRef PM) {
value llvm_add_scoped_no_alias_aa(LLVMPassManagerRef PM) {
LLVMAddScopedNoAliasAAPass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_basic_alias_analysis(LLVMPassManagerRef PM) {
value llvm_add_basic_alias_analysis(LLVMPassManagerRef PM) {
LLVMAddBasicAliasAnalysisPass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_unify_function_exit_nodes(LLVMPassManagerRef PM) {
value llvm_add_unify_function_exit_nodes(LLVMPassManagerRef PM) {
LLVMAddUnifyFunctionExitNodesPass(PM);
return Val_unit;
}

@ -26,6 +26,6 @@
*/
/* llmodule -> llmodule */
CAMLprim LLVMModuleRef llvm_clone_module(LLVMModuleRef M) {
LLVMModuleRef llvm_clone_module(LLVMModuleRef M) {
return LLVMCloneModule(M);
}

@ -20,13 +20,13 @@
#include "caml/misc.h"
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_loop_vectorize(LLVMPassManagerRef PM) {
value llvm_add_loop_vectorize(LLVMPassManagerRef PM) {
LLVMAddLoopVectorizePass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_slp_vectorize(LLVMPassManagerRef PM) {
value llvm_add_slp_vectorize(LLVMPassManagerRef PM) {
LLVMAddSLPVectorizePass(PM);
return Val_unit;
}

Loading…
Cancel
Save