diff options
author | Jordan Rose <jordan_rose@apple.com> | 2013-03-18 23:34:32 +0000 |
---|---|---|
committer | Jordan Rose <jordan_rose@apple.com> | 2013-03-18 23:34:32 +0000 |
commit | 85a92cfa52ddf4c45fe2baca4d7fea0bdc5ed103 (patch) | |
tree | 521579fc9d967f58a08a4f05a06d0d839c76f0a9 /include/clang/StaticAnalyzer/Core | |
parent | 2317dc8842e7b5ad0dc56723ff45ab2cf73abb35 (diff) |
[analyzer] Replace uses of assume() with isNull() in BR visitors.
Also, replace a std::string with a SmallString.
No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177352 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/StaticAnalyzer/Core')
-rw-r--r-- | include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitor.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitor.h b/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitor.h index aad2ab1772..eb026f36ff 100644 --- a/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitor.h +++ b/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitor.h @@ -129,12 +129,14 @@ class TrackConstraintBRVisitor : public BugReporterVisitorImpl<TrackConstraintBRVisitor> { DefinedSVal Constraint; - const bool Assumption; - bool isSatisfied; + bool Assumption; + bool IsSatisfied; + bool IsZeroCheck; public: TrackConstraintBRVisitor(DefinedSVal constraint, bool assumption) - : Constraint(constraint), Assumption(assumption), isSatisfied(false) {} + : Constraint(constraint), Assumption(assumption), IsSatisfied(false), + IsZeroCheck(!Assumption && Constraint.getAs<Loc>()) {} void Profile(llvm::FoldingSetNodeID &ID) const; @@ -146,6 +148,11 @@ public: const ExplodedNode *PrevN, BugReporterContext &BRC, BugReport &BR); + +private: + /// Checks if the constraint is valid in the current state. + bool isUnderconstrained(const ExplodedNode *N) const; + }; class NilReceiverBRVisitor |