2 * mini-llvm-cpp.h: LLVM backend
5 * Zoltan Varga (vargaz@gmail.com)
7 * (C) 2009 Novell, Inc.
10 #ifndef __MONO_MINI_LLVM_CPP_H__
11 #define __MONO_MINI_LLVM_CPP_H__
15 #include "llvm-c/Core.h"
16 #include "llvm-c/ExecutionEngine.h"
23 * Keep in sync with the enum in utils/mono-memory-model.h.
26 LLVM_BARRIER_NONE = 0,
33 LLVM_ATOMICRMW_OP_XCHG = 0,
34 LLVM_ATOMICRMW_OP_ADD = 1,
38 mono_llvm_dump_value (LLVMValueRef value);
41 mono_llvm_build_alloca (LLVMBuilderRef builder, LLVMTypeRef Ty,
42 LLVMValueRef ArraySize,
43 int alignment, const char *Name);
46 mono_llvm_build_load (LLVMBuilderRef builder, LLVMValueRef PointerVal,
47 const char *Name, gboolean is_volatile);
50 mono_llvm_build_atomic_load (LLVMBuilderRef builder, LLVMValueRef PointerVal,
51 const char *Name, gboolean is_volatile, int alignment, BarrierKind barrier);
54 mono_llvm_build_aligned_load (LLVMBuilderRef builder, LLVMValueRef PointerVal,
55 const char *Name, gboolean is_volatile, int alignment);
58 mono_llvm_build_store (LLVMBuilderRef builder, LLVMValueRef Val, LLVMValueRef PointerVal,
59 gboolean is_volatile, BarrierKind kind);
62 mono_llvm_build_aligned_store (LLVMBuilderRef builder, LLVMValueRef Val, LLVMValueRef PointerVal,
63 gboolean is_volatile, int alignment);
66 mono_llvm_build_atomic_rmw (LLVMBuilderRef builder, AtomicRMWOp op, LLVMValueRef ptr, LLVMValueRef val);
69 mono_llvm_build_fence (LLVMBuilderRef builder, BarrierKind kind);
72 mono_llvm_replace_uses_of (LLVMValueRef var, LLVMValueRef v);
75 mono_llvm_build_cmpxchg (LLVMBuilderRef builder, LLVMValueRef addr, LLVMValueRef comparand, LLVMValueRef value);
78 mono_llvm_set_must_tail (LLVMValueRef call_ins);
81 mono_llvm_create_constant_data_array (const uint8_t *data, int len);
84 mono_llvm_set_is_constant (LLVMValueRef global_var);
87 mono_llvm_set_preserveall_cc (LLVMValueRef func);
90 mono_llvm_set_call_preserveall_cc (LLVMValueRef call);
93 mono_llvm_set_call_notail (LLVMValueRef call);
96 mono_debug_personality (int a, _Unwind_Action b,
97 uint64_t c, struct _Unwind_Exception *d, struct _Unwind_Context *e);
100 default_mono_llvm_unhandled_exception (void);
103 mono_llvm_create_di_builder (LLVMModuleRef module);
106 mono_llvm_di_create_function (void *di_builder, void *cu, LLVMValueRef func, const char *name, const char *mangled_name, const char *dir, const char *file, int line);
109 mono_llvm_di_create_compile_unit (void *di_builder, const char *cu_name, const char *dir, const char *producer);
112 mono_llvm_di_create_file (void *di_builder, const char *dir, const char *file);
115 mono_llvm_di_create_location (void *di_builder, void *scope, int row, int column);
118 mono_llvm_di_builder_finalize (void *di_builder);
121 mono_llvm_di_set_location (LLVMBuilderRef builder, void *loc_md);
125 #endif /* __MONO_MINI_LLVM_CPP_H__ */