[sledge][llvm] Reformat to clean up following CAMLprim removal

Summary:
The removal of CAMLprim left the code in need of an application of
clang-format. There are various other changes made by clang-format
which it seems ought to be rolled together into this diff.

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

Reviewed By: ngorogiannis

Differential Revision: D27564876

fbshipit-source-id: 8e22eb099
master
Josh Berdine 4 years ago committed by Facebook GitHub Bot
parent 83421103cf
commit 6dab0ee459

@ -26,7 +26,8 @@ LLVMModuleRef llvm_get_module(LLVMContextRef C, LLVMMemoryBufferRef MemBuf) {
LLVMModuleRef M; LLVMModuleRef M;
if (LLVMGetBitcodeModuleInContext2(C, MemBuf, &M)) if (LLVMGetBitcodeModuleInContext2(C, MemBuf, &M))
llvm_raise(*caml_named_value("Llvm_bitreader.Error"), LLVMCreateMessage("")); llvm_raise(*caml_named_value("Llvm_bitreader.Error"),
LLVMCreateMessage(""));
return M; return M;
} }
@ -36,7 +37,8 @@ LLVMModuleRef llvm_parse_bitcode(LLVMContextRef C, LLVMMemoryBufferRef MemBuf) {
LLVMModuleRef M; LLVMModuleRef M;
if (LLVMParseBitcodeInContext2(C, MemBuf, &M)) if (LLVMParseBitcodeInContext2(C, MemBuf, &M))
llvm_raise(*caml_named_value("Llvm_bitreader.Error"), LLVMCreateMessage("")); llvm_raise(*caml_named_value("Llvm_bitreader.Error"),
LLVMCreateMessage(""));
return M; return M;
} }

@ -219,7 +219,7 @@ LLVMMetadataRef llvm_dibuild_create_compile_unit_native(
} }
LLVMMetadataRef llvm_dibuild_create_compile_unit_bytecode(value *argv, LLVMMetadataRef llvm_dibuild_create_compile_unit_bytecode(value *argv,
int argn) { int argn) {
return llvm_dibuild_create_compile_unit_native( return llvm_dibuild_create_compile_unit_native(
argv[0], // Builder argv[0], // Builder
argv[1], // Lang argv[1], // Lang
@ -239,16 +239,17 @@ LLVMMetadataRef llvm_dibuild_create_compile_unit_bytecode(value *argv,
} }
LLVMMetadataRef llvm_dibuild_create_file(value Builder, value Filename, LLVMMetadataRef llvm_dibuild_create_file(value Builder, value Filename,
value Directory) { value Directory) {
return LLVMDIBuilderCreateFile(DIBuilder_val(Builder), String_val(Filename), return LLVMDIBuilderCreateFile(DIBuilder_val(Builder), String_val(Filename),
caml_string_length(Filename), caml_string_length(Filename),
String_val(Directory), String_val(Directory),
caml_string_length(Directory)); caml_string_length(Directory));
} }
LLVMMetadataRef llvm_dibuild_create_module_native( LLVMMetadataRef
value Builder, LLVMMetadataRef ParentScope, value Name, value ConfigMacros, llvm_dibuild_create_module_native(value Builder, LLVMMetadataRef ParentScope,
value IncludePath, value SysRoot) { value Name, value ConfigMacros,
value IncludePath, value SysRoot) {
return LLVMDIBuilderCreateModule( return LLVMDIBuilderCreateModule(
DIBuilder_val(Builder), ParentScope, String_val(Name), DIBuilder_val(Builder), ParentScope, String_val(Name),
caml_string_length(Name), String_val(ConfigMacros), caml_string_length(Name), String_val(ConfigMacros),
@ -257,8 +258,7 @@ LLVMMetadataRef llvm_dibuild_create_module_native(
caml_string_length(SysRoot)); caml_string_length(SysRoot));
} }
LLVMMetadataRef llvm_dibuild_create_module_bytecode(value *argv, LLVMMetadataRef llvm_dibuild_create_module_bytecode(value *argv, int argn) {
int argn) {
return llvm_dibuild_create_module_native( return llvm_dibuild_create_module_native(
argv[0], // Builder argv[0], // Builder
(LLVMMetadataRef)argv[1], // ParentScope (LLVMMetadataRef)argv[1], // ParentScope
@ -269,9 +269,9 @@ LLVMMetadataRef llvm_dibuild_create_module_bytecode(value *argv,
); );
} }
LLVMMetadataRef LLVMMetadataRef llvm_dibuild_create_namespace(value Builder,
llvm_dibuild_create_namespace(value Builder, LLVMMetadataRef ParentScope, LLVMMetadataRef ParentScope,
value Name, value ExportSymbols) { value Name, value ExportSymbols) {
return LLVMDIBuilderCreateNameSpace( return LLVMDIBuilderCreateNameSpace(
DIBuilder_val(Builder), ParentScope, String_val(Name), DIBuilder_val(Builder), ParentScope, String_val(Name),
caml_string_length(Name), Bool_val(ExportSymbols)); caml_string_length(Name), Bool_val(ExportSymbols));
@ -288,8 +288,7 @@ LLVMMetadataRef llvm_dibuild_create_function_native(
Int_val(ScopeLine), DIFlags_val(Flags), Bool_val(IsOptimized)); Int_val(ScopeLine), DIFlags_val(Flags), Bool_val(IsOptimized));
} }
LLVMMetadataRef llvm_dibuild_create_function_bytecode(value *argv, LLVMMetadataRef llvm_dibuild_create_function_bytecode(value *argv, int argn) {
int argn) {
return llvm_dibuild_create_function_native(argv[0], // Builder, return llvm_dibuild_create_function_native(argv[0], // Builder,
(LLVMMetadataRef)argv[1], // Scope (LLVMMetadataRef)argv[1], // Scope
argv[2], // Name argv[2], // Name
@ -305,18 +304,20 @@ LLVMMetadataRef llvm_dibuild_create_function_bytecode(value *argv,
); );
} }
LLVMMetadataRef llvm_dibuild_create_lexical_block( LLVMMetadataRef llvm_dibuild_create_lexical_block(value Builder,
value Builder, LLVMMetadataRef Scope, LLVMMetadataRef File, value Line, LLVMMetadataRef Scope,
value Column) { LLVMMetadataRef File,
value Line, value Column) {
return LLVMDIBuilderCreateLexicalBlock(DIBuilder_val(Builder), Scope, File, return LLVMDIBuilderCreateLexicalBlock(DIBuilder_val(Builder), Scope, File,
Int_val(Line), Int_val(Column)); Int_val(Line), Int_val(Column));
} }
LLVMMetadataRef llvm_metadata_null() { return (LLVMMetadataRef)NULL; } LLVMMetadataRef llvm_metadata_null() { return (LLVMMetadataRef)NULL; }
LLVMMetadataRef llvm_dibuild_create_debug_location( LLVMMetadataRef llvm_dibuild_create_debug_location(LLVMContextRef Ctx,
LLVMContextRef Ctx, value Line, value Column, LLVMMetadataRef Scope, value Line, value Column,
LLVMMetadataRef InlinedAt) { LLVMMetadataRef Scope,
LLVMMetadataRef InlinedAt) {
return LLVMDIBuilderCreateDebugLocation(Ctx, Int_val(Line), Int_val(Column), return LLVMDIBuilderCreateDebugLocation(Ctx, Int_val(Line), Int_val(Column),
Scope, InlinedAt); Scope, InlinedAt);
} }
@ -360,32 +361,32 @@ value llvm_di_file_get_source(LLVMMetadataRef File) {
} }
LLVMMetadataRef llvm_dibuild_get_or_create_type_array(value Builder, LLVMMetadataRef llvm_dibuild_get_or_create_type_array(value Builder,
value Data) { value Data) {
return LLVMDIBuilderGetOrCreateTypeArray(DIBuilder_val(Builder), return LLVMDIBuilderGetOrCreateTypeArray(DIBuilder_val(Builder),
(LLVMMetadataRef *)Op_val(Data), (LLVMMetadataRef *)Op_val(Data),
Wosize_val(Data)); Wosize_val(Data));
} }
LLVMMetadataRef llvm_dibuild_get_or_create_array(value Builder, LLVMMetadataRef llvm_dibuild_get_or_create_array(value Builder, value Data) {
value Data) {
return LLVMDIBuilderGetOrCreateArray(DIBuilder_val(Builder), return LLVMDIBuilderGetOrCreateArray(DIBuilder_val(Builder),
(LLVMMetadataRef *)Op_val(Data), (LLVMMetadataRef *)Op_val(Data),
Wosize_val(Data)); Wosize_val(Data));
} }
LLVMMetadataRef llvm_dibuild_create_subroutine_type( LLVMMetadataRef llvm_dibuild_create_subroutine_type(value Builder,
value Builder, LLVMMetadataRef File, value ParameterTypes, value Flags) { LLVMMetadataRef File,
value ParameterTypes,
value Flags) {
return LLVMDIBuilderCreateSubroutineType( return LLVMDIBuilderCreateSubroutineType(
DIBuilder_val(Builder), File, (LLVMMetadataRef *)Op_val(ParameterTypes), DIBuilder_val(Builder), File, (LLVMMetadataRef *)Op_val(ParameterTypes),
Wosize_val(ParameterTypes), DIFlags_val(Flags)); Wosize_val(ParameterTypes), DIFlags_val(Flags));
} }
LLVMMetadataRef llvm_dibuild_create_enumerator(value Builder, LLVMMetadataRef llvm_dibuild_create_enumerator(value Builder, value Name,
value Name, value Value, value Value, value IsUnsigned) {
value IsUnsigned) {
return LLVMDIBuilderCreateEnumerator( return LLVMDIBuilderCreateEnumerator(
DIBuilder_val(Builder), String_val(Name), caml_string_length(Name), DIBuilder_val(Builder), String_val(Name), caml_string_length(Name),
(int64_t)Int_val(Value), Bool_val(IsUnsigned)); (int64_t)Int_val(Value), Bool_val(IsUnsigned));
@ -402,8 +403,8 @@ LLVMMetadataRef llvm_dibuild_create_enumeration_type_native(
Wosize_val(Elements), ClassTy); Wosize_val(Elements), ClassTy);
} }
LLVMMetadataRef LLVMMetadataRef llvm_dibuild_create_enumeration_type_bytecode(value *argv,
llvm_dibuild_create_enumeration_type_bytecode(value *argv, int argn) { int argn) {
return llvm_dibuild_create_enumeration_type_native( return llvm_dibuild_create_enumeration_type_native(
argv[0], // Builder argv[0], // Builder
(LLVMMetadataRef)argv[1], // Scope (LLVMMetadataRef)argv[1], // Scope
@ -431,8 +432,7 @@ LLVMMetadataRef llvm_dibuild_create_union_type_native(
caml_string_length(UniqueId)); caml_string_length(UniqueId));
} }
LLVMMetadataRef llvm_dibuild_create_union_type_bytecode(value *argv, LLVMMetadataRef llvm_dibuild_create_union_type_bytecode(value *argv, int argn) {
int argn) {
return llvm_dibuild_create_union_type_native( return llvm_dibuild_create_union_type_native(
argv[0], // Builder argv[0], // Builder
(LLVMMetadataRef)argv[1], // Scope (LLVMMetadataRef)argv[1], // Scope
@ -448,34 +448,33 @@ LLVMMetadataRef llvm_dibuild_create_union_type_bytecode(value *argv,
); );
} }
LLVMMetadataRef llvm_dibuild_create_array_type(value Builder, LLVMMetadataRef llvm_dibuild_create_array_type(value Builder, value Size,
value Size, value AlignInBits,
value AlignInBits, LLVMMetadataRef Ty,
LLVMMetadataRef Ty, value Subscripts) {
value Subscripts) {
return LLVMDIBuilderCreateArrayType( return LLVMDIBuilderCreateArrayType(
DIBuilder_val(Builder), (uint64_t)Int_val(Size), Int_val(AlignInBits), Ty, DIBuilder_val(Builder), (uint64_t)Int_val(Size), Int_val(AlignInBits), Ty,
(LLVMMetadataRef *)Op_val(Subscripts), Wosize_val(Subscripts)); (LLVMMetadataRef *)Op_val(Subscripts), Wosize_val(Subscripts));
} }
LLVMMetadataRef llvm_dibuild_create_vector_type(value Builder, LLVMMetadataRef llvm_dibuild_create_vector_type(value Builder, value Size,
value Size, value AlignInBits,
value AlignInBits, LLVMMetadataRef Ty,
LLVMMetadataRef Ty, value Subscripts) {
value Subscripts) {
return LLVMDIBuilderCreateVectorType( return LLVMDIBuilderCreateVectorType(
DIBuilder_val(Builder), (uint64_t)Int_val(Size), Int_val(AlignInBits), Ty, DIBuilder_val(Builder), (uint64_t)Int_val(Size), Int_val(AlignInBits), Ty,
(LLVMMetadataRef *)Op_val(Subscripts), Wosize_val(Subscripts)); (LLVMMetadataRef *)Op_val(Subscripts), Wosize_val(Subscripts));
} }
LLVMMetadataRef llvm_dibuild_create_unspecified_type(value Builder, LLVMMetadataRef llvm_dibuild_create_unspecified_type(value Builder,
value Name) { value Name) {
return LLVMDIBuilderCreateUnspecifiedType( return LLVMDIBuilderCreateUnspecifiedType(
DIBuilder_val(Builder), String_val(Name), caml_string_length(Name)); DIBuilder_val(Builder), String_val(Name), caml_string_length(Name));
} }
LLVMMetadataRef llvm_dibuild_create_basic_type( LLVMMetadataRef llvm_dibuild_create_basic_type(value Builder, value Name,
value Builder, value Name, value SizeInBits, value Encoding, value Flags) { value SizeInBits, value Encoding,
value Flags) {
return LLVMDIBuilderCreateBasicType( return LLVMDIBuilderCreateBasicType(
DIBuilder_val(Builder), String_val(Name), caml_string_length(Name), DIBuilder_val(Builder), String_val(Name), caml_string_length(Name),
@ -492,7 +491,7 @@ LLVMMetadataRef llvm_dibuild_create_pointer_type_native(
} }
LLVMMetadataRef llvm_dibuild_create_pointer_type_bytecode(value *argv, LLVMMetadataRef llvm_dibuild_create_pointer_type_bytecode(value *argv,
int argn) { int argn) {
return llvm_dibuild_create_pointer_type_native( return llvm_dibuild_create_pointer_type_native(
argv[0], // Builder argv[0], // Builder
(LLVMMetadataRef)argv[1], // PointeeTy (LLVMMetadataRef)argv[1], // PointeeTy
@ -519,7 +518,7 @@ LLVMMetadataRef llvm_dibuild_create_struct_type_native(
} }
LLVMMetadataRef llvm_dibuild_create_struct_type_bytecode(value *argv, LLVMMetadataRef llvm_dibuild_create_struct_type_bytecode(value *argv,
int argn) { int argn) {
return llvm_dibuild_create_struct_type_native( return llvm_dibuild_create_struct_type_native(
argv[0], // Builder argv[0], // Builder
(LLVMMetadataRef)argv[1], // Scope (LLVMMetadataRef)argv[1], // Scope
@ -550,7 +549,7 @@ LLVMMetadataRef llvm_dibuild_create_member_type_native(
} }
LLVMMetadataRef llvm_dibuild_create_member_type_bytecode(value *argv, LLVMMetadataRef llvm_dibuild_create_member_type_bytecode(value *argv,
int argn) { int argn) {
return llvm_dibuild_create_member_type_native( return llvm_dibuild_create_member_type_native(
argv[0], // Builder argv[0], // Builder
(LLVMMetadataRef)argv[1], // Scope (LLVMMetadataRef)argv[1], // Scope
@ -576,8 +575,8 @@ LLVMMetadataRef llvm_dibuild_create_static_member_type_native(
Int_val(AlignInBits)); Int_val(AlignInBits));
} }
LLVMMetadataRef LLVMMetadataRef llvm_dibuild_create_static_member_type_bytecode(value *argv,
llvm_dibuild_create_static_member_type_bytecode(value *argv, int argn) { int argn) {
return llvm_dibuild_create_static_member_type_native( return llvm_dibuild_create_static_member_type_native(
argv[0], // Builder argv[0], // Builder
(LLVMMetadataRef)argv[1], // Scope (LLVMMetadataRef)argv[1], // Scope
@ -600,8 +599,8 @@ LLVMMetadataRef llvm_dibuild_create_member_pointer_type_native(
(uint64_t)Int_val(SizeInBits), Int_val(AlignInBits), Flags); (uint64_t)Int_val(SizeInBits), Int_val(AlignInBits), Flags);
} }
LLVMMetadataRef LLVMMetadataRef llvm_dibuild_create_member_pointer_type_bytecode(value *argv,
llvm_dibuild_create_member_pointer_type_bytecode(value *argv, int argn) { int argn) {
return llvm_dibuild_create_member_pointer_type_native( return llvm_dibuild_create_member_pointer_type_native(
argv[0], // Builder argv[0], // Builder
(LLVMMetadataRef)argv[1], // PointeeType (LLVMMetadataRef)argv[1], // PointeeType
@ -612,20 +611,20 @@ llvm_dibuild_create_member_pointer_type_bytecode(value *argv, int argn) {
); );
} }
LLVMMetadataRef LLVMMetadataRef llvm_dibuild_create_object_pointer_type(value Builder,
llvm_dibuild_create_object_pointer_type(value Builder, LLVMMetadataRef Type) { LLVMMetadataRef Type) {
return LLVMDIBuilderCreateObjectPointerType(DIBuilder_val(Builder), Type); return LLVMDIBuilderCreateObjectPointerType(DIBuilder_val(Builder), Type);
} }
LLVMMetadataRef llvm_dibuild_create_qualified_type( LLVMMetadataRef llvm_dibuild_create_qualified_type(value Builder, value Tag,
value Builder, value Tag, LLVMMetadataRef Type) { LLVMMetadataRef Type) {
return LLVMDIBuilderCreateQualifiedType(DIBuilder_val(Builder), Int_val(Tag), return LLVMDIBuilderCreateQualifiedType(DIBuilder_val(Builder), Int_val(Tag),
Type); Type);
} }
LLVMMetadataRef llvm_dibuild_create_reference_type( LLVMMetadataRef llvm_dibuild_create_reference_type(value Builder, value Tag,
value Builder, value Tag, LLVMMetadataRef Type) { LLVMMetadataRef Type) {
return LLVMDIBuilderCreateReferenceType(DIBuilder_val(Builder), Int_val(Tag), return LLVMDIBuilderCreateReferenceType(DIBuilder_val(Builder), Int_val(Tag),
Type); Type);
@ -645,8 +644,7 @@ LLVMMetadataRef llvm_dibuild_create_typedef_native(
File, Int_val(LineNo), Scope, Int_val(AlignInBits)); File, Int_val(LineNo), Scope, Int_val(AlignInBits));
} }
LLVMMetadataRef llvm_dibuild_create_typedef_bytecode(value *argv, LLVMMetadataRef llvm_dibuild_create_typedef_bytecode(value *argv, int argn) {
int argn) {
return llvm_dibuild_create_typedef_native(argv[0], // Builder return llvm_dibuild_create_typedef_native(argv[0], // Builder
(LLVMMetadataRef)argv[1], // Type (LLVMMetadataRef)argv[1], // Type
@ -658,17 +656,17 @@ LLVMMetadataRef llvm_dibuild_create_typedef_bytecode(value *argv,
); );
} }
LLVMMetadataRef llvm_dibuild_create_inheritance_native( LLVMMetadataRef
value Builder, LLVMMetadataRef Ty, LLVMMetadataRef BaseTy, value BaseOffset, llvm_dibuild_create_inheritance_native(value Builder, LLVMMetadataRef Ty,
value VBPtrOffset, value Flags) { LLVMMetadataRef BaseTy, value BaseOffset,
value VBPtrOffset, value Flags) {
return LLVMDIBuilderCreateInheritance(DIBuilder_val(Builder), Ty, BaseTy, return LLVMDIBuilderCreateInheritance(DIBuilder_val(Builder), Ty, BaseTy,
(uint64_t)Int_val(BaseOffset), (uint64_t)Int_val(BaseOffset),
Int_val(VBPtrOffset), Flags); Int_val(VBPtrOffset), Flags);
} }
LLVMMetadataRef llvm_dibuild_create_inheritance_bytecode(value *argv, LLVMMetadataRef llvm_dibuild_create_inheritance_bytecode(value *argv, int arg) {
int arg) {
return llvm_dibuild_create_inheritance_native( return llvm_dibuild_create_inheritance_native(
argv[0], // Builder argv[0], // Builder
@ -692,7 +690,7 @@ LLVMMetadataRef llvm_dibuild_create_forward_decl_native(
} }
LLVMMetadataRef llvm_dibuild_create_forward_decl_bytecode(value *argv, LLVMMetadataRef llvm_dibuild_create_forward_decl_bytecode(value *argv,
int arg) { int arg) {
return llvm_dibuild_create_forward_decl_native( return llvm_dibuild_create_forward_decl_native(
argv[0], // Builder argv[0], // Builder
@ -751,8 +749,8 @@ LLVMMetadataRef llvm_dibuild_create_bit_field_member_type_native(
DIFlags_val(Flags), Ty); DIFlags_val(Flags), Ty);
} }
LLVMMetadataRef LLVMMetadataRef llvm_dibuild_create_bit_field_member_type_bytecode(value *argv,
llvm_dibuild_create_bit_field_member_type_bytecode(value *argv, int arg) { int arg) {
return llvm_dibuild_create_bit_field_member_type_native( return llvm_dibuild_create_bit_field_member_type_native(
argv[0], // Builder argv[0], // Builder
@ -784,8 +782,7 @@ LLVMMetadataRef llvm_dibuild_create_class_type_native(
caml_string_length(UniqueIdentifier)); caml_string_length(UniqueIdentifier));
} }
LLVMMetadataRef llvm_dibuild_create_class_type_bytecode(value *argv, LLVMMetadataRef llvm_dibuild_create_class_type_bytecode(value *argv, int arg) {
int arg) {
return llvm_dibuild_create_class_type_native( return llvm_dibuild_create_class_type_native(
argv[0], // Builder argv[0], // Builder
@ -805,8 +802,8 @@ LLVMMetadataRef llvm_dibuild_create_class_type_bytecode(value *argv,
); );
} }
LLVMMetadataRef LLVMMetadataRef llvm_dibuild_create_artificial_type(value Builder,
llvm_dibuild_create_artificial_type(value Builder, LLVMMetadataRef Type) { LLVMMetadataRef Type) {
return LLVMDIBuilderCreateArtificialType(DIBuilder_val(Builder), Type); return LLVMDIBuilderCreateArtificialType(DIBuilder_val(Builder), Type);
} }
@ -858,14 +855,13 @@ value llvm_instr_get_debug_loc(LLVMValueRef Inst) {
return (ptr_to_option(LLVMInstructionGetDebugLoc(Inst))); return (ptr_to_option(LLVMInstructionGetDebugLoc(Inst)));
} }
value llvm_instr_set_debug_loc(LLVMValueRef Inst, value llvm_instr_set_debug_loc(LLVMValueRef Inst, LLVMMetadataRef Loc) {
LLVMMetadataRef Loc) {
LLVMInstructionSetDebugLoc(Inst, Loc); LLVMInstructionSetDebugLoc(Inst, Loc);
return Val_unit; return Val_unit;
} }
LLVMMetadataRef LLVMMetadataRef llvm_dibuild_create_constant_value_expression(value Builder,
llvm_dibuild_create_constant_value_expression(value Builder, value Value) { value Value) {
return LLVMDIBuilderCreateConstantValueExpression(DIBuilder_val(Builder), return LLVMDIBuilderCreateConstantValueExpression(DIBuilder_val(Builder),
(int64_t)Int_val(Value)); (int64_t)Int_val(Value));
} }
@ -898,8 +894,7 @@ llvm_dibuild_create_global_variable_expression_bytecode(value *argv, int arg) {
); );
} }
value value llvm_di_global_variable_expression_get_variable(LLVMMetadataRef GVE) {
llvm_di_global_variable_expression_get_variable(LLVMMetadataRef GVE) {
return (ptr_to_option(LLVMDIGlobalVariableExpressionGetVariable(GVE))); return (ptr_to_option(LLVMDIGlobalVariableExpressionGetVariable(GVE)));
} }

@ -54,8 +54,8 @@ LLVMExecutionEngineRef llvm_ee_create(value OptRecordOpt, LLVMModuleRef M) {
Options.MCJMM = NULL; Options.MCJMM = NULL;
} }
if (LLVMCreateMCJITCompilerForModule(&MCJIT, M, &Options, if (LLVMCreateMCJITCompilerForModule(&MCJIT, M, &Options, sizeof(Options),
sizeof(Options), &Error)) &Error))
llvm_raise(*caml_named_value("Llvm_executionengine.Error"), Error); llvm_raise(*caml_named_value("Llvm_executionengine.Error"), Error);
return MCJIT; return MCJIT;
} }
@ -99,7 +99,7 @@ extern value llvm_alloc_data_layout(LLVMTargetDataRef TargetData);
value llvm_ee_get_data_layout(LLVMExecutionEngineRef EE) { value llvm_ee_get_data_layout(LLVMExecutionEngineRef EE) {
value DataLayout; value DataLayout;
LLVMTargetDataRef OrigDataLayout; LLVMTargetDataRef OrigDataLayout;
char* TargetDataCStr; char *TargetDataCStr;
OrigDataLayout = LLVMGetExecutionEngineTargetData(EE); OrigDataLayout = LLVMGetExecutionEngineTargetData(EE);
TargetDataCStr = LLVMCopyStringRepOfTargetData(OrigDataLayout); TargetDataCStr = LLVMCopyStringRepOfTargetData(OrigDataLayout);
@ -111,17 +111,16 @@ value llvm_ee_get_data_layout(LLVMExecutionEngineRef EE) {
/* Llvm.llvalue -> int64 -> llexecutionengine -> unit */ /* Llvm.llvalue -> int64 -> llexecutionengine -> unit */
value llvm_ee_add_global_mapping(LLVMValueRef Global, value Ptr, value llvm_ee_add_global_mapping(LLVMValueRef Global, value Ptr,
LLVMExecutionEngineRef EE) { LLVMExecutionEngineRef EE) {
LLVMAddGlobalMapping(EE, Global, (void*) (Int64_val(Ptr))); LLVMAddGlobalMapping(EE, Global, (void *)(Int64_val(Ptr)));
return Val_unit; return Val_unit;
} }
value llvm_ee_get_global_value_address(value Name, value llvm_ee_get_global_value_address(value Name, LLVMExecutionEngineRef EE) {
LLVMExecutionEngineRef EE) { return caml_copy_int64(
return caml_copy_int64((int64_t) LLVMGetGlobalValueAddress(EE, String_val(Name))); (int64_t)LLVMGetGlobalValueAddress(EE, String_val(Name)));
} }
value llvm_ee_get_function_address(value Name, value llvm_ee_get_function_address(value Name, LLVMExecutionEngineRef EE) {
LLVMExecutionEngineRef EE) { return caml_copy_int64((int64_t)LLVMGetFunctionAddress(EE, String_val(Name)));
return caml_copy_int64((int64_t) LLVMGetFunctionAddress(EE, String_val(Name)));
} }

@ -21,8 +21,7 @@
void llvm_raise(value Prototype, char *Message); void llvm_raise(value Prototype, char *Message);
/* Llvm.llcontext -> Llvm.llmemorybuffer -> Llvm.llmodule */ /* Llvm.llcontext -> Llvm.llmemorybuffer -> Llvm.llmodule */
value llvm_parse_ir(LLVMContextRef C, value llvm_parse_ir(LLVMContextRef C, LLVMMemoryBufferRef MemBuf) {
LLVMMemoryBufferRef MemBuf) {
CAMLparam0(); CAMLparam0();
CAMLlocal2(Variant, MessageVal); CAMLlocal2(Variant, MessageVal);
LLVMModuleRef M; LLVMModuleRef M;
@ -31,5 +30,5 @@ value llvm_parse_ir(LLVMContextRef C,
if (LLVMParseIRInContext(C, MemBuf, &M, &Message)) if (LLVMParseIRInContext(C, MemBuf, &M, &Message))
llvm_raise(*caml_named_value("Llvm_irreader.Error"), Message); llvm_raise(*caml_named_value("Llvm_irreader.Error"), Message);
CAMLreturn((value) M); CAMLreturn((value)M);
} }

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

@ -26,29 +26,28 @@
#include "llvm_ocaml.h" #include "llvm_ocaml.h"
void llvm_raise(value Prototype, char *Message); void llvm_raise(value Prototype, char *Message);
value llvm_string_of_message(char* Message); value llvm_string_of_message(char *Message);
/*===---- Data Layout -----------------------------------------------------===*/ /*===---- Data Layout -----------------------------------------------------===*/
#define DataLayout_val(v) (*(LLVMTargetDataRef *)(Data_custom_val(v))) #define DataLayout_val(v) (*(LLVMTargetDataRef *)(Data_custom_val(v)))
static void llvm_finalize_data_layout(value DataLayout) { static void llvm_finalize_data_layout(value DataLayout) {
LLVMDisposeTargetData(DataLayout_val(DataLayout)); LLVMDisposeTargetData(DataLayout_val(DataLayout));
} }
static struct custom_operations llvm_data_layout_ops = { static struct custom_operations llvm_data_layout_ops = {
(char *) "Llvm_target.DataLayout.t", (char *)"Llvm_target.DataLayout.t",
llvm_finalize_data_layout, llvm_finalize_data_layout,
custom_compare_default, custom_compare_default,
custom_hash_default, custom_hash_default,
custom_serialize_default, custom_serialize_default,
custom_deserialize_default, custom_deserialize_default,
custom_compare_ext_default custom_compare_ext_default};
};
value llvm_alloc_data_layout(LLVMTargetDataRef DataLayout) { value llvm_alloc_data_layout(LLVMTargetDataRef DataLayout) {
value V = alloc_custom(&llvm_data_layout_ops, sizeof(LLVMTargetDataRef), value V =
0, 1); alloc_custom(&llvm_data_layout_ops, sizeof(LLVMTargetDataRef), 0, 1);
DataLayout_val(V) = DataLayout; DataLayout_val(V) = DataLayout;
return V; return V;
} }
@ -87,9 +86,8 @@ value llvm_datalayout_qualified_pointer_size(value AS, value DL) {
} }
/* Llvm.llcontext -> int -> DataLayout.t -> Llvm.lltype */ /* Llvm.llcontext -> int -> DataLayout.t -> Llvm.lltype */
LLVMTypeRef llvm_datalayout_qualified_intptr_type(LLVMContextRef C, LLVMTypeRef llvm_datalayout_qualified_intptr_type(LLVMContextRef C, value AS,
value AS, value DL) {
value DL) {
return LLVMIntPtrTypeForASInContext(C, DataLayout_val(DL), Int_val(AS)); return LLVMIntPtrTypeForASInContext(C, DataLayout_val(DL), Int_val(AS));
} }
@ -125,22 +123,21 @@ value llvm_datalayout_preferred_align(LLVMTypeRef Ty, value DL) {
/* Llvm.llvalue -> DataLayout.t -> int */ /* Llvm.llvalue -> DataLayout.t -> int */
value llvm_datalayout_preferred_align_of_global(LLVMValueRef GlobalVar, value llvm_datalayout_preferred_align_of_global(LLVMValueRef GlobalVar,
value DL) { value DL) {
return Val_int(LLVMPreferredAlignmentOfGlobal(DataLayout_val(DL), GlobalVar)); return Val_int(LLVMPreferredAlignmentOfGlobal(DataLayout_val(DL), GlobalVar));
} }
/* Llvm.lltype -> Int64.t -> DataLayout.t -> int */ /* Llvm.lltype -> Int64.t -> DataLayout.t -> int */
value llvm_datalayout_element_at_offset(LLVMTypeRef Ty, value Offset, value llvm_datalayout_element_at_offset(LLVMTypeRef Ty, value Offset,
value DL) { value DL) {
return Val_int(LLVMElementAtOffset(DataLayout_val(DL), Ty, return Val_int(
Int64_val(Offset))); LLVMElementAtOffset(DataLayout_val(DL), Ty, Int64_val(Offset)));
} }
/* Llvm.lltype -> int -> DataLayout.t -> Int64.t */ /* Llvm.lltype -> int -> DataLayout.t -> Int64.t */
value llvm_datalayout_offset_of_element(LLVMTypeRef Ty, value Index, value llvm_datalayout_offset_of_element(LLVMTypeRef Ty, value Index, value DL) {
value DL) { return caml_copy_int64(
return caml_copy_int64(LLVMOffsetOfElement(DataLayout_val(DL), Ty, LLVMOffsetOfElement(DataLayout_val(DL), Ty, Int_val(Index)));
Int_val(Index)));
} }
/*===---- Target ----------------------------------------------------------===*/ /*===---- Target ----------------------------------------------------------===*/
@ -174,7 +171,7 @@ LLVMTargetRef llvm_target_by_triple(value Triple) {
LLVMTargetRef T; LLVMTargetRef T;
char *Error; char *Error;
if(LLVMGetTargetFromTriple(String_val(Triple), &T, &Error)) if (LLVMGetTargetFromTriple(String_val(Triple), &T, &Error))
llvm_raise(*caml_named_value("Llvm_target.Error"), Error); llvm_raise(*caml_named_value("Llvm_target.Error"), Error);
return T; return T;
@ -207,21 +204,20 @@ value llvm_target_has_asm_backend(LLVMTargetRef Target) {
/*===---- Target Machine --------------------------------------------------===*/ /*===---- Target Machine --------------------------------------------------===*/
#define TargetMachine_val(v) (*(LLVMTargetMachineRef *)(Data_custom_val(v))) #define TargetMachine_val(v) (*(LLVMTargetMachineRef *)(Data_custom_val(v)))
static void llvm_finalize_target_machine(value Machine) { static void llvm_finalize_target_machine(value Machine) {
LLVMDisposeTargetMachine(TargetMachine_val(Machine)); LLVMDisposeTargetMachine(TargetMachine_val(Machine));
} }
static struct custom_operations llvm_target_machine_ops = { static struct custom_operations llvm_target_machine_ops = {
(char *) "Llvm_target.TargetMachine.t", (char *)"Llvm_target.TargetMachine.t",
llvm_finalize_target_machine, llvm_finalize_target_machine,
custom_compare_default, custom_compare_default,
custom_hash_default, custom_hash_default,
custom_serialize_default, custom_serialize_default,
custom_deserialize_default, custom_deserialize_default,
custom_compare_ext_default custom_compare_ext_default};
};
static value llvm_alloc_targetmachine(LLVMTargetMachineRef Machine) { static value llvm_alloc_targetmachine(LLVMTargetMachineRef Machine) {
value V = alloc_custom(&llvm_target_machine_ops, sizeof(LLVMTargetMachineRef), value V = alloc_custom(&llvm_target_machine_ops, sizeof(LLVMTargetMachineRef),
@ -233,35 +229,37 @@ static value llvm_alloc_targetmachine(LLVMTargetMachineRef Machine) {
/* triple:string -> ?cpu:string -> ?features:string /* triple:string -> ?cpu:string -> ?features:string
?level:CodeGenOptLevel.t -> ?reloc_mode:RelocMode.t ?level:CodeGenOptLevel.t -> ?reloc_mode:RelocMode.t
?code_model:CodeModel.t -> Target.t -> TargetMachine.t */ ?code_model:CodeModel.t -> Target.t -> TargetMachine.t */
value llvm_create_targetmachine_native(value Triple, value CPU, value llvm_create_targetmachine_native(value Triple, value CPU, value Features,
value Features, value OptLevel, value RelocMode, value OptLevel, value RelocMode,
value CodeModel, LLVMTargetRef Target) { value CodeModel, LLVMTargetRef Target) {
LLVMTargetMachineRef Machine; LLVMTargetMachineRef Machine;
const char *CPUStr = "", *FeaturesStr = ""; const char *CPUStr = "", *FeaturesStr = "";
LLVMCodeGenOptLevel OptLevelEnum = LLVMCodeGenLevelDefault; LLVMCodeGenOptLevel OptLevelEnum = LLVMCodeGenLevelDefault;
LLVMRelocMode RelocModeEnum = LLVMRelocDefault; LLVMRelocMode RelocModeEnum = LLVMRelocDefault;
LLVMCodeModel CodeModelEnum = LLVMCodeModelDefault; LLVMCodeModel CodeModelEnum = LLVMCodeModelDefault;
if(CPU != Val_int(0)) if (CPU != Val_int(0))
CPUStr = String_val(Field(CPU, 0)); CPUStr = String_val(Field(CPU, 0));
if(Features != Val_int(0)) if (Features != Val_int(0))
FeaturesStr = String_val(Field(Features, 0)); FeaturesStr = String_val(Field(Features, 0));
if(OptLevel != Val_int(0)) if (OptLevel != Val_int(0))
OptLevelEnum = Int_val(Field(OptLevel, 0)); OptLevelEnum = Int_val(Field(OptLevel, 0));
if(RelocMode != Val_int(0)) if (RelocMode != Val_int(0))
RelocModeEnum = Int_val(Field(RelocMode, 0)); RelocModeEnum = Int_val(Field(RelocMode, 0));
if(CodeModel != Val_int(0)) if (CodeModel != Val_int(0))
CodeModelEnum = Int_val(Field(CodeModel, 0)); CodeModelEnum = Int_val(Field(CodeModel, 0));
Machine = LLVMCreateTargetMachine(Target, String_val(Triple), CPUStr, Machine =
FeaturesStr, OptLevelEnum, RelocModeEnum, CodeModelEnum); LLVMCreateTargetMachine(Target, String_val(Triple), CPUStr, FeaturesStr,
OptLevelEnum, RelocModeEnum, CodeModelEnum);
return llvm_alloc_targetmachine(Machine); return llvm_alloc_targetmachine(Machine);
} }
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], return llvm_create_targetmachine_native(argv[0], argv[1], argv[2], argv[3],
argv[4], argv[5], (LLVMTargetRef) argv[6]); argv[4], argv[5],
(LLVMTargetRef)argv[6]);
} }
/* TargetMachine.t -> Target.t */ /* TargetMachine.t -> Target.t */
@ -271,26 +269,26 @@ LLVMTargetRef llvm_targetmachine_target(value Machine) {
/* TargetMachine.t -> string */ /* TargetMachine.t -> string */
value llvm_targetmachine_triple(value Machine) { value llvm_targetmachine_triple(value Machine) {
return llvm_string_of_message(LLVMGetTargetMachineTriple( return llvm_string_of_message(
TargetMachine_val(Machine))); LLVMGetTargetMachineTriple(TargetMachine_val(Machine)));
} }
/* TargetMachine.t -> string */ /* TargetMachine.t -> string */
value llvm_targetmachine_cpu(value Machine) { value llvm_targetmachine_cpu(value Machine) {
return llvm_string_of_message(LLVMGetTargetMachineCPU( return llvm_string_of_message(
TargetMachine_val(Machine))); LLVMGetTargetMachineCPU(TargetMachine_val(Machine)));
} }
/* TargetMachine.t -> string */ /* TargetMachine.t -> string */
value llvm_targetmachine_features(value Machine) { value llvm_targetmachine_features(value Machine) {
return llvm_string_of_message(LLVMGetTargetMachineFeatureString( return llvm_string_of_message(
TargetMachine_val(Machine))); LLVMGetTargetMachineFeatureString(TargetMachine_val(Machine)));
} }
/* TargetMachine.t -> DataLayout.t */ /* TargetMachine.t -> DataLayout.t */
value llvm_targetmachine_data_layout(value Machine) { value llvm_targetmachine_data_layout(value Machine) {
return llvm_alloc_data_layout(LLVMCreateTargetDataLayout( return llvm_alloc_data_layout(
TargetMachine_val(Machine))); LLVMCreateTargetDataLayout(TargetMachine_val(Machine)));
} }
/* bool -> TargetMachine.t -> unit */ /* bool -> TargetMachine.t -> unit */
@ -300,13 +298,13 @@ value llvm_targetmachine_set_verbose_asm(value Verb, value Machine) {
} }
/* Llvm.llmodule -> CodeGenFileType.t -> string -> TargetMachine.t -> unit */ /* Llvm.llmodule -> CodeGenFileType.t -> string -> TargetMachine.t -> unit */
value llvm_targetmachine_emit_to_file(LLVMModuleRef Module, value llvm_targetmachine_emit_to_file(LLVMModuleRef Module, value FileType,
value FileType, value FileName, value Machine) { value FileName, value Machine) {
char *ErrorMessage; char *ErrorMessage;
if(LLVMTargetMachineEmitToFile(TargetMachine_val(Machine), Module, if (LLVMTargetMachineEmitToFile(TargetMachine_val(Machine), Module,
(char *)String_val(FileName), Int_val(FileType), (char *)String_val(FileName),
&ErrorMessage)) { Int_val(FileType), &ErrorMessage)) {
llvm_raise(*caml_named_value("Llvm_target.Error"), ErrorMessage); llvm_raise(*caml_named_value("Llvm_target.Error"), ErrorMessage);
} }
@ -315,15 +313,15 @@ value llvm_targetmachine_emit_to_file(LLVMModuleRef Module,
/* Llvm.llmodule -> CodeGenFileType.t -> TargetMachine.t -> /* Llvm.llmodule -> CodeGenFileType.t -> TargetMachine.t ->
Llvm.llmemorybuffer */ Llvm.llmemorybuffer */
LLVMMemoryBufferRef llvm_targetmachine_emit_to_memory_buffer( LLVMMemoryBufferRef
LLVMModuleRef Module, value FileType, llvm_targetmachine_emit_to_memory_buffer(LLVMModuleRef Module, value FileType,
value Machine) { value Machine) {
char *ErrorMessage; char *ErrorMessage;
LLVMMemoryBufferRef Buffer; LLVMMemoryBufferRef Buffer;
if(LLVMTargetMachineEmitToMemoryBuffer(TargetMachine_val(Machine), Module, if (LLVMTargetMachineEmitToMemoryBuffer(TargetMachine_val(Machine), Module,
Int_val(FileType), &ErrorMessage, Int_val(FileType), &ErrorMessage,
&Buffer)) { &Buffer)) {
llvm_raise(*caml_named_value("Llvm_target.Error"), ErrorMessage); llvm_raise(*caml_named_value("Llvm_target.Error"), ErrorMessage);
} }
@ -332,7 +330,7 @@ LLVMMemoryBufferRef llvm_targetmachine_emit_to_memory_buffer(
/* TargetMachine.t -> Llvm.PassManager.t -> unit */ /* TargetMachine.t -> Llvm.PassManager.t -> unit */
value llvm_targetmachine_add_analysis_passes(LLVMPassManagerRef PM, value llvm_targetmachine_add_analysis_passes(LLVMPassManagerRef PM,
value Machine) { value Machine) {
LLVMAddAnalysisPasses(TargetMachine_val(Machine), PM); LLVMAddAnalysisPasses(TargetMachine_val(Machine), PM);
return Val_unit; return Val_unit;
} }

@ -20,25 +20,21 @@
#include "caml/custom.h" #include "caml/custom.h"
#include "caml/misc.h" #include "caml/misc.h"
#define PMBuilder_val(v) (*(LLVMPassManagerBuilderRef *)(Data_custom_val(v))) #define PMBuilder_val(v) (*(LLVMPassManagerBuilderRef *)(Data_custom_val(v)))
static void llvm_finalize_pmbuilder(value PMB) { static void llvm_finalize_pmbuilder(value PMB) {
LLVMPassManagerBuilderDispose(PMBuilder_val(PMB)); LLVMPassManagerBuilderDispose(PMBuilder_val(PMB));
} }
static struct custom_operations pmbuilder_ops = { static struct custom_operations pmbuilder_ops = {
(char *) "Llvm_passmgr_builder.t", (char *)"Llvm_passmgr_builder.t", llvm_finalize_pmbuilder,
llvm_finalize_pmbuilder, custom_compare_default, custom_hash_default,
custom_compare_default, custom_serialize_default, custom_deserialize_default,
custom_hash_default, custom_compare_ext_default};
custom_serialize_default,
custom_deserialize_default,
custom_compare_ext_default
};
static value alloc_pmbuilder(LLVMPassManagerBuilderRef Ref) { static value alloc_pmbuilder(LLVMPassManagerBuilderRef Ref) {
value Val = alloc_custom(&pmbuilder_ops, value Val =
sizeof(LLVMPassManagerBuilderRef), 0, 1); alloc_custom(&pmbuilder_ops, sizeof(LLVMPassManagerBuilderRef), 0, 1);
PMBuilder_val(Val) = Ref; PMBuilder_val(Val) = Ref;
return Val; return Val;
} }
@ -61,51 +57,46 @@ value llvm_pmbuilder_set_size_level(value SizeLevel, value PMB) {
} }
/* int -> t -> unit */ /* int -> t -> unit */
value llvm_pmbuilder_use_inliner_with_threshold( value llvm_pmbuilder_use_inliner_with_threshold(value Threshold, value PMB) {
value Threshold, value PMB) {
LLVMPassManagerBuilderSetOptLevel(PMBuilder_val(PMB), Int_val(Threshold)); LLVMPassManagerBuilderSetOptLevel(PMBuilder_val(PMB), Int_val(Threshold));
return Val_unit; return Val_unit;
} }
/* bool -> t -> unit */ /* bool -> t -> unit */
value llvm_pmbuilder_set_disable_unit_at_a_time( value llvm_pmbuilder_set_disable_unit_at_a_time(value DisableUnitAtATime,
value DisableUnitAtATime, value PMB) { value PMB) {
LLVMPassManagerBuilderSetDisableUnitAtATime( LLVMPassManagerBuilderSetDisableUnitAtATime(PMBuilder_val(PMB),
PMBuilder_val(PMB), Bool_val(DisableUnitAtATime)); Bool_val(DisableUnitAtATime));
return Val_unit; return Val_unit;
} }
/* bool -> t -> unit */ /* bool -> t -> unit */
value llvm_pmbuilder_set_disable_unroll_loops( value llvm_pmbuilder_set_disable_unroll_loops(value DisableUnroll, value PMB) {
value DisableUnroll, value PMB) { LLVMPassManagerBuilderSetDisableUnrollLoops(PMBuilder_val(PMB),
LLVMPassManagerBuilderSetDisableUnrollLoops( Bool_val(DisableUnroll));
PMBuilder_val(PMB), Bool_val(DisableUnroll));
return Val_unit; return Val_unit;
} }
/* [ `Function ] Llvm.PassManager.t -> t -> unit */ /* [ `Function ] Llvm.PassManager.t -> t -> unit */
value llvm_pmbuilder_populate_function_pass_manager( value llvm_pmbuilder_populate_function_pass_manager(LLVMPassManagerRef PM,
LLVMPassManagerRef PM, value PMB) { value PMB) {
LLVMPassManagerBuilderPopulateFunctionPassManager( LLVMPassManagerBuilderPopulateFunctionPassManager(PMBuilder_val(PMB), PM);
PMBuilder_val(PMB), PM);
return Val_unit; return Val_unit;
} }
/* [ `Module ] Llvm.PassManager.t -> t -> unit */ /* [ `Module ] Llvm.PassManager.t -> t -> unit */
value llvm_pmbuilder_populate_module_pass_manager( value llvm_pmbuilder_populate_module_pass_manager(LLVMPassManagerRef PM,
LLVMPassManagerRef PM, value PMB) { value PMB) {
LLVMPassManagerBuilderPopulateModulePassManager( LLVMPassManagerBuilderPopulateModulePassManager(PMBuilder_val(PMB), PM);
PMBuilder_val(PMB), PM);
return Val_unit; return Val_unit;
} }
/* [ `Module ] Llvm.PassManager.t -> /* [ `Module ] Llvm.PassManager.t ->
internalize:bool -> run_inliner:bool -> t -> unit */ internalize:bool -> run_inliner:bool -> t -> unit */
value llvm_pmbuilder_populate_lto_pass_manager( value llvm_pmbuilder_populate_lto_pass_manager(LLVMPassManagerRef PM,
LLVMPassManagerRef PM, value Internalize, value RunInliner, value Internalize,
value PMB) { value RunInliner, value PMB) {
LLVMPassManagerBuilderPopulateLTOPassManager( LLVMPassManagerBuilderPopulateLTOPassManager(
PMBuilder_val(PMB), PM, PMBuilder_val(PMB), PM, Bool_val(Internalize), Bool_val(RunInliner));
Bool_val(Internalize), Bool_val(RunInliner));
return Val_unit; return Val_unit;
} }

@ -183,7 +183,7 @@ value llvm_add_scalar_repl_aggregates_ssa(LLVMPassManagerRef PM) {
/* int -> [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */ /* int -> [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
value llvm_add_scalar_repl_aggregates_with_threshold(value threshold, value llvm_add_scalar_repl_aggregates_with_threshold(value threshold,
LLVMPassManagerRef PM) { LLVMPassManagerRef PM) {
LLVMAddScalarReplAggregatesPassWithThreshold(PM, Int_val(threshold)); LLVMAddScalarReplAggregatesPassWithThreshold(PM, Int_val(threshold));
return Val_unit; return Val_unit;
} }

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

Loading…
Cancel
Save