Commit 23c6cf79 authored by Alex Clarke's avatar Alex Clarke Committed by Commit Bot

Move PRETTY_FUNCTION macros to base/compiler_specific.h

This will help https://crrev.com/c/1340317.

TBR=mbarbella@chromium.org

Bug: 906125, 907410
Change-Id: Id6d666a0e8dc18d8646a81dd16fadec16fe44abe
Reviewed-on: https://chromium-review.googlesource.com/c/1344105
Commit-Queue: Alex Clarke <alexclarke@chromium.org>
Reviewed-by: default avatarAlex Clarke <alexclarke@chromium.org>
Reviewed-by: default avatarSami Kyöstilä <skyostil@chromium.org>
Reviewed-by: default avatarGabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#610027}
parent fa281606
...@@ -217,4 +217,13 @@ ...@@ -217,4 +217,13 @@
#define FALLTHROUGH #define FALLTHROUGH
#endif #endif
#if defined(COMPILER_GCC)
#define PRETTY_FUNCTION __PRETTY_FUNCTION__
#elif defined(COMPILER_MSVC)
#define PRETTY_FUNCTION __FUNCSIG__
#else
// See https://en.cppreference.com/w/c/language/function_definition#func
#define PRETTY_FUNCTION __func__
#endif
#endif // BASE_COMPILER_SPECIFIC_H_ #endif // BASE_COMPILER_SPECIFIC_H_
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include <iosfwd> #include <iosfwd>
#include <limits> #include <limits>
#include "base/compiler_specific.h"
#include "base/numerics/safe_conversions.h" #include "base/numerics/safe_conversions.h"
#include "third_party/blink/renderer/platform/platform_export.h" #include "third_party/blink/renderer/platform/platform_export.h"
#include "third_party/blink/renderer/platform/wtf/allocator.h" #include "third_party/blink/renderer/platform/wtf/allocator.h"
...@@ -45,7 +46,7 @@ namespace blink { ...@@ -45,7 +46,7 @@ namespace blink {
#if DCHECK_IS_ON() #if DCHECK_IS_ON()
#define REPORT_OVERFLOW(doesOverflow) \ #define REPORT_OVERFLOW(doesOverflow) \
DLOG_IF(ERROR, !(doesOverflow)) << "LayoutUnit overflow !(" << #doesOverflow \ DLOG_IF(ERROR, !(doesOverflow)) << "LayoutUnit overflow !(" << #doesOverflow \
<< ") in " << WTF_PRETTY_FUNCTION << ") in " << PRETTY_FUNCTION
#else #else
#define REPORT_OVERFLOW(doesOverflow) ((void)0) #define REPORT_OVERFLOW(doesOverflow) ((void)0)
#endif #endif
......
...@@ -41,16 +41,6 @@ ...@@ -41,16 +41,6 @@
#endif #endif
#endif #endif
/* WTF_PRETTY_FUNCTION */
#if defined(COMPILER_GCC)
#define WTF_PRETTY_FUNCTION __PRETTY_FUNCTION__
#elif defined(COMPILER_MSVC)
#define WTF_PRETTY_FUNCTION __FUNCSIG__
#else
#define WTF_PRETTY_FUNCTION __func__
#endif
/* NO_SANITIZE_UNRELATED_CAST - Disable runtime checks related to casts between /* NO_SANITIZE_UNRELATED_CAST - Disable runtime checks related to casts between
* unrelated objects (-fsanitize=cfi-unrelated-cast or -fsanitize=vptr). */ * unrelated objects (-fsanitize=cfi-unrelated-cast or -fsanitize=vptr). */
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include <cstddef> #include <cstddef>
#include <type_traits> #include <type_traits>
#include <utility> #include <utility>
#include "base/compiler_specific.h"
#include "base/template_util.h" #include "base/template_util.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "third_party/blink/renderer/platform/wtf/compiler.h" #include "third_party/blink/renderer/platform/wtf/compiler.h"
...@@ -34,7 +35,7 @@ namespace WTF { ...@@ -34,7 +35,7 @@ namespace WTF {
// Returns a string that contains the type name of |T| as a substring. // Returns a string that contains the type name of |T| as a substring.
template <typename T> template <typename T>
inline const char* GetStringWithTypeName() { inline const char* GetStringWithTypeName() {
return WTF_PRETTY_FUNCTION; return PRETTY_FUNCTION;
} }
template <typename T> template <typename T>
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include <utility> #include <utility>
#include <vector> #include <vector>
#include "base/compiler_specific.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
#include "base/memory/shared_memory_handle.h" #include "base/memory/shared_memory_handle.h"
...@@ -33,14 +34,6 @@ ...@@ -33,14 +34,6 @@
#include "tools/ipc_fuzzer/message_lib/all_messages.h" #include "tools/ipc_fuzzer/message_lib/all_messages.h"
#include "tools/ipc_fuzzer/message_lib/all_message_null_macros.h" #include "tools/ipc_fuzzer/message_lib/all_message_null_macros.h"
#if defined(COMPILER_GCC)
#define PRETTY_FUNCTION __PRETTY_FUNCTION__
#elif defined(COMPILER_MSVC)
#define PRETTY_FUNCTION __FUNCSIG__
#else
#define PRETTY_FUNCTION __FUNCTION__
#endif
namespace IPC { namespace IPC {
class Message; class Message;
} // namespace IPC } // namespace IPC
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment