Merge pull request #2417 from razzfazz/guard_substr
[mono.git] / mono / mini / llvm-jit.h
1 /*
2  * llvm-jit.h: LLVM backend
3  *
4  * Authors:
5  *   Zoltan Varga (vargaz@gmail.com)
6  *
7  * (C) 2009 Novell, Inc.
8  */
9
10 #ifndef __MONO_LLVM_JIT_H__
11 #define __MONO_LLVM_JIT_H__
12
13 #include <glib.h>
14
15 #include "llvm-c/Core.h"
16 #include "llvm-c/ExecutionEngine.h"
17
18 #include <unwind.h>
19
20 G_BEGIN_DECLS
21
22 typedef unsigned char * (AllocCodeMemoryCb) (LLVMValueRef function, int size);
23 typedef void (FunctionEmittedCb) (LLVMValueRef function, void *start, void *end);
24 typedef void (ExceptionTableCb) (void *data);
25 typedef char* (DlSymCb) (const char *name, void **symbol);
26
27 typedef void* MonoEERef;
28
29 MonoEERef
30 mono_llvm_create_ee (LLVMModuleProviderRef MP, AllocCodeMemoryCb *alloc_cb, FunctionEmittedCb *emitted_cb, ExceptionTableCb *exception_cb, DlSymCb *dlsym_cb, LLVMExecutionEngineRef *ee);
31
32 void
33 mono_llvm_dispose_ee (MonoEERef *mono_ee);
34
35 gpointer
36 mono_llvm_compile_method (MonoEERef mono_ee, LLVMValueRef method, int nvars, LLVMValueRef *callee_vars, gpointer *callee_addrs, gpointer *eh_frame);
37
38 void
39 mono_llvm_optimize_method (MonoEERef mono_ee, LLVMValueRef method);
40
41 void
42 mono_llvm_set_unhandled_exception_handler (void);
43
44 G_END_DECLS
45
46 #endif /* __MONO_LLVM_JIT_H__ */