aboutsummaryrefslogtreecommitdiff
path: root/lib/StaticAnalyzer/Core/BugReporter.cpp
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2012-08-02 23:41:05 +0000
committerAnna Zaks <ganna@apple.com>2012-08-02 23:41:05 +0000
commitd015f4febe85d3e3340172d70042840c51bbd836 (patch)
tree2d3cd83d797b9d8f31440d54af58a4f8d86806ed /lib/StaticAnalyzer/Core/BugReporter.cpp
parentaf19a6aaa2959ef5e76f19d51e87ef523bdeedde (diff)
[analyzer] Solve another source of non-determinism in the diagnostic
engine. The code that was supposed to split the tie in a deterministic way is not deterministic. Most likely one of the profile methods uses a pointer. After this change we do finally get the consistent diagnostic output. Testing this requires running the analyzer on large code bases and diffing the results. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161224 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Core/BugReporter.cpp')
-rw-r--r--lib/StaticAnalyzer/Core/BugReporter.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/StaticAnalyzer/Core/BugReporter.cpp b/lib/StaticAnalyzer/Core/BugReporter.cpp
index 1eaf1f9f76..7ba2fa7fdd 100644
--- a/lib/StaticAnalyzer/Core/BugReporter.cpp
+++ b/lib/StaticAnalyzer/Core/BugReporter.cpp
@@ -1536,6 +1536,8 @@ void BugReporter::FlushReports() {
I = bugTypes.begin(), E = bugTypes.end(); I != E; ++I)
const_cast<BugType*>(*I)->FlushReports(*this);
+ // We need to flush reports in deterministic order to ensure the order
+ // of the reports is consistent between runs.
typedef std::vector<BugReportEquivClass *> ContVecTy;
for (ContVecTy::iterator EI=EQClassesVector.begin(), EE=EQClassesVector.end();
EI != EE; ++EI){