mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
Add (very basic) bindings for ModuleProvider.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44899 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -14,6 +14,7 @@ type lltypehandle
|
||||
type llvalue
|
||||
type llbasicblock
|
||||
type llbuilder
|
||||
type llmoduleprovider
|
||||
|
||||
type type_kind =
|
||||
Void_type
|
||||
@@ -427,6 +428,13 @@ external build_shufflevector : llvalue -> llvalue -> llvalue -> string ->
|
||||
llbuilder -> llvalue = "llvm_build_shufflevector"
|
||||
|
||||
|
||||
(*===-- Module providers --------------------------------------------------===*)
|
||||
external create_module_provider : llmodule -> llmoduleprovider
|
||||
= "LLVMCreateModuleProviderForExistingModule"
|
||||
external dispose_module_provider : llmoduleprovider -> unit
|
||||
= "llvm_dispose_module_provider"
|
||||
|
||||
|
||||
(*===-- Non-Externs -------------------------------------------------------===*)
|
||||
(* These functions are built using the externals, so must be declared late. *)
|
||||
|
||||
|
@@ -40,6 +40,9 @@ type llbasicblock
|
||||
class. **)
|
||||
type llbuilder
|
||||
|
||||
(** Used to provide a module to JIT or interpreter. **)
|
||||
type llmoduleprovider
|
||||
|
||||
(** The kind of an [lltype], the result of [classify_type ty]. See the
|
||||
[llvm::Type::TypeID] enumeration. **)
|
||||
type type_kind =
|
||||
@@ -1217,3 +1220,17 @@ external build_insertelement : llvalue -> llvalue -> llvalue -> string ->
|
||||
See the method [llvm::LLVMBuilder::CreateShuffleVector]. **)
|
||||
external build_shufflevector : llvalue -> llvalue -> llvalue -> string ->
|
||||
llbuilder -> llvalue = "llvm_build_shufflevector"
|
||||
|
||||
|
||||
(*===-- Module providers --------------------------------------------------===*)
|
||||
|
||||
(** [create_module_provider m] encapsulates [m] in a module provider and takes
|
||||
ownership of the module. See the constructor
|
||||
[llvm::ExistingModuleProvider::ExistingModuleProvider]. **)
|
||||
external create_module_provider : llmodule -> llmoduleprovider
|
||||
= "LLVMCreateModuleProviderForExistingModule"
|
||||
|
||||
(** [dispose_module_provider mp] destroys the module provider [mp] as well as
|
||||
the contained module. **)
|
||||
external dispose_module_provider : llmoduleprovider -> unit
|
||||
= "llvm_dispose_module_provider"
|
||||
|
@@ -1047,3 +1047,11 @@ CAMLprim LLVMValueRef llvm_build_shufflevector(LLVMValueRef V1, LLVMValueRef V2,
|
||||
return LLVMBuildShuffleVector(Builder_val(B), V1, V2, Mask, String_val(Name));
|
||||
}
|
||||
|
||||
|
||||
/*===-- Module Providers --------------------------------------------------===*/
|
||||
|
||||
/* llmoduleprovider -> unit */
|
||||
CAMLprim value llvm_dispose_module_provider(LLVMModuleProviderRef MP) {
|
||||
LLVMDisposeModuleProvider(MP);
|
||||
return Val_unit;
|
||||
}
|
||||
|
Reference in New Issue
Block a user