summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/gallivm/lp_bld.h
diff options
context:
space:
mode:
authorJose Fonseca <[email protected]>2016-04-02 14:31:16 +0100
committerJose Fonseca <[email protected]>2016-04-03 09:51:27 +0100
commitbcfb86b09de3bfc9c7cdf6925658b5e529a8fc62 (patch)
tree3609f16a54701d648f10beba4b7b0450300e6f0d /src/gallium/auxiliary/gallivm/lp_bld.h
parent6d54096fa6cde0ebc7da29468071fe2c34aec0cf (diff)
gallivm: Use standard LLVMSetAlignment from LLVM 3.4 onwards.
Only provide a fallback for LLVM 3.3. One less dependency on LLVM C++ interface. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/gallivm/lp_bld.h')
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld.h b/src/gallium/auxiliary/gallivm/lp_bld.h
index 7ba925c4803..239c27e3c25 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld.h
+++ b/src/gallium/auxiliary/gallivm/lp_bld.h
@@ -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 */