From 4c4fe84b25a8c866d396d08f3000e7e56ccc0c7d Mon Sep 17 00:00:00 2001 From: Anna Zaks Date: Thu, 2 Aug 2012 00:41:43 +0000 Subject: [PATCH] [analyzer] Flush bug reports in deterministic order. This makes the diagnostic output order deterministic. 1) This makes order of text diagnostics consistent from run to run. 2) Also resulted in different bugs being reported (from one run to another) with plist-html output. llvm-svn: 161151 --- clang/lib/StaticAnalyzer/Core/BugReporter.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/clang/lib/StaticAnalyzer/Core/BugReporter.cpp b/clang/lib/StaticAnalyzer/Core/BugReporter.cpp index 12479ca53a73..1eaf1f9f7621 100644 --- a/clang/lib/StaticAnalyzer/Core/BugReporter.cpp +++ b/clang/lib/StaticAnalyzer/Core/BugReporter.cpp @@ -1536,9 +1536,10 @@ void BugReporter::FlushReports() { I = bugTypes.begin(), E = bugTypes.end(); I != E; ++I) const_cast(*I)->FlushReports(*this); - typedef llvm::FoldingSet SetTy; - for (SetTy::iterator EI=EQClasses.begin(), EE=EQClasses.end(); EI!=EE;++EI){ - BugReportEquivClass& EQ = *EI; + typedef std::vector ContVecTy; + for (ContVecTy::iterator EI=EQClassesVector.begin(), EE=EQClassesVector.end(); + EI != EE; ++EI){ + BugReportEquivClass& EQ = **EI; FlushReport(EQ); }