Implement support for the .mono_eh_frame created by llc on LLVM mono branch.
[mono.git] / mono / mini / mini-llvm-cpp.h
1 /*
2  * mini-llvm-cpp.h: LLVM backend
3  *
4  * Authors:
5  *   Zoltan Varga (vargaz@gmail.com)
6  *
7  * (C) 2009 Novell, Inc.
8  */
9
10 #ifndef __MONO_MINI_LLVM_CPP_H__
11 #define __MONO_MINI_LLVM_CPP_H__
12
13 #include <glib.h>
14
15 #include "llvm-c/Core.h"
16 #include "llvm-c/ExecutionEngine.h"
17
18 G_BEGIN_DECLS
19
20 typedef unsigned char * (AllocCodeMemoryCb) (LLVMValueRef function, int size);
21 typedef void (FunctionEmittedCb) (LLVMValueRef function, void *start, void *end);
22 typedef void (ExceptionTableCb) (void *data);
23
24 LLVMExecutionEngineRef
25 mono_llvm_create_ee (LLVMModuleProviderRef MP, AllocCodeMemoryCb *alloc_cb, FunctionEmittedCb *emitted_cb, ExceptionTableCb *exception_cb);
26
27 void
28 mono_llvm_dispose_ee (LLVMExecutionEngineRef ee);
29
30 void
31 mono_llvm_optimize_method (LLVMValueRef method);
32
33 void
34 mono_llvm_dump_value (LLVMValueRef value);
35
36 LLVMValueRef
37 mono_llvm_build_alloca (LLVMBuilderRef builder, LLVMTypeRef Ty, 
38                                                 LLVMValueRef ArraySize,
39                                                 int alignment, const char *Name);
40
41 LLVMValueRef 
42 mono_llvm_build_load (LLVMBuilderRef builder, LLVMValueRef PointerVal,
43                                           const char *Name, gboolean is_volatile);
44
45 LLVMValueRef 
46 mono_llvm_build_aligned_load (LLVMBuilderRef builder, LLVMValueRef PointerVal,
47                                                           const char *Name, gboolean is_volatile, int alignment);
48
49 LLVMValueRef 
50 mono_llvm_build_store (LLVMBuilderRef builder, LLVMValueRef Val, LLVMValueRef PointerVal,
51                                            gboolean is_volatile);
52
53 void
54 mono_llvm_replace_uses_of (LLVMValueRef var, LLVMValueRef v);
55
56 G_END_DECLS
57
58 #endif /* __MONO_MINI_LLVM_CPP_H__ */