Bug 74124
Summary: | Update LIKELY and UNLIKELY to work with clang | ||
---|---|---|---|
Product: | WebKit | Reporter: | Tony Chang <tony> |
Component: | Web Template Framework | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED INVALID | ||
Severity: | Normal | CC: | thakis |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
Tony Chang
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 | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Tony Chang
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
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
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).