Refactor pieces of PathDiagnostic into its own data structure. No functionality change.

llvm-svn: 150053
This commit is contained in:
Ted Kremenek 2012-02-08 04:32:27 +00:00
parent c03bdd9c80
commit 3116c4e5cd
2 changed files with 11 additions and 3 deletions

View 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;

View 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;