mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-30 21:56:43 +00:00
[Statistics] Use the new Statistic::updateMax to atomically calculate a maximum value statistic.
llvm-svn: 303320
This commit is contained in:
parent
be42c4aec8
commit
704b4fbbf6
@ -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<size_t>(MaxBugClassSize));
|
||||
MaxBugClassSize.updateMax(bugReports.size());
|
||||
|
||||
if (!generatePathDiagnostic(*D.get(), PD, bugReports))
|
||||
return;
|
||||
|
||||
MaxValidBugClassSize =
|
||||
std::max(bugReports.size(), static_cast<size_t>(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.
|
||||
|
@ -674,10 +674,8 @@ void AnalysisConsumer::HandleCode(Decl *D, AnalysisMode Mode,
|
||||
|
||||
DisplayFunction(D, Mode, IMode);
|
||||
CFG *DeclCFG = Mgr->getCFG(D);
|
||||
if (DeclCFG) {
|
||||
unsigned CFGSize = DeclCFG->size();
|
||||
MaxCFGSize = MaxCFGSize < CFGSize ? CFGSize : MaxCFGSize;
|
||||
}
|
||||
if (DeclCFG)
|
||||
MaxCFGSize.updateMax(DeclCFG->size());
|
||||
|
||||
BugReporter BR(*Mgr);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user