[Demangle][Rust] Parse array type

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D102573
This commit is contained in:
Tomasz Miąsko 2021-05-18 18:14:02 +02:00
parent 068332978c
commit b42400ccf3
2 changed files with 24 additions and 7 deletions

View File

@ -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();
BasicType Type;
if (parseBasicType(C, Type)) {
consume();
return printBasicType(Type);
}
size_t Start = Position;
demanglePath(InType::Yes);
char C = consume();
BasicType Type;
if (parseBasicType(C, Type))
return printBasicType(Type);
switch (C) {
case 'A':
print("[");
demangleType();
print("; ");
demangleConst();
print("]");
break;
default:
Position = Start;
demanglePath(InType::Yes);
break;
}
}
// <const> = <basic-type> <const-data>

View File

@ -155,6 +155,11 @@ CHECK: named::<name::Name>
CHECK: named::<Name<>>
_RIC5namedIC4NameEE
; Types
CHECK: types::<[u8; 0]>
_RIC5typesAhj0_E
; Integer constants. Test value demangling.
CHECK: integer::<0>