Add Objective-C property accessors loaded from Clang module DWARF to lookup
authorAdrian Prantl <aprantl@apple.com>
Thu, 16 Apr 2020 22:20:07 +0000 (15:20 -0700)
committerAdrian Prantl <aprantl@apple.com>
Fri, 24 Apr 2020 18:10:50 +0000 (11:10 -0700)
commitef423a3ba57045f80b0fcafce72121449a8b54d4
tree904ddda0d9898883239c2d81d59348a0adbb28cf
parentfdbf493a705c01b33796afc34d0da92c7e8cbb77
Add Objective-C property accessors loaded from Clang module DWARF to lookup

This patch fixes a bug when synthesizing an ObjC property from
-gmodules debug info. Because the method declaration that is injected
via the non-modular property implementation is not added to the
ObjCInterfaceDecl's lookup pointer, a second copy of the accessor
would be generated when processing the ObjCPropertyDecl. This can be
avoided by finding the existing method decl in
ClangExternalASTSourceCallbacks::FindExternalVisibleDeclsByName() and
adding it to the LookupPtr.

Differential Revision: https://reviews.llvm.org/D78333
lldb/source/Plugins/ExpressionParser/Clang/ClangExternalASTSourceCallbacks.cpp
lldb/source/Plugins/ExpressionParser/Clang/ClangExternalASTSourceCallbacks.h
lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
lldb/test/Shell/SymbolFile/DWARF/module-ownership.mm