aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Demangle/RustDemangle.cpp
diff options
context:
space:
mode:
authorTomasz Miąsko <tomasz.miasko@gmail.com>2021-06-07 18:13:19 +0200
committerTomasz Miąsko <tomasz.miasko@gmail.com>2021-06-07 18:18:31 +0200
commit1499afa09ba27ee0e6569668b74fea40e0458930 (patch)
treec3113bf22e3f3f6dae77d82e03e0d2c0f1fa120a /llvm/lib/Demangle/RustDemangle.cpp
parent89615a5e925e10f388130e80fba4bf28bc3c3c0a (diff)
downloadllvm-1499afa09ba27ee0e6569668b74fea40e0458930.zip
llvm-1499afa09ba27ee0e6569668b74fea40e0458930.tar.gz
llvm-1499afa09ba27ee0e6569668b74fea40e0458930.tar.bz2
[Demangle][Rust] Parse dyn-trait
Reviewed By: dblaikie Differential Revision: https://reviews.llvm.org/D103361
Diffstat (limited to 'llvm/lib/Demangle/RustDemangle.cpp')
-rw-r--r--llvm/lib/Demangle/RustDemangle.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/llvm/lib/Demangle/RustDemangle.cpp b/llvm/lib/Demangle/RustDemangle.cpp
index 04bc175..cbb52fa 100644
--- a/llvm/lib/Demangle/RustDemangle.cpp
+++ b/llvm/lib/Demangle/RustDemangle.cpp
@@ -545,9 +545,18 @@ void Demangler::demangleDynBounds() {
SwapAndRestore<size_t> SaveBoundLifetimes(BoundLifetimes, BoundLifetimes);
print("dyn ");
demangleOptionalBinder();
- // FIXME demangle {dyn-trait}
- if (!consumeIf('E'))
- Error = true;
+ for (size_t I = 0; !Error && !consumeIf('E'); ++I) {
+ if (I > 0)
+ print(" + ");
+ demangleDynTrait();
+ }
+}
+
+// <dyn-trait> = <path> {<dyn-trait-assoc-binding>}
+// <dyn-trait-assoc-binding> = "p" <undisambiguated-identifier> <type>
+void Demangler::demangleDynTrait() {
+ demanglePath(InType::Yes);
+ // FIXME demangle {<dyn-trait-assoc-binding>}
}
// Demangles optional binder and updates the number of bound lifetimes.