summaryrefslogtreecommitdiffstats
path: root/clang/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
commit7bec903850806b942967ba3a5eaa37cb4629cf62 (patch)
tree95289048bf74ab305e74c0fd65d7e569a9fa129f /clang/lib/CodeGen/CGDebugInfo.cpp
parent438cec566b97e8815a26ebd8bbe56c64a8bca687 (diff)
downloadbcm5719-llvm-7bec903850806b942967ba3a5eaa37cb4629cf62.tar.gz
bcm5719-llvm-7bec903850806b942967ba3a5eaa37cb4629cf62.zip
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 llvm-svn: 181629
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index 6678aa7198b..d9ab0902e35 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/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);
OpenPOWER on IntegriCloud