From: Eric Christopher Date: Wed, 4 Sep 2013 22:21:24 +0000 (+0000) Subject: Remove hack ensuring that darwin didn't produce dwarf > 3 for modules X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=commitdiff_plain;h=efc47ec528c32f09fa32445f54ee966b462add0f Remove hack ensuring that darwin didn't produce dwarf > 3 for modules without a limiting factor. Update all testcases accordingly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190002 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 6835f40cd8e..535b094f168 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -161,12 +161,8 @@ DIType DbgVariable::getType() const { /// Return Dwarf Version by checking module flags. static unsigned getDwarfVersionFromModule(const Module *M) { Value *Val = M->getModuleFlag("Dwarf Version"); - // If we don't have a value in the module go ahead and use the default in - // dwarf::DWARF_VERSION. - // FIXME: Apple ld has a problem parsing compilation units that specify a - // dwarf version of greater than 3. if (!Val) - return Triple(M->getTargetTriple()).isOSDarwin() ? 3 : dwarf::DWARF_VERSION; + return dwarf::DWARF_VERSION; return cast(Val)->getZExtValue(); } diff --git a/test/DebugInfo/X86/DW_TAG_friend.ll b/test/DebugInfo/X86/DW_TAG_friend.ll index f86d5e4a85e..5ef8692a7f8 100644 --- a/test/DebugInfo/X86/DW_TAG_friend.ll +++ b/test/DebugInfo/X86/DW_TAG_friend.ll @@ -3,10 +3,10 @@ ; Check that the friend tag is there and is followed by a DW_AT_friend that has a reference back. -; CHECK: 0x00000032: DW_TAG_class_type [4] -; CHECK: 0x00000077: DW_TAG_class_type [4] -; CHECK: 0x000000a0: DW_TAG_friend [9] -; CHECK: DW_AT_friend [DW_FORM_ref4] (cu + 0x0032 => {0x00000032}) +; CHECK: [[BACK:0x[0-9a-f]*]]: DW_TAG_class_type [4] +; CHECK-NEXT: DW_AT_name [DW_FORM_strp] ( .debug_str[{{.*}}] = "A") +; CHECK: DW_TAG_friend [9] +; CHECK-NEXT: DW_AT_friend [DW_FORM_ref4] (cu + 0x0032 => {[[BACK]]}) %class.A = type { i32 } diff --git a/test/DebugInfo/X86/block-capture.ll b/test/DebugInfo/X86/block-capture.ll index a01d369c391..30f13305921 100644 --- a/test/DebugInfo/X86/block-capture.ll +++ b/test/DebugInfo/X86/block-capture.ll @@ -2,10 +2,10 @@ ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s ; Checks that we emit debug info for the block variable declare. -; CHECK: 0x00000030: DW_TAG_subprogram [3] -; CHECK: 0x0000005b: DW_TAG_variable [5] -; CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x000000e6] = "block") -; CHECK: DW_AT_location [DW_FORM_data4] (0x00000023) +; CHECK: DW_TAG_subprogram [3] +; CHECK: DW_TAG_variable [5] +; CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[{{.*}}] = "block") +; CHECK: DW_AT_location [DW_FORM_data4] ({{.*}}) %struct.__block_descriptor = type { i64, i64 } %struct.__block_literal_generic = type { i8*, i32, i32, i8*, %struct.__block_descriptor* } diff --git a/test/DebugInfo/X86/empty-and-one-elem-array.ll b/test/DebugInfo/X86/empty-and-one-elem-array.ll index c84ed042726..283d4f99a3a 100644 --- a/test/DebugInfo/X86/empty-and-one-elem-array.ll +++ b/test/DebugInfo/X86/empty-and-one-elem-array.ll @@ -28,34 +28,36 @@ declare void @llvm.dbg.declare(metadata, metadata) nounwind readnone ; An empty array should not have an AT_upper_bound attribute. But an array of 1 ; should. -; CHECK: 0x00000074: DW_TAG_base_type [5] -; CHECK-NEXT: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000043] = "int") +; CHECK: DW_TAG_base_type [5] +; CHECK-NEXT: DW_AT_name [DW_FORM_strp] ( .debug_str[{{.*}}] = "int") ; CHECK-NEXT: DW_AT_encoding [DW_FORM_data1] (0x05) ; CHECK-NEXT: DW_AT_byte_size [DW_FORM_data1] (0x04) ; int[1]: -; CHECK: 0x00000082: DW_TAG_array_type [7] * -; CHECK-NEXT: DW_AT_type [DW_FORM_ref4] (cu + 0x0074 => {0x00000074}) -; CHECK: 0x00000087: DW_TAG_subrange_type [8] -; CHECK-NEXT: DW_AT_type [DW_FORM_ref4] (cu + 0x007b => {0x0000007b}) +; CHECK: DW_TAG_array_type [7] * +; CHECK-NEXT: DW_AT_type [DW_FORM_ref4] +; CHECK: DW_TAG_subrange_type [8] +; CHECK-NEXT: DW_AT_type [DW_FORM_ref4] ; CHECK-NEXT: DW_AT_upper_bound [DW_FORM_data1] (0x00) ; int foo::b[1]: -; CHECK: 0x000000a5: DW_TAG_member [10] -; CHECK-NEXT: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000050] = "b") -; CHECK-NEXT: DW_AT_type [DW_FORM_ref4] (cu + 0x0082 => {0x00000082}) +; CHECK: DW_TAG_member [10] +; CHECK: DW_TAG_member [10] +; CHECK-NEXT: DW_AT_name [DW_FORM_strp] ( .debug_str[{{.*}}] = "b") +; CHECK-NEXT: DW_AT_type [DW_FORM_ref4] ; int[0]: -; CHECK: 0x000000b5: DW_TAG_array_type [7] * -; CHECK-NEXT: DW_AT_type [DW_FORM_ref4] (cu + 0x0074 => {0x00000074}) -; CHECK: 0x000000ba: DW_TAG_subrange_type [11] -; CHECK-NEXT: DW_AT_type [DW_FORM_ref4] (cu + 0x007b => {0x0000007b}) +; CHECK: DW_TAG_array_type [7] * +; CHECK-NEXT: DW_AT_type [DW_FORM_ref4] +; CHECK: DW_TAG_subrange_type [11] +; CHECK-NEXT: DW_AT_type [DW_FORM_ref4] ; CHECK-NOT: DW_AT_upper_bound ; int bar::b[0]: -; CHECK: 0x000000d7: DW_TAG_member [10] -; CHECK-NEXT: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000050] = "b") -; CHECK-NEXT: DW_AT_type [DW_FORM_ref4] (cu + 0x00b5 => {0x000000b5}) +; CHECK: DW_TAG_member [10] +; CHECK: DW_TAG_member [10] +; CHECK-NEXT: DW_AT_name [DW_FORM_strp] ( .debug_str[{{.*}}] = "b") +; CHECK-NEXT: DW_AT_type [DW_FORM_ref4] !llvm.dbg.cu = !{!0} diff --git a/test/DebugInfo/X86/enum-class.ll b/test/DebugInfo/X86/enum-class.ll index 4b4d605b9ab..1f24051302d 100644 --- a/test/DebugInfo/X86/enum-class.ll +++ b/test/DebugInfo/X86/enum-class.ll @@ -29,12 +29,12 @@ !22 = metadata !{metadata !"foo.cpp", metadata !"/Users/echristo/tmp"} ; CHECK: DW_TAG_enumeration_type [3] -; CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0026 => {0x00000026}) +; CHECK: DW_AT_type [DW_FORM_ref4] ; CHECK: DW_AT_enum_class [DW_FORM_flag] (0x01) ; CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[{{.*}}] = "A") ; CHECK: DW_TAG_enumeration_type [3] * -; CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0057 => {0x00000057}) +; CHECK: DW_AT_type [DW_FORM_ref4] ; CHECK: DW_AT_enum_class [DW_FORM_flag] (0x01) ; CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[{{.*}}] = "B") diff --git a/test/DebugInfo/X86/pr11300.ll b/test/DebugInfo/X86/pr11300.ll index 0630f2bc60f..ba9743d70ca 100644 --- a/test/DebugInfo/X86/pr11300.ll +++ b/test/DebugInfo/X86/pr11300.ll @@ -3,8 +3,8 @@ ; test that the DW_AT_specification is a back edge in the file. -; CHECK: 0x0000005c: DW_TAG_subprogram [5] -; CHECK: DW_AT_specification [DW_FORM_ref4] (cu + 0x005c => {0x0000005c}) +; CHECK: [[BACK:0x[0-9a-f]*]]: DW_TAG_subprogram [5] +; CHECK: DW_AT_specification [DW_FORM_ref4] (cu + {{.*}} => {[[BACK]]}) %struct.foo = type { i8 } diff --git a/test/DebugInfo/X86/stringpool.ll b/test/DebugInfo/X86/stringpool.ll index d9604de0f62..02a0fea7e39 100644 --- a/test/DebugInfo/X86/stringpool.ll +++ b/test/DebugInfo/X86/stringpool.ll @@ -26,8 +26,8 @@ ; Verify that we refer to 'yyyy' without a relocation. ; DARWIN: Lset5 = Linfo_string3-Linfo_string ## DW_AT_name ; DARWIN-NEXT: .long Lset5 -; DARWIN-NEXT: .long 39 ## DW_AT_type -; DARWIN-NEXT: .byte 1 ## DW_AT_external +; DARWIN-NEXT: .long 38 ## DW_AT_type +; DARWIN-NEXT: ## DW_AT_external ; DARWIN-NEXT: .byte 1 ## DW_AT_decl_file ; DARWIN-NEXT: .byte 1 ## DW_AT_decl_line ; DARWIN-NEXT: .byte 9 ## DW_AT_location