mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-26 00:56:05 +00:00
[NFC] [scudo] syntax-check DCHECK arguments if DCHECK is off
This is a widespread technique, used in at least: * ABSL: https://github.com/abseil/abseil-cpp/blob/master/absl/log/internal/check_op.h#L52 * Chromium: https://source.chromium.org/chromium/chromium/src/+/main:base/check.h;l=185?q=DCHECK%20f:base&ss=chromium * Android: https://cs.android.com/android/platform/superproject/+/master:system/libbase/include/android-base/logging.h;drc=bda7f0a0cc945c860713a1dc497919f17fad1651;l=321 Reviewed By: Chia-hungDuan, vitalybuka Differential Revision: https://reviews.llvm.org/D141713
This commit is contained in:
parent
fe93da22aa
commit
f3f4bc814b
@ -133,25 +133,25 @@ void NORETURN reportCheckFailed(const char *File, int Line,
|
||||
#else
|
||||
#define DCHECK(A) \
|
||||
do { \
|
||||
} while (false)
|
||||
} while (false && (A))
|
||||
#define DCHECK_EQ(A, B) \
|
||||
do { \
|
||||
} while (false)
|
||||
} while (false && (A) == (B))
|
||||
#define DCHECK_NE(A, B) \
|
||||
do { \
|
||||
} while (false)
|
||||
} while (false && (A) != (B))
|
||||
#define DCHECK_LT(A, B) \
|
||||
do { \
|
||||
} while (false)
|
||||
} while (false && (A) < (B))
|
||||
#define DCHECK_LE(A, B) \
|
||||
do { \
|
||||
} while (false)
|
||||
} while (false && (A) <= (B))
|
||||
#define DCHECK_GT(A, B) \
|
||||
do { \
|
||||
} while (false)
|
||||
} while (false && (A) > (B))
|
||||
#define DCHECK_GE(A, B) \
|
||||
do { \
|
||||
} while (false)
|
||||
} while (false && (A) >= (B))
|
||||
#endif
|
||||
|
||||
// The superfluous die() call effectively makes this macro NORETURN.
|
||||
|
Loading…
x
Reference in New Issue
Block a user