RESOLVED INVALID 74124
Update LIKELY and UNLIKELY to work with clang
https://bugs.webkit.org/show_bug.cgi?id=74124
Summary Update LIKELY and UNLIKELY to work with clang
Tony Chang
Reported 2011-12-08 13:48:04 PST
Compiler.h has macros for __builtin_expect in Compiler.h: http://trac.webkit.org/browser/trunk/Source/JavaScriptCore/wtf/Compiler.h#L139 We only run this on gcc, but we should enable it for clang as well.
Attachments
Tony Chang
Comment 1 2011-12-08 13:48:45 PST
I don't have time right now to work on this, but it should be easy for someone with a clang build setup to do.
Nico Weber
Comment 2 2011-12-08 13:53:54 PST
Are you sure that doesn't work as is? clang does set __GNUC__ etc. I don't know how COMPILER(GCC) is implemented, but unless it explicitly excludes clang, then it's probably set when clang is used as well. clang tries fairly hard to be gcc compatible.
Tony Chang
Comment 3 2011-12-08 13:57:57 PST
Oh, then it's probably already enabled for clang: 81 #if defined(__GNUC__) && !COMPILER(RVCT) 82 #define WTF_COMPILER_GCC 1 (RVCT seems like something related to arm).
Note You need to log in before you can comment on or make changes to this bug.