aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Demangle/RustDemangle.cpp
diff options
context:
space:
mode:
authorTomasz Miąsko <tomasz.miasko@gmail.com>2021-06-07 18:12:13 +0200
committerTomasz Miąsko <tomasz.miasko@gmail.com>2021-06-07 18:18:30 +0200
commit89615a5e925e10f388130e80fba4bf28bc3c3c0a (patch)
treef316fb31d2cf0185261c01a2be3fce0b89c38e14 /llvm/lib/Demangle/RustDemangle.cpp
parentfb5b590b5e18796bf850170946f15fc10ab9394a (diff)
downloadllvm-89615a5e925e10f388130e80fba4bf28bc3c3c0a.zip
llvm-89615a5e925e10f388130e80fba4bf28bc3c3c0a.tar.gz
llvm-89615a5e925e10f388130e80fba4bf28bc3c3c0a.tar.bz2
[Demangle][Rust] Parse dyn-bounds
Reviewed By: dblaikie Differential Revision: https://reviews.llvm.org/D103151
Diffstat (limited to 'llvm/lib/Demangle/RustDemangle.cpp')
-rw-r--r--llvm/lib/Demangle/RustDemangle.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/llvm/lib/Demangle/RustDemangle.cpp b/llvm/lib/Demangle/RustDemangle.cpp
index d6cf78b..04bc175 100644
--- a/llvm/lib/Demangle/RustDemangle.cpp
+++ b/llvm/lib/Demangle/RustDemangle.cpp
@@ -480,6 +480,17 @@ void Demangler::demangleType() {
case 'F':
demangleFnSig();
break;
+ case 'D':
+ demangleDynBounds();
+ if (consumeIf('L')) {
+ if (auto Lifetime = parseBase62Number()) {
+ print(" + ");
+ printLifetime(Lifetime);
+ }
+ } else {
+ Error = true;
+ }
+ break;
default:
Position = Start;
demanglePath(rust_demangle::InType::Yes);
@@ -529,6 +540,16 @@ void Demangler::demangleFnSig() {
}
}
+// <dyn-bounds> = [<binder>] {<dyn-trait>} "E"
+void Demangler::demangleDynBounds() {
+ SwapAndRestore<size_t> SaveBoundLifetimes(BoundLifetimes, BoundLifetimes);
+ print("dyn ");
+ demangleOptionalBinder();
+ // FIXME demangle {dyn-trait}
+ if (!consumeIf('E'))
+ Error = true;
+}
+
// Demangles optional binder and updates the number of bound lifetimes.
//
// <binder> = "G" <base-62-number>