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
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index d1da81d..8ef3749 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -2256,8 +2256,10 @@
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.