forked from OSchip/llvm-project
[Demangle][Rust] Parse array type
Reviewed By: dblaikie Differential Revision: https://reviews.llvm.org/D102573
This commit is contained in:
parent
068332978c
commit
b42400ccf3
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue