[llvm] 43929cc - [Demangle][Rust] Parse instantiating crate
Tomasz Miąsko via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 7 10:17:37 PDT 2021
Author: Tomasz Miąsko
Date: 2021-06-07T19:16:11+02:00
New Revision: 43929ccc1296b13250965d75bd410550256d45c5
URL: https://github.com/llvm/llvm-project/commit/43929ccc1296b13250965d75bd410550256d45c5
DIFF: https://github.com/llvm/llvm-project/commit/43929ccc1296b13250965d75bd410550256d45c5.diff
LOG: [Demangle][Rust] Parse instantiating crate
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D103460
Added:
Modified:
llvm/lib/Demangle/RustDemangle.cpp
llvm/test/Demangle/rust.test
Removed:
################################################################################
diff --git a/llvm/lib/Demangle/RustDemangle.cpp b/llvm/lib/Demangle/RustDemangle.cpp
index 9513a00628d1a..582cdbc9f7498 100644
--- a/llvm/lib/Demangle/RustDemangle.cpp
+++ b/llvm/lib/Demangle/RustDemangle.cpp
@@ -113,7 +113,10 @@ bool Demangler::demangle(StringView Mangled) {
demanglePath(rust_demangle::InType::No);
- // FIXME parse optional <instantiating-crate>.
+ if (Position != Input.size()) {
+ SwapAndRestore<bool> SavePrint(Print, false);
+ demanglePath(InType::No);
+ }
if (Position != Input.size())
Error = true;
diff --git a/llvm/test/Demangle/rust.test b/llvm/test/Demangle/rust.test
index 04af35b76d6e3..cef5d20275ac2 100644
--- a/llvm/test/Demangle/rust.test
+++ b/llvm/test/Demangle/rust.test
@@ -9,6 +9,11 @@ CHECK: hello::rust
CHECK: a::b::c
_RNvNvC1a1b1c
+; Instantiating crate
+
+CHECK: crate
+ _RC5crateC3foo
+
; Closure namespace
CHECK: crate::{closure#0}
More information about the llvm-commits
mailing list