[PATCH] D103460: [Demangle][Rust] Parse instantiating crate

Tomasz Miąsko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 1 06:59:58 PDT 2021


tmiasko created this revision.
tmiasko added a reviewer: dblaikie.
Herald added subscribers: JDevlieghere, hiraditya.
tmiasko requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Depends on D103459 <https://reviews.llvm.org/D103459>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D103460

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
@@ -9,6 +9,11 @@
 CHECK: a::b::c
        _RNvNvC1a1b1c
 
+; Instantiating crate
+
+CHECK: crate
+       _RC5crateC3foo
+
 ; Closure namespace
 
 CHECK: crate::{closure#0}
Index: llvm/lib/Demangle/RustDemangle.cpp
===================================================================
--- llvm/lib/Demangle/RustDemangle.cpp
+++ llvm/lib/Demangle/RustDemangle.cpp
@@ -113,7 +113,10 @@
 
   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;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D103460.348963.patch
Type: text/x-patch
Size: 824 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210601/2b6b706f/attachment.bin>


More information about the llvm-commits mailing list