summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGDebugInfo.cpp
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2013-05-10 21:08:31 +0000
committerAdrian Prantl <aprantl@apple.com>2013-05-10 21:08:31 +0000
commit566a9c3680d9960bb0eb6acf33507251cc13a8d8 (patch)
tree526c528eb24b39820490fc0549a687e566f74e61 /lib/CodeGen/CGDebugInfo.cpp
parent9cbcab88d441761b5c5d7811c4d0c205250991bf (diff)
downloadclang-566a9c3680d9960bb0eb6acf33507251cc13a8d8.tar.gz
clang-566a9c3680d9960bb0eb6acf33507251cc13a8d8.tar.bz2
clang-566a9c3680d9960bb0eb6acf33507251cc13a8d8.tar.xz
ObjC debug info: Substitute the class type for methods that return
a related type (e.g., if they use the instancetype keyword). rdar://problem/13359718 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181629 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r--lib/CodeGen/CGDebugInfo.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp
index 6678aa7198..d9ab0902e3 100644
--- a/lib/CodeGen/CGDebugInfo.cpp
+++ b/lib/CodeGen/CGDebugInfo.cpp
@@ -2154,7 +2154,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.
- Elts.push_back(getOrCreateType(OMethod->getResultType(), F));
+ QualType ResultTy = OMethod->hasRelatedResultType()
+ ? QualType(OMethod->getClassInterface()->getTypeForDecl(), 0)
+ : OMethod->getResultType();
+ Elts.push_back(getOrCreateType(ResultTy, F));
// "self" pointer is always first argument.
QualType SelfDeclTy = OMethod->getSelfDecl()->getType();
llvm::DIType SelfTy = getOrCreateType(SelfDeclTy, F);