diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-10-17 00:03:18 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-10-17 00:03:18 +0000 |
commit | 97ed4f68f5dba3e21e7a490ef0f9ffd3bfead7f8 (patch) | |
tree | f3a66afc6ddebc3798f677f7934921cc95644c77 /lib/Analysis/GRExprEngine.cpp | |
parent | c6f7345e44e079f373d6bdecaa06c7e06574dc27 (diff) |
Add transfer function support for ObjCIvarRefExpr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57654 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/GRExprEngine.cpp')
-rw-r--r-- | lib/Analysis/GRExprEngine.cpp | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/lib/Analysis/GRExprEngine.cpp b/lib/Analysis/GRExprEngine.cpp index 2d241344af..f974dfc2c4 100644 --- a/lib/Analysis/GRExprEngine.cpp +++ b/lib/Analysis/GRExprEngine.cpp @@ -350,10 +350,13 @@ void GRExprEngine::Visit(Stmt* S, NodeTy* Pred, NodeSet& Dst) { break; } - case Stmt::MemberExprClass: { + case Stmt::MemberExprClass: VisitMemberExpr(cast<MemberExpr>(S), Pred, Dst, false); break; - } + + case Stmt::ObjCIvarRefExprClass: + VisitObjCIvarRefExpr(cast<ObjCIvarRefExpr>(S), Pred, Dst, false); + break; case Stmt::ObjCMessageExprClass: { VisitObjCMessageExpr(cast<ObjCMessageExpr>(S), Pred, Dst); @@ -417,6 +420,10 @@ void GRExprEngine::VisitLValue(Expr* Ex, NodeTy* Pred, NodeSet& Dst) { VisitDeclRefExpr(cast<DeclRefExpr>(Ex), Pred, Dst, true); return; + case Stmt::ObjCIvarRefExprClass: + VisitObjCIvarRefExpr(cast<ObjCIvarRefExpr>(Ex), Pred, Dst, true); + return; + case Stmt::UnaryOperatorClass: VisitUnaryOperator(cast<UnaryOperator>(Ex), Pred, Dst, true); return; @@ -1223,6 +1230,30 @@ void GRExprEngine::VisitCall(CallExpr* CE, NodeTy* Pred, } //===----------------------------------------------------------------------===// +// Transfer function: Objective-C ivar references. +//===----------------------------------------------------------------------===// + +void GRExprEngine::VisitObjCIvarRefExpr(ObjCIvarRefExpr* Ex, + NodeTy* Pred, NodeSet& Dst, + bool asLValue) { + + Expr* Base = cast<Expr>(Ex->getBase()); + NodeSet Tmp; + Visit(Base, Pred, Tmp); + + for (NodeSet::iterator I=Tmp.begin(), E=Tmp.end(); I!=E; ++I) { + const GRState* St = GetState(*I); + RVal BaseVal = GetRVal(St, Base); + RVal location = StateMgr.GetLValue(St, Ex->getDecl(), BaseVal); + + if (asLValue) + MakeNode(Dst, Ex, *I, SetRVal(St, Ex, location)); + else + EvalLoad(Dst, Ex, *I, St, location); + } +} + +//===----------------------------------------------------------------------===// // Transfer function: Objective-C message expressions. //===----------------------------------------------------------------------===// |