[llvm] 8e4fc55 - [NFC][OCaml] Remove vestigial CAMLprim declarations
Josh Berdine via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 5 02:59:06 PDT 2021
Author: Josh Berdine
Date: 2021-04-05T10:55:08+01:00
New Revision: 8e4fc55a0e544d7d370a2d7689dbb622b2caefca
URL: https://github.com/llvm/llvm-project/commit/8e4fc55a0e544d7d370a2d7689dbb622b2caefca
DIFF: https://github.com/llvm/llvm-project/commit/8e4fc55a0e544d7d370a2d7689dbb622b2caefca.diff
LOG: [NFC][OCaml] Remove vestigial CAMLprim declarations
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.
Differential Revision: https://reviews.llvm.org/D99476
Added:
Modified:
llvm/bindings/ocaml/all_backends/all_backends_ocaml.c
llvm/bindings/ocaml/analysis/analysis_ocaml.c
llvm/bindings/ocaml/backends/backend_ocaml.c
llvm/bindings/ocaml/bitreader/bitreader_ocaml.c
llvm/bindings/ocaml/bitwriter/bitwriter_ocaml.c
llvm/bindings/ocaml/debuginfo/debuginfo_ocaml.c
llvm/bindings/ocaml/executionengine/executionengine_ocaml.c
llvm/bindings/ocaml/irreader/irreader_ocaml.c
llvm/bindings/ocaml/linker/linker_ocaml.c
llvm/bindings/ocaml/llvm/llvm_ocaml.c
llvm/bindings/ocaml/llvm/llvm_ocaml.h
llvm/bindings/ocaml/target/target_ocaml.c
llvm/bindings/ocaml/transforms/ipo/ipo_ocaml.c
llvm/bindings/ocaml/transforms/passmgr_builder/passmgr_builder_ocaml.c
llvm/bindings/ocaml/transforms/scalar_opts/scalar_opts_ocaml.c
llvm/bindings/ocaml/transforms/utils/transform_utils_ocaml.c
llvm/bindings/ocaml/transforms/vectorize/vectorize_ocaml.c
Removed:
################################################################################
diff --git a/llvm/bindings/ocaml/all_backends/all_backends_ocaml.c b/llvm/bindings/ocaml/all_backends/all_backends_ocaml.c
index ae4b496cb3920..fdc73efa3f039 100644
--- a/llvm/bindings/ocaml/all_backends/all_backends_ocaml.c
+++ b/llvm/bindings/ocaml/all_backends/all_backends_ocaml.c
@@ -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();
diff --git a/llvm/bindings/ocaml/analysis/analysis_ocaml.c b/llvm/bindings/ocaml/analysis/analysis_ocaml.c
index 1db09fa5419c5..8fb81ee485258 100644
--- a/llvm/bindings/ocaml/analysis/analysis_ocaml.c
+++ b/llvm/bindings/ocaml/analysis/analysis_ocaml.c
@@ -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;
}
diff --git a/llvm/bindings/ocaml/backends/backend_ocaml.c b/llvm/bindings/ocaml/backends/backend_ocaml.c
index 16e68c541e3e0..2b3983f1b12ec 100644
--- a/llvm/bindings/ocaml/backends/backend_ocaml.c
+++ b/llvm/bindings/ocaml/backends/backend_ocaml.c
@@ -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(); \
diff --git a/llvm/bindings/ocaml/bitreader/bitreader_ocaml.c b/llvm/bindings/ocaml/bitreader/bitreader_ocaml.c
index 1af554e24b5ac..bbb8d03672c23 100644
--- a/llvm/bindings/ocaml/bitreader/bitreader_ocaml.c
+++ b/llvm/bindings/ocaml/bitreader/bitreader_ocaml.c
@@ -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))
diff --git a/llvm/bindings/ocaml/bitwriter/bitwriter_ocaml.c b/llvm/bindings/ocaml/bitwriter/bitwriter_ocaml.c
index 6856d7547f0e0..8ced8dd76eaf1 100644
--- a/llvm/bindings/ocaml/bitwriter/bitwriter_ocaml.c
+++ b/llvm/bindings/ocaml/bitwriter/bitwriter_ocaml.c
@@ -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);
}
diff --git a/llvm/bindings/ocaml/debuginfo/debuginfo_ocaml.c b/llvm/bindings/ocaml/debuginfo/debuginfo_ocaml.c
index 11c260735c4eb..1f95e46bca247 100644
--- a/llvm/bindings/ocaml/debuginfo/debuginfo_ocaml.c
+++ b/llvm/bindings/ocaml/debuginfo/debuginfo_ocaml.c
@@ -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,
@@ -220,7 +220,7 @@ CAMLprim LLVMMetadataRef llvm_dibuild_create_compile_unit_native(
caml_string_length(SDK));
}
-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
@@ -240,7 +240,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),
@@ -248,7 +248,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(
@@ -259,7 +259,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
@@ -271,7 +271,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(
@@ -279,7 +279,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) {
@@ -290,7 +290,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
@@ -307,61 +307,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),
@@ -369,7 +369,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),
@@ -377,7 +377,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(
@@ -385,7 +385,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(
@@ -393,7 +393,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) {
@@ -404,7 +404,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
@@ -419,7 +419,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) {
@@ -433,7 +433,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
@@ -450,7 +450,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,
@@ -460,7 +460,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,
@@ -470,13 +470,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(
@@ -484,7 +484,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(
@@ -493,7 +493,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
@@ -505,7 +505,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,
@@ -520,7 +520,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
@@ -539,7 +539,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) {
@@ -551,7 +551,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
@@ -567,7 +567,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) {
@@ -578,7 +578,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
@@ -593,7 +593,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) {
@@ -602,7 +602,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
@@ -614,31 +614,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) {
@@ -647,7 +647,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
@@ -660,7 +660,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) {
@@ -669,7 +669,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(
@@ -682,7 +682,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) {
@@ -693,7 +693,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(
@@ -710,7 +710,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) {
@@ -723,7 +723,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(
@@ -741,7 +741,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) {
@@ -753,7 +753,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(
@@ -770,7 +770,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,
@@ -786,7 +786,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(
@@ -807,72 +807,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) {
@@ -882,7 +882,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(
@@ -900,19 +900,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));
}
diff --git a/llvm/bindings/ocaml/executionengine/executionengine_ocaml.c b/llvm/bindings/ocaml/executionengine/executionengine_ocaml.c
index c83a8cadf4699..b47a469455e5b 100644
--- a/llvm/bindings/ocaml/executionengine/executionengine_ocaml.c
+++ b/llvm/bindings/ocaml/executionengine/executionengine_ocaml.c
@@ -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)));
}
diff --git a/llvm/bindings/ocaml/irreader/irreader_ocaml.c b/llvm/bindings/ocaml/irreader/irreader_ocaml.c
index 63a339edb8de8..f65003e7884b1 100644
--- a/llvm/bindings/ocaml/irreader/irreader_ocaml.c
+++ b/llvm/bindings/ocaml/irreader/irreader_ocaml.c
@@ -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);
diff --git a/llvm/bindings/ocaml/linker/linker_ocaml.c b/llvm/bindings/ocaml/linker/linker_ocaml.c
index 75723d9ee2252..fdeb207d5a6b2 100644
--- a/llvm/bindings/ocaml/linker/linker_ocaml.c
+++ b/llvm/bindings/ocaml/linker/linker_ocaml.c
@@ -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"));
diff --git a/llvm/bindings/ocaml/llvm/llvm_ocaml.c b/llvm/bindings/ocaml/llvm/llvm_ocaml.c
index eb1df93612482..d20324b90f2c6 100644
--- a/llvm/bindings/ocaml/llvm/llvm_ocaml.c
+++ b/llvm/bindings/ocaml/llvm/llvm_ocaml.c
@@ -50,13 +50,13 @@ value llvm_string_of_message(char* Message) {
return String;
}
-CAMLprim value ptr_to_option(void *Ptr) {
+value ptr_to_option(void *Ptr) {
if (!Ptr)
return Val_none;
return caml_alloc_some((value)Ptr);
}
-CAMLprim value cstr_to_string(const char *Str, mlsize_t Len) {
+value cstr_to_string(const char *Str, mlsize_t Len) {
if (!Str)
return caml_alloc_string(0);
value String = caml_alloc_string(Len);
@@ -64,7 +64,7 @@ CAMLprim value cstr_to_string(const char *Str, mlsize_t Len) {
return String;
}
-CAMLprim value cstr_to_string_option(const char *CStr, mlsize_t Len) {
+value cstr_to_string_option(const char *CStr, mlsize_t Len) {
if (!CStr)
return Val_none;
value String = caml_alloc_string(Len);
@@ -82,25 +82,25 @@ static void llvm_fatal_error_trampoline(const char *Reason) {
callback(llvm_fatal_error_handler, caml_copy_string(Reason));
}
-CAMLprim value llvm_install_fatal_error_handler(value Handler) {
+value llvm_install_fatal_error_handler(value Handler) {
LLVMInstallFatalErrorHandler(llvm_fatal_error_trampoline);
llvm_fatal_error_handler = Handler;
caml_register_global_root(&llvm_fatal_error_handler);
return Val_unit;
}
-CAMLprim value llvm_reset_fatal_error_handler(value Unit) {
+value llvm_reset_fatal_error_handler(value Unit) {
caml_remove_global_root(&llvm_fatal_error_handler);
LLVMResetFatalErrorHandler();
return Val_unit;
}
-CAMLprim value llvm_enable_pretty_stacktrace(value Unit) {
+value llvm_enable_pretty_stacktrace(value Unit) {
LLVMEnablePrettyStackTrace();
return Val_unit;
}
-CAMLprim value llvm_parse_command_line_options(value Overview, value Args) {
+value llvm_parse_command_line_options(value Overview, value Args) {
const char *COverview;
if (Overview == Val_int(0)) {
COverview = NULL;
@@ -121,7 +121,7 @@ static value alloc_variant(int tag, void *Value) {
llrev_pos idiom. */
#define DEFINE_ITERATORS(camlname, cname, pty, cty, pfun) \
/* llmodule -> ('a, 'b) llpos */ \
- CAMLprim value llvm_##camlname##_begin(pty Mom) { \
+ value llvm_##camlname##_begin(pty Mom) { \
cty First = LLVMGetFirst##cname(Mom); \
if (First) \
return alloc_variant(1, First); \
@@ -129,7 +129,7 @@ static value alloc_variant(int tag, void *Value) {
} \
\
/* llvalue -> ('a, 'b) llpos */ \
- CAMLprim value llvm_##camlname##_succ(cty Kid) { \
+ value llvm_##camlname##_succ(cty Kid) { \
cty Next = LLVMGetNext##cname(Kid); \
if (Next) \
return alloc_variant(1, Next); \
@@ -137,7 +137,7 @@ static value alloc_variant(int tag, void *Value) {
} \
\
/* llmodule -> ('a, 'b) llrev_pos */ \
- CAMLprim value llvm_##camlname##_end(pty Mom) { \
+ value llvm_##camlname##_end(pty Mom) { \
cty Last = LLVMGetLast##cname(Mom); \
if (Last) \
return alloc_variant(1, Last); \
@@ -145,7 +145,7 @@ static value alloc_variant(int tag, void *Value) {
} \
\
/* llvalue -> ('a, 'b) llrev_pos */ \
- CAMLprim value llvm_##camlname##_pred(cty Kid) { \
+ value llvm_##camlname##_pred(cty Kid) { \
cty Prev = LLVMGetPrevious##cname(Kid); \
if (Prev) \
return alloc_variant(1, Prev); \
@@ -160,13 +160,13 @@ void llvm_diagnostic_handler_trampoline(LLVMDiagnosticInfoRef DI,
}
/* Diagnostic.t -> string */
-CAMLprim value llvm_get_diagnostic_description(value Diagnostic) {
+value llvm_get_diagnostic_description(value Diagnostic) {
return llvm_string_of_message(
LLVMGetDiagInfoDescription((LLVMDiagnosticInfoRef)Diagnostic));
}
/* Diagnostic.t -> DiagnosticSeverity.t */
-CAMLprim value llvm_get_diagnostic_severity(value Diagnostic) {
+value llvm_get_diagnostic_severity(value Diagnostic) {
return Val_int(LLVMGetDiagInfoSeverity((LLVMDiagnosticInfoRef)Diagnostic));
}
@@ -180,7 +180,7 @@ static void llvm_remove_diagnostic_handler(LLVMContextRef C) {
}
/* llcontext -> (Diagnostic.t -> unit) option -> unit */
-CAMLprim value llvm_set_diagnostic_handler(LLVMContextRef C, value Handler) {
+value llvm_set_diagnostic_handler(LLVMContextRef C, value Handler) {
llvm_remove_diagnostic_handler(C);
if (Handler == Val_none) {
LLVMContextSetDiagnosticHandler(C, NULL, NULL);
@@ -199,24 +199,24 @@ CAMLprim value llvm_set_diagnostic_handler(LLVMContextRef C, value Handler) {
/*===-- Contexts ----------------------------------------------------------===*/
/* unit -> llcontext */
-CAMLprim LLVMContextRef llvm_create_context(value Unit) {
+LLVMContextRef llvm_create_context(value Unit) {
return LLVMContextCreate();
}
/* llcontext -> unit */
-CAMLprim value llvm_dispose_context(LLVMContextRef C) {
+value llvm_dispose_context(LLVMContextRef C) {
llvm_remove_diagnostic_handler(C);
LLVMContextDispose(C);
return Val_unit;
}
/* unit -> llcontext */
-CAMLprim LLVMContextRef llvm_global_context(value Unit) {
+LLVMContextRef llvm_global_context(value Unit) {
return LLVMGetGlobalContext();
}
/* llcontext -> string -> int */
-CAMLprim value llvm_mdkind_id(LLVMContextRef C, value Name) {
+value llvm_mdkind_id(LLVMContextRef C, value Name) {
unsigned MDKindID = LLVMGetMDKindIDInContext(C, String_val(Name),
caml_string_length(Name));
return Val_int(MDKindID);
@@ -225,7 +225,7 @@ CAMLprim value llvm_mdkind_id(LLVMContextRef C, value Name) {
/*===-- Attributes --------------------------------------------------------===*/
/* string -> llattrkind */
-CAMLprim value llvm_enum_attr_kind(value Name) {
+value llvm_enum_attr_kind(value Name) {
unsigned Kind = LLVMGetEnumAttributeKindForName(
String_val(Name), caml_string_length(Name));
if(Kind == 0)
@@ -234,28 +234,28 @@ CAMLprim value llvm_enum_attr_kind(value Name) {
}
/* llcontext -> int -> int64 -> llattribute */
-CAMLprim LLVMAttributeRef
+LLVMAttributeRef
llvm_create_enum_attr_by_kind(LLVMContextRef C, value Kind, value Value) {
return LLVMCreateEnumAttribute(C, Int_val(Kind), Int64_val(Value));
}
/* llattribute -> bool */
-CAMLprim value llvm_is_enum_attr(LLVMAttributeRef A) {
+value llvm_is_enum_attr(LLVMAttributeRef A) {
return Val_int(LLVMIsEnumAttribute(A));
}
/* llattribute -> llattrkind */
-CAMLprim value llvm_get_enum_attr_kind(LLVMAttributeRef A) {
+value llvm_get_enum_attr_kind(LLVMAttributeRef A) {
return Val_int(LLVMGetEnumAttributeKind(A));
}
/* llattribute -> int64 */
-CAMLprim value llvm_get_enum_attr_value(LLVMAttributeRef A) {
+value llvm_get_enum_attr_value(LLVMAttributeRef A) {
return caml_copy_int64(LLVMGetEnumAttributeValue(A));
}
/* llcontext -> kind:string -> name:string -> llattribute */
-CAMLprim LLVMAttributeRef llvm_create_string_attr(LLVMContextRef C,
+LLVMAttributeRef llvm_create_string_attr(LLVMContextRef C,
value Kind, value Value) {
return LLVMCreateStringAttribute(C,
String_val(Kind), caml_string_length(Kind),
@@ -263,19 +263,19 @@ CAMLprim LLVMAttributeRef llvm_create_string_attr(LLVMContextRef C,
}
/* llattribute -> bool */
-CAMLprim value llvm_is_string_attr(LLVMAttributeRef A) {
+value llvm_is_string_attr(LLVMAttributeRef A) {
return Val_int(LLVMIsStringAttribute(A));
}
/* llattribute -> string */
-CAMLprim value llvm_get_string_attr_kind(LLVMAttributeRef A) {
+value llvm_get_string_attr_kind(LLVMAttributeRef A) {
unsigned Length;
const char *String = LLVMGetStringAttributeKind(A, &Length);
return cstr_to_string (String, Length);
}
/* llattribute -> string */
-CAMLprim value llvm_get_string_attr_value(LLVMAttributeRef A) {
+value llvm_get_string_attr_value(LLVMAttributeRef A) {
unsigned Length;
const char *String = LLVMGetStringAttributeValue(A, &Length);
return cstr_to_string (String, Length);
@@ -284,46 +284,46 @@ CAMLprim value llvm_get_string_attr_value(LLVMAttributeRef A) {
/*===-- Modules -----------------------------------------------------------===*/
/* llcontext -> string -> llmodule */
-CAMLprim LLVMModuleRef llvm_create_module(LLVMContextRef C, value ModuleID) {
+LLVMModuleRef llvm_create_module(LLVMContextRef C, value ModuleID) {
return LLVMModuleCreateWithNameInContext(String_val(ModuleID), C);
}
/* llmodule -> unit */
-CAMLprim value llvm_dispose_module(LLVMModuleRef M) {
+value llvm_dispose_module(LLVMModuleRef M) {
LLVMDisposeModule(M);
return Val_unit;
}
/* llmodule -> string */
-CAMLprim value llvm_target_triple(LLVMModuleRef M) {
+value llvm_target_triple(LLVMModuleRef M) {
return caml_copy_string(LLVMGetTarget(M));
}
/* string -> llmodule -> unit */
-CAMLprim value llvm_set_target_triple(value Trip, LLVMModuleRef M) {
+value llvm_set_target_triple(value Trip, LLVMModuleRef M) {
LLVMSetTarget(M, String_val(Trip));
return Val_unit;
}
/* llmodule -> string */
-CAMLprim value llvm_data_layout(LLVMModuleRef M) {
+value llvm_data_layout(LLVMModuleRef M) {
return caml_copy_string(LLVMGetDataLayout(M));
}
/* string -> llmodule -> unit */
-CAMLprim value llvm_set_data_layout(value Layout, LLVMModuleRef M) {
+value llvm_set_data_layout(value Layout, LLVMModuleRef M) {
LLVMSetDataLayout(M, String_val(Layout));
return Val_unit;
}
/* llmodule -> unit */
-CAMLprim value llvm_dump_module(LLVMModuleRef M) {
+value llvm_dump_module(LLVMModuleRef M) {
LLVMDumpModule(M);
return Val_unit;
}
/* string -> llmodule -> unit */
-CAMLprim value llvm_print_module(value Filename, LLVMModuleRef M) {
+value llvm_print_module(value Filename, LLVMModuleRef M) {
char* Message;
if(LLVMPrintModuleToFile(M, String_val(Filename), &Message))
@@ -333,7 +333,7 @@ CAMLprim value llvm_print_module(value Filename, LLVMModuleRef M) {
}
/* llmodule -> string */
-CAMLprim value llvm_string_of_llmodule(LLVMModuleRef M) {
+value llvm_string_of_llmodule(LLVMModuleRef M) {
char *ModuleCStr = LLVMPrintModuleToString(M);
value ModuleStr = caml_copy_string(ModuleCStr);
LLVMDisposeMessage(ModuleCStr);
@@ -342,31 +342,31 @@ CAMLprim value llvm_string_of_llmodule(LLVMModuleRef M) {
}
/* llmodule -> string */
-CAMLprim value llvm_get_module_identifier(LLVMModuleRef M) {
+value llvm_get_module_identifier(LLVMModuleRef M) {
size_t Len;
const char *Name = LLVMGetModuleIdentifier(M, &Len);
return cstr_to_string(Name, (mlsize_t)Len);
}
/* llmodule -> string -> unit */
-CAMLprim value llvm_set_module_identifier(LLVMModuleRef M, value Id) {
+value llvm_set_module_identifier(LLVMModuleRef M, value Id) {
LLVMSetModuleIdentifier(M, String_val(Id), caml_string_length(Id));
return Val_unit;
}
/* llmodule -> string -> unit */
-CAMLprim value llvm_set_module_inline_asm(LLVMModuleRef M, value Asm) {
+value llvm_set_module_inline_asm(LLVMModuleRef M, value Asm) {
LLVMSetModuleInlineAsm(M, String_val(Asm));
return Val_unit;
}
/* llmodule -> string -> llmetadata option */
-CAMLprim value llvm_get_module_flag(LLVMModuleRef M, value Key) {
+value llvm_get_module_flag(LLVMModuleRef M, value Key) {
return ptr_to_option(
LLVMGetModuleFlag(M, String_val(Key), caml_string_length(Key)));
}
-CAMLprim value llvm_add_module_flag(LLVMModuleRef M,
+value llvm_add_module_flag(LLVMModuleRef M,
LLVMModuleFlagBehavior Behaviour, value Key,
LLVMMetadataRef Val) {
LLVMAddModuleFlag(M, Int_val(Behaviour), String_val(Key),
@@ -377,21 +377,21 @@ CAMLprim value llvm_add_module_flag(LLVMModuleRef M,
/*===-- Types -------------------------------------------------------------===*/
/* lltype -> TypeKind.t */
-CAMLprim value llvm_classify_type(LLVMTypeRef Ty) {
+value llvm_classify_type(LLVMTypeRef Ty) {
return Val_int(LLVMGetTypeKind(Ty));
}
-CAMLprim value llvm_type_is_sized(LLVMTypeRef Ty) {
+value llvm_type_is_sized(LLVMTypeRef Ty) {
return Val_bool(LLVMTypeIsSized(Ty));
}
/* lltype -> llcontext */
-CAMLprim LLVMContextRef llvm_type_context(LLVMTypeRef Ty) {
+LLVMContextRef llvm_type_context(LLVMTypeRef Ty) {
return LLVMGetTypeContext(Ty);
}
/* lltype -> unit */
-CAMLprim value llvm_dump_type(LLVMTypeRef Val) {
+value llvm_dump_type(LLVMTypeRef Val) {
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
LLVMDumpType(Val);
#else
@@ -402,7 +402,7 @@ CAMLprim value llvm_dump_type(LLVMTypeRef Val) {
}
/* lltype -> string */
-CAMLprim value llvm_string_of_lltype(LLVMTypeRef M) {
+value llvm_string_of_lltype(LLVMTypeRef M) {
char *TypeCStr = LLVMPrintTypeToString(M);
value TypeStr = caml_copy_string(TypeCStr);
LLVMDisposeMessage(TypeCStr);
@@ -413,89 +413,89 @@ CAMLprim value llvm_string_of_lltype(LLVMTypeRef M) {
/*--... Operations on integer types ........................................--*/
/* llcontext -> lltype */
-CAMLprim LLVMTypeRef llvm_i1_type (LLVMContextRef Context) {
+LLVMTypeRef llvm_i1_type (LLVMContextRef Context) {
return LLVMInt1TypeInContext(Context);
}
/* llcontext -> lltype */
-CAMLprim LLVMTypeRef llvm_i8_type (LLVMContextRef Context) {
+LLVMTypeRef llvm_i8_type (LLVMContextRef Context) {
return LLVMInt8TypeInContext(Context);
}
/* llcontext -> lltype */
-CAMLprim LLVMTypeRef llvm_i16_type (LLVMContextRef Context) {
+LLVMTypeRef llvm_i16_type (LLVMContextRef Context) {
return LLVMInt16TypeInContext(Context);
}
/* llcontext -> lltype */
-CAMLprim LLVMTypeRef llvm_i32_type (LLVMContextRef Context) {
+LLVMTypeRef llvm_i32_type (LLVMContextRef Context) {
return LLVMInt32TypeInContext(Context);
}
/* llcontext -> lltype */
-CAMLprim LLVMTypeRef llvm_i64_type (LLVMContextRef Context) {
+LLVMTypeRef llvm_i64_type (LLVMContextRef Context) {
return LLVMInt64TypeInContext(Context);
}
/* llcontext -> int -> lltype */
-CAMLprim LLVMTypeRef llvm_integer_type(LLVMContextRef Context, value Width) {
+LLVMTypeRef llvm_integer_type(LLVMContextRef Context, value Width) {
return LLVMIntTypeInContext(Context, Int_val(Width));
}
/* lltype -> int */
-CAMLprim value llvm_integer_bitwidth(LLVMTypeRef IntegerTy) {
+value llvm_integer_bitwidth(LLVMTypeRef IntegerTy) {
return Val_int(LLVMGetIntTypeWidth(IntegerTy));
}
/*--... Operations on real types ...........................................--*/
/* llcontext -> lltype */
-CAMLprim LLVMTypeRef llvm_float_type(LLVMContextRef Context) {
+LLVMTypeRef llvm_float_type(LLVMContextRef Context) {
return LLVMFloatTypeInContext(Context);
}
/* llcontext -> lltype */
-CAMLprim LLVMTypeRef llvm_double_type(LLVMContextRef Context) {
+LLVMTypeRef llvm_double_type(LLVMContextRef Context) {
return LLVMDoubleTypeInContext(Context);
}
/* llcontext -> lltype */
-CAMLprim LLVMTypeRef llvm_x86fp80_type(LLVMContextRef Context) {
+LLVMTypeRef llvm_x86fp80_type(LLVMContextRef Context) {
return LLVMX86FP80TypeInContext(Context);
}
/* llcontext -> lltype */
-CAMLprim LLVMTypeRef llvm_fp128_type(LLVMContextRef Context) {
+LLVMTypeRef llvm_fp128_type(LLVMContextRef Context) {
return LLVMFP128TypeInContext(Context);
}
/* llcontext -> lltype */
-CAMLprim LLVMTypeRef llvm_ppc_fp128_type(LLVMContextRef Context) {
+LLVMTypeRef llvm_ppc_fp128_type(LLVMContextRef Context) {
return LLVMPPCFP128TypeInContext(Context);
}
/*--... Operations on function types .......................................--*/
/* lltype -> lltype array -> lltype */
-CAMLprim LLVMTypeRef llvm_function_type(LLVMTypeRef RetTy, value ParamTys) {
+LLVMTypeRef llvm_function_type(LLVMTypeRef RetTy, value ParamTys) {
return LLVMFunctionType(RetTy, (LLVMTypeRef *) ParamTys,
Wosize_val(ParamTys), 0);
}
/* lltype -> lltype array -> lltype */
-CAMLprim LLVMTypeRef llvm_var_arg_function_type(LLVMTypeRef RetTy,
+LLVMTypeRef llvm_var_arg_function_type(LLVMTypeRef RetTy,
value ParamTys) {
return LLVMFunctionType(RetTy, (LLVMTypeRef *) ParamTys,
Wosize_val(ParamTys), 1);
}
/* lltype -> bool */
-CAMLprim value llvm_is_var_arg(LLVMTypeRef FunTy) {
+value llvm_is_var_arg(LLVMTypeRef FunTy) {
return Val_bool(LLVMIsFunctionVarArg(FunTy));
}
/* lltype -> lltype array */
-CAMLprim value llvm_param_types(LLVMTypeRef FunTy) {
+value llvm_param_types(LLVMTypeRef FunTy) {
value Tys = caml_alloc_tuple_uninit(LLVMCountParamTypes(FunTy));
LLVMGetParamTypes(FunTy, (LLVMTypeRef *)Op_val(Tys));
return Tys;
@@ -504,25 +504,25 @@ CAMLprim value llvm_param_types(LLVMTypeRef FunTy) {
/*--... Operations on struct types .........................................--*/
/* llcontext -> lltype array -> lltype */
-CAMLprim LLVMTypeRef llvm_struct_type(LLVMContextRef C, value ElementTypes) {
+LLVMTypeRef llvm_struct_type(LLVMContextRef C, value ElementTypes) {
return LLVMStructTypeInContext(C, (LLVMTypeRef *) ElementTypes,
Wosize_val(ElementTypes), 0);
}
/* llcontext -> lltype array -> lltype */
-CAMLprim LLVMTypeRef llvm_packed_struct_type(LLVMContextRef C,
+LLVMTypeRef llvm_packed_struct_type(LLVMContextRef C,
value ElementTypes) {
return LLVMStructTypeInContext(C, (LLVMTypeRef *) ElementTypes,
Wosize_val(ElementTypes), 1);
}
/* llcontext -> string -> lltype */
-CAMLprim LLVMTypeRef llvm_named_struct_type(LLVMContextRef C,
+LLVMTypeRef llvm_named_struct_type(LLVMContextRef C,
value Name) {
return LLVMStructCreateNamed(C, String_val(Name));
}
-CAMLprim value llvm_struct_set_body(LLVMTypeRef Ty,
+value llvm_struct_set_body(LLVMTypeRef Ty,
value ElementTypes,
value Packed) {
LLVMStructSetBody(Ty, (LLVMTypeRef *) ElementTypes,
@@ -531,7 +531,7 @@ CAMLprim value llvm_struct_set_body(LLVMTypeRef Ty,
}
/* lltype -> string option */
-CAMLprim value llvm_struct_name(LLVMTypeRef Ty) {
+value llvm_struct_name(LLVMTypeRef Ty) {
const char *CStr = LLVMGetStructName(Ty);
size_t Len;
if (!CStr)
@@ -541,31 +541,31 @@ CAMLprim value llvm_struct_name(LLVMTypeRef Ty) {
}
/* lltype -> lltype array */
-CAMLprim value llvm_struct_element_types(LLVMTypeRef StructTy) {
+value llvm_struct_element_types(LLVMTypeRef StructTy) {
value Tys = caml_alloc_tuple_uninit(LLVMCountStructElementTypes(StructTy));
LLVMGetStructElementTypes(StructTy, (LLVMTypeRef *)Op_val(Tys));
return Tys;
}
/* lltype -> bool */
-CAMLprim value llvm_is_packed(LLVMTypeRef StructTy) {
+value llvm_is_packed(LLVMTypeRef StructTy) {
return Val_bool(LLVMIsPackedStruct(StructTy));
}
/* lltype -> bool */
-CAMLprim value llvm_is_opaque(LLVMTypeRef StructTy) {
+value llvm_is_opaque(LLVMTypeRef StructTy) {
return Val_bool(LLVMIsOpaqueStruct(StructTy));
}
/* lltype -> bool */
-CAMLprim value llvm_is_literal(LLVMTypeRef StructTy) {
+value llvm_is_literal(LLVMTypeRef StructTy) {
return Val_bool(LLVMIsLiteralStruct(StructTy));
}
/*--... Operations on array, pointer, and vector types .....................--*/
/* lltype -> lltype array */
-CAMLprim value llvm_subtypes(LLVMTypeRef Ty) {
+value llvm_subtypes(LLVMTypeRef Ty) {
unsigned Size = LLVMGetNumContainedTypes(Ty);
value Arr = caml_alloc_tuple_uninit(Size);
LLVMGetSubtypes(Ty, (LLVMTypeRef *)Op_val(Arr));
@@ -573,66 +573,66 @@ CAMLprim value llvm_subtypes(LLVMTypeRef Ty) {
}
/* lltype -> int -> lltype */
-CAMLprim LLVMTypeRef llvm_array_type(LLVMTypeRef ElementTy, value Count) {
+LLVMTypeRef llvm_array_type(LLVMTypeRef ElementTy, value Count) {
return LLVMArrayType(ElementTy, Int_val(Count));
}
/* lltype -> lltype */
-CAMLprim LLVMTypeRef llvm_pointer_type(LLVMTypeRef ElementTy) {
+LLVMTypeRef llvm_pointer_type(LLVMTypeRef ElementTy) {
return LLVMPointerType(ElementTy, 0);
}
/* lltype -> int -> lltype */
-CAMLprim LLVMTypeRef llvm_qualified_pointer_type(LLVMTypeRef ElementTy,
+LLVMTypeRef llvm_qualified_pointer_type(LLVMTypeRef ElementTy,
value AddressSpace) {
return LLVMPointerType(ElementTy, Int_val(AddressSpace));
}
/* lltype -> int -> lltype */
-CAMLprim LLVMTypeRef llvm_vector_type(LLVMTypeRef ElementTy, value Count) {
+LLVMTypeRef llvm_vector_type(LLVMTypeRef ElementTy, value Count) {
return LLVMVectorType(ElementTy, Int_val(Count));
}
/* lltype -> int */
-CAMLprim value llvm_array_length(LLVMTypeRef ArrayTy) {
+value llvm_array_length(LLVMTypeRef ArrayTy) {
return Val_int(LLVMGetArrayLength(ArrayTy));
}
/* lltype -> int */
-CAMLprim value llvm_address_space(LLVMTypeRef PtrTy) {
+value llvm_address_space(LLVMTypeRef PtrTy) {
return Val_int(LLVMGetPointerAddressSpace(PtrTy));
}
/* lltype -> int */
-CAMLprim value llvm_vector_size(LLVMTypeRef VectorTy) {
+value llvm_vector_size(LLVMTypeRef VectorTy) {
return Val_int(LLVMGetVectorSize(VectorTy));
}
/*--... Operations on other types ..........................................--*/
/* llcontext -> lltype */
-CAMLprim LLVMTypeRef llvm_void_type (LLVMContextRef Context) {
+LLVMTypeRef llvm_void_type (LLVMContextRef Context) {
return LLVMVoidTypeInContext(Context);
}
/* llcontext -> lltype */
-CAMLprim LLVMTypeRef llvm_label_type(LLVMContextRef Context) {
+LLVMTypeRef llvm_label_type(LLVMContextRef Context) {
return LLVMLabelTypeInContext(Context);
}
/* llcontext -> lltype */
-CAMLprim LLVMTypeRef llvm_x86_mmx_type(LLVMContextRef Context) {
+LLVMTypeRef llvm_x86_mmx_type(LLVMContextRef Context) {
return LLVMX86MMXTypeInContext(Context);
}
-CAMLprim value llvm_type_by_name(LLVMModuleRef M, value Name) {
+value llvm_type_by_name(LLVMModuleRef M, value Name) {
return ptr_to_option(LLVMGetTypeByName(M, String_val(Name)));
}
/*===-- VALUES ------------------------------------------------------------===*/
/* llvalue -> lltype */
-CAMLprim LLVMTypeRef llvm_type_of(LLVMValueRef Val) {
+LLVMTypeRef llvm_type_of(LLVMValueRef Val) {
return LLVMTypeOf(Val);
}
@@ -668,7 +668,7 @@ enum ValueKind {
#define DEFINE_CASE(Val, Kind) \
do {if (LLVMIsA##Kind(Val)) return Val_int(Kind);} while(0)
-CAMLprim value llvm_classify_value(LLVMValueRef Val) {
+value llvm_classify_value(LLVMValueRef Val) {
if (!Val)
return Val_int(NullValue);
if (LLVMIsAConstant(Val)) {
@@ -706,24 +706,24 @@ CAMLprim value llvm_classify_value(LLVMValueRef Val) {
}
/* llvalue -> string */
-CAMLprim value llvm_value_name(LLVMValueRef Val) {
+value llvm_value_name(LLVMValueRef Val) {
return caml_copy_string(LLVMGetValueName(Val));
}
/* string -> llvalue -> unit */
-CAMLprim value llvm_set_value_name(value Name, LLVMValueRef Val) {
+value llvm_set_value_name(value Name, LLVMValueRef Val) {
LLVMSetValueName(Val, String_val(Name));
return Val_unit;
}
/* llvalue -> unit */
-CAMLprim value llvm_dump_value(LLVMValueRef Val) {
+value llvm_dump_value(LLVMValueRef Val) {
LLVMDumpValue(Val);
return Val_unit;
}
/* llvalue -> string */
-CAMLprim value llvm_string_of_llvalue(LLVMValueRef M) {
+value llvm_string_of_llvalue(LLVMValueRef M) {
char *ValueCStr = LLVMPrintValueToString(M);
value ValueStr = caml_copy_string(ValueCStr);
LLVMDisposeMessage(ValueCStr);
@@ -732,7 +732,7 @@ CAMLprim value llvm_string_of_llvalue(LLVMValueRef M) {
}
/* llvalue -> llvalue -> unit */
-CAMLprim value llvm_replace_all_uses_with(LLVMValueRef OldVal,
+value llvm_replace_all_uses_with(LLVMValueRef OldVal,
LLVMValueRef NewVal) {
LLVMReplaceAllUsesWith(OldVal, NewVal);
return Val_unit;
@@ -741,28 +741,28 @@ CAMLprim value llvm_replace_all_uses_with(LLVMValueRef OldVal,
/*--... Operations on users ................................................--*/
/* llvalue -> int -> llvalue */
-CAMLprim LLVMValueRef llvm_operand(LLVMValueRef V, value I) {
+LLVMValueRef llvm_operand(LLVMValueRef V, value I) {
return LLVMGetOperand(V, Int_val(I));
}
/* llvalue -> int -> lluse */
-CAMLprim LLVMUseRef llvm_operand_use(LLVMValueRef V, value I) {
+LLVMUseRef llvm_operand_use(LLVMValueRef V, value I) {
return LLVMGetOperandUse(V, Int_val(I));
}
/* llvalue -> int -> llvalue -> unit */
-CAMLprim value llvm_set_operand(LLVMValueRef U, value I, LLVMValueRef V) {
+value llvm_set_operand(LLVMValueRef U, value I, LLVMValueRef V) {
LLVMSetOperand(U, Int_val(I), V);
return Val_unit;
}
/* llvalue -> int */
-CAMLprim value llvm_num_operands(LLVMValueRef V) {
+value llvm_num_operands(LLVMValueRef V) {
return Val_int(LLVMGetNumOperands(V));
}
/* llvalue -> int array */
-CAMLprim value llvm_indices(LLVMValueRef Instr) {
+value llvm_indices(LLVMValueRef Instr) {
unsigned n = LLVMGetNumIndices(Instr);
const unsigned *Indices = LLVMGetIndices(Instr);
value indices = caml_alloc_tuple_uninit(n);
@@ -775,27 +775,27 @@ CAMLprim value llvm_indices(LLVMValueRef Instr) {
/*--... Operations on constants of (mostly) any type .......................--*/
/* llvalue -> bool */
-CAMLprim value llvm_is_constant(LLVMValueRef Val) {
+value llvm_is_constant(LLVMValueRef Val) {
return Val_bool(LLVMIsConstant(Val));
}
/* llvalue -> bool */
-CAMLprim value llvm_is_null(LLVMValueRef Val) {
+value llvm_is_null(LLVMValueRef Val) {
return Val_bool(LLVMIsNull(Val));
}
/* llvalue -> bool */
-CAMLprim value llvm_is_undef(LLVMValueRef Val) {
+value llvm_is_undef(LLVMValueRef Val) {
return Val_bool(LLVMIsUndef(Val));
}
/* llvalue -> bool */
-CAMLprim value llvm_is_poison(LLVMValueRef Val) {
+value llvm_is_poison(LLVMValueRef Val) {
return Val_bool(LLVMIsPoison(Val));
}
/* llvalue -> Opcode.t */
-CAMLprim value llvm_constexpr_get_opcode(LLVMValueRef Val) {
+value llvm_constexpr_get_opcode(LLVMValueRef Val) {
return LLVMIsAConstantExpr(Val) ?
Val_int(LLVMGetConstOpcode(Val)) : Val_int(0);
}
@@ -803,24 +803,24 @@ CAMLprim value llvm_constexpr_get_opcode(LLVMValueRef Val) {
/*--... Operations on instructions .........................................--*/
/* llvalue -> bool */
-CAMLprim value llvm_has_metadata(LLVMValueRef Val) {
+value llvm_has_metadata(LLVMValueRef Val) {
return Val_bool(LLVMHasMetadata(Val));
}
/* llvalue -> int -> llvalue option */
-CAMLprim value llvm_metadata(LLVMValueRef Val, value MDKindID) {
+value llvm_metadata(LLVMValueRef Val, value MDKindID) {
return ptr_to_option(LLVMGetMetadata(Val, Int_val(MDKindID)));
}
/* llvalue -> int -> llvalue -> unit */
-CAMLprim value llvm_set_metadata(LLVMValueRef Val, value MDKindID,
+value llvm_set_metadata(LLVMValueRef Val, value MDKindID,
LLVMValueRef MD) {
LLVMSetMetadata(Val, Int_val(MDKindID), MD);
return Val_unit;
}
/* llvalue -> int -> unit */
-CAMLprim value llvm_clear_metadata(LLVMValueRef Val, value MDKindID) {
+value llvm_clear_metadata(LLVMValueRef Val, value MDKindID) {
LLVMSetMetadata(Val, Int_val(MDKindID), NULL);
return Val_unit;
}
@@ -829,29 +829,29 @@ CAMLprim value llvm_clear_metadata(LLVMValueRef Val, value MDKindID) {
/*--... Operations on metadata .............................................--*/
/* llcontext -> string -> llvalue */
-CAMLprim LLVMValueRef llvm_mdstring(LLVMContextRef C, value S) {
+LLVMValueRef llvm_mdstring(LLVMContextRef C, value S) {
return LLVMMDStringInContext(C, String_val(S), caml_string_length(S));
}
/* llcontext -> llvalue array -> llvalue */
-CAMLprim LLVMValueRef llvm_mdnode(LLVMContextRef C, value ElementVals) {
+LLVMValueRef llvm_mdnode(LLVMContextRef C, value ElementVals) {
return LLVMMDNodeInContext(C, (LLVMValueRef*) Op_val(ElementVals),
Wosize_val(ElementVals));
}
/* llcontext -> llvalue */
-CAMLprim LLVMValueRef llvm_mdnull(LLVMContextRef C) {
+LLVMValueRef llvm_mdnull(LLVMContextRef C) {
return NULL;
}
/* llvalue -> string option */
-CAMLprim value llvm_get_mdstring(LLVMValueRef V) {
+value llvm_get_mdstring(LLVMValueRef V) {
unsigned Len;
const char *CStr = LLVMGetMDString(V, &Len);
return cstr_to_string_option(CStr, Len);
}
-CAMLprim value llvm_get_mdnode_operands(LLVMValueRef V) {
+value llvm_get_mdnode_operands(LLVMValueRef V) {
unsigned int n = LLVMGetMDNodeNumOperands(V);
value Operands = caml_alloc_tuple_uninit(n);
LLVMGetMDNodeOperands(V, (LLVMValueRef *)Op_val(Operands));
@@ -859,7 +859,7 @@ CAMLprim value llvm_get_mdnode_operands(LLVMValueRef V) {
}
/* llmodule -> string -> llvalue array */
-CAMLprim value llvm_get_namedmd(LLVMModuleRef M, value Name) {
+value llvm_get_namedmd(LLVMModuleRef M, value Name) {
CAMLparam1(Name);
value Nodes = caml_alloc_tuple_uninit(
LLVMGetNamedMetadataNumOperands(M, String_val(Name)));
@@ -869,18 +869,18 @@ CAMLprim value llvm_get_namedmd(LLVMModuleRef M, value Name) {
}
/* llmodule -> string -> llvalue -> unit */
-CAMLprim value llvm_append_namedmd(LLVMModuleRef M, value Name, LLVMValueRef Val) {
+value llvm_append_namedmd(LLVMModuleRef M, value Name, LLVMValueRef Val) {
LLVMAddNamedMetadataOperand(M, String_val(Name), Val);
return Val_unit;
}
/* llvalue -> llmetadata */
-CAMLprim LLVMMetadataRef llvm_value_as_metadata(LLVMValueRef Val) {
+LLVMMetadataRef llvm_value_as_metadata(LLVMValueRef Val) {
return LLVMValueAsMetadata(Val);
}
/* llcontext -> llmetadata -> llvalue */
-CAMLprim LLVMValueRef llvm_metadata_as_value(LLVMContextRef C,
+LLVMValueRef llvm_metadata_as_value(LLVMContextRef C,
LLVMMetadataRef MD) {
return LLVMMetadataAsValue(C, MD);
}
@@ -888,18 +888,18 @@ CAMLprim LLVMValueRef llvm_metadata_as_value(LLVMContextRef C,
/*--... Operations on scalar constants .....................................--*/
/* lltype -> int -> llvalue */
-CAMLprim LLVMValueRef llvm_const_int(LLVMTypeRef IntTy, value N) {
+LLVMValueRef llvm_const_int(LLVMTypeRef IntTy, value N) {
return LLVMConstInt(IntTy, (long long) Long_val(N), 1);
}
/* lltype -> Int64.t -> bool -> llvalue */
-CAMLprim LLVMValueRef llvm_const_of_int64(LLVMTypeRef IntTy, value N,
+LLVMValueRef llvm_const_of_int64(LLVMTypeRef IntTy, value N,
value SExt) {
return LLVMConstInt(IntTy, Int64_val(N), Bool_val(SExt));
}
/* llvalue -> Int64.t */
-CAMLprim value llvm_int64_of_const(LLVMValueRef Const) {
+value llvm_int64_of_const(LLVMValueRef Const) {
if (!(LLVMIsAConstantInt(Const)) ||
!(LLVMGetIntTypeWidth(LLVMTypeOf(Const)) <= 64))
return Val_none;
@@ -907,19 +907,19 @@ CAMLprim value llvm_int64_of_const(LLVMValueRef Const) {
}
/* lltype -> string -> int -> llvalue */
-CAMLprim LLVMValueRef llvm_const_int_of_string(LLVMTypeRef IntTy, value S,
+LLVMValueRef llvm_const_int_of_string(LLVMTypeRef IntTy, value S,
value Radix) {
return LLVMConstIntOfStringAndSize(IntTy, String_val(S), caml_string_length(S),
Int_val(Radix));
}
/* lltype -> float -> llvalue */
-CAMLprim LLVMValueRef llvm_const_float(LLVMTypeRef RealTy, value N) {
+LLVMValueRef llvm_const_float(LLVMTypeRef RealTy, value N) {
return LLVMConstReal(RealTy, Double_val(N));
}
/* llvalue -> float */
-CAMLprim value llvm_float_of_const(LLVMValueRef Const) {
+value llvm_float_of_const(LLVMValueRef Const) {
LLVMBool LosesInfo;
double Result;
if (!LLVMIsAConstantFP(Const))
@@ -931,7 +931,7 @@ CAMLprim value llvm_float_of_const(LLVMValueRef Const) {
}
/* lltype -> string -> llvalue */
-CAMLprim LLVMValueRef llvm_const_float_of_string(LLVMTypeRef RealTy, value S) {
+LLVMValueRef llvm_const_float_of_string(LLVMTypeRef RealTy, value S) {
return LLVMConstRealOfStringAndSize(RealTy, String_val(S),
caml_string_length(S));
}
@@ -939,52 +939,52 @@ CAMLprim LLVMValueRef llvm_const_float_of_string(LLVMTypeRef RealTy, value S) {
/*--... Operations on composite constants ..................................--*/
/* llcontext -> string -> llvalue */
-CAMLprim LLVMValueRef llvm_const_string(LLVMContextRef Context, value Str,
+LLVMValueRef llvm_const_string(LLVMContextRef Context, value Str,
value NullTerminate) {
return LLVMConstStringInContext(Context, String_val(Str), string_length(Str),
1);
}
/* llcontext -> string -> llvalue */
-CAMLprim LLVMValueRef llvm_const_stringz(LLVMContextRef Context, value Str,
+LLVMValueRef llvm_const_stringz(LLVMContextRef Context, value Str,
value NullTerminate) {
return LLVMConstStringInContext(Context, String_val(Str), string_length(Str),
0);
}
/* lltype -> llvalue array -> llvalue */
-CAMLprim LLVMValueRef llvm_const_array(LLVMTypeRef ElementTy,
+LLVMValueRef llvm_const_array(LLVMTypeRef ElementTy,
value ElementVals) {
return LLVMConstArray(ElementTy, (LLVMValueRef*) Op_val(ElementVals),
Wosize_val(ElementVals));
}
/* llcontext -> llvalue array -> llvalue */
-CAMLprim LLVMValueRef llvm_const_struct(LLVMContextRef C, value ElementVals) {
+LLVMValueRef llvm_const_struct(LLVMContextRef C, value ElementVals) {
return LLVMConstStructInContext(C, (LLVMValueRef *) Op_val(ElementVals),
Wosize_val(ElementVals), 0);
}
/* lltype -> llvalue array -> llvalue */
-CAMLprim LLVMValueRef llvm_const_named_struct(LLVMTypeRef Ty, value ElementVals) {
+LLVMValueRef llvm_const_named_struct(LLVMTypeRef Ty, value ElementVals) {
return LLVMConstNamedStruct(Ty, (LLVMValueRef *) Op_val(ElementVals), Wosize_val(ElementVals));
}
/* llcontext -> llvalue array -> llvalue */
-CAMLprim LLVMValueRef llvm_const_packed_struct(LLVMContextRef C,
+LLVMValueRef llvm_const_packed_struct(LLVMContextRef C,
value ElementVals) {
return LLVMConstStructInContext(C, (LLVMValueRef *) Op_val(ElementVals),
Wosize_val(ElementVals), 1);
}
/* llvalue array -> llvalue */
-CAMLprim LLVMValueRef llvm_const_vector(value ElementVals) {
+LLVMValueRef llvm_const_vector(value ElementVals) {
return LLVMConstVector((LLVMValueRef*) Op_val(ElementVals),
Wosize_val(ElementVals));
}
/* llvalue -> string option */
-CAMLprim value llvm_string_of_const(LLVMValueRef Const) {
+value llvm_string_of_const(LLVMValueRef Const) {
size_t Len;
const char *CStr;
if (!LLVMIsAConstantDataSequential(Const) || !LLVMIsConstantString(Const))
@@ -994,47 +994,47 @@ CAMLprim value llvm_string_of_const(LLVMValueRef Const) {
}
/* llvalue -> int -> llvalue */
-CAMLprim LLVMValueRef llvm_const_element(LLVMValueRef Const, value N) {
+LLVMValueRef llvm_const_element(LLVMValueRef Const, value N) {
return LLVMGetElementAsConstant(Const, Int_val(N));
}
/*--... Constant expressions ...............................................--*/
/* Icmp.t -> llvalue -> llvalue -> llvalue */
-CAMLprim LLVMValueRef llvm_const_icmp(value Pred,
+LLVMValueRef llvm_const_icmp(value Pred,
LLVMValueRef LHSConstant,
LLVMValueRef RHSConstant) {
return LLVMConstICmp(Int_val(Pred) + LLVMIntEQ, LHSConstant, RHSConstant);
}
/* Fcmp.t -> llvalue -> llvalue -> llvalue */
-CAMLprim LLVMValueRef llvm_const_fcmp(value Pred,
+LLVMValueRef llvm_const_fcmp(value Pred,
LLVMValueRef LHSConstant,
LLVMValueRef RHSConstant) {
return LLVMConstFCmp(Int_val(Pred), LHSConstant, RHSConstant);
}
/* llvalue -> llvalue array -> llvalue */
-CAMLprim LLVMValueRef llvm_const_gep(LLVMValueRef ConstantVal, value Indices) {
+LLVMValueRef llvm_const_gep(LLVMValueRef ConstantVal, value Indices) {
return LLVMConstGEP(ConstantVal, (LLVMValueRef*) Op_val(Indices),
Wosize_val(Indices));
}
/* llvalue -> llvalue array -> llvalue */
-CAMLprim LLVMValueRef llvm_const_in_bounds_gep(LLVMValueRef ConstantVal,
+LLVMValueRef llvm_const_in_bounds_gep(LLVMValueRef ConstantVal,
value Indices) {
return LLVMConstInBoundsGEP(ConstantVal, (LLVMValueRef*) Op_val(Indices),
Wosize_val(Indices));
}
/* llvalue -> lltype -> is_signed:bool -> llvalue */
-CAMLprim LLVMValueRef llvm_const_intcast(LLVMValueRef CV, LLVMTypeRef T,
+LLVMValueRef llvm_const_intcast(LLVMValueRef CV, LLVMTypeRef T,
value IsSigned) {
return LLVMConstIntCast(CV, T, Bool_val(IsSigned));
}
/* llvalue -> int array -> llvalue */
-CAMLprim LLVMValueRef llvm_const_extractvalue(LLVMValueRef Aggregate,
+LLVMValueRef llvm_const_extractvalue(LLVMValueRef Aggregate,
value Indices) {
int size = Wosize_val(Indices);
int i;
@@ -1051,7 +1051,7 @@ CAMLprim LLVMValueRef llvm_const_extractvalue(LLVMValueRef Aggregate,
}
/* llvalue -> llvalue -> int array -> llvalue */
-CAMLprim LLVMValueRef llvm_const_insertvalue(LLVMValueRef Aggregate,
+LLVMValueRef llvm_const_insertvalue(LLVMValueRef Aggregate,
LLVMValueRef Val, value Indices) {
int size = Wosize_val(Indices);
int i;
@@ -1068,7 +1068,7 @@ CAMLprim LLVMValueRef llvm_const_insertvalue(LLVMValueRef Aggregate,
}
/* lltype -> string -> string -> bool -> bool -> llvalue */
-CAMLprim LLVMValueRef llvm_const_inline_asm(LLVMTypeRef Ty, value Asm,
+LLVMValueRef llvm_const_inline_asm(LLVMTypeRef Ty, value Asm,
value Constraints, value HasSideEffects,
value IsAlignStack) {
return LLVMConstInlineAsm(Ty, String_val(Asm), String_val(Constraints),
@@ -1078,78 +1078,78 @@ CAMLprim LLVMValueRef llvm_const_inline_asm(LLVMTypeRef Ty, value Asm,
/*--... Operations on global variables, functions, and aliases (globals) ...--*/
/* llvalue -> bool */
-CAMLprim value llvm_is_declaration(LLVMValueRef Global) {
+value llvm_is_declaration(LLVMValueRef Global) {
return Val_bool(LLVMIsDeclaration(Global));
}
/* llvalue -> Linkage.t */
-CAMLprim value llvm_linkage(LLVMValueRef Global) {
+value llvm_linkage(LLVMValueRef Global) {
return Val_int(LLVMGetLinkage(Global));
}
/* Linkage.t -> llvalue -> unit */
-CAMLprim value llvm_set_linkage(value Linkage, LLVMValueRef Global) {
+value llvm_set_linkage(value Linkage, LLVMValueRef Global) {
LLVMSetLinkage(Global, Int_val(Linkage));
return Val_unit;
}
/* llvalue -> bool */
-CAMLprim value llvm_unnamed_addr(LLVMValueRef Global) {
+value llvm_unnamed_addr(LLVMValueRef Global) {
return Val_bool(LLVMHasUnnamedAddr(Global));
}
/* bool -> llvalue -> unit */
-CAMLprim value llvm_set_unnamed_addr(value UseUnnamedAddr, LLVMValueRef Global) {
+value llvm_set_unnamed_addr(value UseUnnamedAddr, LLVMValueRef Global) {
LLVMSetUnnamedAddr(Global, Bool_val(UseUnnamedAddr));
return Val_unit;
}
/* llvalue -> string */
-CAMLprim value llvm_section(LLVMValueRef Global) {
+value llvm_section(LLVMValueRef Global) {
return caml_copy_string(LLVMGetSection(Global));
}
/* string -> llvalue -> unit */
-CAMLprim value llvm_set_section(value Section, LLVMValueRef Global) {
+value llvm_set_section(value Section, LLVMValueRef Global) {
LLVMSetSection(Global, String_val(Section));
return Val_unit;
}
/* llvalue -> Visibility.t */
-CAMLprim value llvm_visibility(LLVMValueRef Global) {
+value llvm_visibility(LLVMValueRef Global) {
return Val_int(LLVMGetVisibility(Global));
}
/* Visibility.t -> llvalue -> unit */
-CAMLprim value llvm_set_visibility(value Viz, LLVMValueRef Global) {
+value llvm_set_visibility(value Viz, LLVMValueRef Global) {
LLVMSetVisibility(Global, Int_val(Viz));
return Val_unit;
}
/* llvalue -> DLLStorageClass.t */
-CAMLprim value llvm_dll_storage_class(LLVMValueRef Global) {
+value llvm_dll_storage_class(LLVMValueRef Global) {
return Val_int(LLVMGetDLLStorageClass(Global));
}
/* DLLStorageClass.t -> llvalue -> unit */
-CAMLprim value llvm_set_dll_storage_class(value Viz, LLVMValueRef Global) {
+value llvm_set_dll_storage_class(value Viz, LLVMValueRef Global) {
LLVMSetDLLStorageClass(Global, Int_val(Viz));
return Val_unit;
}
/* llvalue -> int */
-CAMLprim value llvm_alignment(LLVMValueRef Global) {
+value llvm_alignment(LLVMValueRef Global) {
return Val_int(LLVMGetAlignment(Global));
}
/* int -> llvalue -> unit */
-CAMLprim value llvm_set_alignment(value Bytes, LLVMValueRef Global) {
+value llvm_set_alignment(value Bytes, LLVMValueRef Global) {
LLVMSetAlignment(Global, Int_val(Bytes));
return Val_unit;
}
/* llvalue -> (llmdkind * llmetadata) array */
-CAMLprim value llvm_global_copy_all_metadata(LLVMValueRef Global) {
+value llvm_global_copy_all_metadata(LLVMValueRef Global) {
CAMLparam0();
CAMLlocal1(Array);
size_t NumEntries;
@@ -1169,22 +1169,22 @@ CAMLprim value llvm_global_copy_all_metadata(LLVMValueRef Global) {
/*--... Operations on uses .................................................--*/
/* llvalue -> lluse option */
-CAMLprim value llvm_use_begin(LLVMValueRef Val) {
+value llvm_use_begin(LLVMValueRef Val) {
return ptr_to_option(LLVMGetFirstUse(Val));
}
/* lluse -> lluse option */
-CAMLprim value llvm_use_succ(LLVMUseRef U) {
+value llvm_use_succ(LLVMUseRef U) {
return ptr_to_option(LLVMGetNextUse(U));
}
/* lluse -> llvalue */
-CAMLprim LLVMValueRef llvm_user(LLVMUseRef UR) {
+LLVMValueRef llvm_user(LLVMUseRef UR) {
return LLVMGetUser(UR);
}
/* lluse -> llvalue */
-CAMLprim LLVMValueRef llvm_used_value(LLVMUseRef UR) {
+LLVMValueRef llvm_used_value(LLVMUseRef UR) {
return LLVMGetUsedValue(UR);
}
@@ -1194,7 +1194,7 @@ DEFINE_ITERATORS(global, Global, LLVMModuleRef, LLVMValueRef,
LLVMGetGlobalParent)
/* lltype -> string -> llmodule -> llvalue */
-CAMLprim LLVMValueRef llvm_declare_global(LLVMTypeRef Ty, value Name,
+LLVMValueRef llvm_declare_global(LLVMTypeRef Ty, value Name,
LLVMModuleRef M) {
LLVMValueRef GlobalVar;
if ((GlobalVar = LLVMGetNamedGlobal(M, String_val(Name)))) {
@@ -1206,7 +1206,7 @@ CAMLprim LLVMValueRef llvm_declare_global(LLVMTypeRef Ty, value Name,
}
/* lltype -> string -> int -> llmodule -> llvalue */
-CAMLprim LLVMValueRef llvm_declare_qualified_global(LLVMTypeRef Ty, value Name,
+LLVMValueRef llvm_declare_qualified_global(LLVMTypeRef Ty, value Name,
value AddressSpace,
LLVMModuleRef M) {
LLVMValueRef GlobalVar;
@@ -1221,12 +1221,12 @@ CAMLprim LLVMValueRef llvm_declare_qualified_global(LLVMTypeRef Ty, value Name,
}
/* string -> llmodule -> llvalue option */
-CAMLprim value llvm_lookup_global(value Name, LLVMModuleRef M) {
+value llvm_lookup_global(value Name, LLVMModuleRef M) {
return ptr_to_option(LLVMGetNamedGlobal(M, String_val(Name)));
}
/* string -> llvalue -> llmodule -> llvalue */
-CAMLprim LLVMValueRef llvm_define_global(value Name, LLVMValueRef Initializer,
+LLVMValueRef llvm_define_global(value Name, LLVMValueRef Initializer,
LLVMModuleRef M) {
LLVMValueRef GlobalVar = LLVMAddGlobal(M, LLVMTypeOf(Initializer),
String_val(Name));
@@ -1235,7 +1235,7 @@ CAMLprim LLVMValueRef llvm_define_global(value Name, LLVMValueRef Initializer,
}
/* string -> llvalue -> int -> llmodule -> llvalue */
-CAMLprim LLVMValueRef llvm_define_qualified_global(value Name,
+LLVMValueRef llvm_define_qualified_global(value Name,
LLVMValueRef Initializer,
value AddressSpace,
LLVMModuleRef M) {
@@ -1248,79 +1248,79 @@ CAMLprim LLVMValueRef llvm_define_qualified_global(value Name,
}
/* llvalue -> unit */
-CAMLprim value llvm_delete_global(LLVMValueRef GlobalVar) {
+value llvm_delete_global(LLVMValueRef GlobalVar) {
LLVMDeleteGlobal(GlobalVar);
return Val_unit;
}
/* llvalue -> llvalue option */
-CAMLprim value llvm_global_initializer(LLVMValueRef GlobalVar) {
+value llvm_global_initializer(LLVMValueRef GlobalVar) {
return ptr_to_option(LLVMGetInitializer(GlobalVar));
}
/* llvalue -> llvalue -> unit */
-CAMLprim value llvm_set_initializer(LLVMValueRef ConstantVal,
+value llvm_set_initializer(LLVMValueRef ConstantVal,
LLVMValueRef GlobalVar) {
LLVMSetInitializer(GlobalVar, ConstantVal);
return Val_unit;
}
/* llvalue -> unit */
-CAMLprim value llvm_remove_initializer(LLVMValueRef GlobalVar) {
+value llvm_remove_initializer(LLVMValueRef GlobalVar) {
LLVMSetInitializer(GlobalVar, NULL);
return Val_unit;
}
/* llvalue -> bool */
-CAMLprim value llvm_is_thread_local(LLVMValueRef GlobalVar) {
+value llvm_is_thread_local(LLVMValueRef GlobalVar) {
return Val_bool(LLVMIsThreadLocal(GlobalVar));
}
/* bool -> llvalue -> unit */
-CAMLprim value llvm_set_thread_local(value IsThreadLocal,
+value llvm_set_thread_local(value IsThreadLocal,
LLVMValueRef GlobalVar) {
LLVMSetThreadLocal(GlobalVar, Bool_val(IsThreadLocal));
return Val_unit;
}
/* llvalue -> ThreadLocalMode.t */
-CAMLprim value llvm_thread_local_mode(LLVMValueRef GlobalVar) {
+value llvm_thread_local_mode(LLVMValueRef GlobalVar) {
return Val_int(LLVMGetThreadLocalMode(GlobalVar));
}
/* ThreadLocalMode.t -> llvalue -> unit */
-CAMLprim value llvm_set_thread_local_mode(value ThreadLocalMode,
+value llvm_set_thread_local_mode(value ThreadLocalMode,
LLVMValueRef GlobalVar) {
LLVMSetThreadLocalMode(GlobalVar, Int_val(ThreadLocalMode));
return Val_unit;
}
/* llvalue -> bool */
-CAMLprim value llvm_is_externally_initialized(LLVMValueRef GlobalVar) {
+value llvm_is_externally_initialized(LLVMValueRef GlobalVar) {
return Val_bool(LLVMIsExternallyInitialized(GlobalVar));
}
/* bool -> llvalue -> unit */
-CAMLprim value llvm_set_externally_initialized(value IsExternallyInitialized,
+value llvm_set_externally_initialized(value IsExternallyInitialized,
LLVMValueRef GlobalVar) {
LLVMSetExternallyInitialized(GlobalVar, Bool_val(IsExternallyInitialized));
return Val_unit;
}
/* llvalue -> bool */
-CAMLprim value llvm_is_global_constant(LLVMValueRef GlobalVar) {
+value llvm_is_global_constant(LLVMValueRef GlobalVar) {
return Val_bool(LLVMIsGlobalConstant(GlobalVar));
}
/* bool -> llvalue -> unit */
-CAMLprim value llvm_set_global_constant(value Flag, LLVMValueRef GlobalVar) {
+value llvm_set_global_constant(value Flag, LLVMValueRef GlobalVar) {
LLVMSetGlobalConstant(GlobalVar, Bool_val(Flag));
return Val_unit;
}
/*--... Operations on aliases ..............................................--*/
-CAMLprim LLVMValueRef llvm_add_alias(LLVMModuleRef M, LLVMTypeRef Ty,
+LLVMValueRef llvm_add_alias(LLVMModuleRef M, LLVMTypeRef Ty,
LLVMValueRef Aliasee, value Name) {
return LLVMAddAlias(M, Ty, Aliasee, String_val(Name));
}
@@ -1331,7 +1331,7 @@ DEFINE_ITERATORS(function, Function, LLVMModuleRef, LLVMValueRef,
LLVMGetGlobalParent)
/* string -> lltype -> llmodule -> llvalue */
-CAMLprim LLVMValueRef llvm_declare_function(value Name, LLVMTypeRef Ty,
+LLVMValueRef llvm_declare_function(value Name, LLVMTypeRef Ty,
LLVMModuleRef M) {
LLVMValueRef Fn;
if ((Fn = LLVMGetNamedFunction(M, String_val(Name)))) {
@@ -1343,12 +1343,12 @@ CAMLprim LLVMValueRef llvm_declare_function(value Name, LLVMTypeRef Ty,
}
/* string -> llmodule -> llvalue option */
-CAMLprim value llvm_lookup_function(value Name, LLVMModuleRef M) {
+value llvm_lookup_function(value Name, LLVMModuleRef M) {
return ptr_to_option(LLVMGetNamedFunction(M, String_val(Name)));
}
/* string -> lltype -> llmodule -> llvalue */
-CAMLprim LLVMValueRef llvm_define_function(value Name, LLVMTypeRef Ty,
+LLVMValueRef llvm_define_function(value Name, LLVMTypeRef Ty,
LLVMModuleRef M) {
LLVMValueRef Fn = LLVMAddFunction(M, String_val(Name), Ty);
LLVMAppendBasicBlockInContext(LLVMGetTypeContext(Ty), Fn, "entry");
@@ -1356,29 +1356,29 @@ CAMLprim LLVMValueRef llvm_define_function(value Name, LLVMTypeRef Ty,
}
/* llvalue -> unit */
-CAMLprim value llvm_delete_function(LLVMValueRef Fn) {
+value llvm_delete_function(LLVMValueRef Fn) {
LLVMDeleteFunction(Fn);
return Val_unit;
}
/* llvalue -> bool */
-CAMLprim value llvm_is_intrinsic(LLVMValueRef Fn) {
+value llvm_is_intrinsic(LLVMValueRef Fn) {
return Val_bool(LLVMGetIntrinsicID(Fn));
}
/* llvalue -> int */
-CAMLprim value llvm_function_call_conv(LLVMValueRef Fn) {
+value llvm_function_call_conv(LLVMValueRef Fn) {
return Val_int(LLVMGetFunctionCallConv(Fn));
}
/* int -> llvalue -> unit */
-CAMLprim value llvm_set_function_call_conv(value Id, LLVMValueRef Fn) {
+value llvm_set_function_call_conv(value Id, LLVMValueRef Fn) {
LLVMSetFunctionCallConv(Fn, Int_val(Id));
return Val_unit;
}
/* llvalue -> string option */
-CAMLprim value llvm_gc(LLVMValueRef Fn) {
+value llvm_gc(LLVMValueRef Fn) {
const char *GC = LLVMGetGC(Fn);
if (!GC)
return Val_none;
@@ -1386,20 +1386,20 @@ CAMLprim value llvm_gc(LLVMValueRef Fn) {
}
/* string option -> llvalue -> unit */
-CAMLprim value llvm_set_gc(value GC, LLVMValueRef Fn) {
+value llvm_set_gc(value GC, LLVMValueRef Fn) {
LLVMSetGC(Fn, GC == Val_none ? 0 : String_val(Field(GC, 0)));
return Val_unit;
}
/* llvalue -> llattribute -> int -> unit */
-CAMLprim value llvm_add_function_attr(LLVMValueRef F, LLVMAttributeRef A,
+value llvm_add_function_attr(LLVMValueRef F, LLVMAttributeRef A,
value Index) {
LLVMAddAttributeAtIndex(F, Int_val(Index), A);
return Val_unit;
}
/* llvalue -> int -> llattribute array */
-CAMLprim value llvm_function_attrs(LLVMValueRef F, value Index) {
+value llvm_function_attrs(LLVMValueRef F, value Index) {
unsigned Length = LLVMGetAttributeCountAtIndex(F, Int_val(Index));
value Array = caml_alloc_tuple_uninit(Length);
LLVMGetAttributesAtIndex(F, Int_val(Index),
@@ -1408,14 +1408,14 @@ CAMLprim value llvm_function_attrs(LLVMValueRef F, value Index) {
}
/* llvalue -> llattrkind -> int -> unit */
-CAMLprim value llvm_remove_enum_function_attr(LLVMValueRef F, value Kind,
+value llvm_remove_enum_function_attr(LLVMValueRef F, value Kind,
value Index) {
LLVMRemoveEnumAttributeAtIndex(F, Int_val(Index), Int_val(Kind));
return Val_unit;
}
/* llvalue -> string -> int -> unit */
-CAMLprim value llvm_remove_string_function_attr(LLVMValueRef F, value Kind,
+value llvm_remove_string_function_attr(LLVMValueRef F, value Kind,
value Index) {
LLVMRemoveStringAttributeAtIndex(F, Int_val(Index), String_val(Kind),
caml_string_length(Kind));
@@ -1427,12 +1427,12 @@ CAMLprim value llvm_remove_string_function_attr(LLVMValueRef F, value Kind,
DEFINE_ITERATORS(param, Param, LLVMValueRef, LLVMValueRef, LLVMGetParamParent)
/* llvalue -> int -> llvalue */
-CAMLprim LLVMValueRef llvm_param(LLVMValueRef Fn, value Index) {
+LLVMValueRef llvm_param(LLVMValueRef Fn, value Index) {
return LLVMGetParam(Fn, Int_val(Index));
}
/* llvalue -> llvalue */
-CAMLprim value llvm_params(LLVMValueRef Fn) {
+value llvm_params(LLVMValueRef Fn) {
value Params = caml_alloc_tuple_uninit(LLVMCountParams(Fn));
LLVMGetParams(Fn, (LLVMValueRef *)Op_val(Params));
return Params;
@@ -1444,55 +1444,55 @@ DEFINE_ITERATORS(
block, BasicBlock, LLVMValueRef, LLVMBasicBlockRef, LLVMGetBasicBlockParent)
/* llbasicblock -> llvalue option */
-CAMLprim value llvm_block_terminator(LLVMBasicBlockRef Block) {
+value llvm_block_terminator(LLVMBasicBlockRef Block) {
return ptr_to_option(LLVMGetBasicBlockTerminator(Block));
}
/* llvalue -> llbasicblock array */
-CAMLprim value llvm_basic_blocks(LLVMValueRef Fn) {
+value llvm_basic_blocks(LLVMValueRef Fn) {
value MLArray = caml_alloc_tuple_uninit(LLVMCountBasicBlocks(Fn));
LLVMGetBasicBlocks(Fn, (LLVMBasicBlockRef *)Op_val(MLArray));
return MLArray;
}
/* llbasicblock -> unit */
-CAMLprim value llvm_delete_block(LLVMBasicBlockRef BB) {
+value llvm_delete_block(LLVMBasicBlockRef BB) {
LLVMDeleteBasicBlock(BB);
return Val_unit;
}
/* llbasicblock -> unit */
-CAMLprim value llvm_remove_block(LLVMBasicBlockRef BB) {
+value llvm_remove_block(LLVMBasicBlockRef BB) {
LLVMRemoveBasicBlockFromParent(BB);
return Val_unit;
}
/* llbasicblock -> llbasicblock -> unit */
-CAMLprim value llvm_move_block_before(LLVMBasicBlockRef Pos, LLVMBasicBlockRef BB) {
+value llvm_move_block_before(LLVMBasicBlockRef Pos, LLVMBasicBlockRef BB) {
LLVMMoveBasicBlockBefore(BB, Pos);
return Val_unit;
}
/* llbasicblock -> llbasicblock -> unit */
-CAMLprim value llvm_move_block_after(LLVMBasicBlockRef Pos, LLVMBasicBlockRef BB) {
+value llvm_move_block_after(LLVMBasicBlockRef Pos, LLVMBasicBlockRef BB) {
LLVMMoveBasicBlockAfter(BB, Pos);
return Val_unit;
}
/* string -> llvalue -> llbasicblock */
-CAMLprim LLVMBasicBlockRef llvm_append_block(LLVMContextRef Context, value Name,
+LLVMBasicBlockRef llvm_append_block(LLVMContextRef Context, value Name,
LLVMValueRef Fn) {
return LLVMAppendBasicBlockInContext(Context, Fn, String_val(Name));
}
/* string -> llbasicblock -> llbasicblock */
-CAMLprim LLVMBasicBlockRef llvm_insert_block(LLVMContextRef Context, value Name,
+LLVMBasicBlockRef llvm_insert_block(LLVMContextRef Context, value Name,
LLVMBasicBlockRef BB) {
return LLVMInsertBasicBlockInContext(Context, BB, String_val(Name));
}
/* llvalue -> bool */
-CAMLprim value llvm_value_is_block(LLVMValueRef Val) {
+value llvm_value_is_block(LLVMValueRef Val) {
return Val_bool(LLVMValueIsBasicBlock(Val));
}
@@ -1502,7 +1502,7 @@ DEFINE_ITERATORS(instr, Instruction, LLVMBasicBlockRef, LLVMValueRef,
LLVMGetInstructionParent)
/* llvalue -> Opcode.t */
-CAMLprim value llvm_instr_get_opcode(LLVMValueRef Inst) {
+value llvm_instr_get_opcode(LLVMValueRef Inst) {
LLVMOpcode o;
if (!LLVMIsAInstruction(Inst))
failwith("Not an instruction");
@@ -1512,7 +1512,7 @@ CAMLprim value llvm_instr_get_opcode(LLVMValueRef Inst) {
}
/* llvalue -> ICmp.t option */
-CAMLprim value llvm_instr_icmp_predicate(LLVMValueRef Val) {
+value llvm_instr_icmp_predicate(LLVMValueRef Val) {
int x = LLVMGetICmpPredicate(Val);
if (!x)
return Val_none;
@@ -1520,7 +1520,7 @@ CAMLprim value llvm_instr_icmp_predicate(LLVMValueRef Val) {
}
/* llvalue -> FCmp.t option */
-CAMLprim value llvm_instr_fcmp_predicate(LLVMValueRef Val) {
+value llvm_instr_fcmp_predicate(LLVMValueRef Val) {
int x = LLVMGetFCmpPredicate(Val);
if (!x)
return Val_none;
@@ -1528,7 +1528,7 @@ CAMLprim value llvm_instr_fcmp_predicate(LLVMValueRef Val) {
}
/* llvalue -> llvalue */
-CAMLprim LLVMValueRef llvm_instr_clone(LLVMValueRef Inst) {
+LLVMValueRef llvm_instr_clone(LLVMValueRef Inst) {
if (!LLVMIsAInstruction(Inst))
failwith("Not an instruction");
return LLVMInstructionClone(Inst);
@@ -1538,25 +1538,25 @@ CAMLprim LLVMValueRef llvm_instr_clone(LLVMValueRef Inst) {
/*--... Operations on call sites ...........................................--*/
/* llvalue -> int */
-CAMLprim value llvm_instruction_call_conv(LLVMValueRef Inst) {
+value llvm_instruction_call_conv(LLVMValueRef Inst) {
return Val_int(LLVMGetInstructionCallConv(Inst));
}
/* int -> llvalue -> unit */
-CAMLprim value llvm_set_instruction_call_conv(value CC, LLVMValueRef Inst) {
+value llvm_set_instruction_call_conv(value CC, LLVMValueRef Inst) {
LLVMSetInstructionCallConv(Inst, Int_val(CC));
return Val_unit;
}
/* llvalue -> llattribute -> int -> unit */
-CAMLprim value llvm_add_call_site_attr(LLVMValueRef F, LLVMAttributeRef A,
+value llvm_add_call_site_attr(LLVMValueRef F, LLVMAttributeRef A,
value Index) {
LLVMAddCallSiteAttribute(F, Int_val(Index), A);
return Val_unit;
}
/* llvalue -> int -> llattribute array */
-CAMLprim value llvm_call_site_attrs(LLVMValueRef F, value Index) {
+value llvm_call_site_attrs(LLVMValueRef F, value Index) {
unsigned Count = LLVMGetCallSiteAttributeCount(F, Int_val(Index));
value Array = caml_alloc_tuple_uninit(Count);
LLVMGetCallSiteAttributes(F, Int_val(Index),
@@ -1565,14 +1565,14 @@ CAMLprim value llvm_call_site_attrs(LLVMValueRef F, value Index) {
}
/* llvalue -> llattrkind -> int -> unit */
-CAMLprim value llvm_remove_enum_call_site_attr(LLVMValueRef F, value Kind,
+value llvm_remove_enum_call_site_attr(LLVMValueRef F, value Kind,
value Index) {
LLVMRemoveCallSiteEnumAttribute(F, Int_val(Index), Int_val(Kind));
return Val_unit;
}
/* llvalue -> string -> int -> unit */
-CAMLprim value llvm_remove_string_call_site_attr(LLVMValueRef F, value Kind,
+value llvm_remove_string_call_site_attr(LLVMValueRef F, value Kind,
value Index) {
LLVMRemoveCallSiteStringAttribute(F, Int_val(Index), String_val(Kind),
caml_string_length(Kind));
@@ -1582,17 +1582,17 @@ CAMLprim value llvm_remove_string_call_site_attr(LLVMValueRef F, value Kind,
/*--... Operations on call instructions (only) .............................--*/
/* llvalue -> int */
-CAMLprim value llvm_num_arg_operands(LLVMValueRef V) {
+value llvm_num_arg_operands(LLVMValueRef V) {
return Val_int(LLVMGetNumArgOperands(V));
}
/* llvalue -> bool */
-CAMLprim value llvm_is_tail_call(LLVMValueRef CallInst) {
+value llvm_is_tail_call(LLVMValueRef CallInst) {
return Val_bool(LLVMIsTailCall(CallInst));
}
/* bool -> llvalue -> unit */
-CAMLprim value llvm_set_tail_call(value IsTailCall,
+value llvm_set_tail_call(value IsTailCall,
LLVMValueRef CallInst) {
LLVMSetTailCall(CallInst, Bool_val(IsTailCall));
return Val_unit;
@@ -1601,12 +1601,12 @@ CAMLprim value llvm_set_tail_call(value IsTailCall,
/*--... Operations on load/store instructions (only)........................--*/
/* llvalue -> bool */
-CAMLprim value llvm_is_volatile(LLVMValueRef MemoryInst) {
+value llvm_is_volatile(LLVMValueRef MemoryInst) {
return Val_bool(LLVMGetVolatile(MemoryInst));
}
/* bool -> llvalue -> unit */
-CAMLprim value llvm_set_volatile(value IsVolatile,
+value llvm_set_volatile(value IsVolatile,
LLVMValueRef MemoryInst) {
LLVMSetVolatile(MemoryInst, Bool_val(IsVolatile));
return Val_unit;
@@ -1616,43 +1616,43 @@ CAMLprim value llvm_set_volatile(value IsVolatile,
/*--.. Operations on terminators ...........................................--*/
/* llvalue -> int -> llbasicblock */
-CAMLprim LLVMBasicBlockRef llvm_successor(LLVMValueRef V, value I) {
+LLVMBasicBlockRef llvm_successor(LLVMValueRef V, value I) {
return LLVMGetSuccessor(V, Int_val(I));
}
/* llvalue -> int -> llvalue -> unit */
-CAMLprim value llvm_set_successor(LLVMValueRef U, value I, LLVMBasicBlockRef B) {
+value llvm_set_successor(LLVMValueRef U, value I, LLVMBasicBlockRef B) {
LLVMSetSuccessor(U, Int_val(I), B);
return Val_unit;
}
/* llvalue -> int */
-CAMLprim value llvm_num_successors(LLVMValueRef V) {
+value llvm_num_successors(LLVMValueRef V) {
return Val_int(LLVMGetNumSuccessors(V));
}
/*--.. Operations on branch ................................................--*/
/* llvalue -> llvalue */
-CAMLprim LLVMValueRef llvm_condition(LLVMValueRef V) {
+LLVMValueRef llvm_condition(LLVMValueRef V) {
return LLVMGetCondition(V);
}
/* llvalue -> llvalue -> unit */
-CAMLprim value llvm_set_condition(LLVMValueRef B, LLVMValueRef C) {
+value llvm_set_condition(LLVMValueRef B, LLVMValueRef C) {
LLVMSetCondition(B, C);
return Val_unit;
}
/* llvalue -> bool */
-CAMLprim value llvm_is_conditional(LLVMValueRef V) {
+value llvm_is_conditional(LLVMValueRef V) {
return Val_bool(LLVMIsConditional(V));
}
/*--... Operations on phi nodes ............................................--*/
/* (llvalue * llbasicblock) -> llvalue -> unit */
-CAMLprim value llvm_add_incoming(value Incoming, LLVMValueRef PhiNode) {
+value llvm_add_incoming(value Incoming, LLVMValueRef PhiNode) {
LLVMAddIncoming(PhiNode,
(LLVMValueRef*) &Field(Incoming, 0),
(LLVMBasicBlockRef*) &Field(Incoming, 1),
@@ -1661,7 +1661,7 @@ CAMLprim value llvm_add_incoming(value Incoming, LLVMValueRef PhiNode) {
}
/* llvalue -> (llvalue * llbasicblock) list */
-CAMLprim value llvm_incoming(LLVMValueRef PhiNode) {
+value llvm_incoming(LLVMValueRef PhiNode) {
unsigned I;
CAMLparam0();
CAMLlocal2(Hd, Tl);
@@ -1683,7 +1683,7 @@ CAMLprim value llvm_incoming(LLVMValueRef PhiNode) {
}
/* llvalue -> unit */
-CAMLprim value llvm_delete_instruction(LLVMValueRef Instruction) {
+value llvm_delete_instruction(LLVMValueRef Instruction) {
LLVMInstructionEraseFromParent(Instruction);
return Val_unit;
}
@@ -1713,12 +1713,12 @@ static value alloc_builder(LLVMBuilderRef B) {
}
/* llcontext -> llbuilder */
-CAMLprim value llvm_builder(LLVMContextRef C) {
+value llvm_builder(LLVMContextRef C) {
return alloc_builder(LLVMCreateBuilderInContext(C));
}
/* (llbasicblock, llvalue) llpos -> llbuilder -> unit */
-CAMLprim value llvm_position_builder(value Pos, value B) {
+value llvm_position_builder(value Pos, value B) {
if (Tag_val(Pos) == 0) {
LLVMBasicBlockRef BB = (LLVMBasicBlockRef) Op_val(Field(Pos, 0));
LLVMPositionBuilderAtEnd(Builder_val(B), BB);
@@ -1730,7 +1730,7 @@ CAMLprim value llvm_position_builder(value Pos, value B) {
}
/* llbuilder -> llbasicblock */
-CAMLprim LLVMBasicBlockRef llvm_insertion_block(value B) {
+LLVMBasicBlockRef llvm_insertion_block(value B) {
LLVMBasicBlockRef InsertBlock = LLVMGetInsertBlock(Builder_val(B));
if (!InsertBlock)
caml_raise_not_found();
@@ -1738,7 +1738,7 @@ CAMLprim LLVMBasicBlockRef llvm_insertion_block(value B) {
}
/* llvalue -> string -> llbuilder -> unit */
-CAMLprim value llvm_insert_into_builder(LLVMValueRef I, value Name, value B) {
+value llvm_insert_into_builder(LLVMValueRef I, value Name, value B) {
LLVMInsertIntoBuilderWithName(Builder_val(B), I, String_val(Name));
return Val_unit;
}
@@ -1746,24 +1746,24 @@ CAMLprim value llvm_insert_into_builder(LLVMValueRef I, value Name, value B) {
/*--... Metadata ...........................................................--*/
/* llbuilder -> llvalue -> unit */
-CAMLprim value llvm_set_current_debug_location(value B, LLVMValueRef V) {
+value llvm_set_current_debug_location(value B, LLVMValueRef V) {
LLVMSetCurrentDebugLocation(Builder_val(B), V);
return Val_unit;
}
/* llbuilder -> unit */
-CAMLprim value llvm_clear_current_debug_location(value B) {
+value llvm_clear_current_debug_location(value B) {
LLVMSetCurrentDebugLocation(Builder_val(B), NULL);
return Val_unit;
}
/* llbuilder -> llvalue option */
-CAMLprim value llvm_current_debug_location(value B) {
+value llvm_current_debug_location(value B) {
return ptr_to_option(LLVMGetCurrentDebugLocation(Builder_val(B)));
}
/* llbuilder -> llvalue -> unit */
-CAMLprim value llvm_set_inst_debug_location(value B, LLVMValueRef V) {
+value llvm_set_inst_debug_location(value B, LLVMValueRef V) {
LLVMSetInstDebugLocation(Builder_val(B), V);
return Val_unit;
}
@@ -1772,28 +1772,28 @@ CAMLprim value llvm_set_inst_debug_location(value B, LLVMValueRef V) {
/*--... Terminators ........................................................--*/
/* llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_ret_void(value B) {
+LLVMValueRef llvm_build_ret_void(value B) {
return LLVMBuildRetVoid(Builder_val(B));
}
/* llvalue -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_ret(LLVMValueRef Val, value B) {
+LLVMValueRef llvm_build_ret(LLVMValueRef Val, value B) {
return LLVMBuildRet(Builder_val(B), Val);
}
/* llvalue array -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_aggregate_ret(value RetVals, value B) {
+LLVMValueRef llvm_build_aggregate_ret(value RetVals, value B) {
return LLVMBuildAggregateRet(Builder_val(B), (LLVMValueRef *) Op_val(RetVals),
Wosize_val(RetVals));
}
/* llbasicblock -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_br(LLVMBasicBlockRef BB, value B) {
+LLVMValueRef llvm_build_br(LLVMBasicBlockRef BB, value B) {
return LLVMBuildBr(Builder_val(B), BB);
}
/* llvalue -> llbasicblock -> llbasicblock -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_cond_br(LLVMValueRef If,
+LLVMValueRef llvm_build_cond_br(LLVMValueRef If,
LLVMBasicBlockRef Then,
LLVMBasicBlockRef Else,
value B) {
@@ -1801,7 +1801,7 @@ CAMLprim LLVMValueRef llvm_build_cond_br(LLVMValueRef If,
}
/* llvalue -> llbasicblock -> int -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_switch(LLVMValueRef Of,
+LLVMValueRef llvm_build_switch(LLVMValueRef Of,
LLVMBasicBlockRef Else,
value EstimatedCount,
value B) {
@@ -1809,14 +1809,14 @@ CAMLprim LLVMValueRef llvm_build_switch(LLVMValueRef Of,
}
/* lltype -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_malloc(LLVMTypeRef Ty, value Name,
+LLVMValueRef llvm_build_malloc(LLVMTypeRef Ty, value Name,
value B)
{
return LLVMBuildMalloc(Builder_val(B), Ty, String_val(Name));
}
/* lltype -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_array_malloc(LLVMTypeRef Ty,
+LLVMValueRef llvm_build_array_malloc(LLVMTypeRef Ty,
LLVMValueRef Val,
value Name, value B)
{
@@ -1824,27 +1824,27 @@ CAMLprim LLVMValueRef llvm_build_array_malloc(LLVMTypeRef Ty,
}
/* llvalue -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_free(LLVMValueRef P, value B)
+LLVMValueRef llvm_build_free(LLVMValueRef P, value B)
{
return LLVMBuildFree(Builder_val(B), P);
}
/* llvalue -> llvalue -> llbasicblock -> unit */
-CAMLprim value llvm_add_case(LLVMValueRef Switch, LLVMValueRef OnVal,
+value llvm_add_case(LLVMValueRef Switch, LLVMValueRef OnVal,
LLVMBasicBlockRef Dest) {
LLVMAddCase(Switch, OnVal, Dest);
return Val_unit;
}
/* llvalue -> llbasicblock -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_indirect_br(LLVMValueRef Addr,
+LLVMValueRef llvm_build_indirect_br(LLVMValueRef Addr,
value EstimatedDests,
value B) {
return LLVMBuildIndirectBr(Builder_val(B), Addr, EstimatedDests);
}
/* llvalue -> llvalue -> llbasicblock -> unit */
-CAMLprim value llvm_add_destination(LLVMValueRef IndirectBr,
+value llvm_add_destination(LLVMValueRef IndirectBr,
LLVMBasicBlockRef Dest) {
LLVMAddDestination(IndirectBr, Dest);
return Val_unit;
@@ -1852,7 +1852,7 @@ CAMLprim value llvm_add_destination(LLVMValueRef IndirectBr,
/* llvalue -> llvalue array -> llbasicblock -> llbasicblock -> string ->
llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_invoke_nat(LLVMValueRef Fn, value Args,
+LLVMValueRef llvm_build_invoke_nat(LLVMValueRef Fn, value Args,
LLVMBasicBlockRef Then,
LLVMBasicBlockRef Catch,
value Name, value B) {
@@ -1862,7 +1862,7 @@ CAMLprim LLVMValueRef llvm_build_invoke_nat(LLVMValueRef Fn, value Args,
/* llvalue -> llvalue array -> llbasicblock -> llbasicblock -> string ->
llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_invoke_bc(value Args[], int NumArgs) {
+LLVMValueRef llvm_build_invoke_bc(value Args[], int NumArgs) {
return llvm_build_invoke_nat((LLVMValueRef) Args[0], Args[1],
(LLVMBasicBlockRef) Args[2],
(LLVMBasicBlockRef) Args[3],
@@ -1870,7 +1870,7 @@ CAMLprim LLVMValueRef llvm_build_invoke_bc(value Args[], int NumArgs) {
}
/* lltype -> llvalue -> int -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_landingpad(LLVMTypeRef Ty, LLVMValueRef PersFn,
+LLVMValueRef llvm_build_landingpad(LLVMTypeRef Ty, LLVMValueRef PersFn,
value NumClauses, value Name,
value B) {
return LLVMBuildLandingPad(Builder_val(B), Ty, PersFn, Int_val(NumClauses),
@@ -1878,214 +1878,214 @@ CAMLprim LLVMValueRef llvm_build_landingpad(LLVMTypeRef Ty, LLVMValueRef PersFn,
}
/* llvalue -> llvalue -> unit */
-CAMLprim value llvm_add_clause(LLVMValueRef LandingPadInst, LLVMValueRef ClauseVal)
+value llvm_add_clause(LLVMValueRef LandingPadInst, LLVMValueRef ClauseVal)
{
LLVMAddClause(LandingPadInst, ClauseVal);
return Val_unit;
}
/* llvalue -> bool */
-CAMLprim value llvm_is_cleanup(LLVMValueRef LandingPadInst)
+value llvm_is_cleanup(LLVMValueRef LandingPadInst)
{
return Val_bool(LLVMIsCleanup(LandingPadInst));
}
/* llvalue -> bool -> unit */
-CAMLprim value llvm_set_cleanup(LLVMValueRef LandingPadInst, value flag)
+value llvm_set_cleanup(LLVMValueRef LandingPadInst, value flag)
{
LLVMSetCleanup(LandingPadInst, Bool_val(flag));
return Val_unit;
}
/* llvalue -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_resume(LLVMValueRef Exn, value B)
+LLVMValueRef llvm_build_resume(LLVMValueRef Exn, value B)
{
return LLVMBuildResume(Builder_val(B), Exn);
}
/* llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_unreachable(value B) {
+LLVMValueRef llvm_build_unreachable(value B) {
return LLVMBuildUnreachable(Builder_val(B));
}
/*--... Arithmetic .........................................................--*/
/* llvalue -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_add(LLVMValueRef LHS, LLVMValueRef RHS,
+LLVMValueRef llvm_build_add(LLVMValueRef LHS, LLVMValueRef RHS,
value Name, value B) {
return LLVMBuildAdd(Builder_val(B), LHS, RHS, String_val(Name));
}
/* llvalue -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_nsw_add(LLVMValueRef LHS, LLVMValueRef RHS,
+LLVMValueRef llvm_build_nsw_add(LLVMValueRef LHS, LLVMValueRef RHS,
value Name, value B) {
return LLVMBuildNSWAdd(Builder_val(B), LHS, RHS, String_val(Name));
}
/* llvalue -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_nuw_add(LLVMValueRef LHS, LLVMValueRef RHS,
+LLVMValueRef llvm_build_nuw_add(LLVMValueRef LHS, LLVMValueRef RHS,
value Name, value B) {
return LLVMBuildNUWAdd(Builder_val(B), LHS, RHS, String_val(Name));
}
/* llvalue -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_fadd(LLVMValueRef LHS, LLVMValueRef RHS,
+LLVMValueRef llvm_build_fadd(LLVMValueRef LHS, LLVMValueRef RHS,
value Name, value B) {
return LLVMBuildFAdd(Builder_val(B), LHS, RHS, String_val(Name));
}
/* llvalue -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_sub(LLVMValueRef LHS, LLVMValueRef RHS,
+LLVMValueRef llvm_build_sub(LLVMValueRef LHS, LLVMValueRef RHS,
value Name, value B) {
return LLVMBuildSub(Builder_val(B), LHS, RHS, String_val(Name));
}
/* llvalue -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_nsw_sub(LLVMValueRef LHS, LLVMValueRef RHS,
+LLVMValueRef llvm_build_nsw_sub(LLVMValueRef LHS, LLVMValueRef RHS,
value Name, value B) {
return LLVMBuildNSWSub(Builder_val(B), LHS, RHS, String_val(Name));
}
/* llvalue -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_nuw_sub(LLVMValueRef LHS, LLVMValueRef RHS,
+LLVMValueRef llvm_build_nuw_sub(LLVMValueRef LHS, LLVMValueRef RHS,
value Name, value B) {
return LLVMBuildNUWSub(Builder_val(B), LHS, RHS, String_val(Name));
}
/* llvalue -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_fsub(LLVMValueRef LHS, LLVMValueRef RHS,
+LLVMValueRef llvm_build_fsub(LLVMValueRef LHS, LLVMValueRef RHS,
value Name, value B) {
return LLVMBuildFSub(Builder_val(B), LHS, RHS, String_val(Name));
}
/* llvalue -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_mul(LLVMValueRef LHS, LLVMValueRef RHS,
+LLVMValueRef llvm_build_mul(LLVMValueRef LHS, LLVMValueRef RHS,
value Name, value B) {
return LLVMBuildMul(Builder_val(B), LHS, RHS, String_val(Name));
}
/* llvalue -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_nsw_mul(LLVMValueRef LHS, LLVMValueRef RHS,
+LLVMValueRef llvm_build_nsw_mul(LLVMValueRef LHS, LLVMValueRef RHS,
value Name, value B) {
return LLVMBuildNSWMul(Builder_val(B), LHS, RHS, String_val(Name));
}
/* llvalue -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_nuw_mul(LLVMValueRef LHS, LLVMValueRef RHS,
+LLVMValueRef llvm_build_nuw_mul(LLVMValueRef LHS, LLVMValueRef RHS,
value Name, value B) {
return LLVMBuildNUWMul(Builder_val(B), LHS, RHS, String_val(Name));
}
/* llvalue -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_fmul(LLVMValueRef LHS, LLVMValueRef RHS,
+LLVMValueRef llvm_build_fmul(LLVMValueRef LHS, LLVMValueRef RHS,
value Name, value B) {
return LLVMBuildFMul(Builder_val(B), LHS, RHS, String_val(Name));
}
/* llvalue -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_udiv(LLVMValueRef LHS, LLVMValueRef RHS,
+LLVMValueRef llvm_build_udiv(LLVMValueRef LHS, LLVMValueRef RHS,
value Name, value B) {
return LLVMBuildUDiv(Builder_val(B), LHS, RHS, String_val(Name));
}
/* llvalue -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_sdiv(LLVMValueRef LHS, LLVMValueRef RHS,
+LLVMValueRef llvm_build_sdiv(LLVMValueRef LHS, LLVMValueRef RHS,
value Name, value B) {
return LLVMBuildSDiv(Builder_val(B), LHS, RHS, String_val(Name));
}
/* llvalue -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_exact_sdiv(LLVMValueRef LHS, LLVMValueRef RHS,
+LLVMValueRef llvm_build_exact_sdiv(LLVMValueRef LHS, LLVMValueRef RHS,
value Name, value B) {
return LLVMBuildExactSDiv(Builder_val(B), LHS, RHS, String_val(Name));
}
/* llvalue -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_fdiv(LLVMValueRef LHS, LLVMValueRef RHS,
+LLVMValueRef llvm_build_fdiv(LLVMValueRef LHS, LLVMValueRef RHS,
value Name, value B) {
return LLVMBuildFDiv(Builder_val(B), LHS, RHS, String_val(Name));
}
/* llvalue -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_urem(LLVMValueRef LHS, LLVMValueRef RHS,
+LLVMValueRef llvm_build_urem(LLVMValueRef LHS, LLVMValueRef RHS,
value Name, value B) {
return LLVMBuildURem(Builder_val(B), LHS, RHS, String_val(Name));
}
/* llvalue -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_srem(LLVMValueRef LHS, LLVMValueRef RHS,
+LLVMValueRef llvm_build_srem(LLVMValueRef LHS, LLVMValueRef RHS,
value Name, value B) {
return LLVMBuildSRem(Builder_val(B), LHS, RHS, String_val(Name));
}
/* llvalue -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_frem(LLVMValueRef LHS, LLVMValueRef RHS,
+LLVMValueRef llvm_build_frem(LLVMValueRef LHS, LLVMValueRef RHS,
value Name, value B) {
return LLVMBuildFRem(Builder_val(B), LHS, RHS, String_val(Name));
}
/* llvalue -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_shl(LLVMValueRef LHS, LLVMValueRef RHS,
+LLVMValueRef llvm_build_shl(LLVMValueRef LHS, LLVMValueRef RHS,
value Name, value B) {
return LLVMBuildShl(Builder_val(B), LHS, RHS, String_val(Name));
}
/* llvalue -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_lshr(LLVMValueRef LHS, LLVMValueRef RHS,
+LLVMValueRef llvm_build_lshr(LLVMValueRef LHS, LLVMValueRef RHS,
value Name, value B) {
return LLVMBuildLShr(Builder_val(B), LHS, RHS, String_val(Name));
}
/* llvalue -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_ashr(LLVMValueRef LHS, LLVMValueRef RHS,
+LLVMValueRef llvm_build_ashr(LLVMValueRef LHS, LLVMValueRef RHS,
value Name, value B) {
return LLVMBuildAShr(Builder_val(B), LHS, RHS, String_val(Name));
}
/* llvalue -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_and(LLVMValueRef LHS, LLVMValueRef RHS,
+LLVMValueRef llvm_build_and(LLVMValueRef LHS, LLVMValueRef RHS,
value Name, value B) {
return LLVMBuildAnd(Builder_val(B), LHS, RHS, String_val(Name));
}
/* llvalue -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_or(LLVMValueRef LHS, LLVMValueRef RHS,
+LLVMValueRef llvm_build_or(LLVMValueRef LHS, LLVMValueRef RHS,
value Name, value B) {
return LLVMBuildOr(Builder_val(B), LHS, RHS, String_val(Name));
}
/* llvalue -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_xor(LLVMValueRef LHS, LLVMValueRef RHS,
+LLVMValueRef llvm_build_xor(LLVMValueRef LHS, LLVMValueRef RHS,
value Name, value B) {
return LLVMBuildXor(Builder_val(B), LHS, RHS, String_val(Name));
}
/* llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_neg(LLVMValueRef X,
+LLVMValueRef llvm_build_neg(LLVMValueRef X,
value Name, value B) {
return LLVMBuildNeg(Builder_val(B), X, String_val(Name));
}
/* llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_nsw_neg(LLVMValueRef X,
+LLVMValueRef llvm_build_nsw_neg(LLVMValueRef X,
value Name, value B) {
return LLVMBuildNSWNeg(Builder_val(B), X, String_val(Name));
}
/* llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_nuw_neg(LLVMValueRef X,
+LLVMValueRef llvm_build_nuw_neg(LLVMValueRef X,
value Name, value B) {
return LLVMBuildNUWNeg(Builder_val(B), X, String_val(Name));
}
/* llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_fneg(LLVMValueRef X,
+LLVMValueRef llvm_build_fneg(LLVMValueRef X,
value Name, value B) {
return LLVMBuildFNeg(Builder_val(B), X, String_val(Name));
}
/* llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_not(LLVMValueRef X,
+LLVMValueRef llvm_build_not(LLVMValueRef X,
value Name, value B) {
return LLVMBuildNot(Builder_val(B), X, String_val(Name));
}
@@ -2093,32 +2093,32 @@ CAMLprim LLVMValueRef llvm_build_not(LLVMValueRef X,
/*--... Memory .............................................................--*/
/* lltype -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_alloca(LLVMTypeRef Ty,
+LLVMValueRef llvm_build_alloca(LLVMTypeRef Ty,
value Name, value B) {
return LLVMBuildAlloca(Builder_val(B), Ty, String_val(Name));
}
/* lltype -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_array_alloca(LLVMTypeRef Ty, LLVMValueRef Size,
+LLVMValueRef llvm_build_array_alloca(LLVMTypeRef Ty, LLVMValueRef Size,
value Name, value B) {
return LLVMBuildArrayAlloca(Builder_val(B), Ty, Size, String_val(Name));
}
/* llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_load(LLVMValueRef Pointer,
+LLVMValueRef llvm_build_load(LLVMValueRef Pointer,
value Name, value B) {
return LLVMBuildLoad(Builder_val(B), Pointer, String_val(Name));
}
/* llvalue -> llvalue -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_store(LLVMValueRef Value, LLVMValueRef Pointer,
+LLVMValueRef llvm_build_store(LLVMValueRef Value, LLVMValueRef Pointer,
value B) {
return LLVMBuildStore(Builder_val(B), Value, Pointer);
}
/* AtomicRMWBinOp.t -> llvalue -> llvalue -> AtomicOrdering.t ->
bool -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_atomicrmw_native(value BinOp, LLVMValueRef Ptr,
+LLVMValueRef llvm_build_atomicrmw_native(value BinOp, LLVMValueRef Ptr,
LLVMValueRef Val, value Ord,
value ST, value Name, value B) {
LLVMValueRef Instr;
@@ -2128,14 +2128,14 @@ CAMLprim LLVMValueRef llvm_build_atomicrmw_native(value BinOp, LLVMValueRef Ptr,
return Instr;
}
-CAMLprim LLVMValueRef llvm_build_atomicrmw_bytecode(value *argv, int argn) {
+LLVMValueRef llvm_build_atomicrmw_bytecode(value *argv, int argn) {
return llvm_build_atomicrmw_native(argv[0], (LLVMValueRef) argv[1],
(LLVMValueRef) argv[2], argv[3],
argv[4], argv[5], argv[6]);
}
/* llvalue -> llvalue array -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_gep(LLVMValueRef Pointer, value Indices,
+LLVMValueRef llvm_build_gep(LLVMValueRef Pointer, value Indices,
value Name, value B) {
return LLVMBuildGEP(Builder_val(B), Pointer,
(LLVMValueRef *) Op_val(Indices), Wosize_val(Indices),
@@ -2143,7 +2143,7 @@ CAMLprim LLVMValueRef llvm_build_gep(LLVMValueRef Pointer, value Indices,
}
/* llvalue -> llvalue array -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_in_bounds_gep(LLVMValueRef Pointer,
+LLVMValueRef llvm_build_in_bounds_gep(LLVMValueRef Pointer,
value Indices, value Name,
value B) {
return LLVMBuildInBoundsGEP(Builder_val(B), Pointer,
@@ -2152,7 +2152,7 @@ CAMLprim LLVMValueRef llvm_build_in_bounds_gep(LLVMValueRef Pointer,
}
/* llvalue -> int -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_struct_gep(LLVMValueRef Pointer,
+LLVMValueRef llvm_build_struct_gep(LLVMValueRef Pointer,
value Index, value Name,
value B) {
return LLVMBuildStructGEP(Builder_val(B), Pointer,
@@ -2160,13 +2160,13 @@ CAMLprim LLVMValueRef llvm_build_struct_gep(LLVMValueRef Pointer,
}
/* string -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_global_string(value Str, value Name, value B) {
+LLVMValueRef llvm_build_global_string(value Str, value Name, value B) {
return LLVMBuildGlobalString(Builder_val(B), String_val(Str),
String_val(Name));
}
/* string -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_global_stringptr(value Str, value Name,
+LLVMValueRef llvm_build_global_stringptr(value Str, value Name,
value B) {
return LLVMBuildGlobalStringPtr(Builder_val(B), String_val(Str),
String_val(Name));
@@ -2175,110 +2175,110 @@ CAMLprim LLVMValueRef llvm_build_global_stringptr(value Str, value Name,
/*--... Casts ..............................................................--*/
/* llvalue -> lltype -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_trunc(LLVMValueRef X, LLVMTypeRef Ty,
+LLVMValueRef llvm_build_trunc(LLVMValueRef X, LLVMTypeRef Ty,
value Name, value B) {
return LLVMBuildTrunc(Builder_val(B), X, Ty, String_val(Name));
}
/* llvalue -> lltype -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_zext(LLVMValueRef X, LLVMTypeRef Ty,
+LLVMValueRef llvm_build_zext(LLVMValueRef X, LLVMTypeRef Ty,
value Name, value B) {
return LLVMBuildZExt(Builder_val(B), X, Ty, String_val(Name));
}
/* llvalue -> lltype -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_sext(LLVMValueRef X, LLVMTypeRef Ty,
+LLVMValueRef llvm_build_sext(LLVMValueRef X, LLVMTypeRef Ty,
value Name, value B) {
return LLVMBuildSExt(Builder_val(B), X, Ty, String_val(Name));
}
/* llvalue -> lltype -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_fptoui(LLVMValueRef X, LLVMTypeRef Ty,
+LLVMValueRef llvm_build_fptoui(LLVMValueRef X, LLVMTypeRef Ty,
value Name, value B) {
return LLVMBuildFPToUI(Builder_val(B), X, Ty, String_val(Name));
}
/* llvalue -> lltype -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_fptosi(LLVMValueRef X, LLVMTypeRef Ty,
+LLVMValueRef llvm_build_fptosi(LLVMValueRef X, LLVMTypeRef Ty,
value Name, value B) {
return LLVMBuildFPToSI(Builder_val(B), X, Ty, String_val(Name));
}
/* llvalue -> lltype -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_uitofp(LLVMValueRef X, LLVMTypeRef Ty,
+LLVMValueRef llvm_build_uitofp(LLVMValueRef X, LLVMTypeRef Ty,
value Name, value B) {
return LLVMBuildUIToFP(Builder_val(B), X, Ty, String_val(Name));
}
/* llvalue -> lltype -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_sitofp(LLVMValueRef X, LLVMTypeRef Ty,
+LLVMValueRef llvm_build_sitofp(LLVMValueRef X, LLVMTypeRef Ty,
value Name, value B) {
return LLVMBuildSIToFP(Builder_val(B), X, Ty, String_val(Name));
}
/* llvalue -> lltype -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_fptrunc(LLVMValueRef X, LLVMTypeRef Ty,
+LLVMValueRef llvm_build_fptrunc(LLVMValueRef X, LLVMTypeRef Ty,
value Name, value B) {
return LLVMBuildFPTrunc(Builder_val(B), X, Ty, String_val(Name));
}
/* llvalue -> lltype -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_fpext(LLVMValueRef X, LLVMTypeRef Ty,
+LLVMValueRef llvm_build_fpext(LLVMValueRef X, LLVMTypeRef Ty,
value Name, value B) {
return LLVMBuildFPExt(Builder_val(B), X, Ty, String_val(Name));
}
/* llvalue -> lltype -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_prttoint(LLVMValueRef X, LLVMTypeRef Ty,
+LLVMValueRef llvm_build_prttoint(LLVMValueRef X, LLVMTypeRef Ty,
value Name, value B) {
return LLVMBuildPtrToInt(Builder_val(B), X, Ty, String_val(Name));
}
/* llvalue -> lltype -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_inttoptr(LLVMValueRef X, LLVMTypeRef Ty,
+LLVMValueRef llvm_build_inttoptr(LLVMValueRef X, LLVMTypeRef Ty,
value Name, value B) {
return LLVMBuildIntToPtr(Builder_val(B), X, Ty, String_val(Name));
}
/* llvalue -> lltype -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_bitcast(LLVMValueRef X, LLVMTypeRef Ty,
+LLVMValueRef llvm_build_bitcast(LLVMValueRef X, LLVMTypeRef Ty,
value Name, value B) {
return LLVMBuildBitCast(Builder_val(B), X, Ty, String_val(Name));
}
/* llvalue -> lltype -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_zext_or_bitcast(LLVMValueRef X, LLVMTypeRef Ty,
+LLVMValueRef llvm_build_zext_or_bitcast(LLVMValueRef X, LLVMTypeRef Ty,
value Name, value B) {
return LLVMBuildZExtOrBitCast(Builder_val(B), X, Ty, String_val(Name));
}
/* llvalue -> lltype -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_sext_or_bitcast(LLVMValueRef X, LLVMTypeRef Ty,
+LLVMValueRef llvm_build_sext_or_bitcast(LLVMValueRef X, LLVMTypeRef Ty,
value Name, value B) {
return LLVMBuildSExtOrBitCast(Builder_val(B), X, Ty, String_val(Name));
}
/* llvalue -> lltype -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_trunc_or_bitcast(LLVMValueRef X,
+LLVMValueRef llvm_build_trunc_or_bitcast(LLVMValueRef X,
LLVMTypeRef Ty, value Name,
value B) {
return LLVMBuildTruncOrBitCast(Builder_val(B), X, Ty, String_val(Name));
}
/* llvalue -> lltype -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_pointercast(LLVMValueRef X, LLVMTypeRef Ty,
+LLVMValueRef llvm_build_pointercast(LLVMValueRef X, LLVMTypeRef Ty,
value Name, value B) {
return LLVMBuildPointerCast(Builder_val(B), X, Ty, String_val(Name));
}
/* llvalue -> lltype -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_intcast(LLVMValueRef X, LLVMTypeRef Ty,
+LLVMValueRef llvm_build_intcast(LLVMValueRef X, LLVMTypeRef Ty,
value Name, value B) {
return LLVMBuildIntCast(Builder_val(B), X, Ty, String_val(Name));
}
/* llvalue -> lltype -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_fpcast(LLVMValueRef X, LLVMTypeRef Ty,
+LLVMValueRef llvm_build_fpcast(LLVMValueRef X, LLVMTypeRef Ty,
value Name, value B) {
return LLVMBuildFPCast(Builder_val(B), X, Ty, String_val(Name));
}
@@ -2286,7 +2286,7 @@ CAMLprim LLVMValueRef llvm_build_fpcast(LLVMValueRef X, LLVMTypeRef Ty,
/*--... Comparisons ........................................................--*/
/* Icmp.t -> llvalue -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_icmp(value Pred,
+LLVMValueRef llvm_build_icmp(value Pred,
LLVMValueRef LHS, LLVMValueRef RHS,
value Name, value B) {
return LLVMBuildICmp(Builder_val(B), Int_val(Pred) + LLVMIntEQ, LHS, RHS,
@@ -2294,7 +2294,7 @@ CAMLprim LLVMValueRef llvm_build_icmp(value Pred,
}
/* Fcmp.t -> llvalue -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_fcmp(value Pred,
+LLVMValueRef llvm_build_fcmp(value Pred,
LLVMValueRef LHS, LLVMValueRef RHS,
value Name, value B) {
return LLVMBuildFCmp(Builder_val(B), Int_val(Pred), LHS, RHS,
@@ -2304,7 +2304,7 @@ CAMLprim LLVMValueRef llvm_build_fcmp(value Pred,
/*--... Miscellaneous instructions .........................................--*/
/* (llvalue * llbasicblock) list -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_phi(value Incoming, value Name, value B) {
+LLVMValueRef llvm_build_phi(value Incoming, value Name, value B) {
value Hd, Tl;
LLVMValueRef FirstValue, PhiNode;
@@ -2325,39 +2325,39 @@ CAMLprim LLVMValueRef llvm_build_phi(value Incoming, value Name, value B) {
}
/* lltype -> string -> llbuilder -> value */
-CAMLprim LLVMValueRef llvm_build_empty_phi(LLVMTypeRef Type, value Name, value B) {
+LLVMValueRef llvm_build_empty_phi(LLVMTypeRef Type, value Name, value B) {
return LLVMBuildPhi(Builder_val(B), Type, String_val(Name));
}
/* llvalue -> llvalue array -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_call(LLVMValueRef Fn, value Params,
+LLVMValueRef llvm_build_call(LLVMValueRef Fn, value Params,
value Name, value B) {
return LLVMBuildCall(Builder_val(B), Fn, (LLVMValueRef *) Op_val(Params),
Wosize_val(Params), String_val(Name));
}
/* llvalue -> llvalue -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_select(LLVMValueRef If,
+LLVMValueRef llvm_build_select(LLVMValueRef If,
LLVMValueRef Then, LLVMValueRef Else,
value Name, value B) {
return LLVMBuildSelect(Builder_val(B), If, Then, Else, String_val(Name));
}
/* llvalue -> lltype -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_va_arg(LLVMValueRef List, LLVMTypeRef Ty,
+LLVMValueRef llvm_build_va_arg(LLVMValueRef List, LLVMTypeRef Ty,
value Name, value B) {
return LLVMBuildVAArg(Builder_val(B), List, Ty, String_val(Name));
}
/* llvalue -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_extractelement(LLVMValueRef Vec,
+LLVMValueRef llvm_build_extractelement(LLVMValueRef Vec,
LLVMValueRef Idx,
value Name, value B) {
return LLVMBuildExtractElement(Builder_val(B), Vec, Idx, String_val(Name));
}
/* llvalue -> llvalue -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_insertelement(LLVMValueRef Vec,
+LLVMValueRef llvm_build_insertelement(LLVMValueRef Vec,
LLVMValueRef Element,
LLVMValueRef Idx,
value Name, value B) {
@@ -2366,21 +2366,21 @@ CAMLprim LLVMValueRef llvm_build_insertelement(LLVMValueRef Vec,
}
/* llvalue -> llvalue -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_shufflevector(LLVMValueRef V1, LLVMValueRef V2,
+LLVMValueRef llvm_build_shufflevector(LLVMValueRef V1, LLVMValueRef V2,
LLVMValueRef Mask,
value Name, value B) {
return LLVMBuildShuffleVector(Builder_val(B), V1, V2, Mask, String_val(Name));
}
/* llvalue -> int -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_extractvalue(LLVMValueRef Aggregate,
+LLVMValueRef llvm_build_extractvalue(LLVMValueRef Aggregate,
value Idx, value Name, value B) {
return LLVMBuildExtractValue(Builder_val(B), Aggregate, Int_val(Idx),
String_val(Name));
}
/* llvalue -> llvalue -> int -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_insertvalue(LLVMValueRef Aggregate,
+LLVMValueRef llvm_build_insertvalue(LLVMValueRef Aggregate,
LLVMValueRef Val, value Idx,
value Name, value B) {
return LLVMBuildInsertValue(Builder_val(B), Aggregate, Val, Int_val(Idx),
@@ -2388,25 +2388,25 @@ CAMLprim LLVMValueRef llvm_build_insertvalue(LLVMValueRef Aggregate,
}
/* llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_is_null(LLVMValueRef Val, value Name,
+LLVMValueRef llvm_build_is_null(LLVMValueRef Val, value Name,
value B) {
return LLVMBuildIsNull(Builder_val(B), Val, String_val(Name));
}
/* llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_is_not_null(LLVMValueRef Val, value Name,
+LLVMValueRef llvm_build_is_not_null(LLVMValueRef Val, value Name,
value B) {
return LLVMBuildIsNotNull(Builder_val(B), Val, String_val(Name));
}
/* llvalue -> llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_ptr
diff (LLVMValueRef LHS, LLVMValueRef RHS,
+LLVMValueRef llvm_build_ptr
diff (LLVMValueRef LHS, LLVMValueRef RHS,
value Name, value B) {
return LLVMBuildPtrDiff(Builder_val(B), LHS, RHS, String_val(Name));
}
/* llvalue -> string -> llbuilder -> llvalue */
-CAMLprim LLVMValueRef llvm_build_freeze(LLVMValueRef X,
+LLVMValueRef llvm_build_freeze(LLVMValueRef X,
value Name, value B) {
return LLVMBuildFreeze(Builder_val(B), X, String_val(Name));
}
@@ -2415,7 +2415,7 @@ CAMLprim LLVMValueRef llvm_build_freeze(LLVMValueRef X,
/* string -> llmemorybuffer
raises IoError msg on error */
-CAMLprim LLVMMemoryBufferRef llvm_memorybuffer_of_file(value Path) {
+LLVMMemoryBufferRef llvm_memorybuffer_of_file(value Path) {
char *Message;
LLVMMemoryBufferRef MemBuf;
@@ -2428,7 +2428,7 @@ CAMLprim LLVMMemoryBufferRef llvm_memorybuffer_of_file(value Path) {
/* unit -> llmemorybuffer
raises IoError msg on error */
-CAMLprim LLVMMemoryBufferRef llvm_memorybuffer_of_stdin(value Unit) {
+LLVMMemoryBufferRef llvm_memorybuffer_of_stdin(value Unit) {
char *Message;
LLVMMemoryBufferRef MemBuf;
@@ -2439,7 +2439,7 @@ CAMLprim LLVMMemoryBufferRef llvm_memorybuffer_of_stdin(value Unit) {
}
/* ?name:string -> string -> llmemorybuffer */
-CAMLprim LLVMMemoryBufferRef llvm_memorybuffer_of_string(value Name, value String) {
+LLVMMemoryBufferRef llvm_memorybuffer_of_string(value Name, value String) {
LLVMMemoryBufferRef MemBuf;
const char *NameCStr;
@@ -2455,14 +2455,14 @@ CAMLprim LLVMMemoryBufferRef llvm_memorybuffer_of_string(value Name, value Strin
}
/* llmemorybuffer -> string */
-CAMLprim value llvm_memorybuffer_as_string(LLVMMemoryBufferRef MemBuf) {
+value llvm_memorybuffer_as_string(LLVMMemoryBufferRef MemBuf) {
size_t BufferSize = LLVMGetBufferSize(MemBuf);
const char *BufferStart = LLVMGetBufferStart(MemBuf);
return cstr_to_string(BufferStart, BufferSize);
}
/* llmemorybuffer -> unit */
-CAMLprim value llvm_memorybuffer_dispose(LLVMMemoryBufferRef MemBuf) {
+value llvm_memorybuffer_dispose(LLVMMemoryBufferRef MemBuf) {
LLVMDisposeMemoryBuffer(MemBuf);
return Val_unit;
}
@@ -2470,34 +2470,34 @@ CAMLprim value llvm_memorybuffer_dispose(LLVMMemoryBufferRef MemBuf) {
/*===-- Pass Managers -----------------------------------------------------===*/
/* unit -> [ `Module ] PassManager.t */
-CAMLprim LLVMPassManagerRef llvm_passmanager_create(value Unit) {
+LLVMPassManagerRef llvm_passmanager_create(value Unit) {
return LLVMCreatePassManager();
}
/* llmodule -> [ `Function ] PassManager.t -> bool */
-CAMLprim value llvm_passmanager_run_module(LLVMModuleRef M,
+value llvm_passmanager_run_module(LLVMModuleRef M,
LLVMPassManagerRef PM) {
return Val_bool(LLVMRunPassManager(PM, M));
}
/* [ `Function ] PassManager.t -> bool */
-CAMLprim value llvm_passmanager_initialize(LLVMPassManagerRef FPM) {
+value llvm_passmanager_initialize(LLVMPassManagerRef FPM) {
return Val_bool(LLVMInitializeFunctionPassManager(FPM));
}
/* llvalue -> [ `Function ] PassManager.t -> bool */
-CAMLprim value llvm_passmanager_run_function(LLVMValueRef F,
+value llvm_passmanager_run_function(LLVMValueRef F,
LLVMPassManagerRef FPM) {
return Val_bool(LLVMRunFunctionPassManager(FPM, F));
}
/* [ `Function ] PassManager.t -> bool */
-CAMLprim value llvm_passmanager_finalize(LLVMPassManagerRef FPM) {
+value llvm_passmanager_finalize(LLVMPassManagerRef FPM) {
return Val_bool(LLVMFinalizeFunctionPassManager(FPM));
}
/* PassManager.any PassManager.t -> unit */
-CAMLprim value llvm_passmanager_dispose(LLVMPassManagerRef PM) {
+value llvm_passmanager_dispose(LLVMPassManagerRef PM) {
LLVMDisposePassManager(PM);
return Val_unit;
}
diff --git a/llvm/bindings/ocaml/llvm/llvm_ocaml.h b/llvm/bindings/ocaml/llvm/llvm_ocaml.h
index a272cafff680a..09e3c6cfb30d7 100644
--- a/llvm/bindings/ocaml/llvm/llvm_ocaml.h
+++ b/llvm/bindings/ocaml/llvm/llvm_ocaml.h
@@ -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
diff --git a/llvm/bindings/ocaml/target/target_ocaml.c b/llvm/bindings/ocaml/target/target_ocaml.c
index c120356bc2497..2f5139d3fbf36 100644
--- a/llvm/bindings/ocaml/target/target_ocaml.c
+++ b/llvm/bindings/ocaml/target/target_ocaml.c
@@ -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;
diff --git a/llvm/bindings/ocaml/transforms/ipo/ipo_ocaml.c b/llvm/bindings/ocaml/transforms/ipo/ipo_ocaml.c
index c0e213714ed02..e18b97a1509b0 100644
--- a/llvm/bindings/ocaml/transforms/ipo/ipo_ocaml.c
+++ b/llvm/bindings/ocaml/transforms/ipo/ipo_ocaml.c
@@ -20,85 +20,85 @@
#include "caml/misc.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;
}
/* [`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;
}
diff --git a/llvm/bindings/ocaml/transforms/passmgr_builder/passmgr_builder_ocaml.c b/llvm/bindings/ocaml/transforms/passmgr_builder/passmgr_builder_ocaml.c
index 6d1f72efd8744..a0590b734387e 100644
--- a/llvm/bindings/ocaml/transforms/passmgr_builder/passmgr_builder_ocaml.c
+++ b/llvm/bindings/ocaml/transforms/passmgr_builder/passmgr_builder_ocaml.c
@@ -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(
diff --git a/llvm/bindings/ocaml/transforms/scalar_opts/scalar_opts_ocaml.c b/llvm/bindings/ocaml/transforms/scalar_opts/scalar_opts_ocaml.c
index 1e794c9241d6c..0a7ae4de49723 100644
--- a/llvm/bindings/ocaml/transforms/scalar_opts/scalar_opts_ocaml.c
+++ b/llvm/bindings/ocaml/transforms/scalar_opts/scalar_opts_ocaml.c
@@ -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;
}
diff --git a/llvm/bindings/ocaml/transforms/utils/transform_utils_ocaml.c b/llvm/bindings/ocaml/transforms/utils/transform_utils_ocaml.c
index 918eec1462223..06bbae707b670 100644
--- a/llvm/bindings/ocaml/transforms/utils/transform_utils_ocaml.c
+++ b/llvm/bindings/ocaml/transforms/utils/transform_utils_ocaml.c
@@ -26,6 +26,6 @@
*/
/* llmodule -> llmodule */
-CAMLprim LLVMModuleRef llvm_clone_module(LLVMModuleRef M) {
+LLVMModuleRef llvm_clone_module(LLVMModuleRef M) {
return LLVMCloneModule(M);
}
diff --git a/llvm/bindings/ocaml/transforms/vectorize/vectorize_ocaml.c b/llvm/bindings/ocaml/transforms/vectorize/vectorize_ocaml.c
index ba9c132c85c29..d9b15bf4588ed 100644
--- a/llvm/bindings/ocaml/transforms/vectorize/vectorize_ocaml.c
+++ b/llvm/bindings/ocaml/transforms/vectorize/vectorize_ocaml.c
@@ -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;
}
More information about the llvm-commits
mailing list