[llvm] r191693 - llvm-c: use typedef for function pointers
Anders Waldenborg
anders at 0x63.nu
Mon Sep 30 12:11:32 PDT 2013
Author: andersg
Date: Mon Sep 30 14:11:32 2013
New Revision: 191693
URL: http://llvm.org/viewvc/llvm-project?rev=191693&view=rev
Log:
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
Modified:
llvm/trunk/include/llvm-c/ExecutionEngine.h
llvm/trunk/lib/ExecutionEngine/ExecutionEngineBindings.cpp
Modified: llvm/trunk/include/llvm-c/ExecutionEngine.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm-c/ExecutionEngine.h?rev=191693&r1=191692&r2=191693&view=diff
==============================================================================
--- llvm/trunk/include/llvm-c/ExecutionEngine.h (original)
+++ llvm/trunk/include/llvm-c/ExecutionEngine.h Mon Sep 30 14:11:32 2013
@@ -171,6 +171,15 @@ void *LLVMGetPointerToGlobal(LLVMExecuti
/*===-- 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(LLVMExecuti
*/
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);
Modified: llvm/trunk/lib/ExecutionEngine/ExecutionEngineBindings.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/ExecutionEngineBindings.cpp?rev=191693&r1=191692&r2=191693&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/ExecutionEngineBindings.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/ExecutionEngineBindings.cpp Mon Sep 30 14:11:32 2013
@@ -339,14 +339,10 @@ void *LLVMGetPointerToGlobal(LLVMExecuti
namespace {
struct SimpleBindingMMFunctions {
- 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 Destroy;
};
class SimpleBindingMemoryManager : public RTDyldMemoryManager {
@@ -415,14 +411,10 @@ bool SimpleBindingMemoryManager::finaliz
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 Destroy) {
if (!AllocateCodeSection || !AllocateDataSection || !FinalizeMemory ||
!Destroy)
More information about the llvm-commits
mailing list