aboutsummaryrefslogtreecommitdiff
path: root/include/clang/StaticAnalyzer/Core/Checker.h
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2013-02-08 23:55:50 +0000
committerAnna Zaks <ganna@apple.com>2013-02-08 23:55:50 +0000
commitadecec39481f925701e63d7fe3b8bf02dd7ddf01 (patch)
treec28d72c73fb8b614210a48ba3155c8c4aab10652 /include/clang/StaticAnalyzer/Core/Checker.h
parent722cd9e3c0142948b9eb3190211dbc0dd4da4105 (diff)
[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
Diffstat (limited to 'include/clang/StaticAnalyzer/Core/Checker.h')
-rw-r--r--include/clang/StaticAnalyzer/Core/Checker.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/clang/StaticAnalyzer/Core/Checker.h b/include/clang/StaticAnalyzer/Core/Checker.h
index 82bac7dd07..305ae2579d 100644
--- a/include/clang/StaticAnalyzer/Core/Checker.h
+++ b/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