From 704b4fbbf686454cf11f6141ea1c823db5694b24 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Thu, 18 May 2017 01:11:52 +0000 Subject: [Statistics] Use the new Statistic::updateMax to atomically calculate a maximum value statistic. llvm-svn: 303320 --- clang/lib/StaticAnalyzer/Core/BugReporter.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'clang/lib/StaticAnalyzer/Core/BugReporter.cpp') diff --git a/clang/lib/StaticAnalyzer/Core/BugReporter.cpp b/clang/lib/StaticAnalyzer/Core/BugReporter.cpp index 2114033ba8b..2c3169c0f8d 100644 --- a/clang/lib/StaticAnalyzer/Core/BugReporter.cpp +++ b/clang/lib/StaticAnalyzer/Core/BugReporter.cpp @@ -3448,14 +3448,12 @@ void BugReporter::FlushReport(BugReport *exampleReport, // the BugReporterVisitors may mark this bug as a false positive. assert(!bugReports.empty()); - MaxBugClassSize = - std::max(bugReports.size(), static_cast(MaxBugClassSize)); + MaxBugClassSize.updateMax(bugReports.size()); if (!generatePathDiagnostic(*D.get(), PD, bugReports)) return; - MaxValidBugClassSize = - std::max(bugReports.size(), static_cast(MaxValidBugClassSize)); + MaxValidBugClassSize.updateMax(bugReports.size()); // Examine the report and see if the last piece is in a header. Reset the // report location to the last piece in the main source file. -- cgit v1.2.3