Project Alice
Loading...
Searching...
No Matches
ExecutionEngine.h
Go to the documentation of this file.
1/*===-- llvm-c/ExecutionEngine.h - ExecutionEngine Lib C Iface --*- C++ -*-===*\
2|* *|
3|* Part of the LLVM Project, under the Apache License v2.0 with LLVM *|
4|* Exceptions. *|
5|* See https://llvm.org/LICENSE.txt for license information. *|
6|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception *|
7|* *|
8|*===----------------------------------------------------------------------===*|
9|* *|
10|* This header declares the C interface to libLLVMExecutionEngine.o, which *|
11|* implements various analyses of the LLVM IR. *|
12|* *|
13|* Many exotic languages can interoperate with C code but have a harder time *|
14|* with C++ due to name mangling. So in addition to C, this interface enables *|
15|* tools written in such languages. *|
16|* *|
17\*===----------------------------------------------------------------------===*/
18
19#ifndef LLVM_C_EXECUTIONENGINE_H
20#define LLVM_C_EXECUTIONENGINE_H
21
22#include "llvm-c/ExternC.h"
23#include "llvm-c/Target.h"
25#include "llvm-c/Types.h"
26
28
36void LLVMLinkInMCJIT(void);
38
39typedef struct LLVMOpaqueGenericValue *LLVMGenericValueRef;
40typedef struct LLVMOpaqueExecutionEngine *LLVMExecutionEngineRef;
41typedef struct LLVMOpaqueMCJITMemoryManager *LLVMMCJITMemoryManagerRef;
42
44 unsigned OptLevel;
49};
50
51/*===-- Operations on generic values --------------------------------------===*/
52
54 unsigned long long N,
55 LLVMBool IsSigned);
56
58
60
62
64 LLVMBool IsSigned);
65
67
69
71
72/*===-- Operations on execution engines -----------------------------------===*/
73
76 char **OutError);
77
80 char **OutError);
81
84 unsigned OptLevel,
85 char **OutError);
86
88 struct LLVMMCJITCompilerOptions *Options, size_t SizeOfOptions);
89
109 struct LLVMMCJITCompilerOptions *Options, size_t SizeOfOptions,
110 char **OutError);
111
113
115
117
119 unsigned ArgC, const char * const *ArgV,
120 const char * const *EnvP);
121
123 unsigned NumArgs,
124 LLVMGenericValueRef *Args);
125
127
129
131 LLVMModuleRef *OutMod, char **OutError);
132
134 LLVMValueRef *OutFn);
135
137 LLVMValueRef Fn);
138
142
144 void* Addr);
145
147
149
151
155 char **OutError);
156
157/*===-- Operations on memory managers -------------------------------------===*/
158
159typedef uint8_t *(*LLVMMemoryManagerAllocateCodeSectionCallback)(
160 void *Opaque, uintptr_t Size, unsigned Alignment, unsigned SectionID,
161 const char *SectionName);
162typedef uint8_t *(*LLVMMemoryManagerAllocateDataSectionCallback)(
163 void *Opaque, uintptr_t Size, unsigned Alignment, unsigned SectionID,
164 const char *SectionName, LLVMBool IsReadOnly);
166 void *Opaque, char **ErrMsg);
167typedef void (*LLVMMemoryManagerDestroyCallback)(void *Opaque);
168
181 void *Opaque,
186
188
189/*===-- JIT Event Listener functions -------------------------------------===*/
190
195
201
202#endif
#define LLVM_C_EXTERN_C_BEGIN
Definition: ExternC.h:35
#define LLVM_C_EXTERN_C_END
Definition: ExternC.h:36
LLVMGenericValueRef LLVMCreateGenericValueOfPointer(void *P)
double LLVMGenericValueToFloat(LLVMTypeRef TyRef, LLVMGenericValueRef GenVal)
LLVMJITEventListenerRef LLVMCreateOProfileJITEventListener(void)
LLVMBool LLVMExecutionEngineGetErrMsg(LLVMExecutionEngineRef EE, char **OutError)
LLVMMCJITMemoryManagerRef LLVMCreateSimpleMCJITMemoryManager(void *Opaque, LLVMMemoryManagerAllocateCodeSectionCallback AllocateCodeSection, LLVMMemoryManagerAllocateDataSectionCallback AllocateDataSection, LLVMMemoryManagerFinalizeMemoryCallback FinalizeMemory, LLVMMemoryManagerDestroyCallback Destroy)
void LLVMInitializeMCJITCompilerOptions(struct LLVMMCJITCompilerOptions *Options, size_t SizeOfOptions)
void LLVMRunStaticDestructors(LLVMExecutionEngineRef EE)
LLVMBool LLVMCreateJITCompilerForModule(LLVMExecutionEngineRef *OutJIT, LLVMModuleRef M, unsigned OptLevel, char **OutError)
LLVMBool LLVMFindFunction(LLVMExecutionEngineRef EE, const char *Name, LLVMValueRef *OutFn)
struct LLVMOpaqueMCJITMemoryManager * LLVMMCJITMemoryManagerRef
LLVMGenericValueRef LLVMCreateGenericValueOfInt(LLVMTypeRef Ty, unsigned long long N, LLVMBool IsSigned)
void LLVMDisposeMCJITMemoryManager(LLVMMCJITMemoryManagerRef MM)
void(* LLVMMemoryManagerDestroyCallback)(void *Opaque)
LLVMGenericValueRef LLVMRunFunction(LLVMExecutionEngineRef EE, LLVMValueRef F, unsigned NumArgs, LLVMGenericValueRef *Args)
LLVMTargetDataRef LLVMGetExecutionEngineTargetData(LLVMExecutionEngineRef EE)
void LLVMDisposeExecutionEngine(LLVMExecutionEngineRef EE)
LLVMJITEventListenerRef LLVMCreatePerfJITEventListener(void)
void * LLVMRecompileAndRelinkFunction(LLVMExecutionEngineRef EE, LLVMValueRef Fn)
struct LLVMOpaqueExecutionEngine * LLVMExecutionEngineRef
uint64_t LLVMGetFunctionAddress(LLVMExecutionEngineRef EE, const char *Name)
LLVMBool LLVMCreateExecutionEngineForModule(LLVMExecutionEngineRef *OutEE, LLVMModuleRef M, char **OutError)
uint64_t LLVMGetGlobalValueAddress(LLVMExecutionEngineRef EE, const char *Name)
void LLVMAddModule(LLVMExecutionEngineRef EE, LLVMModuleRef M)
LLVMBool LLVMRemoveModule(LLVMExecutionEngineRef EE, LLVMModuleRef M, LLVMModuleRef *OutMod, char **OutError)
LLVMJITEventListenerRef LLVMCreateIntelJITEventListener(void)
struct LLVMOpaqueGenericValue * LLVMGenericValueRef
LLVMJITEventListenerRef LLVMCreateGDBRegistrationListener(void)
void * LLVMGenericValueToPointer(LLVMGenericValueRef GenVal)
LLVMBool(* LLVMMemoryManagerFinalizeMemoryCallback)(void *Opaque, char **ErrMsg)
unsigned LLVMGenericValueIntWidth(LLVMGenericValueRef GenValRef)
void LLVMRunStaticConstructors(LLVMExecutionEngineRef EE)
LLVMBool LLVMCreateMCJITCompilerForModule(LLVMExecutionEngineRef *OutJIT, LLVMModuleRef M, struct LLVMMCJITCompilerOptions *Options, size_t SizeOfOptions, char **OutError)
LLVMGenericValueRef LLVMCreateGenericValueOfFloat(LLVMTypeRef Ty, double N)
uint8_t *(* LLVMMemoryManagerAllocateDataSectionCallback)(void *Opaque, uintptr_t Size, unsigned Alignment, unsigned SectionID, const char *SectionName, LLVMBool IsReadOnly)
unsigned long long LLVMGenericValueToInt(LLVMGenericValueRef GenVal, LLVMBool IsSigned)
int LLVMRunFunctionAsMain(LLVMExecutionEngineRef EE, LLVMValueRef F, unsigned ArgC, const char *const *ArgV, const char *const *EnvP)
void LLVMLinkInInterpreter(void)
void * LLVMGetPointerToGlobal(LLVMExecutionEngineRef EE, LLVMValueRef Global)
uint8_t *(* LLVMMemoryManagerAllocateCodeSectionCallback)(void *Opaque, uintptr_t Size, unsigned Alignment, unsigned SectionID, const char *SectionName)
void LLVMAddGlobalMapping(LLVMExecutionEngineRef EE, LLVMValueRef Global, void *Addr)
LLVMBool LLVMCreateInterpreterForModule(LLVMExecutionEngineRef *OutInterp, LLVMModuleRef M, char **OutError)
void LLVMLinkInMCJIT(void)
void LLVMFreeMachineCodeForFunction(LLVMExecutionEngineRef EE, LLVMValueRef F)
void LLVMDisposeGenericValue(LLVMGenericValueRef GenVal)
LLVMTargetMachineRef LLVMGetExecutionEngineTargetMachine(LLVMExecutionEngineRef EE)
struct LLVMOpaqueValue * LLVMValueRef
Definition: Types.h:75
int LLVMBool
Definition: Types.h:28
struct LLVMOpaqueType * LLVMTypeRef
Definition: Types.h:68
struct LLVMOpaqueModule * LLVMModuleRef
Definition: Types.h:61
struct LLVMOpaqueJITEventListener * LLVMJITEventListenerRef
Definition: Types.h:165
struct LLVMOpaqueTargetMachine * LLVMTargetMachineRef
Definition: TargetMachine.h:35
LLVMCodeModel
Definition: TargetMachine.h:55
struct LLVMOpaqueTargetData * LLVMTargetDataRef
Definition: Target.h:37
ulong uint64_t
uchar uint8_t
LLVMMCJITMemoryManagerRef MCJMM