mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
llvm-c: use typedef for function pointers
This makes it consistent with other function pointers used in llvm-c Differential Revision: http://llvm-reviews.chandlerc.com/D1712 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191693 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
20546c697f
commit
5be81238f0
@ -171,6 +171,15 @@ void *LLVMGetPointerToGlobal(LLVMExecutionEngineRef EE, LLVMValueRef Global);
|
|||||||
|
|
||||||
/*===-- Operations on memory managers -------------------------------------===*/
|
/*===-- 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
|
* Create a simple custom MCJIT memory manager. This memory manager can
|
||||||
* intercept allocations in a module-oblivious way. This will return NULL
|
* intercept allocations in a module-oblivious way. This will return NULL
|
||||||
@ -184,14 +193,10 @@ void *LLVMGetPointerToGlobal(LLVMExecutionEngineRef EE, LLVMValueRef Global);
|
|||||||
*/
|
*/
|
||||||
LLVMMCJITMemoryManagerRef LLVMCreateSimpleMCJITMemoryManager(
|
LLVMMCJITMemoryManagerRef LLVMCreateSimpleMCJITMemoryManager(
|
||||||
void *Opaque,
|
void *Opaque,
|
||||||
uint8_t *(*AllocateCodeSection)(void *Opaque,
|
LLVMMemoryManagerAllocateCodeSectionCallback AllocateCodeSection,
|
||||||
uintptr_t Size, unsigned Alignment,
|
LLVMMemoryManagerAllocateDataSectionCallback AllocateDataSection,
|
||||||
unsigned SectionID),
|
LLVMMemoryManagerFinalizeMemoryCallback FinalizeMemory,
|
||||||
uint8_t *(*AllocateDataSection)(void *Opaque,
|
LLVMMemoryManagerDestroyCallback Destory);
|
||||||
uintptr_t Size, unsigned Alignment,
|
|
||||||
unsigned SectionID, LLVMBool IsReadOnly),
|
|
||||||
LLVMBool (*FinalizeMemory)(void *Opaque, char **ErrMsg),
|
|
||||||
void (*Destroy)(void *Opaque));
|
|
||||||
|
|
||||||
void LLVMDisposeMCJITMemoryManager(LLVMMCJITMemoryManagerRef MM);
|
void LLVMDisposeMCJITMemoryManager(LLVMMCJITMemoryManagerRef MM);
|
||||||
|
|
||||||
|
@ -339,14 +339,10 @@ void *LLVMGetPointerToGlobal(LLVMExecutionEngineRef EE, LLVMValueRef Global) {
|
|||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
struct SimpleBindingMMFunctions {
|
struct SimpleBindingMMFunctions {
|
||||||
uint8_t *(*AllocateCodeSection)(void *Opaque,
|
LLVMMemoryManagerAllocateCodeSectionCallback AllocateCodeSection;
|
||||||
uintptr_t Size, unsigned Alignment,
|
LLVMMemoryManagerAllocateDataSectionCallback AllocateDataSection;
|
||||||
unsigned SectionID);
|
LLVMMemoryManagerFinalizeMemoryCallback FinalizeMemory;
|
||||||
uint8_t *(*AllocateDataSection)(void *Opaque,
|
LLVMMemoryManagerDestroyCallback Destroy;
|
||||||
uintptr_t Size, unsigned Alignment,
|
|
||||||
unsigned SectionID, LLVMBool IsReadOnly);
|
|
||||||
LLVMBool (*FinalizeMemory)(void *Opaque, char **ErrMsg);
|
|
||||||
void (*Destroy)(void *Opaque);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class SimpleBindingMemoryManager : public RTDyldMemoryManager {
|
class SimpleBindingMemoryManager : public RTDyldMemoryManager {
|
||||||
@ -415,14 +411,10 @@ bool SimpleBindingMemoryManager::finalizeMemory(std::string *ErrMsg) {
|
|||||||
|
|
||||||
LLVMMCJITMemoryManagerRef LLVMCreateSimpleMCJITMemoryManager(
|
LLVMMCJITMemoryManagerRef LLVMCreateSimpleMCJITMemoryManager(
|
||||||
void *Opaque,
|
void *Opaque,
|
||||||
uint8_t *(*AllocateCodeSection)(void *Opaque,
|
LLVMMemoryManagerAllocateCodeSectionCallback AllocateCodeSection,
|
||||||
uintptr_t Size, unsigned Alignment,
|
LLVMMemoryManagerAllocateDataSectionCallback AllocateDataSection,
|
||||||
unsigned SectionID),
|
LLVMMemoryManagerFinalizeMemoryCallback FinalizeMemory,
|
||||||
uint8_t *(*AllocateDataSection)(void *Opaque,
|
LLVMMemoryManagerDestroyCallback Destroy) {
|
||||||
uintptr_t Size, unsigned Alignment,
|
|
||||||
unsigned SectionID, LLVMBool IsReadOnly),
|
|
||||||
LLVMBool (*FinalizeMemory)(void *Opaque, char **ErrMsg),
|
|
||||||
void (*Destroy)(void *Opaque)) {
|
|
||||||
|
|
||||||
if (!AllocateCodeSection || !AllocateDataSection || !FinalizeMemory ||
|
if (!AllocateCodeSection || !AllocateDataSection || !FinalizeMemory ||
|
||||||
!Destroy)
|
!Destroy)
|
||||||
|
Loading…
Reference in New Issue
Block a user