r180740 - [analyzer] Remove comparePath's dependency on subscript operator.
Ted Kremenek
kremenek at apple.com
Mon Apr 29 15:38:22 PDT 2013
Author: kremenek
Date: Mon Apr 29 17:38:22 2013
New Revision: 180740
URL: http://llvm.org/viewvc/llvm-project?rev=180740&view=rev
Log:
[analyzer] Remove comparePath's dependency on subscript operator.
Modified:
cfe/trunk/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
Modified: cfe/trunk/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/PathDiagnostic.cpp?rev=180740&r1=180739&r2=180740&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/PathDiagnostic.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/PathDiagnostic.cpp Mon Apr 29 17:38:22 2013
@@ -297,11 +297,16 @@ static Optional<bool> comparePiece(const
static Optional<bool> comparePath(const PathPieces &X, const PathPieces &Y) {
if (X.size() != Y.size())
return X.size() < Y.size();
- for (unsigned i = 0, n = X.size(); i != n; ++i) {
- Optional<bool> b = comparePiece(*X[i], *Y[i]);
+
+ PathPieces::const_iterator X_I = X.begin(), X_end = X.end();
+ PathPieces::const_iterator Y_I = Y.begin(), Y_end = Y.end();
+
+ for ( ; X_I != X_end && Y_I != Y_end; ++X_I, ++Y_I) {
+ Optional<bool> b = comparePiece(**X_I, **Y_I);
if (b.hasValue())
return b.getValue();
}
+
return None;
}
More information about the cfe-commits
mailing list