llvm-dwarfdump: Pretty printing types including a space between const and parenthesiz...
authorDavid Blaikie <dblaikie@gmail.com>
Sun, 19 Sep 2021 20:32:21 +0000 (13:32 -0700)
committerDavid Blaikie <dblaikie@gmail.com>
Sun, 19 Sep 2021 20:32:53 +0000 (13:32 -0700)
llvm/lib/DebugInfo/DWARF/DWARFDie.cpp
llvm/test/tools/llvm-dwarfdump/X86/prettyprint_types.s

index a0610bb..075ce40 100644 (file)
@@ -187,10 +187,10 @@ struct DWARFTypePrinter {
 
   void appendPointerLikeTypeBefore(DWARFDie D, DWARFDie Inner, StringRef Ptr) {
     appendUnqualifiedNameBefore(Inner);
+    if (Word)
+      OS << ' ';
     if (needsParens(Inner))
       OS << '(';
-    else if (Word)
-      OS << ' ';
     OS << Ptr;
     Word = false;
   }
index 7fc2e29..14ebd24 100644 (file)
@@ -60,7 +60,7 @@
 # const reference to a pointer to member function (with const, volatile, rvalue ref qualifiers)
 # CHECK:   DW_AT_type{{.*}}"void (foo::*const &)() const volatile &&")
 
-# CHECK:   DW_AT_type{{.*}}"int *const(&)[1]")
+# CHECK:   DW_AT_type{{.*}}"int *const (&)[1]")
 # CHECK:   DW_AT_type{{.*}}"int *const[1]")
 # CHECK:   DW_AT_type{{.*}}"const int (&)[1]")
 # CHECK:   DW_AT_type{{.*}}"const int [1]")