[cfe-commits] r68693 - /cfe/trunk/lib/Analysis/CFRefCount.cpp

Zhongxing Xu xuzhongxing at gmail.com
Wed Apr 8 23:32:20 PDT 2009


Author: zhongxingxu
Date: Thu Apr  9 01:32:20 2009
New Revision: 68693

URL: http://llvm.org/viewvc/llvm-project?rev=68693&view=rev
Log:
clean up code with new API.

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

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

==============================================================================
--- cfe/trunk/lib/Analysis/CFRefCount.cpp (original)
+++ cfe/trunk/lib/Analysis/CFRefCount.cpp Thu Apr  9 01:32:20 2009
@@ -1789,28 +1789,12 @@
                 if (Loc::IsLocType(FT) || 
                     (FT->isIntegerType() && FT->isScalarType())) {
                   
-                  // Tag the symbol with the field decl so that we generate
-                  // a unique symbol.
-                  SymbolRef NewSym =
-                    Eng.getSymbolManager().getConjuredSymbol(*I, FT, Count, FD);
-                  
-                  // Create a region.
-                  // FIXME: How do we handle 'typedefs' in TypeViewRegions?
-                  //  e.g.:
-                  //     typedef struct *s foo;
-                  //  
-                  //     ((foo) x)->f vs. x->f
-                  //
-                  //  The cast will add a ViewTypeRegion.  Probably RegionStore
-                  //  needs to reason about typedefs explicitly when binding
-                  //  fields and elements.
-                  //
                   const FieldRegion* FR = MRMgr.getFieldRegion(FD, R);
-                  
-                  state = state.BindLoc(Loc::MakeVal(FR),
-                                        Loc::IsLocType(FT)
-                                        ? cast<SVal>(loc::SymbolVal(NewSym))
-                                        : cast<SVal>(nonloc::SymbolVal(NewSym)));
+
+                  SVal V = SVal::GetConjuredSymbolVal(Eng.getSymbolManager(),
+                       Eng.getStoreManager().getRegionManager(), *I, FT, Count);
+
+                  state = state.BindLoc(Loc::MakeVal(FR), V);
                 }                
               }
             }





More information about the cfe-commits mailing list