Change references to 'const ProgramState *' to typedef 'ProgramStateRef'.

At this point this is largely cosmetic, but it opens the door to replace
ProgramStateRef with a smart pointer that more eagerly acts in the role
of reclaiming unused ProgramState objects.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149081 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp b/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp
index ffe23f1..74dd26b 100644
--- a/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp
+++ b/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp
@@ -46,7 +46,7 @@
                                              const CallExpr *) const;
 private:
   bool ReportZeroByteAllocation(CheckerContext &C,
-                                const ProgramState *falseState,
+                                ProgramStateRef falseState,
                                 const Expr *arg,
                                 const char *fn_name) const;
   void BasicAllocationCheck(CheckerContext &C,
@@ -88,7 +88,7 @@
   }
 
   // Look at the 'oflags' argument for the O_CREAT flag.
-  const ProgramState *state = C.getState();
+  ProgramStateRef state = C.getState();
 
   if (CE->getNumArgs() < 2) {
     // The frontend should issue a warning for this case, so this is a sanity
@@ -116,7 +116,7 @@
   DefinedSVal maskedFlags = cast<DefinedSVal>(maskedFlagsUC);
 
   // Check if maskedFlags is non-zero.
-  const ProgramState *trueState, *falseState;
+  ProgramStateRef trueState, falseState;
   llvm::tie(trueState, falseState) = state->assume(maskedFlags);
 
   // Only emit an error if the value of 'maskedFlags' is properly
@@ -155,7 +155,7 @@
 
   // Check if the first argument is stack allocated.  If so, issue a warning
   // because that's likely to be bad news.
-  const ProgramState *state = C.getState();
+  ProgramStateRef state = C.getState();
   const MemRegion *R =
     state->getSVal(CE->getArg(0), C.getLocationContext()).getAsRegion();
   if (!R || !isa<StackSpaceRegion>(R->getMemorySpace()))
@@ -192,10 +192,10 @@
 
 // Returns true if we try to do a zero byte allocation, false otherwise.
 // Fills in trueState and falseState.
-static bool IsZeroByteAllocation(const ProgramState *state,
+static bool IsZeroByteAllocation(ProgramStateRef state,
                                 const SVal argVal,
-                                const ProgramState **trueState,
-                                const ProgramState **falseState) {
+                                ProgramStateRef *trueState,
+                                ProgramStateRef *falseState) {
   llvm::tie(*trueState, *falseState) =
     state->assume(cast<DefinedSVal>(argVal));
   
@@ -206,7 +206,7 @@
 // will perform a zero byte allocation.
 // Returns false if an error occured, true otherwise.
 bool UnixAPIChecker::ReportZeroByteAllocation(CheckerContext &C,
-                                              const ProgramState *falseState,
+                                              ProgramStateRef falseState,
                                               const Expr *arg,
                                               const char *fn_name) const {
   ExplodedNode *N = C.generateSink(falseState);
@@ -240,8 +240,8 @@
     return;
 
   // Check if the allocation size is 0.
-  const ProgramState *state = C.getState();
-  const ProgramState *trueState = NULL, *falseState = NULL;
+  ProgramStateRef state = C.getState();
+  ProgramStateRef trueState = NULL, falseState = NULL;
   const Expr *arg = CE->getArg(sizeArg);
   SVal argVal = state->getSVal(arg, C.getLocationContext());
 
@@ -265,8 +265,8 @@
   if (nArgs != 2)
     return;
 
-  const ProgramState *state = C.getState();
-  const ProgramState *trueState = NULL, *falseState = NULL;
+  ProgramStateRef state = C.getState();
+  ProgramStateRef trueState = NULL, falseState = NULL;
 
   unsigned int i;
   for (i = 0; i < nArgs; i++) {