[cfe-commits] r150053 - in /cfe/trunk: include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h lib/StaticAnalyzer/Core/PathDiagnostic.cpp
Ted Kremenek
kremenek at apple.com
Tue Feb 7 20:32:27 PST 2012
Author: kremenek
Date: Tue Feb 7 22:32:27 2012
New Revision: 150053
URL: http://llvm.org/viewvc/llvm-project?rev=150053&view=rev
Log:
Refactor pieces of PathDiagnostic into its own data structure. No functionality change.
Modified:
cfe/trunk/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h
cfe/trunk/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
Modified: cfe/trunk/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h?rev=150053&r1=150052&r2=150053&view=diff
==============================================================================
--- cfe/trunk/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h (original)
+++ cfe/trunk/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h Tue Feb 7 22:32:27 2012
@@ -44,6 +44,12 @@
//===----------------------------------------------------------------------===//
class PathDiagnostic;
+class PathDiagnosticPiece;
+
+class PathPieces : public std::deque<PathDiagnosticPiece *> {
+public:
+ ~PathPieces();
+};
class PathDiagnosticConsumer {
virtual void anchor();
@@ -475,7 +481,7 @@
/// 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;
Modified: cfe/trunk/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/PathDiagnostic.cpp?rev=150053&r1=150052&r2=150053&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/PathDiagnostic.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/PathDiagnostic.cpp Tue Feb 7 22:32:27 2012
@@ -62,10 +62,12 @@
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;
More information about the cfe-commits
mailing list