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,
41 LLVM_ATTR_OPTIMIZE_FOR_SIZE,
50 mono_llvm_dump_value (LLVMValueRef value);
53 mono_llvm_build_alloca (LLVMBuilderRef builder, LLVMTypeRef Ty,
54 LLVMValueRef ArraySize,
55 int alignment, const char *Name);
58 mono_llvm_build_load (LLVMBuilderRef builder, LLVMValueRef PointerVal,
59 const char *Name, gboolean is_volatile);
62 mono_llvm_build_atomic_load (LLVMBuilderRef builder, LLVMValueRef PointerVal,
63 const char *Name, gboolean is_volatile, int alignment, BarrierKind barrier);
66 mono_llvm_build_aligned_load (LLVMBuilderRef builder, LLVMValueRef PointerVal,
67 const char *Name, gboolean is_volatile, int alignment);
70 mono_llvm_build_store (LLVMBuilderRef builder, LLVMValueRef Val, LLVMValueRef PointerVal,
71 gboolean is_volatile, BarrierKind kind);
74 mono_llvm_build_aligned_store (LLVMBuilderRef builder, LLVMValueRef Val, LLVMValueRef PointerVal,
75 gboolean is_volatile, int alignment);
78 mono_llvm_build_atomic_rmw (LLVMBuilderRef builder, AtomicRMWOp op, LLVMValueRef ptr, LLVMValueRef val);
81 mono_llvm_build_fence (LLVMBuilderRef builder, BarrierKind kind);
84 mono_llvm_replace_uses_of (LLVMValueRef var, LLVMValueRef v);
87 mono_llvm_build_cmpxchg (LLVMBuilderRef builder, LLVMValueRef addr, LLVMValueRef comparand, LLVMValueRef value);
90 mono_llvm_set_must_tail (LLVMValueRef call_ins);
93 mono_llvm_create_constant_data_array (const uint8_t *data, int len);
96 mono_llvm_set_is_constant (LLVMValueRef global_var);
99 mono_llvm_set_preserveall_cc (LLVMValueRef func);
102 mono_llvm_set_call_preserveall_cc (LLVMValueRef call);
105 mono_llvm_set_call_notail (LLVMValueRef call);
108 mono_llvm_add_func_attr (LLVMValueRef func, AttrKind kind);
111 mono_llvm_add_param_attr (LLVMValueRef param, AttrKind kind);
114 mono_llvm_add_instr_attr (LLVMValueRef val, int index, AttrKind kind);
117 mono_debug_personality (int a, _Unwind_Action b,
118 uint64_t c, struct _Unwind_Exception *d, struct _Unwind_Context *e);
121 default_mono_llvm_unhandled_exception (void);
124 mono_llvm_create_di_builder (LLVMModuleRef module);
127 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);
130 mono_llvm_di_create_compile_unit (void *di_builder, const char *cu_name, const char *dir, const char *producer);
133 mono_llvm_di_create_file (void *di_builder, const char *dir, const char *file);
136 mono_llvm_di_create_location (void *di_builder, void *scope, int row, int column);
139 mono_llvm_di_builder_finalize (void *di_builder);
142 mono_llvm_di_set_location (LLVMBuilderRef builder, void *loc_md);
146 #endif /* __MONO_MINI_LLVM_CPP_H__ */