Skip to main content

llvm_sys/orc2/
ee.rs

1use super::*;
2use crate::execution_engine::*;
3
4pub type LLVMMemoryManagerCreateContextCallback =
5    extern "C" fn(CtxCtx: *mut ::libc::c_void) -> *mut ::libc::c_void;
6pub type LLVMMemoryManagerNotifyTerminatingCallback = extern "C" fn(CtxCtx: *mut ::libc::c_void);
7
8extern "C" {
9    /// Create a ObjectLinkingLayer instance using the standard JITLink
10    /// InProcessMemoryManager for memory management.
11    pub fn LLVMOrcCreateObjectLinkingLayerWithInProcessMemoryManager(
12        Result: *mut LLVMOrcObjectLayerRef,
13        ES: LLVMOrcExecutionSessionRef,
14    ) -> LLVMErrorRef;
15    pub fn LLVMOrcCreateRTDyldObjectLinkingLayerWithSectionMemoryManager(
16        ES: LLVMOrcExecutionSessionRef,
17    ) -> LLVMOrcObjectLayerRef;
18    /// Create a RTDyldObjectLinkingLayer instance using the standard
19    /// SectionMemoryManager for memory management. If ReserveAlloc is true then
20    /// a contiguous range of memory will be reserved for each object file.
21    pub fn LLVMOrcCreateRTDyldObjectLinkingLayerWithSectionMemoryManagerReserveAlloc(
22        ES: LLVMOrcExecutionSessionRef,
23        ReserveAlloc: LLVMBool,
24    ) -> LLVMOrcObjectLayerRef;
25    pub fn LLVMOrcCreateRTDyldObjectLinkingLayerWithMCJITMemoryManagerLikeCallbacks(
26        ES: LLVMOrcExecutionSessionRef,
27        CreateContextCtx: *mut ::libc::c_void,
28        CreateContext: LLVMMemoryManagerCreateContextCallback,
29        NotifyTerminating: LLVMMemoryManagerNotifyTerminatingCallback,
30        AllocateCodeSection: LLVMMemoryManagerAllocateCodeSectionCallback,
31        AllocateDataSection: LLVMMemoryManagerAllocateDataSectionCallback,
32        FinalizeMemory: LLVMMemoryManagerFinalizeMemoryCallback,
33        Destroy: LLVMMemoryManagerDestroyCallback,
34    ) -> LLVMOrcObjectLayerRef;
35    pub fn LLVMOrcRTDyldObjectLinkingLayerRegisterJITEventListener(
36        RTDyldObjLinkingLayer: LLVMOrcObjectLayerRef,
37        Listener: LLVMJITEventListenerRef,
38    );
39}