aboutsummaryrefslogtreecommitdiff
path: root/lib/Checker/BugReporter.cpp
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
commitb6b7e7bff3101062521de6e79533a3c25e2195d9 (patch)
tree4a7040ddfe0242fbcf76bb1ce23c6067434d5422 /lib/Checker/BugReporter.cpp
parentf928dca56542cf8f981a684f090d2c79bdcb2a10 (diff)
Handle any number of SourceRanges inside BugReporter::FlushReport.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120769 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Checker/BugReporter.cpp')
-rw-r--r--lib/Checker/BugReporter.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/Checker/BugReporter.cpp b/lib/Checker/BugReporter.cpp
index 3fc62f3fbd..0ef99ad09a 100644
--- a/lib/Checker/BugReporter.cpp
+++ b/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.