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

Unified Diff: third_party/WebKit/Source/wtf/Compiler.h

Issue 2473153003: Move some compiler intrinsic #defines to base/. (Closed)
Patch Set: Don't redefine ALWAYS_INLINE in ios/... . Created 4 years, 1 month 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
Index: third_party/WebKit/Source/wtf/Compiler.h
diff --git a/third_party/WebKit/Source/wtf/Compiler.h b/third_party/WebKit/Source/wtf/Compiler.h
index 413bf2101090ae5c439f724ec0d0ff0840a0de6b..519c20522353036e9dfeb2b5cfbed90993ec98f0 100644
--- a/third_party/WebKit/Source/wtf/Compiler.h
+++ b/third_party/WebKit/Source/wtf/Compiler.h
@@ -26,6 +26,8 @@
#ifndef WTF_Compiler_h
#define WTF_Compiler_h
+#include "base/compiler_specific.h"
+
/* COMPILER() - the compiler being used to build the project */
#define COMPILER(WTF_FEATURE) \
(defined WTF_COMPILER_##WTF_FEATURE && WTF_COMPILER_##WTF_FEATURE)
@@ -59,50 +61,6 @@
/* ==== Compiler features ==== */
-/* ALWAYS_INLINE */
-
-#ifndef ALWAYS_INLINE
-#if COMPILER(GCC) && defined(NDEBUG) && !COMPILER(MINGW)
-#define ALWAYS_INLINE inline __attribute__((__always_inline__))
-#elif COMPILER(MSVC) && defined(NDEBUG)
-#define ALWAYS_INLINE __forceinline
-#else
-#define ALWAYS_INLINE inline
-#endif
-#endif
-
-/* NEVER_INLINE */
-
-#ifndef NEVER_INLINE
-#if COMPILER(GCC)
-#define NEVER_INLINE __attribute__((__noinline__))
-#elif COMPILER(MSVC)
-#define NEVER_INLINE __declspec(noinline)
-#else
-#define NEVER_INLINE
-#endif
-#endif
-
-/* UNLIKELY */
-
-#ifndef UNLIKELY
-#if COMPILER(GCC)
-#define UNLIKELY(x) __builtin_expect((x), 0)
-#else
-#define UNLIKELY(x) (x)
-#endif
-#endif
-
-/* LIKELY */
-
-#ifndef LIKELY
-#if COMPILER(GCC)
-#define LIKELY(x) __builtin_expect((x), 1)
-#else
-#define LIKELY(x) (x)
-#endif
-#endif
-
/* NO_RETURN */
#ifndef NO_RETURN
@@ -115,6 +73,14 @@
#endif
#endif
+/* NEVER_INLINE */
+
+// TODO(palmer): Remove this and update callers to use NOINLINE from Chromium
+// base. https://bugs.chromium.org/p/chromium/issues/detail?id=632441
+//
+// For compatibility with callers in Blink:
+#define NEVER_INLINE NOINLINE
+
/* WARN_UNUSED_RETURN */
#if COMPILER(GCC)

Powered by Google App Engine
This is Rietveld 408576698