Update mcs/class/Commons.Xml.Relaxng/Commons.Xml.Relaxng/RelaxngPattern.cs
[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 enum {
21         LLVM_ATOMICRMW_OP_XCHG = 0,
22         LLVM_ATOMICRMW_OP_ADD = 1,
23 } AtomicRMWOp;
24
25 typedef unsigned char * (AllocCodeMemoryCb) (LLVMValueRef function, int size);
26 typedef void (FunctionEmittedCb) (LLVMValueRef function, void *start, void *end);
27 typedef void (ExceptionTableCb) (void *data);
28
29 LLVMExecutionEngineRef
30 mono_llvm_create_ee (LLVMModuleProviderRef MP, AllocCodeMemoryCb *alloc_cb, FunctionEmittedCb *emitted_cb, ExceptionTableCb *exception_cb);
31
32 void
33 mono_llvm_dispose_ee (LLVMExecutionEngineRef ee);
34
35 void
36 mono_llvm_optimize_method (LLVMValueRef method);
37
38 void
39 mono_llvm_dump_value (LLVMValueRef value);
40
41 LLVMValueRef
42 mono_llvm_build_alloca (LLVMBuilderRef builder, LLVMTypeRef Ty, 
43                                                 LLVMValueRef ArraySize,
44                                                 int alignment, const char *Name);
45
46 LLVMValueRef 
47 mono_llvm_build_load (LLVMBuilderRef builder, LLVMValueRef PointerVal,
48                                           const char *Name, gboolean is_volatile);
49
50 LLVMValueRef 
51 mono_llvm_build_aligned_load (LLVMBuilderRef builder, LLVMValueRef PointerVal,
52                                                           const char *Name, gboolean is_volatile, int alignment);
53
54 LLVMValueRef 
55 mono_llvm_build_store (LLVMBuilderRef builder, LLVMValueRef Val, LLVMValueRef PointerVal,
56                                            gboolean is_volatile);
57
58 LLVMValueRef 
59 mono_llvm_build_aligned_store (LLVMBuilderRef builder, LLVMValueRef Val, LLVMValueRef PointerVal,
60                                                            gboolean is_volatile, int alignment);
61
62 LLVMValueRef
63 mono_llvm_build_atomic_rmw (LLVMBuilderRef builder, AtomicRMWOp op, LLVMValueRef ptr, LLVMValueRef val);
64
65 LLVMValueRef
66 mono_llvm_build_fence (LLVMBuilderRef builder);
67
68 void
69 mono_llvm_replace_uses_of (LLVMValueRef var, LLVMValueRef v);
70
71 LLVMValueRef
72 mono_llvm_build_cmpxchg (LLVMBuilderRef builder, LLVMValueRef addr, LLVMValueRef comparand, LLVMValueRef value);
73
74 G_END_DECLS
75
76 #endif /* __MONO_MINI_LLVM_CPP_H__ */