5#ifndef INCLUDE_CPPGC_INTERNAL_NAME_TRAIT_H_
6#define INCLUDE_CPPGC_INTERNAL_NAME_TRAIT_H_
12#include "cppgc/name-provider.h"
18#if CPPGC_SUPPORTS_OBJECT_NAMES && defined(__clang__
)
19#define CPPGC_SUPPORTS_COMPILE_TIME_TYPENAME 1
38 "const char *cppgc::internal::GetTypename() [T =";
41 "The prefix must match");
48 static constexpr auto buffer =
54#define CPPGC_SUPPORTS_COMPILE_TIME_TYPENAME 0
80#elif CPPGC_SUPPORTS_OBJECT_NAMES
89 return GetNameFor(
static_cast<
const T*>(obj), name_retrieval_mode);
106 return {GetTypename<T>(),
false};
107#elif CPPGC_SUPPORTS_OBJECT_NAMES
109#if defined(V8_CC_GNU)
110#define PRETTY_FUNCTION_VALUE __PRETTY_FUNCTION__
111#elif defined(V8_CC_MSVC)
112#define PRETTY_FUNCTION_VALUE __FUNCSIG__
114#define PRETTY_FUNCTION_VALUE nullptr
117 static const HeapObjectName leaky_name =
118 GetNameFromTypeSignature(PRETTY_FUNCTION_VALUE);
121#undef PRETTY_FUNCTION_VALUE
139#undef CPPGC_SUPPORTS_COMPILE_TIME_TYPENAME
virtual const char * GetHumanReadableName() const =0
static constexpr const char kHiddenName[]
static HeapObjectName GetNameFromTypeSignature(const char *)
static HeapObjectName GetName(const void *obj, HeapObjectNameForUnnamedObject name_retrieval_mode)
static constexpr bool HasNonHiddenName()
#define CPPGC_SUPPORTS_COMPILE_TIME_TYPENAME
HeapObjectNameForUnnamedObject
@ kUseClassNameIfSupported