[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
This commit is contained in:
Anna Zaks 2012-08-02 00:41:43 +00:00
parent 45a992b5f0
commit 4c4fe84b25
1 changed files with 4 additions and 3 deletions

View 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);
}