aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm-c
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm-c')
-rw-r--r--include/llvm-c/ExecutionEngine.h21
1 files changed, 13 insertions, 8 deletions
diff --git a/include/llvm-c/ExecutionEngine.h b/include/llvm-c/ExecutionEngine.h
index 50fdb6b..cf3565c 100644
--- a/include/llvm-c/ExecutionEngine.h
+++ b/include/llvm-c/ExecutionEngine.h
@@ -171,6 +171,15 @@ void *LLVMGetPointerToGlobal(LLVMExecutionEngineRef EE, LLVMValueRef Global);
/*===-- Operations on memory managers -------------------------------------===*/
+typedef uint8_t *(*LLVMMemoryManagerAllocateCodeSectionCallback)(void *Opaque,
+ uintptr_t Size, unsigned Alignment,
+ unsigned SectionID);
+typedef uint8_t *(*LLVMMemoryManagerAllocateDataSectionCallback)(void *Opaque,
+ uintptr_t Size, unsigned Alignment,
+ unsigned SectionID, LLVMBool IsReadOnly);
+typedef LLVMBool (*LLVMMemoryManagerFinalizeMemoryCallback)(void *Opaque, char **ErrMsg);
+typedef void (*LLVMMemoryManagerDestroyCallback)(void *Opaque);
+
/**
* Create a simple custom MCJIT memory manager. This memory manager can
* intercept allocations in a module-oblivious way. This will return NULL
@@ -184,14 +193,10 @@ void *LLVMGetPointerToGlobal(LLVMExecutionEngineRef EE, LLVMValueRef Global);
*/
LLVMMCJITMemoryManagerRef LLVMCreateSimpleMCJITMemoryManager(
void *Opaque,
- uint8_t *(*AllocateCodeSection)(void *Opaque,
- uintptr_t Size, unsigned Alignment,
- unsigned SectionID),
- uint8_t *(*AllocateDataSection)(void *Opaque,
- uintptr_t Size, unsigned Alignment,
- unsigned SectionID, LLVMBool IsReadOnly),
- LLVMBool (*FinalizeMemory)(void *Opaque, char **ErrMsg),
- void (*Destroy)(void *Opaque));
+ LLVMMemoryManagerAllocateCodeSectionCallback AllocateCodeSection,
+ LLVMMemoryManagerAllocateDataSectionCallback AllocateDataSection,
+ LLVMMemoryManagerFinalizeMemoryCallback FinalizeMemory,
+ LLVMMemoryManagerDestroyCallback Destory);
void LLVMDisposeMCJITMemoryManager(LLVMMCJITMemoryManagerRef MM);