summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Engestrom <[email protected]>2017-11-23 13:16:43 +0000
committerEmil Velikov <[email protected]>2017-12-14 22:56:46 +0000
commit3fbe230348d004d0c1315436ef30a74d9d601d4a (patch)
tree1256a3dadf1fd1be5eb94701336832d8d46badee
parent219d03127d5983a51441e60cf92e1c014c0b611c (diff)
compiler: use NDEBUG to guard asserts
nir_validate.c's #endif already had the correct NDEBUG comment Fixes: dcb1acdea00a8f2c29777 "nir/validate: Only build in debug mode" Fixes: 9ff71b649b4b3808a9e17 "i965/nir: Validate that NIR passes call nir_metadata_preserve()" Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Matt Turner <[email protected]> (cherry picked from commit 7b85b9b8773b119360a31b66b321ae560a77cb6d) [Emil Velikov: trivial conflicts] Signed-off-by: Emil Velikov <[email protected]> Conflicts: src/compiler/nir/nir.h
-rw-r--r--src/compiler/nir/nir.h6
-rw-r--r--src/compiler/nir/nir_metadata.c2
-rw-r--r--src/compiler/nir/nir_validate.c2
3 files changed, 5 insertions, 5 deletions
diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
index cbdadc75fbc..c885b10e375 100644
--- a/src/compiler/nir/nir.h
+++ b/src/compiler/nir/nir.h
@@ -41,9 +41,9 @@
#include "compiler/shader_info.h"
#include <stdio.h>
-#ifdef DEBUG
+#ifndef NDEBUG
#include "util/debug.h"
-#endif /* DEBUG */
+#endif /* NDEBUG */
#include "nir_opcodes.h"
@@ -2341,7 +2341,7 @@ static inline void nir_metadata_set_validation_flag(nir_shader *shader) { (void)
static inline void nir_metadata_check_validation_flag(nir_shader *shader) { (void) shader; }
static inline bool should_clone_nir(void) { return false; }
static inline bool should_print_nir(void) { return false; }
-#endif /* DEBUG */
+#endif /* NDEBUG */
#define _PASS(nir, do_pass) do { \
do_pass \
diff --git a/src/compiler/nir/nir_metadata.c b/src/compiler/nir/nir_metadata.c
index f71cf432b70..e681ba34f75 100644
--- a/src/compiler/nir/nir_metadata.c
+++ b/src/compiler/nir/nir_metadata.c
@@ -59,7 +59,7 @@ nir_metadata_preserve(nir_function_impl *impl, nir_metadata preserved)
impl->valid_metadata &= preserved;
}
-#ifdef DEBUG
+#ifndef NDEBUG
/**
* Make sure passes properly invalidate metadata (part 1).
*
diff --git a/src/compiler/nir/nir_validate.c b/src/compiler/nir/nir_validate.c
index 2322c8f786d..4a995fcf1fc 100644
--- a/src/compiler/nir/nir_validate.c
+++ b/src/compiler/nir/nir_validate.c
@@ -35,7 +35,7 @@
/* Since this file is just a pile of asserts, don't bother compiling it if
* we're not building a debug build.
*/
-#ifdef DEBUG
+#ifndef NDEBUG
/*
* Per-register validation state.