Cleanup various declarations of 'Stmt*' to be 'Stmt *', etc. in libAnalyzer and libStaticAnalyzer[*].  It was highly inconsistent, and very ugly to look at.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137537 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/StaticAnalyzer/Core/BugReporter.cpp b/lib/StaticAnalyzer/Core/BugReporter.cpp
index 0d0ea8b..67a5e48 100644
--- a/lib/StaticAnalyzer/Core/BugReporter.cpp
+++ b/lib/StaticAnalyzer/Core/BugReporter.cpp
@@ -59,26 +59,26 @@
 // Helper routines for walking the ExplodedGraph and fetching statements.
 //===----------------------------------------------------------------------===//
 
-static inline const Stmt* GetStmt(const ProgramPoint &P) {
+static inline const Stmt *GetStmt(const ProgramPoint &P) {
   if (const StmtPoint* SP = dyn_cast<StmtPoint>(&P))
     return SP->getStmt();
-  else if (const BlockEdge* BE = dyn_cast<BlockEdge>(&P))
+  else if (const BlockEdge *BE = dyn_cast<BlockEdge>(&P))
     return BE->getSrc()->getTerminator();
 
   return 0;
 }
 
 static inline const ExplodedNode*
-GetPredecessorNode(const ExplodedNode* N) {
+GetPredecessorNode(const ExplodedNode *N) {
   return N->pred_empty() ? NULL : *(N->pred_begin());
 }
 
 static inline const ExplodedNode*
-GetSuccessorNode(const ExplodedNode* N) {
+GetSuccessorNode(const ExplodedNode *N) {
   return N->succ_empty() ? NULL : *(N->succ_begin());
 }
 
-static const Stmt* GetPreviousStmt(const ExplodedNode* N) {
+static const Stmt *GetPreviousStmt(const ExplodedNode *N) {
   for (N = GetPredecessorNode(N); N; N = GetPredecessorNode(N))
     if (const Stmt *S = GetStmt(N->getLocation()))
       return S;
@@ -86,7 +86,7 @@
   return 0;
 }
 
-static const Stmt* GetNextStmt(const ExplodedNode* N) {
+static const Stmt *GetNextStmt(const ExplodedNode *N) {
   for (N = GetSuccessorNode(N); N; N = GetSuccessorNode(N))
     if (const Stmt *S = GetStmt(N->getLocation())) {
       // Check if the statement is '?' or '&&'/'||'.  These are "merges",
@@ -116,7 +116,7 @@
 }
 
 static inline const Stmt*
-GetCurrentOrPreviousStmt(const ExplodedNode* N) {
+GetCurrentOrPreviousStmt(const ExplodedNode *N) {
   if (const Stmt *S = GetStmt(N->getLocation()))
     return S;
 
@@ -124,7 +124,7 @@
 }
 
 static inline const Stmt*
-GetCurrentOrNextStmt(const ExplodedNode* N) {
+GetCurrentOrNextStmt(const ExplodedNode *N) {
   if (const Stmt *S = GetStmt(N->getLocation()))
     return S;
 
@@ -145,7 +145,7 @@
   NodeMapClosure(NodeBackMap *m) : M(*m) {}
   ~NodeMapClosure() {}
 
-  const ExplodedNode* getOriginalNode(const ExplodedNode* N) {
+  const ExplodedNode *getOriginalNode(const ExplodedNode *N) {
     NodeBackMap::iterator I = M.find(N);
     return I == M.end() ? 0 : I->second;
   }
@@ -165,10 +165,10 @@
     addVisitor(R);
   }
 
-  PathDiagnosticLocation ExecutionContinues(const ExplodedNode* N);
+  PathDiagnosticLocation ExecutionContinues(const ExplodedNode *N);
 
-  PathDiagnosticLocation ExecutionContinues(llvm::raw_string_ostream& os,
-                                            const ExplodedNode* N);
+  PathDiagnosticLocation ExecutionContinues(llvm::raw_string_ostream &os,
+                                            const ExplodedNode *N);
 
   Decl const &getCodeDecl() { return R->getErrorNode()->getCodeDecl(); }
 
@@ -193,7 +193,7 @@
 } // end anonymous namespace
 
 PathDiagnosticLocation
-PathDiagnosticBuilder::ExecutionContinues(const ExplodedNode* N) {
+PathDiagnosticBuilder::ExecutionContinues(const ExplodedNode *N) {
   if (const Stmt *S = GetNextStmt(N))
     return PathDiagnosticLocation(S, getSourceManager());
 
@@ -202,8 +202,8 @@
 }
 
 PathDiagnosticLocation
-PathDiagnosticBuilder::ExecutionContinues(llvm::raw_string_ostream& os,
-                                          const ExplodedNode* N) {
+PathDiagnosticBuilder::ExecutionContinues(llvm::raw_string_ostream &os,
+                                          const ExplodedNode *N) {
 
   // Slow, but probably doesn't matter.
   if (os.str().empty())
@@ -253,7 +253,7 @@
 
 PathDiagnosticLocation
 PathDiagnosticBuilder::getEnclosingStmtLocation(const Stmt *S) {
-  assert(S && "Null Stmt* passed to getEnclosingStmtLocation");
+  assert(S && "Null Stmt *passed to getEnclosingStmtLocation");
   ParentMap &P = getParentMap();
   SourceManager &SMgr = getSourceManager();
 
@@ -347,7 +347,7 @@
 //===----------------------------------------------------------------------===//
 
 static const VarDecl*
-GetMostRecentVarDeclBinding(const ExplodedNode* N,
+GetMostRecentVarDeclBinding(const ExplodedNode *N,
                             GRStateManager& VMgr, SVal X) {
 
   for ( ; N ; N = N->pred_empty() ? 0 : *N->pred_begin()) {
@@ -357,7 +357,7 @@
     if (!isa<PostStmt>(P))
       continue;
 
-    const DeclRefExpr* DR = dyn_cast<DeclRefExpr>(cast<PostStmt>(P).getStmt());
+    const DeclRefExpr *DR = dyn_cast<DeclRefExpr>(cast<PostStmt>(P).getStmt());
 
     if (!DR)
       continue;
@@ -367,7 +367,7 @@
     if (X != Y)
       continue;
 
-    const VarDecl* VD = dyn_cast<VarDecl>(DR->getDecl());
+    const VarDecl *VD = dyn_cast<VarDecl>(DR->getDecl());
 
     if (!VD)
       continue;
@@ -383,17 +383,17 @@
 : public StoreManager::BindingsHandler {
 
   SymbolRef Sym;
-  const GRState* PrevSt;
-  const Stmt* S;
+  const GRState *PrevSt;
+  const Stmt *S;
   GRStateManager& VMgr;
-  const ExplodedNode* Pred;
+  const ExplodedNode *Pred;
   PathDiagnostic& PD;
   BugReporter& BR;
 
 public:
 
-  NotableSymbolHandler(SymbolRef sym, const GRState* prevst, const Stmt* s,
-                       GRStateManager& vmgr, const ExplodedNode* pred,
+  NotableSymbolHandler(SymbolRef sym, const GRState *prevst, const Stmt *s,
+                       GRStateManager& vmgr, const ExplodedNode *pred,
                        PathDiagnostic& pd, BugReporter& br)
   : Sym(sym), PrevSt(prevst), S(s), VMgr(vmgr), Pred(pred), PD(pd), BR(br) {}
 
@@ -422,14 +422,14 @@
         return true;
 
       // What variable did we assign to?
-      DeclRefExpr* DR = dyn_cast<DeclRefExpr>(B->getLHS()->IgnoreParenCasts());
+      DeclRefExpr *DR = dyn_cast<DeclRefExpr>(B->getLHS()->IgnoreParenCasts());
 
       if (!DR)
         return true;
 
       VD = dyn_cast<VarDecl>(DR->getDecl());
     }
-    else if (const DeclStmt* DS = dyn_cast<DeclStmt>(S)) {
+    else if (const DeclStmt *DS = dyn_cast<DeclStmt>(S)) {
       // FIXME: Eventually CFGs won't have DeclStmts.  Right now we
       //  assume that each DeclStmt has a single Decl.  This invariant
       //  holds by construction in the CFG.
@@ -440,7 +440,7 @@
       return true;
 
     // What is the most recently referenced variable with this binding?
-    const VarDecl* MostRecent = GetMostRecentVarDeclBinding(Pred, VMgr, V);
+    const VarDecl *MostRecent = GetMostRecentVarDeclBinding(Pred, VMgr, V);
 
     if (!MostRecent)
       return true;
@@ -460,13 +460,13 @@
 };
 }
 
-static void HandleNotableSymbol(const ExplodedNode* N,
-                                const Stmt* S,
+static void HandleNotableSymbol(const ExplodedNode *N,
+                                const Stmt *S,
                                 SymbolRef Sym, BugReporter& BR,
                                 PathDiagnostic& PD) {
 
-  const ExplodedNode* Pred = N->pred_empty() ? 0 : *N->pred_begin();
-  const GRState* PrevSt = Pred ? Pred->getState() : 0;
+  const ExplodedNode *Pred = N->pred_empty() ? 0 : *N->pred_begin();
+  const GRState *PrevSt = Pred ? Pred->getState() : 0;
 
   if (!PrevSt)
     return;
@@ -483,13 +483,13 @@
 : public StoreManager::BindingsHandler {
 
   llvm::SmallSet<SymbolRef, 10> AlreadyProcessed;
-  const ExplodedNode* N;
-  const Stmt* S;
+  const ExplodedNode *N;
+  const Stmt *S;
   GRBugReporter& BR;
   PathDiagnostic& PD;
 
 public:
-  ScanNotableSymbols(const ExplodedNode* n, const Stmt* s,
+  ScanNotableSymbols(const ExplodedNode *n, const Stmt *s,
                      GRBugReporter& br, PathDiagnostic& pd)
   : N(n), S(s), BR(br), PD(pd) {}
 
@@ -526,7 +526,7 @@
                                           const ExplodedNode *N) {
 
   SourceManager& SMgr = PDB.getSourceManager();
-  const ExplodedNode* NextNode = N->pred_empty()
+  const ExplodedNode *NextNode = N->pred_empty()
                                         ? NULL : *(N->pred_begin());
   while (NextNode) {
     N = NextNode;
@@ -534,10 +534,10 @@
 
     ProgramPoint P = N->getLocation();
 
-    if (const BlockEdge* BE = dyn_cast<BlockEdge>(&P)) {
-      const CFGBlock* Src = BE->getSrc();
-      const CFGBlock* Dst = BE->getDst();
-      const Stmt* T = Src->getTerminator();
+    if (const BlockEdge *BE = dyn_cast<BlockEdge>(&P)) {
+      const CFGBlock *Src = BE->getSrc();
+      const CFGBlock *Dst = BE->getDst();
+      const Stmt *T = Src->getTerminator();
 
       if (!T)
         continue;
@@ -550,7 +550,7 @@
 
         case Stmt::GotoStmtClass:
         case Stmt::IndirectGotoStmtClass: {
-          const Stmt* S = GetNextStmt(N);
+          const Stmt *S = GetNextStmt(N);
 
           if (!S)
             continue;
@@ -571,7 +571,7 @@
           std::string sbuf;
           llvm::raw_string_ostream os(sbuf);
 
-          if (const Stmt* S = Dst->getLabel()) {
+          if (const Stmt *S = Dst->getLabel()) {
             PathDiagnosticLocation End(S, SMgr);
 
             switch (S->getStmtClass()) {
@@ -587,16 +587,16 @@
 
               case Stmt::CaseStmtClass: {
                 os << "Control jumps to 'case ";
-                const CaseStmt* Case = cast<CaseStmt>(S);
-                const Expr* LHS = Case->getLHS()->IgnoreParenCasts();
+                const CaseStmt *Case = cast<CaseStmt>(S);
+                const Expr *LHS = Case->getLHS()->IgnoreParenCasts();
 
                 // Determine if it is an enum.
                 bool GetRawInt = true;
 
-                if (const DeclRefExpr* DR = dyn_cast<DeclRefExpr>(LHS)) {
+                if (const DeclRefExpr *DR = dyn_cast<DeclRefExpr>(LHS)) {
                   // FIXME: Maybe this should be an assertion.  Are there cases
                   // were it is not an EnumConstantDecl?
-                  const EnumConstantDecl* D =
+                  const EnumConstantDecl *D =
                     dyn_cast<EnumConstantDecl>(DR->getDecl());
 
                   if (D) {
@@ -783,12 +783,12 @@
     if (NextNode) {
       for (BugReporterContext::visitor_iterator I = PDB.visitor_begin(),
            E = PDB.visitor_end(); I!=E; ++I) {
-        if (PathDiagnosticPiece* p = (*I)->VisitNode(N, NextNode, PDB))
+        if (PathDiagnosticPiece *p = (*I)->VisitNode(N, NextNode, PDB))
           PD.push_front(p);
       }
     }
 
-    if (const PostStmt* PS = dyn_cast<PostStmt>(&P)) {
+    if (const PostStmt *PS = dyn_cast<PostStmt>(&P)) {
       // Scan the region bindings, and see if a "notable" symbol has a new
       // lval binding.
       ScanNotableSymbols SNS(N, PS->getStmt(), PDB.getBugReporter(), PD);
@@ -1125,7 +1125,7 @@
                                             const ExplodedNode *N) {
   EdgeBuilder EB(PD, PDB);
 
-  const ExplodedNode* NextNode = N->pred_empty() ? NULL : *(N->pred_begin());
+  const ExplodedNode *NextNode = N->pred_empty() ? NULL : *(N->pred_begin());
   while (NextNode) {
     N = NextNode;
     NextNode = GetPredecessorNode(N);
@@ -1190,7 +1190,7 @@
 
     for (BugReporterContext::visitor_iterator I = PDB.visitor_begin(),
          E = PDB.visitor_end(); I!=E; ++I) {
-      if (PathDiagnosticPiece* p = (*I)->VisitNode(N, NextNode, PDB)) {
+      if (PathDiagnosticPiece *p = (*I)->VisitNode(N, NextNode, PDB)) {
         const PathDiagnosticLocation &Loc = p->getLocation();
         EB.addEdge(Loc, true);
         PD.push_front(p);
@@ -1214,11 +1214,11 @@
 BugReport::~BugReport() {}
 RangedBugReport::~RangedBugReport() {}
 
-const Stmt* BugReport::getStmt() const {
+const Stmt *BugReport::getStmt() const {
   ProgramPoint ProgP = ErrorNode->getLocation();
   const Stmt *S = NULL;
 
-  if (BlockEntrance* BE = dyn_cast<BlockEntrance>(&ProgP)) {
+  if (BlockEntrance *BE = dyn_cast<BlockEntrance>(&ProgP)) {
     CFGBlock &Exit = ProgP.getLocationContext()->getCFG()->getExit();
     if (BE->getBlock() == &Exit)
       S = GetPreviousStmt(ErrorNode);
@@ -1230,8 +1230,8 @@
 }
 
 PathDiagnosticPiece*
-BugReport::getEndPath(BugReporterContext& BRC,
-                      const ExplodedNode* EndPathNode) {
+BugReport::getEndPath(BugReporterContext &BRC,
+                      const ExplodedNode *EndPathNode) {
 
   const ProgramPoint &PP = EndPathNode->getLocation();
   PathDiagnosticLocation L;
@@ -1246,7 +1246,7 @@
   }
 
   if (!L.isValid()) {
-    const Stmt* S = getStmt();
+    const Stmt *S = getStmt();
 
     if (!S)
       return NULL;
@@ -1259,7 +1259,7 @@
 
   // Only add the statement itself as a range if we didn't specify any
   // special ranges for this report.
-  PathDiagnosticPiece* P = new PathDiagnosticEventPiece(L, getDescription(),
+  PathDiagnosticPiece *P = new PathDiagnosticEventPiece(L, getDescription(),
                                                         Beg == End);
 
   for (; Beg != End; ++Beg)
@@ -1270,7 +1270,7 @@
 
 std::pair<BugReport::ranges_iterator, BugReport::ranges_iterator>
 BugReport::getRanges() const {
-  if (const Expr* E = dyn_cast_or_null<Expr>(getStmt())) {
+  if (const Expr *E = dyn_cast_or_null<Expr>(getStmt())) {
     R = E->getSourceRange();
     assert(R.isValid());
     return std::make_pair(&R, &R+1);
@@ -1281,7 +1281,7 @@
 
 SourceLocation BugReport::getLocation() const {
   if (ErrorNode)
-    if (const Stmt* S = GetCurrentOrPreviousStmt(ErrorNode)) {
+    if (const Stmt *S = GetCurrentOrPreviousStmt(ErrorNode)) {
       // For member expressions, return the location of the '.' or '->'.
       if (const MemberExpr *ME = dyn_cast<MemberExpr>(S))
         return ME->getMemberLoc();
@@ -1295,8 +1295,8 @@
   return FullSourceLoc();
 }
 
-PathDiagnosticPiece* BugReport::VisitNode(const ExplodedNode* N,
-                                          const ExplodedNode* PrevN,
+PathDiagnosticPiece *BugReport::VisitNode(const ExplodedNode *N,
+                                          const ExplodedNode *PrevN,
                                           BugReporterContext &BRC) {
   return NULL;
 }
@@ -1405,10 +1405,10 @@
   llvm::DenseMap<const void*,unsigned> Visited;
 
   unsigned cnt = 0;
-  const ExplodedNode* Root = 0;
+  const ExplodedNode *Root = 0;
 
   while (!WS.empty()) {
-    const ExplodedNode* Node = WS.front();
+    const ExplodedNode *Node = WS.front();
     WS.pop();
 
     if (Visited.find(Node) != Visited.end())
@@ -1441,7 +1441,7 @@
 
     // Create the equivalent node in the new graph with the same state
     // and location.
-    ExplodedNode* NewN = GNew->getNode(N->getLocation(), N->getState());
+    ExplodedNode *NewN = GNew->getNode(N->getLocation(), N->getState());
 
     // Store the mapping to the original node.
     llvm::DenseMap<const void*, const void*>::iterator IMitr=InverseMap.find(N);
@@ -1611,7 +1611,7 @@
   // Start building the path diagnostic...
   PathDiagnosticBuilder PDB(*this, R, BackMap.get(), getPathDiagnosticClient());
 
-  if (PathDiagnosticPiece* Piece = R->getEndPath(PDB, N))
+  if (PathDiagnosticPiece *Piece = R->getEndPath(PDB, N))
     PD.push_back(Piece);
   else
     return;
@@ -1683,7 +1683,7 @@
   // to 'Nodes'.  Any of the reports will serve as a "representative" report.
   if (!BT.isSuppressOnSink()) {
     for (BugReportEquivClass::iterator I=EQ.begin(), E=EQ.end(); I!=E; ++I) {
-      const ExplodedNode* N = I->getErrorNode();
+      const ExplodedNode *N = I->getErrorNode();
       if (N) {
         R = *I;
         bugReports.push_back(R);
@@ -1878,7 +1878,7 @@
     return;
 
   if (D->empty()) {
-    PathDiagnosticPiece* piece =
+    PathDiagnosticPiece *piece =
       new PathDiagnosticEventPiece(L, exampleReport->getDescription());
 
     for ( ; Beg != End; ++Beg) piece->addRange(*Beg);