summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp6
-rw-r--r--clang/test/CodeGenObjC/debug-info-instancetype.m3
2 files changed, 6 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index d1da81d2599..8ef3749b2ad 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -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.
diff --git a/clang/test/CodeGenObjC/debug-info-instancetype.m b/clang/test/CodeGenObjC/debug-info-instancetype.m
index 7275b63d17a..06861606060 100644
--- a/clang/test/CodeGenObjC/debug-info-instancetype.m
+++ b/clang/test/CodeGenObjC/debug-info-instancetype.m
@@ -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
OpenPOWER on IntegriCloud