summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorMichel Dänzer <[email protected]>2019-09-16 17:08:14 +0200
committerMichel Dänzer <[email protected]>2019-09-17 10:24:29 +0000
commit2c278602d8cbc731c755f94a7dee39b815aa54ac (patch)
treec49cf88c0f3aea8da402c9388daaf8697750cf1b /src/gallium
parent8218f6e22d0a7854249180c8df923f97e936d964 (diff)
swr: Limit DEBUG workaround to LLVM < 7
As of version 7, LLVM uses LLVM_DEBUG instead of just DEBUG. Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/swr/rasterizer/jitter/jit_pch.hpp8
-rw-r--r--src/gallium/drivers/swr/swr_shader.cpp9
-rw-r--r--src/gallium/drivers/swr/swr_state.cpp7
3 files changed, 21 insertions, 3 deletions
diff --git a/src/gallium/drivers/swr/rasterizer/jitter/jit_pch.hpp b/src/gallium/drivers/swr/rasterizer/jitter/jit_pch.hpp
index 47f717bfc2a..42b2d6d8096 100644
--- a/src/gallium/drivers/swr/rasterizer/jitter/jit_pch.hpp
+++ b/src/gallium/drivers/swr/rasterizer/jitter/jit_pch.hpp
@@ -34,9 +34,13 @@
#pragma warning(disable : 4146 4244 4267 4800 4996)
#endif
+#include <llvm/Config/llvm-config.h>
+
+#if LLVM_VERSION_MAJOR < 7
// llvm 3.7+ reuses "DEBUG" as an enum value
#pragma push_macro("DEBUG")
#undef DEBUG
+#endif
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/Instructions.h"
@@ -47,8 +51,6 @@
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/ExecutionEngine/ObjectCache.h"
-#include "llvm/Config/llvm-config.h"
-
#include "llvm/IR/Verifier.h"
#include "llvm/ExecutionEngine/MCJIT.h"
#include "llvm/Support/FileSystem.h"
@@ -133,7 +135,9 @@ static inline llvm::AttributeSet GetFuncAttribSet(llvm::LLVMContext& ctx,
}
#endif
+#if LLVM_VERSION_MAJOR < 7
#pragma pop_macro("DEBUG")
+#endif
#include <deque>
#include <list>
diff --git a/src/gallium/drivers/swr/swr_shader.cpp b/src/gallium/drivers/swr/swr_shader.cpp
index 2a73095ec49..9b4eb047e21 100644
--- a/src/gallium/drivers/swr/swr_shader.cpp
+++ b/src/gallium/drivers/swr/swr_shader.cpp
@@ -21,15 +21,22 @@
* IN THE SOFTWARE.
***************************************************************************/
+#include <llvm/Config/llvm-config.h>
+
+#if LLVM_VERSION_MAJOR < 7
// llvm redefines DEBUG
#pragma push_macro("DEBUG")
#undef DEBUG
+#endif
+
#include "JitManager.h"
-#include <llvm/Config/llvm-config.h>
#include "llvm-c/Core.h"
#include "llvm/Support/CBindingWrapping.h"
#include "llvm/IR/LegacyPassManager.h"
+
+#if LLVM_VERSION_MAJOR < 7
#pragma pop_macro("DEBUG")
+#endif
#include "state.h"
#include "gen_state_llvm.h"
diff --git a/src/gallium/drivers/swr/swr_state.cpp b/src/gallium/drivers/swr/swr_state.cpp
index 84c67597c46..c6b19204b32 100644
--- a/src/gallium/drivers/swr/swr_state.cpp
+++ b/src/gallium/drivers/swr/swr_state.cpp
@@ -21,13 +21,20 @@
* IN THE SOFTWARE.
***************************************************************************/
+#include <llvm/Config/llvm-config.h>
+
+#if LLVM_VERSION_MAJOR < 7
// llvm redefines DEBUG
#pragma push_macro("DEBUG")
#undef DEBUG
+#endif
#include <rasterizer/core/state.h>
#include "JitManager.h"
+
+#if LLVM_VERSION_MAJOR < 7
#pragma pop_macro("DEBUG")
+#endif
#include "common/os.h"
#include "jit_api.h"