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:
parent
41726d4381
commit
a1eed91cb0
|
@ -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 ")"; \
|
||||||
} \
|
} \
|
||||||
|
|
Loading…
Reference in New Issue