diff --git a/llvm/include/llvm/Support/TypeName.h b/llvm/include/llvm/Support/TypeName.h index 61ba09c216304..518a39ee02a53 100644 --- a/llvm/include/llvm/Support/TypeName.h +++ b/llvm/include/llvm/Support/TypeName.h @@ -13,8 +13,17 @@ namespace llvm { -namespace detail { -template inline StringRef getTypeNameImpl() { +/// We provide a function which tries to compute the (demangled) name of a type +/// statically. +/// +/// This routine may fail on some platforms or for particularly unusual types. +/// Do not use it for anything other than logging and debugging aids. It isn't +/// portable or dependendable in any real sense. +/// +/// The returned StringRef will point into a static storage duration string. +/// However, it may not be null terminated and may be some strangely aligned +/// inner substring of a larger string. +template inline StringRef getTypeName() { #if defined(__clang__) || defined(__GNUC__) StringRef Name = __PRETTY_FUNCTION__; @@ -48,22 +57,6 @@ template inline StringRef getTypeNameImpl() { return "UNKNOWN_TYPE"; #endif } -} // namespace detail - -/// We provide a function which tries to compute the (demangled) name of a type -/// statically. -/// -/// This routine may fail on some platforms or for particularly unusual types. -/// Do not use it for anything other than logging and debugging aids. It isn't -/// portable or dependendable in any real sense. -/// -/// The returned StringRef will point into a static storage duration string. -/// However, it may not be null terminated and may be some strangely aligned -/// inner substring of a larger string. -template inline StringRef getTypeName() { - static StringRef Name = detail::getTypeNameImpl(); - return Name; -} } // namespace llvm