From 372e2c24b6e17bbff8fe6ed488cff5f7b7abd2b7 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Sun, 19 Sep 2021 13:32:21 -0700 Subject: [PATCH] llvm-dwarfdump: Pretty printing types including a space between const and parenthesized references/pointers to arrays --- llvm/lib/DebugInfo/DWARF/DWARFDie.cpp | 4 ++-- llvm/test/tools/llvm-dwarfdump/X86/prettyprint_types.s | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp b/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp index a0610bb..075ce40 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 7fc2e29..14ebd24 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]") -- 2.7.4