[analyzer] Move DefaultBool so that all checkers can share it.

llvm-svn: 174782
This commit is contained in:
Anna Zaks 2013-02-08 23:55:50 +00:00
parent 91a5fdf83a
commit 0d8779cb79
4 changed files with 8 additions and 22 deletions

View File

@ -471,6 +471,14 @@ struct ImplicitNullDerefEvent {
BugReporter *BR;
};
/// \brief A helper class which wraps a boolean value set to false by default.
struct DefaultBool {
bool val;
DefaultBool() : val(false) {}
operator bool() const { return val; }
DefaultBool &operator=(bool b) { val = b; return *this; }
};
} // end ento namespace
} // end clang namespace

View File

@ -303,14 +303,6 @@ private:
}
};
/// \brief A helper class which wraps a boolean value set to false by default.
struct DefaultBool {
bool Val;
DefaultBool() : Val(false) {}
operator bool() const { return Val; }
DefaultBool &operator=(bool b) { Val = b; return *this; }
};
} // end GR namespace
} // end clang namespace

View File

@ -36,13 +36,6 @@ static bool isArc4RandomAvailable(const ASTContext &Ctx) {
}
namespace {
struct DefaultBool {
bool val;
DefaultBool() : val(false) {}
operator bool() const { return val; }
DefaultBool &operator=(bool b) { val = b; return *this; }
};
struct ChecksFilter {
DefaultBool check_gets;
DefaultBool check_getpw;

View File

@ -43,13 +43,6 @@ using namespace clang;
using namespace ento;
namespace {
// TODO: move this somewhere?
struct DefaultBool {
bool val;
DefaultBool() : val(false) {}
operator bool() const { return val; }
DefaultBool &operator=(bool b) { val = b; return *this; }
};
struct ChecksFilter {
/// Check for missing invalidation method declarations.