[PATCH] D102573: [Demangle][Rust] Parse array type
Tomasz Miąsko via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon May 17 07:53:19 PDT 2021
tmiasko updated this revision to Diff 345882.
tmiasko added a comment.
- Remove redundant test case.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D102573/new/
https://reviews.llvm.org/D102573
Files:
llvm/lib/Demangle/RustDemangle.cpp
llvm/test/Demangle/rust.test
Index: llvm/test/Demangle/rust.test
===================================================================
--- llvm/test/Demangle/rust.test
+++ llvm/test/Demangle/rust.test
@@ -155,6 +155,11 @@
CHECK: named::<Name<>>
_RIC5namedIC4NameEE
+; Types
+
+CHECK: types::<[u8; 0]>
+ _RIC5typesAhj0_E
+
; Integer constants. Test value demangling.
CHECK: integer::<0>
Index: llvm/lib/Demangle/RustDemangle.cpp
===================================================================
--- llvm/lib/Demangle/RustDemangle.cpp
+++ llvm/lib/Demangle/RustDemangle.cpp
@@ -421,14 +421,26 @@
// | "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>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D102573.345882.patch
Type: text/x-patch
Size: 1263 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210517/a891101b/attachment.bin>
More information about the llvm-commits
mailing list