[PATCH] D66121: Debug Info: Nest Objective-C property function decls inside their container.

Adrian Prantl via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 12 16:44:47 PDT 2019


aprantl created this revision.
aprantl added reviewers: vsk, rjmccall.
aprantl added a project: debug-info.
aprantl added a reviewer: davide.

This fixes 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


https://reviews.llvm.org/D66121

Files:
  clang/lib/CodeGen/CGDebugInfo.cpp
  clang/lib/CodeGen/CGDebugInfo.h
  clang/lib/CodeGen/CGObjC.cpp
  clang/lib/CodeGen/CodeGenFunction.cpp
  clang/lib/CodeGen/CodeGenFunction.h
  clang/test/CodeGenObjC/debug-info-objc-property-dwarf5.m

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66121.214741.patch
Type: text/x-patch
Size: 10290 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190812/dad928ed/attachment.bin>


More information about the cfe-commits mailing list