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 | 252fe5c9f1f6a0605e4662e058186736c2d13a16 (patch) | |
tree | b09582906f7fa311e1d4275119ed7b9fbbc37ce8 | |
parent | 9fe408057ab38851cc6e7c0162cc3e006e1300ba (diff) | |
download | bcm5719-llvm-252fe5c9f1f6a0605e4662e058186736c2d13a16.tar.gz bcm5719-llvm-252fe5c9f1f6a0605e4662e058186736c2d13a16.zip |
Get array's lvalue through standard interface.
llvm-svn: 57666
-rw-r--r-- | clang/lib/Analysis/GRExprEngine.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/clang/lib/Analysis/GRExprEngine.cpp b/clang/lib/Analysis/GRExprEngine.cpp index 76d89bb3b1a..bc7a00a5469 100644 --- a/clang/lib/Analysis/GRExprEngine.cpp +++ b/clang/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)); |