From: Ted Kremenek Date: Wed, 8 Feb 2012 04:32:27 +0000 (+0000) Subject: Refactor pieces of PathDiagnostic into its own data structure. No functionality... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=eb2303c76971f3cc89bbb367ce77564ccb7042c1;p=clang Refactor pieces of PathDiagnostic into its own data structure. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150053 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h b/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h index 9516fcea83..08b48e529b 100644 --- a/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h +++ b/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h @@ -44,6 +44,12 @@ class ExplodedNode; //===----------------------------------------------------------------------===// class PathDiagnostic; +class PathDiagnosticPiece; + +class PathPieces : public std::deque { +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 path; + PathPieces path; unsigned Size; std::string BugType; std::string Desc; diff --git a/lib/StaticAnalyzer/Core/PathDiagnostic.cpp b/lib/StaticAnalyzer/Core/PathDiagnostic.cpp index 0d2c2e82d9..bdf2e16a4b 100644 --- a/lib/StaticAnalyzer/Core/PathDiagnostic.cpp +++ b/lib/StaticAnalyzer/Core/PathDiagnostic.cpp @@ -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;