[llvm] f933f7f - [Demangle][Rust] Parse trait definitions
Tomasz Miąsko via llvm-commits
llvm-commits at lists.llvm.org
Sat May 15 14:57:07 PDT 2021
Author: Tomasz Miąsko
Date: 2021-05-15T23:52:25+02:00
New Revision: f933f7fbd047802456f9d614daf0f0dfb3c7c45f
URL: https://github.com/llvm/llvm-project/commit/f933f7fbd047802456f9d614daf0f0dfb3c7c45f
DIFF: https://github.com/llvm/llvm-project/commit/f933f7fbd047802456f9d614daf0f0dfb3c7c45f.diff
LOG: [Demangle][Rust] Parse trait definitions
Part of https://reviews.llvm.org/D102549
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 7df2ec8e77aa..70183ee67ba3 100644
--- a/llvm/lib/Demangle/RustDemangle.cpp
+++ b/llvm/lib/Demangle/RustDemangle.cpp
@@ -162,6 +162,14 @@ void Demangler::demanglePath() {
print(">");
break;
}
+ case 'Y': {
+ print("<");
+ demangleType();
+ print(" as ");
+ demanglePath();
+ print(">");
+ break;
+ }
case 'N': {
char NS = consume();
if (!isLower(NS) && !isUpper(NS)) {
diff --git a/llvm/test/Demangle/rust.test b/llvm/test/Demangle/rust.test
index f69156bc5500..f3e23844a115 100644
--- a/llvm/test/Demangle/rust.test
+++ b/llvm/test/Demangle/rust.test
@@ -49,6 +49,11 @@ CHECK: <_ as Clone>
CHECK: <_ as Clone>
_RXs_C5cratepC5Clone
+; Trait definition
+
+CHECK: <_ as Ord>
+ _RYpC3Ord
+
; Generic type arguments
CHECK: generic::<_>
More information about the llvm-commits
mailing list