diff options
author | Zhongxing Xu <xuzhongxing@gmail.com> | 2008-10-17 02:20:14 +0000 |
---|---|---|
committer | Zhongxing Xu <xuzhongxing@gmail.com> | 2008-10-17 02:20:14 +0000 |
commit | a7581731b1453b51b26154d2409d42a5b6395079 (patch) | |
tree | 94277d7c7941018b3b515fe930e8cb37278884df | |
parent | ab9f1a2ab9a25c63538d8080fe5ed6be299cca2a (diff) |
Get array's lvalue through standard interface.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57666 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Analysis/GRExprEngine.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/Analysis/GRExprEngine.cpp b/lib/Analysis/GRExprEngine.cpp index 76d89bb3b1..bc7a00a546 100644 --- a/lib/Analysis/GRExprEngine.cpp +++ b/lib/Analysis/GRExprEngine.cpp @@ -804,20 +804,18 @@ void GRExprEngine::VisitDeclRefExpr(DeclRefExpr* Ex, NodeTy* Pred, NodeSet& Dst, if (const VarDecl* VD = dyn_cast<VarDecl>(D)) { - QualType T = VD->getType(); - if (T->isArrayType()) { + RVal V = StateMgr.GetLValue(St, VD); + + if (VD->getType()->isArrayType()) { // C++ standard says array of type T should be implicitly converted to // pointer to type T in some cases. Currently we don't do this cast in // VisitCast(), because BasicStore is not field sensitive. We shall do // this in a transfer function in the future. We represent both lvalue and // rvalue of array of type T as the corresponding MemRegionVal of it. - RVal V = lval::MemRegionVal(StateMgr.getRegion(VD)); MakeNode(Dst, Ex, Pred, SetRVal(St, Ex, V)); return; } - - RVal V = StateMgr.GetLValue(St, VD); if (asLValue) MakeNode(Dst, Ex, Pred, SetRVal(St, Ex, V)); |