|
@@ -37,6 +37,9 @@ class PathDiagnosticPiece;
|
|
/// will have to provide your own implementation.)
|
|
/// will have to provide your own implementation.)
|
|
class BugReporterVisitor : public llvm::FoldingSetNode {
|
|
class BugReporterVisitor : public llvm::FoldingSetNode {
|
|
public:
|
|
public:
|
|
|
|
+ BugReporterVisitor() = default;
|
|
|
|
+ BugReporterVisitor(const BugReporterVisitor &) = default;
|
|
|
|
+ BugReporterVisitor(BugReporterVisitor &&) = default;
|
|
virtual ~BugReporterVisitor();
|
|
virtual ~BugReporterVisitor();
|
|
|
|
|
|
/// \brief Returns a copy of this BugReporter.
|
|
/// \brief Returns a copy of this BugReporter.
|
|
@@ -92,9 +95,8 @@ class BugReporterVisitorImpl : public BugReporterVisitor {
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
-class FindLastStoreBRVisitor
|
|
|
|
- : public BugReporterVisitorImpl<FindLastStoreBRVisitor>
|
|
|
|
-{
|
|
|
|
|
|
+class FindLastStoreBRVisitor final
|
|
|
|
+ : public BugReporterVisitorImpl<FindLastStoreBRVisitor> {
|
|
const MemRegion *R;
|
|
const MemRegion *R;
|
|
SVal V;
|
|
SVal V;
|
|
bool Satisfied;
|
|
bool Satisfied;
|
|
@@ -124,9 +126,8 @@ public:
|
|
BugReport &BR) override;
|
|
BugReport &BR) override;
|
|
};
|
|
};
|
|
|
|
|
|
-class TrackConstraintBRVisitor
|
|
|
|
- : public BugReporterVisitorImpl<TrackConstraintBRVisitor>
|
|
|
|
-{
|
|
|
|
|
|
+class TrackConstraintBRVisitor final
|
|
|
|
+ : public BugReporterVisitorImpl<TrackConstraintBRVisitor> {
|
|
DefinedSVal Constraint;
|
|
DefinedSVal Constraint;
|
|
bool Assumption;
|
|
bool Assumption;
|
|
bool IsSatisfied;
|
|
bool IsSatisfied;
|
|
@@ -161,8 +162,8 @@ private:
|
|
|
|
|
|
/// \class NilReceiverBRVisitor
|
|
/// \class NilReceiverBRVisitor
|
|
/// \brief Prints path notes when a message is sent to a nil receiver.
|
|
/// \brief Prints path notes when a message is sent to a nil receiver.
|
|
-class NilReceiverBRVisitor
|
|
|
|
- : public BugReporterVisitorImpl<NilReceiverBRVisitor> {
|
|
|
|
|
|
+class NilReceiverBRVisitor final
|
|
|
|
+ : public BugReporterVisitorImpl<NilReceiverBRVisitor> {
|
|
public:
|
|
public:
|
|
|
|
|
|
void Profile(llvm::FoldingSetNodeID &ID) const override {
|
|
void Profile(llvm::FoldingSetNodeID &ID) const override {
|
|
@@ -181,7 +182,8 @@ public:
|
|
};
|
|
};
|
|
|
|
|
|
/// Visitor that tries to report interesting diagnostics from conditions.
|
|
/// Visitor that tries to report interesting diagnostics from conditions.
|
|
-class ConditionBRVisitor : public BugReporterVisitorImpl<ConditionBRVisitor> {
|
|
|
|
|
|
+class ConditionBRVisitor final
|
|
|
|
+ : public BugReporterVisitorImpl<ConditionBRVisitor> {
|
|
public:
|
|
public:
|
|
void Profile(llvm::FoldingSetNodeID &ID) const override {
|
|
void Profile(llvm::FoldingSetNodeID &ID) const override {
|
|
static int x = 0;
|
|
static int x = 0;
|
|
@@ -247,8 +249,8 @@ public:
|
|
/// \brief Suppress reports that might lead to known false positives.
|
|
/// \brief Suppress reports that might lead to known false positives.
|
|
///
|
|
///
|
|
/// Currently this suppresses reports based on locations of bugs.
|
|
/// Currently this suppresses reports based on locations of bugs.
|
|
-class LikelyFalsePositiveSuppressionBRVisitor
|
|
|
|
- : public BugReporterVisitorImpl<LikelyFalsePositiveSuppressionBRVisitor> {
|
|
|
|
|
|
+class LikelyFalsePositiveSuppressionBRVisitor final
|
|
|
|
+ : public BugReporterVisitorImpl<LikelyFalsePositiveSuppressionBRVisitor> {
|
|
public:
|
|
public:
|
|
static void *getTag() {
|
|
static void *getTag() {
|
|
static int Tag = 0;
|
|
static int Tag = 0;
|
|
@@ -276,8 +278,8 @@ public:
|
|
///
|
|
///
|
|
/// As a result, BugReporter will not prune the path through the function even
|
|
/// As a result, BugReporter will not prune the path through the function even
|
|
/// if the region's contents are not modified/accessed by the call.
|
|
/// if the region's contents are not modified/accessed by the call.
|
|
-class UndefOrNullArgVisitor
|
|
|
|
- : public BugReporterVisitorImpl<UndefOrNullArgVisitor> {
|
|
|
|
|
|
+class UndefOrNullArgVisitor final
|
|
|
|
+ : public BugReporterVisitorImpl<UndefOrNullArgVisitor> {
|
|
|
|
|
|
/// The interesting memory region this visitor is tracking.
|
|
/// The interesting memory region this visitor is tracking.
|
|
const MemRegion *R;
|
|
const MemRegion *R;
|
|
@@ -297,9 +299,8 @@ public:
|
|
BugReport &BR) override;
|
|
BugReport &BR) override;
|
|
};
|
|
};
|
|
|
|
|
|
-class SuppressInlineDefensiveChecksVisitor
|
|
|
|
-: public BugReporterVisitorImpl<SuppressInlineDefensiveChecksVisitor>
|
|
|
|
-{
|
|
|
|
|
|
+class SuppressInlineDefensiveChecksVisitor final
|
|
|
|
+ : public BugReporterVisitorImpl<SuppressInlineDefensiveChecksVisitor> {
|
|
/// The symbolic value for which we are tracking constraints.
|
|
/// The symbolic value for which we are tracking constraints.
|
|
/// This value is constrained to null in the end of path.
|
|
/// This value is constrained to null in the end of path.
|
|
DefinedSVal V;
|
|
DefinedSVal V;
|