nir/validate: refactor validate_assert to have a return value
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com> Reviewed-by: Connor Abbott <cwabbott0@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11775>
This commit is contained in:
parent
e212a191a6
commit
499cc7a9ec
|
@ -120,10 +120,18 @@ log_error(validate_state *state, const char *cond, const char *file, int line)
|
||||||
_mesa_hash_table_insert(state->errors, obj, msg);
|
_mesa_hash_table_insert(state->errors, obj, msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define validate_assert(state, cond) do { \
|
static bool
|
||||||
if (!(cond)) \
|
validate_assert_impl(validate_state *state, bool cond, const char *str,
|
||||||
log_error(state, #cond, __FILE__, __LINE__); \
|
const char *file, unsigned line)
|
||||||
} while (0)
|
{
|
||||||
|
if (!cond)
|
||||||
|
log_error(state, str, file, line);
|
||||||
|
return cond;
|
||||||
|
}
|
||||||
|
|
||||||
|
#define validate_assert(state, cond) \
|
||||||
|
validate_assert_impl(state, (cond), #cond, __FILE__, __LINE__)
|
||||||
|
|
||||||
|
|
||||||
static void validate_src(nir_src *src, validate_state *state,
|
static void validate_src(nir_src *src, validate_state *state,
|
||||||
unsigned bit_sizes, unsigned num_components);
|
unsigned bit_sizes, unsigned num_components);
|
||||||
|
|
Loading…
Reference in New Issue