gallivm: Use standard LLVMSetAlignment from LLVM 3.4 onwards.
[mesa.git] / src / gallium / auxiliary / gallivm / lp_bld.h
index 7ba925c480350d15b4aaa607149618fb2c3459f9..239c27e3c255dc8ab51dc2557947c56fdac81d9a 100644 (file)
@@ -95,4 +95,18 @@ typedef void *LLVMMCJITMemoryManagerRef;
 #define LLVMInsertBasicBlock ILLEGAL_LLVM_FUNCTION
 #define LLVMCreateBuilder ILLEGAL_LLVM_FUNCTION
 
+
+/*
+ * Before LLVM 3.4 LLVMSetAlignment only supported GlobalValue, not
+ * LoadInst/StoreInst as we need.
+ */
+#if HAVE_LLVM < 0x0304
+#  ifdef __cplusplus
+      extern "C"
+#  endif
+   void LLVMSetAlignmentBackport(LLVMValueRef V, unsigned Bytes);
+#  define LLVMSetAlignment LLVMSetAlignmentBackport
+#endif
+
+
 #endif /* LP_BLD_H */