]> granicus.if.org Git - clang/commitdiff
Refactor pieces of PathDiagnostic into its own data structure. No functionality...
authorTed Kremenek <kremenek@apple.com>
Wed, 8 Feb 2012 04:32:27 +0000 (04:32 +0000)
committerTed Kremenek <kremenek@apple.com>
Wed, 8 Feb 2012 04:32:27 +0000 (04:32 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150053 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h
lib/StaticAnalyzer/Core/PathDiagnostic.cpp

index 9516fcea83ccf766ce3d019f40515b25a28e6499..08b48e529bbeea947a3c47db565a0c334d46d4e1 100644 (file)
@@ -44,6 +44,12 @@ class ExplodedNode;
 //===----------------------------------------------------------------------===//
 
 class PathDiagnostic;
+class PathDiagnosticPiece;
+
+class PathPieces : public std::deque<PathDiagnosticPiece *> {
+public:
+  ~PathPieces();  
+};
 
 class PathDiagnosticConsumer {
   virtual void anchor();
@@ -475,7 +481,7 @@ public:
 ///  diagnostic.  It represents an ordered-collection of PathDiagnosticPieces,
 ///  each which represent the pieces of the path.
 class PathDiagnostic : public llvm::FoldingSetNode {
-  std::deque<PathDiagnosticPiece*> path;
+  PathPieces path;
   unsigned Size;
   std::string BugType;
   std::string Desc;
index 0d2c2e82d97cf719bf79f9410119c5c3c6920d8f..bdf2e16a4bea84fe70556b4bec5ed92cb9b3a1f4 100644 (file)
@@ -62,10 +62,12 @@ PathDiagnosticMacroPiece::~PathDiagnosticMacroPiece() {
 
 PathDiagnostic::PathDiagnostic() : Size(0) {}
 
-PathDiagnostic::~PathDiagnostic() {
-  for (iterator I = begin(), E = end(); I != E; ++I) delete &*I;
+PathPieces::~PathPieces() {
+  for (iterator I = begin(), E = end(); I != E; ++I) delete *I;
 }
 
+PathDiagnostic::~PathDiagnostic() {}
+
 void PathDiagnostic::resetPath(bool deletePieces) {
   Size = 0;