[clang-tools-extra] r203118 - Use the appropriate operator<< instead of addRanges.
Alexander Kornienko
alexfh at google.com
Thu Mar 6 05:24:28 PST 2014
Author: alexfh
Date: Thu Mar 6 07:24:28 2014
New Revision: 203118
URL: http://llvm.org/viewvc/llvm-project?rev=203118&view=rev
Log:
Use the appropriate operator<< instead of addRanges.
Modified:
clang-tools-extra/trunk/clang-tidy/ClangTidy.cpp
Modified: clang-tools-extra/trunk/clang-tidy/ClangTidy.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/ClangTidy.cpp?rev=203118&r1=203117&r2=203118&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/ClangTidy.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/ClangTidy.cpp Thu Mar 6 07:24:28 2014
@@ -69,15 +69,15 @@ public:
for (const ento::PathDiagnostic *PD : Diags) {
SmallString<64> CheckName(AnalyzerCheckNamePrefix);
CheckName += PD->getCheckName();
- addRanges(Context.diag(CheckName, PD->getLocation().asLocation(),
- PD->getShortDescription()),
- PD->path.back()->getRanges());
+ Context.diag(CheckName, PD->getLocation().asLocation(),
+ PD->getShortDescription())
+ << PD->path.back()->getRanges();
for (const auto &DiagPiece :
PD->path.flatten(/*ShouldFlattenMacros=*/true)) {
- addRanges(Context.diag(CheckName, DiagPiece->getLocation().asLocation(),
- DiagPiece->getString(), DiagnosticIDs::Note),
- DiagPiece->getRanges());
+ Context.diag(CheckName, DiagPiece->getLocation().asLocation(),
+ DiagPiece->getString(), DiagnosticIDs::Note)
+ << DiagPiece->getRanges();
}
}
}
@@ -88,14 +88,6 @@ public:
private:
ClangTidyContext &Context;
-
- // FIXME: Convert to operator<<(DiagnosticBuilder&, ArrayRef<SourceRange>).
- static const DiagnosticBuilder &addRanges(const DiagnosticBuilder &DB,
- ArrayRef<SourceRange> Ranges) {
- for (const SourceRange &Range : Ranges)
- DB << Range;
- return DB;
- }
};
} // namespace
More information about the cfe-commits
mailing list