File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,8 @@ NodePointer Context::demangleTypeAsNode(llvm::StringRef MangledName) {
5353 return D->demangleType (MangledName);
5454}
5555
56+ #if SWIFT_STDLIB_HAS_TYPE_PRINTING
57+
5658std::string Context::demangleSymbolAsString (llvm::StringRef MangledName,
5759 const DemangleOptions &Options) {
5860 NodePointer root = demangleSymbolAsNode (MangledName);
@@ -75,6 +77,8 @@ std::string Context::demangleTypeAsString(llvm::StringRef MangledName,
7577 return demangling;
7678}
7779
80+ #endif
81+
7882// Removes a '.<n>' suffix from \p Name. <n> is either a number or a combination of
7983// '.<other-text>.<n>'.
8084// Such symbols are produced in IRGen or in LLVM optimizations.
@@ -243,6 +247,8 @@ std::string Context::getModuleName(llvm::StringRef mangledName) {
243247// Public utility functions //
244248// ////////////////////////////////
245249
250+ #if SWIFT_STDLIB_HAS_TYPE_PRINTING
251+
246252std::string demangleSymbolAsString (const char *MangledName,
247253 size_t MangledNameLength,
248254 const DemangleOptions &Options) {
@@ -259,6 +265,8 @@ std::string demangleTypeAsString(const char *MangledName,
259265 Options);
260266}
261267
268+ #endif
269+
262270SWIFT_END_INLINE_NAMESPACE
263271} // namespace Demangle
264272} // namespace swift
Original file line number Diff line number Diff line change @@ -720,6 +720,9 @@ char *swift_demangle(const char *mangledName,
720720 if (!Demangle::isSwiftSymbol (mangledName))
721721 return nullptr ; // Not a mangled name
722722
723+ #if !SWIFT_STDLIB_HAS_TYPE_PRINTING
724+ return nullptr ;
725+ #else
723726 // Demangle the name.
724727 auto options = Demangle::DemangleOptions ();
725728 options.DisplayDebuggerGeneratedModule = false ;
@@ -743,4 +746,5 @@ char *swift_demangle(const char *mangledName,
743746 }
744747
745748 return outputBuffer;
749+ #endif
746750}
You can’t perform that action at this time.
0 commit comments