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>
This commit is contained in:
Ben Clayton 2023-01-13 14:46:21 +00:00 committed by Dawn LUCI CQ
parent 41726d4381
commit a1eed91cb0
1 changed files with 2 additions and 1 deletions

View File

@ -20,6 +20,7 @@
#include "src/tint/diagnostic/diagnostic.h" #include "src/tint/diagnostic/diagnostic.h"
#include "src/tint/diagnostic/formatter.h" #include "src/tint/diagnostic/formatter.h"
#include "src/tint/diagnostic/printer.h" #include "src/tint/diagnostic/printer.h"
#include "src/tint/utils/compiler_macros.h"
namespace tint { namespace tint {
@ -111,7 +112,7 @@ class InternalCompilerError {
/// error handling. /// error handling.
#define TINT_ASSERT(system, condition) \ #define TINT_ASSERT(system, condition) \
do { \ do { \
if (!(condition)) { \ if (TINT_UNLIKELY(!(condition))) { \
tint::diag::List diagnostics; \ tint::diag::List diagnostics; \
TINT_ICE(system, diagnostics) << "TINT_ASSERT(" #system ", " #condition ")"; \ TINT_ICE(system, diagnostics) << "TINT_ASSERT(" #system ", " #condition ")"; \
} \ } \