summaryrefslogtreecommitdiffstats
path: root/clang/lib/Checker
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-12-03 00:58:10 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-12-03 00:58:10 +0000
commit7c0570e40f0741d42b80f896e68cc9b5d126e1f3 (patch)
tree1f7cb46f09a1e150324230b5e7a8478c6deccc9d /clang/lib/Checker
parentc23f0e0a03060ba1b5427eaf13bd57e3f0234869 (diff)
downloadbcm5719-llvm-7c0570e40f0741d42b80f896e68cc9b5d126e1f3.tar.gz
bcm5719-llvm-7c0570e40f0741d42b80f896e68cc9b5d126e1f3.zip
Handle any number of SourceRanges inside BugReporter::FlushReport.
llvm-svn: 120769
Diffstat (limited to 'clang/lib/Checker')
-rw-r--r--clang/lib/Checker/BugReporter.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/clang/lib/Checker/BugReporter.cpp b/clang/lib/Checker/BugReporter.cpp
index 3fc62f3fbd1..0ef99ad09a8 100644
--- a/clang/lib/Checker/BugReporter.cpp
+++ b/clang/lib/Checker/BugReporter.cpp
@@ -1850,12 +1850,10 @@ void BugReporter::FlushReport(BugReportEquivClass& EQ) {
ErrorDiag = Diag.getCustomDiagID(Diagnostic::Warning, TmpStr);
}
- switch (End-Beg) {
- default: assert(0 && "Don't handle this many ranges yet!");
- case 0: Diag.Report(L, ErrorDiag); break;
- case 1: Diag.Report(L, ErrorDiag) << Beg[0]; break;
- case 2: Diag.Report(L, ErrorDiag) << Beg[0] << Beg[1]; break;
- case 3: Diag.Report(L, ErrorDiag) << Beg[0] << Beg[1] << Beg[2]; break;
+ {
+ DiagnosticBuilder diagBuilder = Diag.Report(L, ErrorDiag);
+ for (const SourceRange *I = Beg; I != End; ++I)
+ diagBuilder << *I;
}
// Emit a full diagnostic for the path if we have a PathDiagnosticClient.
OpenPOWER on IntegriCloud