[PATCH] D110577: [llvm-cxxfilt] Enable support for D programming language demangling

Luís Ferreira via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 8 08:46:56 PDT 2021


ljmf00 updated this revision to Diff 378254.

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D110577/new/

https://reviews.llvm.org/D110577

Files:
  llvm/test/Demangle/dlang.test
  llvm/tools/llvm-cxxfilt/llvm-cxxfilt.cpp


Index: llvm/tools/llvm-cxxfilt/llvm-cxxfilt.cpp
===================================================================
--- llvm/tools/llvm-cxxfilt/llvm-cxxfilt.cpp
+++ llvm/tools/llvm-cxxfilt/llvm-cxxfilt.cpp
@@ -92,6 +92,11 @@
     Undecorated = rustDemangle(DecoratedStr, nullptr, nullptr, &Status);
   }
 
+  if (!Undecorated &&
+      (DecoratedLength >= 2 && strncmp(DecoratedStr, "_D", 2) == 0)) {
+    Undecorated = dlangDemangle(DecoratedStr);
+  }
+
   std::string Result(Undecorated ? Prefix + Undecorated : Mangled);
   free(Undecorated);
   return Result;
Index: llvm/test/Demangle/dlang.test
===================================================================
--- /dev/null
+++ llvm/test/Demangle/dlang.test
@@ -0,0 +1,10 @@
+RUN: llvm-cxxfilt -n  < %s | FileCheck --match-full-lines %s
+
+; Full test suite for dlang demangling at
+; llvm/unittests/Demangle/DLangDemangleTest.cpp
+
+CHECK: D main
+       _Dmain
+
+CHECK: demangle.test
+       _D8demangle4testZ


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110577.378254.patch
Type: text/x-patch
Size: 973 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211008/d7a39cb3/attachment.bin>


More information about the llvm-commits mailing list