[cfe-commits] r57666 - /cfe/trunk/lib/Analysis/GRExprEngine.cpp

Zhongxing Xu xuzhongxing at gmail.com
Thu Oct 16 19:20:15 PDT 2008


Author: zhongxingxu
Date: Thu Oct 16 21:20:14 2008
New Revision: 57666

URL: http://llvm.org/viewvc/llvm-project?rev=57666&view=rev
Log:
Get array's lvalue through standard interface.

Modified:
    cfe/trunk/lib/Analysis/GRExprEngine.cpp

Modified: cfe/trunk/lib/Analysis/GRExprEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/GRExprEngine.cpp?rev=57666&r1=57665&r2=57666&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/GRExprEngine.cpp (original)
+++ cfe/trunk/lib/Analysis/GRExprEngine.cpp Thu Oct 16 21:20:14 2008
@@ -804,20 +804,18 @@
 
   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));





More information about the cfe-commits mailing list