From: Ted Kremenek Date: Tue, 31 Jan 2012 01:19:57 +0000 (+0000) Subject: Convert checker over to using ProgramStateRef. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=be4dc941030988c71e41303fc9116e0dc099b516;p=clang Convert checker over to using ProgramStateRef. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149319 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/StaticAnalyzer/Checkers/ObjCContainersChecker.cpp b/lib/StaticAnalyzer/Checkers/ObjCContainersChecker.cpp index 8c8020be5c..f781f0ab8a 100644 --- a/lib/StaticAnalyzer/Checkers/ObjCContainersChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/ObjCContainersChecker.cpp @@ -79,7 +79,7 @@ template<> struct ProgramStateTrait void ObjCContainersChecker::addSizeInfo(const Expr *Array, const Expr *Size, CheckerContext &C) const { - const ProgramState *State = C.getState(); + ProgramStateRef State = C.getState(); SVal SizeV = State->getSVal(Size, C.getLocationContext()); // Undefined is reported by another checker. if (SizeV.isUnknownOrUndef()) @@ -124,7 +124,7 @@ void ObjCContainersChecker::checkPreStmt(const CallExpr *CE, // Check the array access. if (Name.equals("CFArrayGetValueAtIndex")) { - const ProgramState *State = C.getState(); + ProgramStateRef State = C.getState(); // Retrieve the size. // Find out if we saw this array symbol before and have information about it. const Expr *ArrayExpr = CE->getArg(0); @@ -140,8 +140,8 @@ void ObjCContainersChecker::checkPreStmt(const CallExpr *CE, // Now, check if 'Idx in [0, Size-1]'. const QualType T = IdxExpr->getType(); - const ProgramState *StInBound = State->assumeInBound(Idx, Size, true, T); - const ProgramState *StOutBound = State->assumeInBound(Idx, Size, false, T); + ProgramStateRef StInBound = State->assumeInBound(Idx, Size, true, T); + ProgramStateRef StOutBound = State->assumeInBound(Idx, Size, false, T); if (StOutBound && !StInBound) { ExplodedNode *N = C.generateSink(StOutBound); if (!N)