diff options
author | thegeorg <thegeorg@yandex-team.ru> | 2022-02-10 16:45:12 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:12 +0300 |
commit | 49116032d905455a7b1c994e4a696afc885c1e71 (patch) | |
tree | be835aa92c6248212e705f25388ebafcf84bc7a1 /util/system/type_name.cpp | |
parent | 4e839db24a3bbc9f1c610c43d6faaaa99824dcca (diff) | |
download | ydb-49116032d905455a7b1c994e4a696afc885c1e71.tar.gz |
Restoring authorship annotation for <thegeorg@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/system/type_name.cpp')
-rw-r--r-- | util/system/type_name.cpp | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/util/system/type_name.cpp b/util/system/type_name.cpp index db0fe3427d..0377da4212 100644 --- a/util/system/type_name.cpp +++ b/util/system/type_name.cpp @@ -1,5 +1,5 @@ #include "platform.h" -#include "demangle_impl.h" +#include "demangle_impl.h" #ifdef __GNUC__ #include <stdexcept> @@ -8,23 +8,23 @@ #include "type_name.h" -namespace { - -#if defined(_LIBCPP_VERSION) - // libc++ is nested under std::__y1 - constexpr std::string_view STD_ABI_PREFIX = "std::__y1::"; -#elif defined(_linux_) - // libstdc++ is nested under std::__cxx11 - // FIXME: is there any way to test if we are building against libstdc++? - constexpr std::string_view STD_ABI_PREFIX = "std::__cxx11::"; -#else - // There is no need to cutoff ABI prefix on Windows -#endif - constexpr std::string_view STD_PREFIX = "std::"; - -} // anonymous namespace - -const char* NPrivate::TCppDemangler::Demangle(const char* name) { +namespace { + +#if defined(_LIBCPP_VERSION) + // libc++ is nested under std::__y1 + constexpr std::string_view STD_ABI_PREFIX = "std::__y1::"; +#elif defined(_linux_) + // libstdc++ is nested under std::__cxx11 + // FIXME: is there any way to test if we are building against libstdc++? + constexpr std::string_view STD_ABI_PREFIX = "std::__cxx11::"; +#else + // There is no need to cutoff ABI prefix on Windows +#endif + constexpr std::string_view STD_PREFIX = "std::"; + +} // anonymous namespace + +const char* NPrivate::TCppDemangler::Demangle(const char* name) { #ifndef __GNUC__ return name; #else @@ -38,23 +38,23 @@ const char* NPrivate::TCppDemangler::Demangle(const char* name) { return TmpBuf_.Get(); #endif } - -TString CppDemangle(const TString& name) { - return NPrivate::TCppDemangler().Demangle(name.data()); -} + +TString CppDemangle(const TString& name) { + return NPrivate::TCppDemangler().Demangle(name.data()); +} TString TypeName(const std::type_info& typeInfo) { - TString demangled = CppDemangle(typeInfo.name()); // NOLINT(arcadia-typeid-name-restriction) -#if defined(_linux_) || defined(_darwin_) - SubstGlobal(demangled, STD_ABI_PREFIX, STD_PREFIX); -#endif - return demangled; + TString demangled = CppDemangle(typeInfo.name()); // NOLINT(arcadia-typeid-name-restriction) +#if defined(_linux_) || defined(_darwin_) + SubstGlobal(demangled, STD_ABI_PREFIX, STD_PREFIX); +#endif + return demangled; } TString TypeName(const std::type_index& typeIndex) { - TString demangled = CppDemangle(typeIndex.name()); -#if defined(_linux_) || defined(_darwin_) - SubstGlobal(demangled, STD_ABI_PREFIX, STD_PREFIX); -#endif - return demangled; + TString demangled = CppDemangle(typeIndex.name()); +#if defined(_linux_) || defined(_darwin_) + SubstGlobal(demangled, STD_ABI_PREFIX, STD_PREFIX); +#endif + return demangled; } |