summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDebugInfo.h
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2019-11-08 09:24:31 -0800
committerAdrian Prantl <aprantl@apple.com>2019-11-08 15:14:00 -0800
commit901cc4a4bc5257d100338e6c318b96b022d554ee (patch)
tree699a3988455df91d6e9ab9d3ab345b747c6f4fe3 /clang/lib/CodeGen/CGDebugInfo.h
parente1b07aac3d1c92f58e05cb5c37c0707842da5839 (diff)
downloadbcm5719-llvm-901cc4a4bc5257d100338e6c318b96b022d554ee.tar.gz
bcm5719-llvm-901cc4a4bc5257d100338e6c318b96b022d554ee.zip
Debug Info: Nest Objective-C property function decls inside their container.
This has the nice side-effect of also fixing a crash in Clang. Starting with DWARF 5 we are emitting ObjC method declarations as children of their containing entity. This worked for interfaces, but didn't consider the case of synthessized properties. When a property of a protocol is synthesized in an interface implementation the ObjCMethodDecl that was passed to CGF::StartFunction was the property *declaration* which obviously couldn't have a containing interface. This patch passes the containing interface all the way through to CGDebugInfo, so the function declaration can be created with the correct parent (= the class implementing the protocol). rdar://problem/53782400 Differential Revision: https://reviews.llvm.org/D66121
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.h')
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.h b/clang/lib/CodeGen/CGDebugInfo.h
index 5e26af4a4f7..9a097615b4b 100644
--- a/clang/lib/CodeGen/CGDebugInfo.h
+++ b/clang/lib/CodeGen/CGDebugInfo.h
@@ -613,6 +613,17 @@ private:
/// declaration for the given method definition.
llvm::DISubprogram *getFunctionDeclaration(const Decl *D);
+ /// \return debug info descriptor to the describe method declaration
+ /// for the given method definition.
+ /// \param FnType For Objective-C methods, their type.
+ /// \param LineNo The declaration's line number.
+ /// \param Flags The DIFlags for the method declaration.
+ /// \param SPFlags The subprogram-spcific flags for the method declaration.
+ llvm::DISubprogram *
+ getObjCMethodDeclaration(const Decl *D, llvm::DISubroutineType *FnType,
+ unsigned LineNo, llvm::DINode::DIFlags Flags,
+ llvm::DISubprogram::DISPFlags SPFlags);
+
/// \return debug info descriptor to describe in-class static data
/// member declaration for the given out-of-class definition. If D
/// is an out-of-class definition of a static data member of a
OpenPOWER on IntegriCloud