Skip to content

Commit 0a5c26f

Browse files
committed
DebugInfo: Simplified Template Names: drop unneeded space in arrays
Matching a recent clang change I've made, now 'int[3]' is formatted without the space between the type and array bound. This commit updates libDebugInfoDWARF/llvm-dwarfdump to match that formatting.
1 parent ef2efd2 commit 0a5c26f

File tree

6 files changed

+9
-12
lines changed

6 files changed

+9
-12
lines changed

cross-project-tests/debuginfo-tests/clang_llvm_roundtrip/simplified_template_names.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ int main() {
185185
f1<int &>();
186186
f1<int &&>();
187187
f1<const int>();
188-
// f1<int[3]>();
188+
f1<int[3]>();
189189
f1<void>();
190190
f1<outer_class::inner_class>();
191191
f1<unsigned long>();
@@ -291,7 +291,7 @@ int main() {
291291
f1<int *const(&)[1]>();
292292
f1<void (::udt::* const&)()>();
293293
f1<void (*(int))(float)>();
294-
// f1<t1<int>[1]>();
294+
f1<t1<int>[1]>();
295295
f1<void (*)() noexcept>();
296296
f1<void (decltype(A))>();
297297
struct t8 { decltype(A) m; };

llvm/lib/DebugInfo/DWARF/DWARFDie.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,6 @@ struct DWARFTypePrinter {
226226
}
227227
case DW_TAG_array_type: {
228228
appendQualifiedNameBefore(Inner);
229-
if (Word)
230-
OS << ' ';
231-
Word = false;
232229
break;
233230
}
234231
case DW_TAG_reference_type:

llvm/test/DebugInfo/X86/tu-to-non-named-type.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
; CHECK-NOT: {{DW_TAG|NULL}}
1212
; CHECK: DW_TAG_member
1313
; CHECK-NEXT: DW_AT_name ("x")
14-
; CHECK-NEXT: DW_AT_type ({{.*}} "int [1]"
14+
; CHECK-NEXT: DW_AT_type ({{.*}} "int[1]"
1515

1616
; But make sure we still use a type unit for an anonymous type that still has a
1717
; name for linkage purposes (due to being defined in a typedef).

llvm/test/tools/llvm-dwarfdump/X86/prettyprint_types.s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
# CHECK: DW_AT_type{{.*}}"int *const (&)[1]")
113113
# CHECK: DW_AT_type{{.*}}"int *const[1]")
114114
# CHECK: DW_AT_type{{.*}}"const int (&)[1]")
115-
# CHECK: DW_AT_type{{.*}}"const int [1]")
115+
# CHECK: DW_AT_type{{.*}}"const int[1]")
116116

117117
# subroutine types
118118
# CHECK: DW_AT_type{{.*}}"int ()"
@@ -129,7 +129,7 @@
129129
# qualified types
130130
# CHECK: DW_AT_type{{.*}}"ns::inner"
131131
# CHECK: DW_AT_type{{.*}}"ns::inner ()"
132-
# CHECK: DW_AT_type{{.*}}"ns::inner [1]"
132+
# CHECK: DW_AT_type{{.*}}"ns::inner[1]"
133133
# CHECK: DW_AT_type{{.*}}"ns::inner *"
134134
# CHECK: DW_AT_type{{.*}}"ns::inner (ns::inner::*)(ns::inner)"
135135
# CHECK: DW_AT_type{{.*}}"const ns::inner"

llvm/test/tools/llvm-dwarfdump/X86/prettyprint_types_handcrafted.s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# CHECK: DW_TAG_variable
88

99
# array_type
10-
# CHECK: DW_AT_type{{.*}}"int{{ }}
10+
# CHECK: DW_AT_type{{.*}}"int
1111
# Testing with a default lower bound of 0 and the following explicit bounds:
1212
# lower_bound(1)
1313
# CHECK-NOT: {{.}}
@@ -34,7 +34,7 @@
3434
# array_type with a language with a default lower bound of 1 instead of 0 and
3535
# an upper bound of 2. This describes an array with 2 elements (whereas with a
3636
# default lower bound of 0 it would be an array of 3 elements)
37-
# CHECK: DW_AT_type{{.*}}"int [2]"
37+
# CHECK: DW_AT_type{{.*}}"int[2]"
3838

3939
.section .debug_str,"MS",@progbits,1
4040
.Lint_name:

llvm/test/tools/llvm-dwarfdump/XCOFF/basic.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
# DWARF32-NEXT: DW_AT_name ("__func__")
9696
# DWARF32-NEXT: DW_AT_decl_file ("/basic.c")
9797
# DWARF32-NEXT: DW_AT_decl_line (0)
98-
# DWARF32-NEXT: DW_AT_type (0x0000005a "const char [5]")
98+
# DWARF32-NEXT: DW_AT_type (0x0000005a "const char[5]")
9999
# DWARF32: 0x00000096: NULL
100100
# DWARF32: 0x00000097: NULL
101101
# DWARF32: .debug_line contents:
@@ -225,7 +225,7 @@
225225
# DWARF64-NEXT: DW_AT_name ("__func__")
226226
# DWARF64-NEXT: DW_AT_decl_file ("/basic.c")
227227
# DWARF64-NEXT: DW_AT_decl_line (0)
228-
# DWARF64-NEXT: DW_AT_type (0x00000076 "const char [5]")
228+
# DWARF64-NEXT: DW_AT_type (0x00000076 "const char[5]")
229229
# DWARF64: 0x000000ce: NULL
230230
# DWARF64: 0x000000cf: NULL
231231
# DWARF64: .debug_line contents:

0 commit comments

Comments
 (0)