]> granicus.if.org Git - clang/commitdiff
[analyzer] Flush bug reports in deterministic order.
authorAnna Zaks <ganna@apple.com>
Thu, 2 Aug 2012 00:41:43 +0000 (00:41 +0000)
committerAnna Zaks <ganna@apple.com>
Thu, 2 Aug 2012 00:41:43 +0000 (00:41 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161151 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Core/BugReporter.cpp

index 12479ca53a73dde0f427ca3d094936349db292b9..1eaf1f9f76216a3fdb92dd5a0c2c91699cd06fcd 100644 (file)
@@ -1536,9 +1536,10 @@ void BugReporter::FlushReports() {
          I = bugTypes.begin(), E = bugTypes.end(); I != E; ++I)
     const_cast<BugType*>(*I)->FlushReports(*this);
 
-  typedef llvm::FoldingSet<BugReportEquivClass> SetTy;
-  for (SetTy::iterator EI=EQClasses.begin(), EE=EQClasses.end(); EI!=EE;++EI){
-    BugReportEquivClass& EQ = *EI;
+  typedef std::vector<BugReportEquivClass *> ContVecTy;
+  for (ContVecTy::iterator EI=EQClassesVector.begin(), EE=EQClassesVector.end();
+       EI != EE; ++EI){
+    BugReportEquivClass& EQ = **EI;
     FlushReport(EQ);
   }