Skip to content

Commit 68d7d77

Browse files
authored
Revert "[NFC] Don't recompute type name (#119631)"
This reverts commit 003a721.
1 parent bc627a4 commit 68d7d77

File tree

1 file changed

+12
-18
lines changed

1 file changed

+12
-18
lines changed

llvm/include/llvm/Support/TypeName.h

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,18 @@
1313

1414
namespace llvm {
1515

16-
namespace detail {
17-
template <typename DesiredTypeName> inline StringRef getTypeNameImpl() {
16+
/// We provide a function which tries to compute the (demangled) name of a type
17+
/// statically.
18+
///
19+
/// This routine may fail on some platforms or for particularly unusual types.
20+
/// Do not use it for anything other than logging and debugging aids. It isn't
21+
/// portable or dependendable in any real sense.
22+
///
23+
/// The returned StringRef will point into a static storage duration string.
24+
/// However, it may not be null terminated and may be some strangely aligned
25+
/// inner substring of a larger string.
26+
template <typename DesiredTypeName>
27+
inline StringRef getTypeName() {
1828
#if defined(__clang__) || defined(__GNUC__)
1929
StringRef Name = __PRETTY_FUNCTION__;
2030

@@ -48,22 +58,6 @@ template <typename DesiredTypeName> inline StringRef getTypeNameImpl() {
4858
return "UNKNOWN_TYPE";
4959
#endif
5060
}
51-
} // namespace detail
52-
53-
/// We provide a function which tries to compute the (demangled) name of a type
54-
/// statically.
55-
///
56-
/// This routine may fail on some platforms or for particularly unusual types.
57-
/// Do not use it for anything other than logging and debugging aids. It isn't
58-
/// portable or dependendable in any real sense.
59-
///
60-
/// The returned StringRef will point into a static storage duration string.
61-
/// However, it may not be null terminated and may be some strangely aligned
62-
/// inner substring of a larger string.
63-
template <typename DesiredTypeName> inline StringRef getTypeName() {
64-
static StringRef Name = detail::getTypeNameImpl<DesiredTypeName>();
65-
return Name;
66-
}
6761

6862
} // namespace llvm
6963

0 commit comments

Comments
 (0)