Remove hack ensuring that darwin didn't produce dwarf > 3 for modules

without a limiting factor.

Update all testcases accordingly.

llvm-svn: 190002
This commit is contained in:
Eric Christopher 2013-09-04 22:21:24 +00:00
parent 99dab3b43c
commit e31e072c33
7 changed files with 33 additions and 35 deletions

View File

@ -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<ConstantInt>(Val)->getZExtValue();
}

View File

@ -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 }

View File

@ -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* }

View File

@ -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}

View File

@ -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")

View File

@ -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 }

View File

@ -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