aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Demangle/RustDemangle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Demangle/RustDemangle.cpp')
-rw-r--r--llvm/lib/Demangle/RustDemangle.cpp22
1 files changed, 17 insertions, 5 deletions
diff --git a/llvm/lib/Demangle/RustDemangle.cpp b/llvm/lib/Demangle/RustDemangle.cpp
index 6e2694f..77aa4f7 100644
--- a/llvm/lib/Demangle/RustDemangle.cpp
+++ b/llvm/lib/Demangle/RustDemangle.cpp
@@ -421,14 +421,26 @@ void Demangler::printBasicType(BasicType Type) {
// | "D" <dyn-bounds> <lifetime> // dyn Trait<Assoc = X> + Send + 'a
// | <backref> // backref
void Demangler::demangleType() {
- char C = look();
+ size_t Start = Position;
+
+ char C = consume();
BasicType Type;
- if (parseBasicType(C, Type)) {
- consume();
+ if (parseBasicType(C, Type))
return printBasicType(Type);
- }
- demanglePath(InType::Yes);
+ switch (C) {
+ case 'A':
+ print("[");
+ demangleType();
+ print("; ");
+ demangleConst();
+ print("]");
+ break;
+ default:
+ Position = Start;
+ demanglePath(InType::Yes);
+ break;
+ }
}
// <const> = <basic-type> <const-data>