Skip to main content

llvm_sys/orc2/
ee.rs

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