From: Jason Ekstrand Date: Wed, 7 Jan 2015 00:11:57 +0000 (-0800) Subject: nir/validate: Only build in debug mode X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=dcb1acdea00a8f2c29777ff4078832df9d5b40ce;p=mesa.git nir/validate: Only build in debug mode Reviewed-by: Kenneth Graunke Reviewed-by: Matt Turner Reviewed-by: Connor Abbott --- diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h index 201304b2f10..1daf53fa44c 100644 --- a/src/glsl/nir/nir.h +++ b/src/glsl/nir/nir.h @@ -1437,7 +1437,11 @@ void nir_index_blocks(nir_function_impl *impl); void nir_print_shader(nir_shader *shader, FILE *fp); +#ifdef DEBUG void nir_validate_shader(nir_shader *shader); +#else +static inline void nir_validate_shader(nir_shader *shader) { } +#endif /* DEBUG */ void nir_calc_dominance_impl(nir_function_impl *impl); void nir_calc_dominance(nir_shader *shader); diff --git a/src/glsl/nir/nir_validate.c b/src/glsl/nir/nir_validate.c index 240da02a715..d2ce021196e 100644 --- a/src/glsl/nir/nir_validate.c +++ b/src/glsl/nir/nir_validate.c @@ -32,6 +32,11 @@ * This file checks for invalid IR indicating a bug somewhere in the compiler. */ +/* Since this file is just a pile of asserts, don't bother compiling it if + * we're not building a debug build. + */ +#ifdef DEBUG + /* * Per-register validation state. */ @@ -882,3 +887,5 @@ nir_validate_shader(nir_shader *shader) destroy_validate_state(&state); } + +#endif /* NDEBUG */