[analyzer] Fix body farm for Obj-C++ properties
authorValeriy Savchenko <vsavchenko@apple.com>
Tue, 23 Mar 2021 15:48:58 +0000 (18:48 +0300)
committerValeriy Savchenko <vsavchenko@apple.com>
Wed, 7 Apr 2021 10:44:43 +0000 (13:44 +0300)
commit4821c15691bab9efaef871c957a8ba73697cdda9
tree33fb3ff24a45d4a2880c1c380dc1cbb1f80fdcaf
parenta7eb6b00e934befae9e8e49803ae6621b27be604
[analyzer] Fix body farm for Obj-C++ properties

When property is declared in a superclass (or in a protocol),
it still can be of CXXRecord type and Sema could've already
generated a body for us.  This patch joins two branches and
two ways of acquiring IVar in order to reuse the existing code.
And prevent us from generating l-value to r-value casts for
C++ types.

rdar://67416721

Differential Revision: https://reviews.llvm.org/D99194
clang/lib/Analysis/BodyFarm.cpp
clang/test/Analysis/properties.mm