[llvm] 372e2c2 - llvm-dwarfdump: Pretty printing types including a space between const and parenthesized references/pointers to arrays

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 19 13:33:10 PDT 2021


Author: David Blaikie
Date: 2021-09-19T13:32:53-07:00
New Revision: 372e2c24b6e17bbff8fe6ed488cff5f7b7abd2b7

URL: https://github.com/llvm/llvm-project/commit/372e2c24b6e17bbff8fe6ed488cff5f7b7abd2b7
DIFF: https://github.com/llvm/llvm-project/commit/372e2c24b6e17bbff8fe6ed488cff5f7b7abd2b7.diff

LOG: llvm-dwarfdump: Pretty printing types including a space between const and parenthesized references/pointers to arrays

Added: 
    

Modified: 
    llvm/lib/DebugInfo/DWARF/DWARFDie.cpp
    llvm/test/tools/llvm-dwarfdump/X86/prettyprint_types.s

Removed: 
    


################################################################################
diff  --git a/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp b/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp
index a0610bb24e2b..075ce40dd7eb 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp
@@ -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;
   }

diff  --git a/llvm/test/tools/llvm-dwarfdump/X86/prettyprint_types.s b/llvm/test/tools/llvm-dwarfdump/X86/prettyprint_types.s
index 7fc2e29c0edf..14ebd24856fe 100644
--- a/llvm/test/tools/llvm-dwarfdump/X86/prettyprint_types.s
+++ b/llvm/test/tools/llvm-dwarfdump/X86/prettyprint_types.s
@@ -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]")


        


More information about the llvm-commits mailing list