Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1977)

Unified Diff: Source/wtf/Compiler.h

Issue 114933002: [POSSIBLE PERFORMANCE IMPACT] Use __builtin_expect on Clang as well (for UNLIKELY and LIKELY) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/Compiler.h
diff --git a/Source/wtf/Compiler.h b/Source/wtf/Compiler.h
index f5ede42f9f46da5a94a488ab1393475c5dbbe292..9c76897555854c5b642652bc8a67f4f88d7cece4 100644
--- a/Source/wtf/Compiler.h
+++ b/Source/wtf/Compiler.h
@@ -153,7 +153,7 @@
/* UNLIKELY */
#ifndef UNLIKELY
-#if COMPILER(GCC)
+#if COMPILER(GCC) || COMPILER(CLANG)
#define UNLIKELY(x) __builtin_expect((x), 0)
#else
#define UNLIKELY(x) (x)
@@ -164,7 +164,7 @@
/* LIKELY */
#ifndef LIKELY
-#if COMPILER(GCC)
+#if COMPILER(GCC) || COMPILER(CLANG)
#define LIKELY(x) __builtin_expect((x), 1)
#else
#define LIKELY(x) (x)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698