Only emit DW_AT_object_pointer if this is a definition.

llvm-svn: 164326
This commit is contained in:
Eric Christopher 2012-09-20 22:51:57 +00:00
parent 93ab64916f
commit 3a3d529e0d
2 changed files with 2 additions and 5 deletions

View File

@ -1109,9 +1109,6 @@ DIE *CompileUnit::getOrCreateSubprogramDIE(DISubprogram SP) {
addType(Arg, ATy);
if (ATy.isArtificial())
addFlag(Arg, dwarf::DW_AT_artificial);
if (ATy.isObjectPointer())
addDIEEntry(SPDie, dwarf::DW_AT_object_pointer, dwarf::DW_FORM_ref4,
Arg);
SPDie->addChild(Arg);
}
}

View File

@ -1,8 +1,8 @@
; RUN: llc -mtriple=x86_64-apple-darwin %s -o %t -filetype=obj
; RUN: llvm-dwarfdump %t | FileCheck %s
; CHECK: DW_AT_object_pointer [DW_FORM_ref4] (cu + 0x00c3 => {0x000000c3})
; CHECK: 0x000000c3: DW_TAG_formal_parameter [12]
; CHECK: DW_AT_object_pointer [DW_FORM_ref4] (cu + 0x00bf => {0x000000bf})
; CHECK: 0x000000bf: DW_TAG_formal_parameter [12]
; CHECK-NEXT: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000085] = "this")
%class.A = type { i32 }