[llvm] [dsymutil] Fixlinker's ODR uniquing for typedefs with different underlying types (PR #195749)
Peter Rong via llvm-commits
llvm-commits at lists.llvm.org
Mon May 4 14:59:56 PDT 2026
https://github.com/DataCorrupted created https://github.com/llvm/llvm-project/pull/195749
The classic DWARF linker's DeclContext uniquing for typedefs only considers the typedef's name, file, and line — not the type it refers to. When two typedefs share the same name and source location but point to different underlying types (e.g. due to clang's preferred_name attribute generating a second typedef), they get the same DeclContext. ODR deduplication then merges them, which can produce incorrect type references or self-referencing typedef cycles in the output DWARF.
The self-referencing cycles are latent until a consumer follows `DW_AT_type` chains through typedefs.
In particular, `unwrapReferencedTypedefType()` (introduced in [#168734](https://github.com/llvm/llvm-project/pull/168734)) caused an infinite recursion and eventual stack overflow.
Fix this by including the `DW_AT_type` target's tag and name in the `NameForUniquing`, such that `typedef` with different underlying types get distinct `DeclContexts`. This mirrors the parallel linker fix in https://github.com/llvm/llvm-project/pull/166767
Added a test for validation
[Assisted-by](https://t.ly/Dkjjk): [Claude Opus 4.6](https://www.anthropic.com/news/claude-opus-4-6)
>From 102d6f51285f2ed13e0ec695d98b737f3af0556f Mon Sep 17 00:00:00 2001
From: Peter Rong <PeterRong at meta.com>
Date: Mon, 4 May 2026 14:54:56 -0700
Subject: [PATCH] [dsymutil] Fix classic linker's ODR uniquing for typedefs
with different underlying types
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The classic DWARF linker's DeclContext uniquing for typedefs only considers the typedef's name, file, and line — not the type it refers to.
When two typedefs share the same name and source location but point to different underlying types (e.g. due to clang's preferred_name attribute generating a second typedef), they get the same DeclContext.
ODR deduplication then merges them, which can produce incorrect type references or self-referencing typedef cycles in the output DWARF.
Fix this by including the DW_AT_type target's tag and name in the typedef's NameForUniquing, so typedefs with different underlying types get distinct DeclContexts.
This mirrors the parallel linker fix in https://github.com/llvm/llvm-project/pull/166767
Added a test for validation
Signed-off-by: Peter Rong <PeterRong at meta.com>
---
.../Classic/DWARFLinkerDeclContext.cpp | 21 +
.../dsymutil/ARM/typedef-different-types.test | 830 ++++++++++++++++++
2 files changed, 851 insertions(+)
create mode 100644 llvm/test/tools/dsymutil/ARM/typedef-different-types.test
diff --git a/llvm/lib/DWARFLinker/Classic/DWARFLinkerDeclContext.cpp b/llvm/lib/DWARFLinker/Classic/DWARFLinkerDeclContext.cpp
index 8aa3a4cbc63c4..57cdd392db1f4 100644
--- a/llvm/lib/DWARFLinker/Classic/DWARFLinkerDeclContext.cpp
+++ b/llvm/lib/DWARFLinker/Classic/DWARFLinkerDeclContext.cpp
@@ -116,6 +116,27 @@ DeclContextTree::getChildDeclContext(DeclContext &Context, const DWARFDie &DIE,
NameForUniquing = StringPool.internString(FullName ? *FullName : Name);
}
+ // For typedefs, include the referenced type's tag and name in the uniquing
+ // key. Two typedefs with the same name (e.g. from preferred_name) but
+ // different DW_AT_type targets must get different DeclContexts, otherwise ODR
+ // deduplication can create self-referencing typedef cycles in the output DWARF.
+ // This mirrors the parallel linker fix in llvm/llvm-project#166767.
+ if (Tag == dwarf::DW_TAG_typedef && !NameForUniquing.empty()) {
+ if (auto TypeAttr = DIE.find(dwarf::DW_AT_type)) {
+ if (auto RefDie = DIE.getAttributeValueAsReferencedDie(*TypeAttr)) {
+ StringRef RefName = RefDie.getShortName();
+ if (!RefName.empty()) {
+ SmallString<128> Combined(NameForUniquing);
+ Combined.push_back('\0');
+ Combined.append(dwarf::TagString(RefDie.getTag()));
+ Combined.push_back('\0');
+ Combined.append(RefName);
+ NameForUniquing = StringPool.internString(Combined);
+ }
+ }
+ }
+ }
+
bool IsAnonymousNamespace =
NameForUniquing.empty() && Tag == dwarf::DW_TAG_namespace;
if (IsAnonymousNamespace) {
diff --git a/llvm/test/tools/dsymutil/ARM/typedef-different-types.test b/llvm/test/tools/dsymutil/ARM/typedef-different-types.test
new file mode 100644
index 0000000000000..0288e19df939c
--- /dev/null
+++ b/llvm/test/tools/dsymutil/ARM/typedef-different-types.test
@@ -0,0 +1,830 @@
+# RUN: rm -rf %t && split-file %s %t && cd %t
+# RUN: yaml2obj a.yaml -o a.o
+# RUN: yaml2obj b.yaml -o b.o
+# RUN: dsymutil --linker=classic -f -oso-prepend-path=%t -y debug-map.yaml -o out-classic.dwarf
+# RUN: llvm-dwarfdump out-classic.dwarf | FileCheck %s
+# RUN: dsymutil --linker=parallel -f -oso-prepend-path=%t -y debug-map.yaml -o out-parallel.dwarf
+# RUN: llvm-dwarfdump out-parallel.dwarf | FileCheck %s
+
+# Two CUs each have a typedef "MyType" declared at the same file and line
+# (via a macro header), but pointing to different underlying types (FooA vs
+# FooB). The classic linker must not merge them into one DeclContext,
+# otherwise ODR deduplication would make CU B's typedef point to CU A's
+# underlying type, producing incorrect debug info or even a self-referencing
+# typedef cycle (as seen with std::string and preferred_name).
+
+# CU A: MyType -> FooA
+# CHECK: DW_TAG_typedef
+# CHECK-NEXT: DW_AT_type ({{.*}} "FooA")
+# CHECK-NEXT: DW_AT_name ("MyType")
+
+# CU B: MyType -> FooB (must NOT be merged with CU A's MyType)
+# CHECK: DW_TAG_typedef
+# CHECK-NEXT: DW_AT_type ({{.*}} "FooB")
+# CHECK-NEXT: DW_AT_name ("MyType")
+
+#--- debug-map.yaml
+---
+triple: 'arm64-apple-darwin'
+objects:
+ - filename: 'a.o'
+ timestamp: 0
+ symbols:
+ - { sym: _globalG, objAddr: 0x29C, binAddr: 0x100001000, size: 0x4 }
+ - filename: 'b.o'
+ timestamp: 0
+ symbols:
+ - { sym: _globalH, objAddr: 0x2A0, binAddr: 0x100001008, size: 0x8 }
+...
+
+#--- a.cpp
+struct FooA { int x; };
+#define UNDERLYING_TYPE FooA
+#include "header.h"
+MyType globalA;
+
+#--- b.cpp
+struct FooB { double y; };
+#define UNDERLYING_TYPE FooB
+#include "header.h"
+MyType globalB;
+
+#--- header.h
+typedef UNDERLYING_TYPE MyType;
+
+#--- gen
+clang++ --target=arm64-apple-darwin -g -O0 -c a.cpp -o a.o && obj2yaml a.o
+clang++ --target=arm64-apple-darwin -g -O0 -c b.cpp -o b.o && obj2yaml b.o
+
+
+#--- a.yaml
+--- !mach-o
+FileHeader:
+ magic: 0xFEEDFACF
+ cputype: 0x100000C
+ cpusubtype: 0x0
+ filetype: 0x1
+ ncmds: 4
+ sizeofcmds: 1000
+ flags: 0x2000
+ reserved: 0x0
+LoadCommands:
+ - cmd: LC_SEGMENT_64
+ cmdsize: 872
+ segname: ''
+ vmaddr: 0
+ vmsize: 672
+ fileoff: 1032
+ filesize: 665
+ maxprot: 7
+ initprot: 7
+ nsects: 10
+ flags: 0
+ Sections:
+ - sectname: __text
+ segname: __TEXT
+ addr: 0x0
+ size: 0
+ offset: 0x408
+ align: 0
+ reloff: 0x0
+ nreloc: 0
+ flags: 0x80000000
+ reserved1: 0x0
+ reserved2: 0x0
+ reserved3: 0x0
+ content: ''
+ - sectname: __common
+ segname: __DATA
+ addr: 0x29C
+ size: 4
+ offset: 0x0
+ align: 2
+ reloff: 0x0
+ nreloc: 0
+ flags: 0x1
+ reserved1: 0x0
+ reserved2: 0x0
+ reserved3: 0x0
+ - sectname: __debug_abbrev
+ segname: __DWARF
+ addr: 0x0
+ size: 90
+ offset: 0x408
+ align: 0
+ reloff: 0x0
+ nreloc: 0
+ flags: 0x2000000
+ reserved1: 0x0
+ reserved2: 0x0
+ reserved3: 0x0
+ - sectname: __debug_info
+ segname: __DWARF
+ addr: 0x5A
+ size: 96
+ offset: 0x462
+ align: 0
+ reloff: 0x6A8
+ nreloc: 1
+ flags: 0x2000000
+ reserved1: 0x0
+ reserved2: 0x0
+ reserved3: 0x0
+ relocations:
+ - address: 0x2F
+ symbolnum: 2
+ pcrel: false
+ length: 3
+ extern: false
+ type: 0
+ scattered: false
+ value: 0
+ - sectname: __debug_str
+ segname: __DWARF
+ addr: 0xBA
+ size: 154
+ offset: 0x4C2
+ align: 0
+ reloff: 0x0
+ nreloc: 0
+ flags: 0x2000000
+ reserved1: 0x0
+ reserved2: 0x0
+ reserved3: 0x0
+ - sectname: __apple_names
+ segname: __DWARF
+ addr: 0x154
+ size: 60
+ offset: 0x55C
+ align: 0
+ reloff: 0x0
+ nreloc: 0
+ flags: 0x2000000
+ reserved1: 0x0
+ reserved2: 0x0
+ reserved3: 0x0
+ content: 485341480100000001000000010000000C00000000000000010000000100060000000000DD3A6B002C00000080000000010000002200000000000000
+ - sectname: __apple_objc
+ segname: __DWARF
+ addr: 0x190
+ size: 36
+ offset: 0x598
+ align: 0
+ reloff: 0x0
+ nreloc: 0
+ flags: 0x2000000
+ reserved1: 0x0
+ reserved2: 0x0
+ reserved3: 0x0
+ content: 485341480100000001000000000000000C000000000000000100000001000600FFFFFFFF
+ - sectname: __apple_namespac
+ segname: __DWARF
+ addr: 0x1B4
+ size: 36
+ offset: 0x5BC
+ align: 0
+ reloff: 0x0
+ nreloc: 0
+ flags: 0x2000000
+ reserved1: 0x0
+ reserved2: 0x0
+ reserved3: 0x0
+ content: 485341480100000001000000000000000C000000000000000100000001000600FFFFFFFF
+ - sectname: __apple_types
+ segname: __DWARF
+ addr: 0x1D8
+ size: 133
+ offset: 0x5E0
+ align: 0
+ reloff: 0x0
+ nreloc: 0
+ flags: 0x2000000
+ reserved1: 0x0
+ reserved2: 0x0
+ reserved3: 0x0
+ content: 48534148010000000300000003000000140000000000000003000000010006000300050004000B00FFFFFFFF0000000002000000CA58857C8DF339C43080880B4C0000005F000000720000008F0000000100000042000000130000000000008800000001000000370000001600000000000096000000010000005800000024000000000000
+ - sectname: __debug_line
+ segname: __DWARF
+ addr: 0x25D
+ size: 60
+ offset: 0x665
+ align: 0
+ reloff: 0x0
+ nreloc: 0
+ flags: 0x2000000
+ reserved1: 0x0
+ reserved2: 0x0
+ reserved3: 0x0
+ - cmd: LC_BUILD_VERSION
+ cmdsize: 24
+ platform: 1
+ minos: 720896
+ sdk: 0
+ ntools: 0
+ - cmd: LC_SYMTAB
+ cmdsize: 24
+ symoff: 1712
+ nsyms: 3
+ stroff: 1760
+ strsize: 24
+ - cmd: LC_DYSYMTAB
+ cmdsize: 80
+ ilocalsym: 0
+ nlocalsym: 2
+ iextdefsym: 2
+ nextdefsym: 1
+ iundefsym: 3
+ nundefsym: 0
+ tocoff: 0
+ ntoc: 0
+ modtaboff: 0
+ nmodtab: 0
+ extrefsymoff: 0
+ nextrefsyms: 0
+ indirectsymoff: 0
+ nindirectsyms: 0
+ extreloff: 0
+ nextrel: 0
+ locreloff: 0
+ nlocrel: 0
+LinkEditData:
+ NameList:
+ - n_strx: 16
+ n_type: 0xE
+ n_sect: 1
+ n_desc: 0
+ n_value: 0
+ - n_strx: 10
+ n_type: 0xE
+ n_sect: 2
+ n_desc: 0
+ n_value: 668
+ - n_strx: 1
+ n_type: 0xF
+ n_sect: 2
+ n_desc: 0
+ n_value: 668
+ StringTable:
+ - ''
+ - _globalG
+ - ltmp1
+ - ltmp0
+ - ''
+ - ''
+DWARF:
+ debug_str:
+ - 'clang version 23.0.0git (/home/peterrong/llvm-project/clang 07707707f21a5b65f6b0ddf08c9df1f22f4fe006)'
+ - g.cpp
+ - '/'
+ - '/tmp/typedef-test'
+ - globalG
+ - MyType
+ - FooA
+ - x
+ - int
+ debug_abbrev:
+ - ID: 0
+ Table:
+ - Code: 0x1
+ Tag: DW_TAG_compile_unit
+ Children: DW_CHILDREN_yes
+ Attributes:
+ - Attribute: DW_AT_producer
+ Form: DW_FORM_strp
+ - Attribute: DW_AT_language
+ Form: DW_FORM_data2
+ - Attribute: DW_AT_name
+ Form: DW_FORM_strp
+ - Attribute: DW_AT_LLVM_sysroot
+ Form: DW_FORM_strp
+ - Attribute: DW_AT_stmt_list
+ Form: DW_FORM_sec_offset
+ - Attribute: DW_AT_comp_dir
+ Form: DW_FORM_strp
+ - Code: 0x2
+ Tag: DW_TAG_variable
+ Children: DW_CHILDREN_no
+ Attributes:
+ - Attribute: DW_AT_name
+ Form: DW_FORM_strp
+ - Attribute: DW_AT_type
+ Form: DW_FORM_ref4
+ - Attribute: DW_AT_external
+ Form: DW_FORM_flag_present
+ - Attribute: DW_AT_decl_file
+ Form: DW_FORM_data1
+ - Attribute: DW_AT_decl_line
+ Form: DW_FORM_data1
+ - Attribute: DW_AT_location
+ Form: DW_FORM_exprloc
+ - Code: 0x3
+ Tag: DW_TAG_typedef
+ Children: DW_CHILDREN_no
+ Attributes:
+ - Attribute: DW_AT_type
+ Form: DW_FORM_ref4
+ - Attribute: DW_AT_name
+ Form: DW_FORM_strp
+ - Attribute: DW_AT_decl_file
+ Form: DW_FORM_data1
+ - Attribute: DW_AT_decl_line
+ Form: DW_FORM_data1
+ - Code: 0x4
+ Tag: DW_TAG_structure_type
+ Children: DW_CHILDREN_yes
+ Attributes:
+ - Attribute: DW_AT_calling_convention
+ Form: DW_FORM_data1
+ - Attribute: DW_AT_name
+ Form: DW_FORM_strp
+ - Attribute: DW_AT_byte_size
+ Form: DW_FORM_data1
+ - Attribute: DW_AT_decl_file
+ Form: DW_FORM_data1
+ - Attribute: DW_AT_decl_line
+ Form: DW_FORM_data1
+ - Code: 0x5
+ Tag: DW_TAG_member
+ Children: DW_CHILDREN_no
+ Attributes:
+ - Attribute: DW_AT_name
+ Form: DW_FORM_strp
+ - Attribute: DW_AT_type
+ Form: DW_FORM_ref4
+ - Attribute: DW_AT_decl_file
+ Form: DW_FORM_data1
+ - Attribute: DW_AT_decl_line
+ Form: DW_FORM_data1
+ - Attribute: DW_AT_data_member_location
+ Form: DW_FORM_data1
+ - Code: 0x6
+ Tag: DW_TAG_base_type
+ Children: DW_CHILDREN_no
+ Attributes:
+ - Attribute: DW_AT_name
+ Form: DW_FORM_strp
+ - Attribute: DW_AT_encoding
+ Form: DW_FORM_data1
+ - Attribute: DW_AT_byte_size
+ Form: DW_FORM_data1
+ debug_info:
+ - Length: 0x5C
+ Version: 4
+ AbbrevTableID: 0
+ AbbrOffset: 0x0
+ AddrSize: 8
+ Entries:
+ - AbbrCode: 0x1
+ Values:
+ - Value: 0x0
+ - Value: 0x21
+ - Value: 0x66
+ - Value: 0x6C
+ - Value: 0x0
+ - Value: 0x6E
+ - AbbrCode: 0x2
+ Values:
+ - Value: 0x80
+ - Value: 0x37
+ - Value: 0x1
+ - Value: 0x1
+ - Value: 0x4
+ - Value: 0x9
+ BlockData: [ 0x3, 0x9C, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0,
+ 0x0 ]
+ - AbbrCode: 0x3
+ Values:
+ - Value: 0x42
+ - Value: 0x88
+ - Value: 0x2
+ - Value: 0x1
+ - AbbrCode: 0x4
+ Values:
+ - Value: 0x5
+ - Value: 0x8F
+ - Value: 0x4
+ - Value: 0x1
+ - Value: 0x1
+ - AbbrCode: 0x5
+ Values:
+ - Value: 0x94
+ - Value: 0x58
+ - Value: 0x1
+ - Value: 0x1
+ - Value: 0x0
+ - AbbrCode: 0x0
+ - AbbrCode: 0x6
+ Values:
+ - Value: 0x96
+ - Value: 0x5
+ - Value: 0x4
+ - AbbrCode: 0x0
+ debug_line:
+ - Length: 56
+ Version: 4
+ PrologueLength: 50
+ MinInstLength: 1
+ MaxOpsPerInst: 1
+ DefaultIsStmt: 1
+ LineBase: 251
+ LineRange: 14
+ OpcodeBase: 13
+ StandardOpcodeLengths: [ 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1 ]
+ IncludeDirs:
+ - .
+ Files:
+ - Name: g.cpp
+ DirIdx: 0
+ ModTime: 0
+ Length: 0
+ - Name: typedef_macro.h
+ DirIdx: 1
+ ModTime: 0
+ Length: 0
+...
+
+#--- b.yaml
+--- !mach-o
+FileHeader:
+ magic: 0xFEEDFACF
+ cputype: 0x100000C
+ cpusubtype: 0x0
+ filetype: 0x1
+ ncmds: 4
+ sizeofcmds: 1000
+ flags: 0x2000
+ reserved: 0x0
+LoadCommands:
+ - cmd: LC_SEGMENT_64
+ cmdsize: 872
+ segname: ''
+ vmaddr: 0
+ vmsize: 680
+ fileoff: 1032
+ filesize: 668
+ maxprot: 7
+ initprot: 7
+ nsects: 10
+ flags: 0
+ Sections:
+ - sectname: __text
+ segname: __TEXT
+ addr: 0x0
+ size: 0
+ offset: 0x408
+ align: 0
+ reloff: 0x0
+ nreloc: 0
+ flags: 0x80000000
+ reserved1: 0x0
+ reserved2: 0x0
+ reserved3: 0x0
+ content: ''
+ - sectname: __common
+ segname: __DATA
+ addr: 0x2A0
+ size: 8
+ offset: 0x0
+ align: 3
+ reloff: 0x0
+ nreloc: 0
+ flags: 0x1
+ reserved1: 0x0
+ reserved2: 0x0
+ reserved3: 0x0
+ - sectname: __debug_abbrev
+ segname: __DWARF
+ addr: 0x0
+ size: 90
+ offset: 0x408
+ align: 0
+ reloff: 0x0
+ nreloc: 0
+ flags: 0x2000000
+ reserved1: 0x0
+ reserved2: 0x0
+ reserved3: 0x0
+ - sectname: __debug_info
+ segname: __DWARF
+ addr: 0x5A
+ size: 96
+ offset: 0x462
+ align: 0
+ reloff: 0x6A8
+ nreloc: 1
+ flags: 0x2000000
+ reserved1: 0x0
+ reserved2: 0x0
+ reserved3: 0x0
+ relocations:
+ - address: 0x2F
+ symbolnum: 2
+ pcrel: false
+ length: 3
+ extern: false
+ type: 0
+ scattered: false
+ value: 0
+ - sectname: __debug_str
+ segname: __DWARF
+ addr: 0xBA
+ size: 157
+ offset: 0x4C2
+ align: 0
+ reloff: 0x0
+ nreloc: 0
+ flags: 0x2000000
+ reserved1: 0x0
+ reserved2: 0x0
+ reserved3: 0x0
+ - sectname: __apple_names
+ segname: __DWARF
+ addr: 0x157
+ size: 60
+ offset: 0x55F
+ align: 0
+ reloff: 0x0
+ nreloc: 0
+ flags: 0x2000000
+ reserved1: 0x0
+ reserved2: 0x0
+ reserved3: 0x0
+ content: 485341480100000001000000010000000C00000000000000010000000100060000000000DE3A6B002C00000080000000010000002200000000000000
+ - sectname: __apple_objc
+ segname: __DWARF
+ addr: 0x193
+ size: 36
+ offset: 0x59B
+ align: 0
+ reloff: 0x0
+ nreloc: 0
+ flags: 0x2000000
+ reserved1: 0x0
+ reserved2: 0x0
+ reserved3: 0x0
+ content: 485341480100000001000000000000000C000000000000000100000001000600FFFFFFFF
+ - sectname: __apple_namespac
+ segname: __DWARF
+ addr: 0x1B7
+ size: 36
+ offset: 0x5BF
+ align: 0
+ reloff: 0x0
+ nreloc: 0
+ flags: 0x2000000
+ reserved1: 0x0
+ reserved2: 0x0
+ reserved3: 0x0
+ content: 485341480100000001000000000000000C000000000000000100000001000600FFFFFFFF
+ - sectname: __apple_types
+ segname: __DWARF
+ addr: 0x1DB
+ size: 133
+ offset: 0x5E3
+ align: 0
+ reloff: 0x0
+ nreloc: 0
+ flags: 0x2000000
+ reserved1: 0x0
+ reserved2: 0x0
+ reserved3: 0x0
+ content: 48534148010000000300000003000000140000000000000003000000010006000300050004000B00FFFFFFFF00000000020000008DF339C4205B3DF9CB58857C4C0000005F0000007200000088000000010000003700000016000000000000960000000100000058000000240000000000008F000000010000004200000013000000000000
+ - sectname: __debug_line
+ segname: __DWARF
+ addr: 0x260
+ size: 60
+ offset: 0x668
+ align: 0
+ reloff: 0x0
+ nreloc: 0
+ flags: 0x2000000
+ reserved1: 0x0
+ reserved2: 0x0
+ reserved3: 0x0
+ - cmd: LC_BUILD_VERSION
+ cmdsize: 24
+ platform: 1
+ minos: 720896
+ sdk: 0
+ ntools: 0
+ - cmd: LC_SYMTAB
+ cmdsize: 24
+ symoff: 1712
+ nsyms: 3
+ stroff: 1760
+ strsize: 24
+ - cmd: LC_DYSYMTAB
+ cmdsize: 80
+ ilocalsym: 0
+ nlocalsym: 2
+ iextdefsym: 2
+ nextdefsym: 1
+ iundefsym: 3
+ nundefsym: 0
+ tocoff: 0
+ ntoc: 0
+ modtaboff: 0
+ nmodtab: 0
+ extrefsymoff: 0
+ nextrefsyms: 0
+ indirectsymoff: 0
+ nindirectsyms: 0
+ extreloff: 0
+ nextrel: 0
+ locreloff: 0
+ nlocrel: 0
+LinkEditData:
+ NameList:
+ - n_strx: 16
+ n_type: 0xE
+ n_sect: 1
+ n_desc: 0
+ n_value: 0
+ - n_strx: 10
+ n_type: 0xE
+ n_sect: 2
+ n_desc: 0
+ n_value: 672
+ - n_strx: 1
+ n_type: 0xF
+ n_sect: 2
+ n_desc: 0
+ n_value: 672
+ StringTable:
+ - ''
+ - _globalH
+ - ltmp1
+ - ltmp0
+ - ''
+ - ''
+DWARF:
+ debug_str:
+ - 'clang version 23.0.0git (/home/peterrong/llvm-project/clang 07707707f21a5b65f6b0ddf08c9df1f22f4fe006)'
+ - h.cpp
+ - '/'
+ - '/tmp/typedef-test'
+ - globalH
+ - MyType
+ - FooB
+ - y
+ - double
+ debug_abbrev:
+ - ID: 0
+ Table:
+ - Code: 0x1
+ Tag: DW_TAG_compile_unit
+ Children: DW_CHILDREN_yes
+ Attributes:
+ - Attribute: DW_AT_producer
+ Form: DW_FORM_strp
+ - Attribute: DW_AT_language
+ Form: DW_FORM_data2
+ - Attribute: DW_AT_name
+ Form: DW_FORM_strp
+ - Attribute: DW_AT_LLVM_sysroot
+ Form: DW_FORM_strp
+ - Attribute: DW_AT_stmt_list
+ Form: DW_FORM_sec_offset
+ - Attribute: DW_AT_comp_dir
+ Form: DW_FORM_strp
+ - Code: 0x2
+ Tag: DW_TAG_variable
+ Children: DW_CHILDREN_no
+ Attributes:
+ - Attribute: DW_AT_name
+ Form: DW_FORM_strp
+ - Attribute: DW_AT_type
+ Form: DW_FORM_ref4
+ - Attribute: DW_AT_external
+ Form: DW_FORM_flag_present
+ - Attribute: DW_AT_decl_file
+ Form: DW_FORM_data1
+ - Attribute: DW_AT_decl_line
+ Form: DW_FORM_data1
+ - Attribute: DW_AT_location
+ Form: DW_FORM_exprloc
+ - Code: 0x3
+ Tag: DW_TAG_typedef
+ Children: DW_CHILDREN_no
+ Attributes:
+ - Attribute: DW_AT_type
+ Form: DW_FORM_ref4
+ - Attribute: DW_AT_name
+ Form: DW_FORM_strp
+ - Attribute: DW_AT_decl_file
+ Form: DW_FORM_data1
+ - Attribute: DW_AT_decl_line
+ Form: DW_FORM_data1
+ - Code: 0x4
+ Tag: DW_TAG_structure_type
+ Children: DW_CHILDREN_yes
+ Attributes:
+ - Attribute: DW_AT_calling_convention
+ Form: DW_FORM_data1
+ - Attribute: DW_AT_name
+ Form: DW_FORM_strp
+ - Attribute: DW_AT_byte_size
+ Form: DW_FORM_data1
+ - Attribute: DW_AT_decl_file
+ Form: DW_FORM_data1
+ - Attribute: DW_AT_decl_line
+ Form: DW_FORM_data1
+ - Code: 0x5
+ Tag: DW_TAG_member
+ Children: DW_CHILDREN_no
+ Attributes:
+ - Attribute: DW_AT_name
+ Form: DW_FORM_strp
+ - Attribute: DW_AT_type
+ Form: DW_FORM_ref4
+ - Attribute: DW_AT_decl_file
+ Form: DW_FORM_data1
+ - Attribute: DW_AT_decl_line
+ Form: DW_FORM_data1
+ - Attribute: DW_AT_data_member_location
+ Form: DW_FORM_data1
+ - Code: 0x6
+ Tag: DW_TAG_base_type
+ Children: DW_CHILDREN_no
+ Attributes:
+ - Attribute: DW_AT_name
+ Form: DW_FORM_strp
+ - Attribute: DW_AT_encoding
+ Form: DW_FORM_data1
+ - Attribute: DW_AT_byte_size
+ Form: DW_FORM_data1
+ debug_info:
+ - Length: 0x5C
+ Version: 4
+ AbbrevTableID: 0
+ AbbrOffset: 0x0
+ AddrSize: 8
+ Entries:
+ - AbbrCode: 0x1
+ Values:
+ - Value: 0x0
+ - Value: 0x21
+ - Value: 0x66
+ - Value: 0x6C
+ - Value: 0x0
+ - Value: 0x6E
+ - AbbrCode: 0x2
+ Values:
+ - Value: 0x80
+ - Value: 0x37
+ - Value: 0x1
+ - Value: 0x1
+ - Value: 0x4
+ - Value: 0x9
+ BlockData: [ 0x3, 0xA0, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0,
+ 0x0 ]
+ - AbbrCode: 0x3
+ Values:
+ - Value: 0x42
+ - Value: 0x88
+ - Value: 0x2
+ - Value: 0x1
+ - AbbrCode: 0x4
+ Values:
+ - Value: 0x5
+ - Value: 0x8F
+ - Value: 0x8
+ - Value: 0x1
+ - Value: 0x1
+ - AbbrCode: 0x5
+ Values:
+ - Value: 0x94
+ - Value: 0x58
+ - Value: 0x1
+ - Value: 0x1
+ - Value: 0x0
+ - AbbrCode: 0x0
+ - AbbrCode: 0x6
+ Values:
+ - Value: 0x96
+ - Value: 0x4
+ - Value: 0x8
+ - AbbrCode: 0x0
+ debug_line:
+ - Length: 56
+ Version: 4
+ PrologueLength: 50
+ MinInstLength: 1
+ MaxOpsPerInst: 1
+ DefaultIsStmt: 1
+ LineBase: 251
+ LineRange: 14
+ OpcodeBase: 13
+ StandardOpcodeLengths: [ 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1 ]
+ IncludeDirs:
+ - .
+ Files:
+ - Name: h.cpp
+ DirIdx: 0
+ ModTime: 0
+ Length: 0
+ - Name: typedef_macro.h
+ DirIdx: 1
+ ModTime: 0
+ Length: 0
+...
More information about the llvm-commits
mailing list