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, BarrierKind barrier);
50 mono_llvm_build_aligned_load (LLVMBuilderRef builder, LLVMValueRef PointerVal,
51 const char *Name, gboolean is_volatile, int alignment);
54 mono_llvm_build_store (LLVMBuilderRef builder, LLVMValueRef Val, LLVMValueRef PointerVal,
55 gboolean is_volatile, BarrierKind kind);
58 mono_llvm_build_aligned_store (LLVMBuilderRef builder, LLVMValueRef Val, LLVMValueRef PointerVal,
59 gboolean is_volatile, int alignment);
62 mono_llvm_build_atomic_rmw (LLVMBuilderRef builder, AtomicRMWOp op, LLVMValueRef ptr, LLVMValueRef val);
65 mono_llvm_build_fence (LLVMBuilderRef builder, BarrierKind kind);
68 mono_llvm_replace_uses_of (LLVMValueRef var, LLVMValueRef v);
71 mono_llvm_build_cmpxchg (LLVMBuilderRef builder, LLVMValueRef addr, LLVMValueRef comparand, LLVMValueRef value);
74 mono_llvm_set_must_tail (LLVMValueRef call_ins);
77 mono_llvm_create_constant_data_array (const uint8_t *data, int len);
80 mono_llvm_set_is_constant (LLVMValueRef global_var);
83 mono_llvm_set_preserveall_cc (LLVMValueRef func);
86 mono_llvm_set_call_preserveall_cc (LLVMValueRef call);
89 mono_debug_personality (int a, _Unwind_Action b,
90 uint64_t c, struct _Unwind_Exception *d, struct _Unwind_Context *e);
93 default_mono_llvm_unhandled_exception (void);
96 mono_llvm_create_di_builder (LLVMModuleRef module);
99 mono_llvm_di_create_function (void *di_builder, void *cu, const char *name, const char *mangled_name, const char *dir, const char *file, int line);
102 mono_llvm_di_create_compile_unit (void *di_builder, const char *cu_name, const char *dir, const char *producer);
105 mono_llvm_di_create_file (void *di_builder, const char *dir, const char *file);
108 mono_llvm_di_create_location (void *di_builder, void *scope, int row, int column);
111 mono_llvm_di_builder_finalize (void *di_builder);
114 mono_llvm_di_set_location (LLVMBuilderRef builder, void *loc_md);
118 #endif /* __MONO_MINI_LLVM_CPP_H__ */