Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mono / mini / mini-llvm-cpp.h
index 484be6dd6a8880f887fabde1b1c5aeb894f11d1a..53ecc02de1a0a48e30a11562628e83d96541007c 100644 (file)
@@ -1,5 +1,6 @@
-/*
- * mini-llvm-cpp.h: LLVM backend
+/**
+ * \file
+ * LLVM backend
  *
  * Authors:
  *   Zoltan Varga (vargaz@gmail.com)
@@ -34,24 +35,16 @@ typedef enum {
        LLVM_ATOMICRMW_OP_ADD = 1,
 } AtomicRMWOp;
 
-typedef unsigned char * (AllocCodeMemoryCb) (LLVMValueRef function, int size);
-typedef void (FunctionEmittedCb) (LLVMValueRef function, void *start, void *end);
-typedef void (ExceptionTableCb) (void *data);
-typedef char* (DlSymCb) (const char *name, void **symbol);
-
-typedef void* MonoEERef;
-
-MonoEERef
-mono_llvm_create_ee (LLVMModuleProviderRef MP, AllocCodeMemoryCb *alloc_cb, FunctionEmittedCb *emitted_cb, ExceptionTableCb *exception_cb, DlSymCb *dlsym_cb, LLVMExecutionEngineRef *ee);
-
-void
-mono_llvm_dispose_ee (MonoEERef *mono_ee);
-
-gpointer
-mono_llvm_compile_method (MonoEERef mono_ee, LLVMValueRef method);
-
-void
-mono_llvm_optimize_method (MonoEERef mono_ee, LLVMValueRef method);
+typedef enum {
+       LLVM_ATTR_NO_UNWIND,
+       LLVM_ATTR_NO_INLINE,
+       LLVM_ATTR_OPTIMIZE_FOR_SIZE,
+       LLVM_ATTR_IN_REG,
+       LLVM_ATTR_STRUCT_RET,
+       LLVM_ATTR_NO_ALIAS,
+       LLVM_ATTR_BY_VAL,
+       LLVM_ATTR_UW_TABLE
+} AttrKind;
 
 void
 mono_llvm_dump_value (LLVMValueRef value);
@@ -63,9 +56,13 @@ mono_llvm_build_alloca (LLVMBuilderRef builder, LLVMTypeRef Ty,
 
 LLVMValueRef 
 mono_llvm_build_load (LLVMBuilderRef builder, LLVMValueRef PointerVal,
-                                         const char *Name, gboolean is_volatile, BarrierKind barrier);
+                                         const char *Name, gboolean is_volatile);
 
 LLVMValueRef 
+mono_llvm_build_atomic_load (LLVMBuilderRef builder, LLVMValueRef PointerVal,
+                                                        const char *Name, gboolean is_volatile, int alignment, BarrierKind barrier);
+
+LLVMValueRef
 mono_llvm_build_aligned_load (LLVMBuilderRef builder, LLVMValueRef PointerVal,
                                                          const char *Name, gboolean is_volatile, int alignment);
 
@@ -104,13 +101,22 @@ mono_llvm_set_preserveall_cc (LLVMValueRef func);
 void
 mono_llvm_set_call_preserveall_cc (LLVMValueRef call);
 
+void
+mono_llvm_set_call_notail (LLVMValueRef call);
+
+void
+mono_llvm_add_func_attr (LLVMValueRef func, AttrKind kind);
+
+void
+mono_llvm_add_param_attr (LLVMValueRef param, AttrKind kind);
+
+void
+mono_llvm_add_instr_attr (LLVMValueRef val, int index, AttrKind kind);
+
 _Unwind_Reason_Code 
 mono_debug_personality (int a, _Unwind_Action b,
        uint64_t c, struct _Unwind_Exception *d, struct _Unwind_Context *e);
 
-void
-mono_llvm_set_unhandled_exception_handler (void);
-
 void
 default_mono_llvm_unhandled_exception (void);
 
@@ -118,7 +124,7 @@ void*
 mono_llvm_create_di_builder (LLVMModuleRef module);
 
 void*
-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);
+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);
 
 void*
 mono_llvm_di_create_compile_unit (void *di_builder, const char *cu_name, const char *dir, const char *producer);