gallium: Require LLVM >= 3.5
[mesa.git] / src / gallium / auxiliary / gallivm / lp_bld_misc.h
index 64d2a04190f0b52df421184861b8c061048475b5..5a19ba1bd2d565e0a7165d910f7f915f972fa5c6 100644 (file)
@@ -31,7 +31,9 @@
 
 
 #include "lp_bld.h"
+#include <llvm/Config/llvm-config.h>
 #include <llvm-c/ExecutionEngine.h>
+#include <llvm-c/Target.h>
 
 
 #ifdef __cplusplus
@@ -41,19 +43,21 @@ extern "C" {
 
 struct lp_generated_code;
 
+extern LLVMTargetLibraryInfoRef
+gallivm_create_target_library_info(const char *triple);
+
+extern void
+gallivm_dispose_target_library_info(LLVMTargetLibraryInfoRef library_info);
 
 extern void
 lp_set_target_options(void);
 
 
-extern LLVMValueRef
-lp_build_load_volatile(LLVMBuilderRef B, LLVMValueRef PointerVal,
-                       const char *Name);
-
 extern int
 lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT,
                                         struct lp_generated_code **OutCode,
                                         LLVMModuleRef M,
+                                        LLVMMCJITMemoryManagerRef MM,
                                         unsigned OptLevel,
                                         int useMCJIT,
                                         char **OutError);
@@ -61,6 +65,26 @@ lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT,
 extern void
 lp_free_generated_code(struct lp_generated_code *code);
 
+extern LLVMMCJITMemoryManagerRef
+lp_get_default_memory_manager();
+
+extern void
+lp_free_memory_manager(LLVMMCJITMemoryManagerRef memorymgr);
+
+extern LLVMValueRef
+lp_get_called_value(LLVMValueRef call);
+
+extern bool
+lp_is_function(LLVMValueRef v);
+
+/* LLVM 3.9 introduces this, provide our own for earlier */
+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 9
+LLVMValueRef LLVMBuildAtomicCmpXchg(LLVMBuilderRef B, LLVMValueRef Ptr,
+                                    LLVMValueRef Cmp, LLVMValueRef New,
+                                    LLVMAtomicOrdering SuccessOrdering,
+                                    LLVMAtomicOrdering FailureOrdering,
+                                    LLVMBool SingleThread);
+#endif
 
 #ifdef __cplusplus
 }