Create PathDiagnosticPiece subclasses PathDiagnosticEventPiece and
PathDiagnosticControlFlowPiece to distinguish (in the class hierarchy) between
events and control-flow diagnostic pieces. Clients must now use these directly
when constructing PathDiagnosticPieces.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66310 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/CFRefCount.cpp b/lib/Analysis/CFRefCount.cpp
index 6caea59..b08bce1 100644
--- a/lib/Analysis/CFRefCount.cpp
+++ b/lib/Analysis/CFRefCount.cpp
@@ -2506,7 +2506,7 @@
     }
     
     FullSourceLoc Pos(S->getLocStart(), BR.getContext().getSourceManager());
-    PathDiagnosticPiece* P = new PathDiagnosticPiece(Pos, os.str());
+    PathDiagnosticPiece* P = new PathDiagnosticEventPiece(Pos, os.str());
     
     if (Expr* Exp = dyn_cast<Expr>(S))
       P->addRange(Exp->getSourceRange());
@@ -2655,7 +2655,7 @@
   
   Stmt* S = cast<PostStmt>(N->getLocation()).getStmt();    
   FullSourceLoc Pos(S->getLocStart(), BR.getContext().getSourceManager());
-  PathDiagnosticPiece* P = new PathDiagnosticPiece(Pos, os.str());
+  PathDiagnosticPiece* P = new PathDiagnosticEventPiece(Pos, os.str());
   
   // Add the range by scanning the children of the statement for any bindings
   // to Sym.
@@ -2844,7 +2844,7 @@
           " +"
        << RV->getCount() << " (object leaked).";
   
-  return new PathDiagnosticPiece(L, os.str());
+  return new PathDiagnosticEventPiece(L, os.str());
 }