diff options
Diffstat (limited to 'llvm/lib/Demangle/RustDemangle.cpp')
-rw-r--r-- | llvm/lib/Demangle/RustDemangle.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/lib/Demangle/RustDemangle.cpp b/llvm/lib/Demangle/RustDemangle.cpp index ebccafc..223d815 100644 --- a/llvm/lib/Demangle/RustDemangle.cpp +++ b/llvm/lib/Demangle/RustDemangle.cpp @@ -101,6 +101,7 @@ static inline bool isValid(const char C) { bool Demangler::demangle(StringView Mangled) { Position = 0; Error = false; + Print = true; RecursionLevel = 0; if (!Mangled.consumeFront("_R")) { @@ -145,6 +146,13 @@ void Demangler::demanglePath() { print(Ident.Name); break; } + case 'M': { + demangleImplPath(); + print("<"); + demangleType(); + print(">"); + break; + } case 'N': { char NS = consume(); if (!isLower(NS) && !isUpper(NS)) { @@ -199,6 +207,14 @@ void Demangler::demanglePath() { } } +// <impl-path> = [<disambiguator>] <path> +// <disambiguator> = "s" <base-62-number> +void Demangler::demangleImplPath() { + SwapAndRestore<bool> SavePrint(Print, false); + parseOptionalBase62Number('s'); + demanglePath(); +} + // <generic-arg> = <lifetime> // | <type> // | "K" <const> |