diff options
author | Csaba Dabis <dabis.csaba98@gmail.com> | 2019-03-16 10:44:49 +0000 |
---|---|---|
committer | Csaba Dabis <dabis.csaba98@gmail.com> | 2019-03-16 10:44:49 +0000 |
commit | 17c8ca8f1ffe6a0f78ee312740913e344debde9b (patch) | |
tree | 9363fec17d24ac0569991576f5d61b296e0839aa /clang/lib/StaticAnalyzer | |
parent | e282b30c58e5d3387f86d7a78d5c5904950cc549 (diff) | |
download | bcm5719-llvm-17c8ca8f1ffe6a0f78ee312740913e344debde9b.tar.gz bcm5719-llvm-17c8ca8f1ffe6a0f78ee312740913e344debde9b.zip |
Revert "[analyzer] ConditionBRVisitor: Remove GDM checking"
This reverts commit f962485adad9d646511fd3240c0408d9554e6784.
llvm-svn: 356321
Diffstat (limited to 'clang/lib/StaticAnalyzer')
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp | 9 | ||||
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp | 5 |
2 files changed, 6 insertions, 8 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp b/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp index bf7d330e4d5..49de53e53b0 100644 --- a/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp +++ b/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp @@ -1816,10 +1816,13 @@ ConditionBRVisitor::VisitNodeImpl(const ExplodedNode *N, BugReporterContext &BRC, BugReport &BR) { ProgramPoint progPoint = N->getLocation(); ProgramStateRef CurrentState = N->getState(); - ProgramStateRef PreviousState = N->getFirstPred()->getState(); + ProgramStateRef PrevState = N->getFirstPred()->getState(); - // If the constraint information does not changed there is no assumption. - if (BRC.getStateManager().haveEqualConstraints(CurrentState, PreviousState)) + // Compare the GDMs of the state, because that is where constraints + // are managed. Note that ensure that we only look at nodes that + // were generated by the analyzer engine proper, not checkers. + if (CurrentState->getGDM().getRoot() == + PrevState->getGDM().getRoot()) return nullptr; // If an assumption was made on a branch, it should be caught diff --git a/clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp b/clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp index c6ebc85812d..778f0f3016f 100644 --- a/clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp +++ b/clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp @@ -230,11 +230,6 @@ public: // Implementation for interface from ConstraintManager. //===------------------------------------------------------------------===// - bool haveEqualConstraints(ProgramStateRef S1, - ProgramStateRef S2) const override { - return S1->get<ConstraintRange>() == S2->get<ConstraintRange>(); - } - bool canReasonAbout(SVal X) const override; ConditionTruthVal checkNull(ProgramStateRef State, SymbolRef Sym) override; |