Bugfix for r181629:

- The return type should be a pointer to the class type.
- Make the condition more specific.

rdar://problem/13359718

llvm-svn: 182504
This commit is contained in:
Adrian Prantl 2013-05-22 19:10:15 +00:00
parent d082ea15f4
commit ef6fca5536
2 changed files with 6 additions and 3 deletions

View File

@ -2256,8 +2256,10 @@ llvm::DIType CGDebugInfo::getOrCreateFunctionType(const Decl *D,
SmallVector<llvm::Value *, 16> Elts;
// First element is always return type. For 'void' functions it is NULL.
QualType ResultTy = OMethod->hasRelatedResultType()
? QualType(OMethod->getClassInterface()->getTypeForDecl(), 0)
QualType ResultTy =
OMethod->getResultType() == CGM.getContext().getObjCInstanceType()
? CGM.getContext().getPointerType(
QualType(OMethod->getClassInterface()->getTypeForDecl(), 0))
: OMethod->getResultType();
Elts.push_back(getOrCreateType(ResultTy, F));
// "self" pointer is always first argument.

View File

@ -16,7 +16,8 @@
// CHECK: ![[FOO:[0-9]+]] = metadata {{.*}}; [ DW_TAG_structure_type ] [Foo]
// CHECK: metadata !"+[Foo defaultFoo]", metadata !"", i32 [[@LINE-2]], metadata ![[TYPE:[0-9]+]]
// CHECK: ![[TYPE]] = {{.*}} metadata ![[RESULT:[0-9]+]], i32 {{.*}}, i32 {{.*}}} ; [ DW_TAG_subroutine_type ]
// CHECK: ![[RESULT]] = metadata !{metadata ![[FOO]],
// CHECK: ![[RESULT]] = metadata {{.*}}{metadata ![[FOOPTR:[0-9]+]],
// CHECK: ![[FOOPTR]] = {{.*}}, metadata ![[FOO]]}{{.*}}[ DW_TAG_pointer_type ] {{.*}} [from Foo]
@end