tint: Use TINT_UNLIKELY() on TINT_ASSERT() condition
Change-Id: I92c6cf4b52132b806822b9edb163838f474d7c3b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/116876
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Ben Clayton <bclayton@google.com>
Auto-Submit: Ben Clayton <bclayton@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
diff --git a/src/tint/debug.h b/src/tint/debug.h
index 86186ac..43bc052 100644
--- a/src/tint/debug.h
+++ b/src/tint/debug.h
@@ -20,6 +20,7 @@
#include "src/tint/diagnostic/diagnostic.h"
#include "src/tint/diagnostic/formatter.h"
#include "src/tint/diagnostic/printer.h"
+#include "src/tint/utils/compiler_macros.h"
namespace tint {
@@ -111,7 +112,7 @@
/// error handling.
#define TINT_ASSERT(system, condition) \
do { \
- if (!(condition)) { \
+ if (TINT_UNLIKELY(!(condition))) { \
tint::diag::List diagnostics; \
TINT_ICE(system, diagnostics) << "TINT_ASSERT(" #system ", " #condition ")"; \
} \