1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00

Explicitly cast an expression to bool before handing it off to __builtin_expect.

Avoids surprises when someone uses LLVM_(UN)LIKELY with an integer.

llvm-svn: 162877
This commit is contained in:
Benjamin Kramer 2012-08-29 23:28:45 +00:00
parent 5aa2b024d7
commit 8bf9966670

View File

@ -106,8 +106,8 @@
#endif
#if (__GNUC__ >= 4)
#define LLVM_LIKELY(EXPR) __builtin_expect((EXPR), true)
#define LLVM_UNLIKELY(EXPR) __builtin_expect((EXPR), false)
#define LLVM_LIKELY(EXPR) __builtin_expect((bool)(EXPR), true)
#define LLVM_UNLIKELY(EXPR) __builtin_expect((bool)(EXPR), false)
#else
#define LLVM_LIKELY(EXPR) (EXPR)
#define LLVM_UNLIKELY(EXPR) (EXPR)