6 * Zoltan Varga (vargaz@gmail.com)
8 * (C) 2009 Novell, Inc.
11 #ifndef __MONO_MINI_LLVM_CPP_H__
12 #define __MONO_MINI_LLVM_CPP_H__
16 #include "llvm-c/Core.h"
17 #include "llvm-c/ExecutionEngine.h"
24 * Keep in sync with the enum in utils/mono-memory-model.h.
27 LLVM_BARRIER_NONE = 0,
34 LLVM_ATOMICRMW_OP_XCHG = 0,
35 LLVM_ATOMICRMW_OP_ADD = 1,
39 mono_llvm_dump_value (LLVMValueRef value);
42 mono_llvm_build_alloca (LLVMBuilderRef builder, LLVMTypeRef Ty,
43 LLVMValueRef ArraySize,
44 int alignment, const char *Name);
47 mono_llvm_build_load (LLVMBuilderRef builder, LLVMValueRef PointerVal,
48 const char *Name, gboolean is_volatile);
51 mono_llvm_build_atomic_load (LLVMBuilderRef builder, LLVMValueRef PointerVal,
52 const char *Name, gboolean is_volatile, int alignment, BarrierKind barrier);
55 mono_llvm_build_aligned_load (LLVMBuilderRef builder, LLVMValueRef PointerVal,
56 const char *Name, gboolean is_volatile, int alignment);
59 mono_llvm_build_store (LLVMBuilderRef builder, LLVMValueRef Val, LLVMValueRef PointerVal,
60 gboolean is_volatile, BarrierKind kind);
63 mono_llvm_build_aligned_store (LLVMBuilderRef builder, LLVMValueRef Val, LLVMValueRef PointerVal,
64 gboolean is_volatile, int alignment);
67 mono_llvm_build_atomic_rmw (LLVMBuilderRef builder, AtomicRMWOp op, LLVMValueRef ptr, LLVMValueRef val);
70 mono_llvm_build_fence (LLVMBuilderRef builder, BarrierKind kind);
73 mono_llvm_replace_uses_of (LLVMValueRef var, LLVMValueRef v);
76 mono_llvm_build_cmpxchg (LLVMBuilderRef builder, LLVMValueRef addr, LLVMValueRef comparand, LLVMValueRef value);
79 mono_llvm_set_must_tail (LLVMValueRef call_ins);
82 mono_llvm_create_constant_data_array (const uint8_t *data, int len);
85 mono_llvm_set_is_constant (LLVMValueRef global_var);
88 mono_llvm_set_preserveall_cc (LLVMValueRef func);
91 mono_llvm_set_call_preserveall_cc (LLVMValueRef call);
94 mono_llvm_set_call_notail (LLVMValueRef call);
97 mono_debug_personality (int a, _Unwind_Action b,
98 uint64_t c, struct _Unwind_Exception *d, struct _Unwind_Context *e);
101 default_mono_llvm_unhandled_exception (void);
104 mono_llvm_create_di_builder (LLVMModuleRef module);
107 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);
110 mono_llvm_di_create_compile_unit (void *di_builder, const char *cu_name, const char *dir, const char *producer);
113 mono_llvm_di_create_file (void *di_builder, const char *dir, const char *file);
116 mono_llvm_di_create_location (void *di_builder, void *scope, int row, int column);
119 mono_llvm_di_builder_finalize (void *di_builder);
122 mono_llvm_di_set_location (LLVMBuilderRef builder, void *loc_md);
126 #endif /* __MONO_MINI_LLVM_CPP_H__ */