From 35f225aa2c04ca2420161cca812cb3eb611bde51 Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Tue, 21 Feb 2012 22:25:53 +0000 Subject: [PATCH] There's no need for a DW_AT_byte_size on a pointer type. Part of rdar://10493979 where it reduces by about .5% (10k) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151097 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | 2 +- test/DebugInfo/X86/DW_AT_specification.ll | 2 +- test/DebugInfo/X86/concrete_out_of_line.ll | 6 +++--- test/DebugInfo/X86/pr11300.ll | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp index 162e17e5ef7..d8d1e5a78d3 100644 --- a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -723,7 +723,7 @@ void CompileUnit::constructTypeDIE(DIE &Buffer, DIDerivedType DTy) { addString(&Buffer, dwarf::DW_AT_name, Name); // Add size if non-zero (derived types might be zero-sized.) - if (Size) + if (Size && Tag != dwarf::DW_TAG_pointer_type) addUInt(&Buffer, dwarf::DW_AT_byte_size, 0, Size); // Add source line info if available and TyDesc is not a forward declaration. diff --git a/test/DebugInfo/X86/DW_AT_specification.ll b/test/DebugInfo/X86/DW_AT_specification.ll index 862349f8b06..fc6cd4bbe4c 100644 --- a/test/DebugInfo/X86/DW_AT_specification.ll +++ b/test/DebugInfo/X86/DW_AT_specification.ll @@ -4,7 +4,7 @@ ; test that the DW_AT_specification is a back edge in the file. ; CHECK: 0x00000038: DW_TAG_subprogram [5] * -; CHECK: 0x00000060: DW_AT_specification [DW_FORM_ref4] (cu + 0x0038 => {0x00000038}) +; CHECK: 0x0000005f: DW_AT_specification [DW_FORM_ref4] (cu + 0x0038 => {0x00000038}) @_ZZN3foo3barEvE1x = constant i32 0, align 4 diff --git a/test/DebugInfo/X86/concrete_out_of_line.ll b/test/DebugInfo/X86/concrete_out_of_line.ll index 92895f199c0..18948445157 100644 --- a/test/DebugInfo/X86/concrete_out_of_line.ll +++ b/test/DebugInfo/X86/concrete_out_of_line.ll @@ -7,7 +7,7 @@ ; first check that we have a TAG_subprogram at a given offset and it has ; AT_inline. -; CHECK: 0x00000136: DW_TAG_subprogram +; CHECK: 0x00000134: DW_TAG_subprogram ; CHECK-NEXT: DW_AT_MIPS_linkage_name ; CHECK-NEXT: DW_AT_specification ; CHECK-NEXT: DW_AT_inline @@ -15,8 +15,8 @@ ; and then that a TAG_subprogram refers to it with AT_abstract_origin. -; CHECK: 0x00000186: DW_TAG_subprogram -; CHECK-NEXT: DW_AT_abstract_origin [DW_FORM_ref4] (cu + 0x0136 => {0x00000136}) +; CHECK: 0x00000184: DW_TAG_subprogram +; CHECK-NEXT: DW_AT_abstract_origin [DW_FORM_ref4] (cu + 0x0134 => {0x00000134}) define i32 @_ZN17nsAutoRefCnt7ReleaseEv() { entry: diff --git a/test/DebugInfo/X86/pr11300.ll b/test/DebugInfo/X86/pr11300.ll index fcb358ad853..507e3f6d9b4 100644 --- a/test/DebugInfo/X86/pr11300.ll +++ b/test/DebugInfo/X86/pr11300.ll @@ -4,7 +4,7 @@ ; test that the DW_AT_specification is a back edge in the file. ; CHECK: 0x0000005b: DW_TAG_subprogram [5] -; CHECK: 0x0000007d: DW_AT_specification [DW_FORM_ref4] (cu + 0x005b => {0x0000005b}) +; CHECK: 0x0000007c: DW_AT_specification [DW_FORM_ref4] (cu + 0x005b => {0x0000005b}) %struct.foo = type { i8 } -- 2.34.1