[cfe-commits] r39679 - /cfe/cfe/trunk/Driver/DiagChecker.cpp
bwendlin at cs.uiuc.edu
bwendlin at cs.uiuc.edu
Wed Jul 11 09:47:04 PDT 2007
Author: bwendlin
Date: Wed Jul 11 11:47:04 2007
New Revision: 39679
URL: http://llvm.org/viewvc/llvm-project?rev=39679&view=rev
Log:
Submitted by: Bill Wendling
- Shouldn't increment the iterator but a copy of it.
Modified:
cfe/cfe/trunk/Driver/DiagChecker.cpp
Modified: cfe/cfe/trunk/Driver/DiagChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Driver/DiagChecker.cpp?rev=39679&r1=39678&r2=39679&view=diff
==============================================================================
--- cfe/cfe/trunk/Driver/DiagChecker.cpp (original)
+++ cfe/cfe/trunk/Driver/DiagChecker.cpp Wed Jul 11 11:47:04 2007
@@ -133,10 +133,10 @@
fprintf(stderr, "%s\n", Msg);
- for (; diag_begin != diag_end; ++diag_begin)
+ for (const_diag_iterator I = diag_begin, E = diag_end; I != E; ++I)
fprintf(stderr, " LineNo %d:\n %s\n",
- SourceMgr.getLineNumber(diag_begin->first),
- diag_begin->second.c_str());
+ SourceMgr.getLineNumber(I->first),
+ I->second.c_str());
return true;
}
@@ -152,20 +152,22 @@
const char *Msg) {
TextDiagnosticBuffer::DiagList DiffList;
- for (; d1_begin != d1_end; ++d1_begin) {
- const std::string &Diag = d1_begin->second;
+ for (const_diag_iterator I = d1_begin, E = d1_end; I != E; ++I) {
+ const std::string &Diag1 = I->second;
bool Found = false;
- for (; d2_begin != d2_end; ++d2_begin) {
- if (d2_begin->second.find(Diag) != std::string::npos ||
- Diag.find(d2_begin->second) != std::string::npos) {
+ for (const_diag_iterator II = d2_begin, IE = d2_end; II != IE; ++II) {
+ const std::string &Diag2 = II->second;
+
+ if (Diag2.find(Diag1) != std::string::npos ||
+ Diag1.find(Diag2) != std::string::npos) {
Found = true;
break;
}
}
if (!Found)
- DiffList.push_back(std::make_pair(d1_begin->first, Diag));
+ DiffList.push_back(std::make_pair(d1_begin->first, Diag1));
}
return PrintProblem(SourceMgr, DiffList.begin(), DiffList.end(), Msg);
More information about the cfe-commits
mailing list