https://bugs.llvm.org/show_bug.cgi?id=39593

            Bug ID: 39593
           Summary: Bikeshedding about the demangling of string literals
                    in the ms demangler
           Product: new-bugs
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedb...@nondot.org
          Reporter: nicolaswe...@gmx.de
                CC: llvm-bugs@lists.llvm.org

llvm-undname has does a great job demangling strings. It demangles e.g.
'??_C@_01NOFIACDB@w?$AA@' to `const char * {"w"}` while undname only says
"`string'".

A while ago I asked zturner if I could send a patch to change the demangling to
`const char * {"w"}` since the symbol really _is_ the string and not a pointer
to it.

But when I wrote the patch, I thought maybe we should omit the braces too.

And then I thought the type is redundant with the "" / u"" / U"" too.

zturner, what do you think about making the demangling of the string above just
`"w"`?


In patch form, the proposal:

Index: lib/Demangle/MicrosoftDemangleNodes.cpp
===================================================================
--- lib/Demangle/MicrosoftDemangleNodes.cpp     (revision 344668)
+++ lib/Demangle/MicrosoftDemangleNodes.cpp     (working copy)
@@ -161,22 +161,21 @@
                                       OutputFlags Flags) const {
   switch (Char) {
   case CharKind::Wchar:
-    OS << "const wchar_t * {L\"";
+    OS << "L\"";
     break;
   case CharKind::Char:
-    OS << "const char * {\"";
+    OS << "\"";
     break;
   case CharKind::Char16:
-    OS << "const char16_t * {u\"";
+    OS << "u\"";
     break;
   case CharKind::Char32:
-    OS << "const char32_t * {U\"";
+    OS << "\"";
     break;
   }
   OS << DecodedString << "\"";
   if (IsTruncated)
     OS << "...";
-  OS << "}";
 }

 void IntegerLiteralNode::output(OutputStream &OS, OutputFlags Flags) const {

(needs updating a few tests too)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to