From e0771beabc1eeb246cffeee968ee90ad011e1ab3 Mon Sep 17 00:00:00 2001 From: Christoffer Lerno Date: Wed, 7 Jan 2026 02:35:05 +0100 Subject: [PATCH] Remove pointer names in debug, following Clang. --- src/compiler/llvm_codegen_debug_info.c | 2 +- .../concurrency/atomic_load_store_debug.c3t | 4 ++-- test/test_suite/debug_symbols/ct_foreach.c3t | 4 ++-- test/test_suite/debug_symbols/defer_macro.c3t | 12 ++++++------ 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/compiler/llvm_codegen_debug_info.c b/src/compiler/llvm_codegen_debug_info.c index 2d3c6d93c..be86337a6 100644 --- a/src/compiler/llvm_codegen_debug_info.c +++ b/src/compiler/llvm_codegen_debug_info.c @@ -324,7 +324,7 @@ static LLVMMetadataRef llvm_debug_pointer_type(GenContext *c, Type *type) inner, type_size(type) * 8, type_abi_alignment(type) * 8, 0, - type->name, strlen(type->name)); + NULL, 0); } static LLVMMetadataRef llvm_debug_enum_type(GenContext *c, Type *type, LLVMMetadataRef scope) diff --git a/test/test_suite/concurrency/atomic_load_store_debug.c3t b/test/test_suite/concurrency/atomic_load_store_debug.c3t index c80e503d8..cd5274afd 100644 --- a/test/test_suite/concurrency/atomic_load_store_debug.c3t +++ b/test/test_suite/concurrency/atomic_load_store_debug.c3t @@ -123,8 +123,8 @@ declare i1 @llvm.expect.i1(i1, i1) !39 = distinct !DISubprogram(name: "_$main", linkageName: "main", scope: !7, file: !7, line: 10, type: !40, scopeLine: 10, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !6, retainedNodes: !11) !40 = !DISubroutineType(types: !41) !41 = !{!13, !13, !42} -!42 = !DIDerivedType(tag: DW_TAG_pointer_type, name: "char**", baseType: !43, size: 64, align: 64, dwarfAddressSpace: 0) -!43 = !DIDerivedType(tag: DW_TAG_pointer_type, name: "char*", baseType: !44, size: 64, align: 64, dwarfAddressSpace: 0) +!42 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !43, size: 64, align: 64, dwarfAddressSpace: 0) +!43 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !44, size: 64, align: 64, dwarfAddressSpace: 0) !44 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_unsigned_char) !45 = !DILocalVariable(name: ".anon", arg: 1, scope: !39, file: !7, line: 10, type: !13) !46 = !DILocation(line: 10, column: 9, scope: !39) diff --git a/test/test_suite/debug_symbols/ct_foreach.c3t b/test/test_suite/debug_symbols/ct_foreach.c3t index b5f7bc0a0..cb7a36147 100644 --- a/test/test_suite/debug_symbols/ct_foreach.c3t +++ b/test/test_suite/debug_symbols/ct_foreach.c3t @@ -47,8 +47,8 @@ entry: !21 = distinct !DISubprogram(name: "_$main", linkageName: "main", scope: !7, file: !7, line: 11, type: !22, scopeLine: 11, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !6, retainedNodes: !11) !22 = !DISubroutineType(types: !23) !23 = !{!14, !14, !24} -!24 = !DIDerivedType(tag: DW_TAG_pointer_type, name: "char**", baseType: !25, size: 64, align: 64, dwarfAddressSpace: 0) -!25 = !DIDerivedType(tag: DW_TAG_pointer_type, name: "char*", baseType: !26, size: 64, align: 64, dwarfAddressSpace: 0) +!24 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !25, size: 64, align: 64, dwarfAddressSpace: 0) +!25 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !26, size: 64, align: 64, dwarfAddressSpace: 0) !26 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_unsigned_char) !27 = !DILocalVariable(name: ".anon", arg: 1, scope: !21, file: !7, line: 11, type: !14) !28 = !DILocation(line: 11, column: 9, scope: !21) diff --git a/test/test_suite/debug_symbols/defer_macro.c3t b/test/test_suite/debug_symbols/defer_macro.c3t index 0e51b0f0b..2350b2b15 100644 --- a/test/test_suite/debug_symbols/defer_macro.c3t +++ b/test/test_suite/debug_symbols/defer_macro.c3t @@ -626,7 +626,7 @@ no_match: ; preds = %compare !11 = !{!12, !13} !12 = !DIDerivedType(tag: DW_TAG_member, name: "kind", scope: !10, file: !7, line: 136, baseType: !9, size: 32, align: 32) !13 = !DIDerivedType(tag: DW_TAG_member, name: "box", scope: !10, file: !7, line: 137, baseType: !14, size: 64, align: 64, offset: 64) -!14 = !DIDerivedType(tag: DW_TAG_pointer_type, name: "void*", baseType: null, size: 64, align: 64, dwarfAddressSpace: 0) +!14 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64, align: 64, dwarfAddressSpace: 0) !15 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) !16 = !{!17} !17 = !DIEnumerator(name: "TOP", value: 0) @@ -650,12 +650,12 @@ no_match: ; preds = %compare !35 = !DICompositeType(tag: DW_TAG_structure_type, name: "String[]", size: 128, align: 64, elements: !36, identifier: "String[]") !36 = !{!37, !48} !37 = !DIDerivedType(tag: DW_TAG_member, name: "ptr", scope: !35, baseType: !38, size: 64, align: 64) -!38 = !DIDerivedType(tag: DW_TAG_pointer_type, name: "String*", baseType: !39, size: 64, align: 64, dwarfAddressSpace: 0) +!38 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !39, size: 64, align: 64, dwarfAddressSpace: 0) !39 = !DIDerivedType(tag: DW_TAG_typedef, name: "String", baseType: !40) !40 = !DICompositeType(tag: DW_TAG_structure_type, name: "char[]", size: 128, align: 64, elements: !41, identifier: "char[]") !41 = !{!42, !45} !42 = !DIDerivedType(tag: DW_TAG_member, name: "ptr", scope: !40, baseType: !43, size: 64, align: 64) -!43 = !DIDerivedType(tag: DW_TAG_pointer_type, name: "char*", baseType: !44, size: 64, align: 64, dwarfAddressSpace: 0) +!43 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !44, size: 64, align: 64, dwarfAddressSpace: 0) !44 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_unsigned_char) !45 = !DIDerivedType(tag: DW_TAG_member, name: "len", scope: !40, baseType: !46, size: 64, align: 64, offset: 64) !46 = !DIDerivedType(tag: DW_TAG_typedef, name: "usz", baseType: !47) @@ -664,7 +664,7 @@ no_match: ; preds = %compare !49 = !DILocalVariable(name: "args", arg: 1, scope: !32, file: !7, line: 15, type: !35) !50 = !DILocation(line: 15, column: 22, scope: !32) !51 = !DILocalVariable(name: "asdf", scope: !32, file: !7, line: 19, type: !52, align: 64) -!52 = !DIDerivedType(tag: DW_TAG_pointer_type, name: "Foo*", baseType: !53, size: 64, align: 64, dwarfAddressSpace: 0) +!52 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !53, size: 64, align: 64, dwarfAddressSpace: 0) !53 = !DICompositeType(tag: DW_TAG_structure_type, name: "Foo", scope: !7, file: !7, line: 28, size: 64, align: 64, elements: !54, identifier: "test.Foo") !54 = !{!55} !55 = !DIDerivedType(tag: DW_TAG_member, name: "asdf", scope: !53, file: !7, line: 30, baseType: !14, size: 64, align: 64) @@ -727,7 +727,7 @@ no_match: ; preds = %compare !112 = !DICompositeType(tag: DW_TAG_structure_type, name: "Arena_Cursor", scope: !7, file: !7, line: 97, size: 128, align: 64, elements: !113, identifier: "foo__Arena_Cursor") !113 = !{!114, !119} !114 = !DIDerivedType(tag: DW_TAG_member, name: "arena", scope: !112, file: !7, line: 99, baseType: !115, size: 64, align: 64) -!115 = !DIDerivedType(tag: DW_TAG_pointer_type, name: "Arena*", baseType: !116, size: 64, align: 64, dwarfAddressSpace: 0) +!115 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !116, size: 64, align: 64, dwarfAddressSpace: 0) !116 = !DICompositeType(tag: DW_TAG_structure_type, name: "Arena", scope: !7, file: !7, line: 92, size: 64, align: 64, elements: !117, identifier: "foo__Arena") !117 = !{!118} !118 = !DIDerivedType(tag: DW_TAG_member, name: "cursor", scope: !116, file: !7, line: 94, baseType: !46, size: 64, align: 64) @@ -750,7 +750,7 @@ no_match: ; preds = %compare !135 = distinct !DISubprogram(name: "_$main", linkageName: "main", scope: !7, file: !7 !136 = !DISubroutineType(types: !137) !137 = !{!15, !15, !138} -!138 = !DIDerivedType(tag: DW_TAG_pointer_type, name: "char**", baseType: !43, size: 64, align: 64, dwarfAddressSpace: 0) +!138 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !43, size: 64, align: 64, dwarfAddressSpace: 0) !139 = !DILocalVariable(name: ".anon", arg: 1, scope: !135, file: !7, line: 15, type: !15) !140 = !DILocation(line: 15, column: 8, scope: !135) !141 = !DILocalVariable(name: ".anon", arg: 2, scope: !135, file: !7, line: 15, type: !138)