[analyzer] More reliably detect property accessors.

This has a side effect of preventing a crash, which occurs because we get a
property getter declaration, which is overriding but is declared inside
@protocol. Will file a bug about this inconsistency internally. Getting a
small test case is very challenging.

llvm-svn: 190836
This commit is contained in:
Anna Zaks
2013-09-17 01:30:57 +00:00
parent fb05094b52
commit 226a56fa1d

View File

@@ -685,8 +685,14 @@ const PseudoObjectExpr *ObjCMethodCall::getContainingPseudoObjectExpr() const {
ObjCMessageKind ObjCMethodCall::getMessageKind() const {
if (Data == 0) {
// Find the parent, ignoring implicit casts.
ParentMap &PM = getLocationContext()->getParentMap();
const Stmt *S = PM.getParent(getOriginExpr());
while (isa<ImplicitCastExpr>(S))
S = PM.getParent(S);
// Check if parent is a PseudoObjectExpr.
if (const PseudoObjectExpr *POE = dyn_cast_or_null<PseudoObjectExpr>(S)) {
const Expr *Syntactic = POE->getSyntacticForm();