summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/GRExprEngine.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-10-17 17:24:14 +0000
committerTed Kremenek <kremenek@apple.com>2008-10-17 17:24:14 +0000
commit5870046c4383b692f7ddb1bc4342315b88bd6e34 (patch)
treefafb70e4fee2d2b9ad04997341ad5a305ec8d6cf /clang/lib/Analysis/GRExprEngine.cpp
parent27c370226738bbfb26d6c86b59503e2176c59551 (diff)
downloadbcm5719-llvm-5870046c4383b692f7ddb1bc4342315b88bd6e34.tar.gz
bcm5719-llvm-5870046c4383b692f7ddb1bc4342315b88bd6e34.zip
"Implement" GRExprEngine::VisitLValue for ObjCPropertyRefExpr. This is only a bandid; we need to properly handle properties by using locv/nonloc objects and specially handling property assignments in the transfer function for BinaryOperator.
llvm-svn: 57693
Diffstat (limited to 'clang/lib/Analysis/GRExprEngine.cpp')
-rw-r--r--clang/lib/Analysis/GRExprEngine.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/lib/Analysis/GRExprEngine.cpp b/clang/lib/Analysis/GRExprEngine.cpp
index d8ab4b12756..bdf42e99c53 100644
--- a/clang/lib/Analysis/GRExprEngine.cpp
+++ b/clang/lib/Analysis/GRExprEngine.cpp
@@ -431,6 +431,21 @@ void GRExprEngine::VisitLValue(Expr* Ex, NodeTy* Pred, NodeSet& Dst) {
case Stmt::MemberExprClass:
VisitMemberExpr(cast<MemberExpr>(Ex), Pred, Dst, true);
return;
+
+ case Stmt::ObjCPropertyRefExprClass:
+ // FIXME: Property assignments are lvalues, but not really "locations".
+ // e.g.: self.x = something;
+ // Here the "self.x" really can translate to a method call (setter) when
+ // the assignment is made. Moreover, the entire assignment expression
+ // evaluate to whatever "something" is, not calling the "getter" for
+ // the property (which would make sense since it can have side effects).
+ // We'll probably treat this as a location, but not one that we can
+ // take the address of. Perhaps we need a new SVal class for cases
+ // like thsis?
+ // Note that we have a similar problem for bitfields, since they don't
+ // have "locations" in the sense that we can take their address.
+ Dst.Add(Pred);
+ return;
}
}
OpenPOWER on IntegriCloud