Bläddra i källkod

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174782 91177308-0d34-0410-b5e6-96231b3b80d8
Anna Zaks 12 år sedan
förälder
incheckning
adecec3948

+ 8 - 0
include/clang/StaticAnalyzer/Core/Checker.h

@@ -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

+ 0 - 8
include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h

@@ -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

+ 0 - 7
lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp

@@ -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;

+ 0 - 7
lib/StaticAnalyzer/Checkers/IvarInvalidationChecker.cpp

@@ -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.