Author: zaks
Date: Thu Aug  9 16:02:45 2012
New Revision: 161617

URL: http://llvm.org/viewvc/llvm-project?rev=161617&view=rev
Log:
[analyzer] Rename the function to better reflect what it actually does.

Modified:
    cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h
    cfe/trunk/lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp
    cfe/trunk/lib/StaticAnalyzer/Core/ProgramState.cpp

Modified: 
cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h?rev=161617&r1=161616&r2=161617&view=diff
==============================================================================
--- cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h 
(original)
+++ cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h 
Thu Aug  9 16:02:45 2012
@@ -334,14 +334,14 @@
   /// \brief Get dynamic type information for a region.
   DynamicTypeInfo getDynamicTypeInfo(const MemRegion *Reg) const;
 
-  /// \brief Add dynamic type information to the region; return the new state.
-  ProgramStateRef addDynamicTypeInfo(const MemRegion *Reg,
+  /// \brief Set dynamic type information of the region; return the new state.
+  ProgramStateRef setDynamicTypeInfo(const MemRegion *Reg,
                                      DynamicTypeInfo NewTy) const;
 
-  /// \brief Add dynamic type information to the region; return the new state.
-  ProgramStateRef addDynamicTypeInfo(const MemRegion *Reg,
+  /// \brief Set dynamic type information of the region; return the new state.
+  ProgramStateRef setDynamicTypeInfo(const MemRegion *Reg,
                                      QualType NewTy) const {
-    return addDynamicTypeInfo(Reg, DynamicTypeInfo(NewTy));
+    return setDynamicTypeInfo(Reg, DynamicTypeInfo(NewTy));
   }
 
   //==---------------------------------------------------------------------==//

Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp?rev=161617&r1=161616&r2=161617&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp Thu Aug  9 
16:02:45 2012
@@ -68,7 +68,7 @@
         return;
       QualType DynResTy =
                  C.getASTContext().getObjCObjectPointerType(QualType(ObjTy, 
0));
-      C.addTransition(State->addDynamicTypeInfo(RetReg, DynResTy));
+      C.addTransition(State->setDynamicTypeInfo(RetReg, DynResTy));
       break;
     }
     case OMF_init: {
@@ -78,7 +78,7 @@
       if (!RecReg)
         return;
       DynamicTypeInfo RecDynType = State->getDynamicTypeInfo(RecReg);
-      C.addTransition(State->addDynamicTypeInfo(RetReg, RecDynType));
+      C.addTransition(State->setDynamicTypeInfo(RetReg, RecDynType));
       break;
     }
     }
@@ -98,7 +98,7 @@
   case CK_BitCast:
     // Only handle ObjCObjects for now.
     if (const Type *NewTy = getBetterObjCType(CastE, C))
-      C.addTransition(C.getState()->addDynamicTypeInfo(ToR, 
QualType(NewTy,0)));
+      C.addTransition(C.getState()->setDynamicTypeInfo(ToR, 
QualType(NewTy,0)));
     break;
   }
   return;

Modified: cfe/trunk/lib/StaticAnalyzer/Core/ProgramState.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/ProgramState.cpp?rev=161617&r1=161616&r2=161617&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/ProgramState.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/ProgramState.cpp Thu Aug  9 16:02:45 2012
@@ -762,12 +762,10 @@
   return DynamicTypeInfo();
 }
 
-ProgramStateRef ProgramState::addDynamicTypeInfo(const MemRegion *Reg,
+ProgramStateRef ProgramState::setDynamicTypeInfo(const MemRegion *Reg,
                                                  DynamicTypeInfo NewTy) const {
   if (const SymbolicRegion *SR = dyn_cast<SymbolicRegion>(Reg)) {
     SymbolRef Sym = SR->getSymbol();
-    // TODO: Instead of resetting the type info, check the old type info and
-    // merge and pick the most precise type.
     ProgramStateRef NewState = set<DynamicTypeMap>(Sym, NewTy);
     assert(NewState);
     return NewState;


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to