diff options
author | DeLesley Hutchins <delesley@google.com> | 2012-12-05 00:06:15 +0000 |
---|---|---|
committer | DeLesley Hutchins <delesley@google.com> | 2012-12-05 00:06:15 +0000 |
commit | fb4afc2fc659faff43a6df4c1d0e07df9c90479d (patch) | |
tree | a8e70a47a3f26e8f6bf6989b29042a95d5360985 /include/clang/Analysis/Analyses/ThreadSafety.h | |
parent | 1d1539875bc0a00935ffb41e27a8fd327054c006 (diff) |
Thread safety analysis: Add a new "beta" warning flag: -Wthread-safety-beta.
As the analysis improves, it will continue to add new warnings that are
potentially disruptive to existing users. From now on, such warnings will
first be introduced under the "beta" flag. Such warnings are not turned on by
default; their purpose is to allow users to test their code against future
planned changes, before those changes are actually made. After a suitable
migration period, beta warnings will be folded into the standard
-Wthread-safety.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169338 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Analysis/Analyses/ThreadSafety.h')
-rw-r--r-- | include/clang/Analysis/Analyses/ThreadSafety.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/clang/Analysis/Analyses/ThreadSafety.h b/include/clang/Analysis/Analyses/ThreadSafety.h index ef6b821e39..f7f12d4820 100644 --- a/include/clang/Analysis/Analyses/ThreadSafety.h +++ b/include/clang/Analysis/Analyses/ThreadSafety.h @@ -68,6 +68,7 @@ enum LockErrorKind { class ThreadSafetyHandler { public: typedef llvm::StringRef Name; + ThreadSafetyHandler() : IssueBetaWarnings(false) { } virtual ~ThreadSafetyHandler(); /// Warn about lock expressions which fail to resolve to lockable objects. @@ -143,6 +144,12 @@ public: /// \param Loc -- The location of the function call. virtual void handleFunExcludesLock(Name FunName, Name LockName, SourceLocation Loc) {} + + bool issueBetaWarnings() { return IssueBetaWarnings; } + void setIssueBetaWarnings(bool b) { IssueBetaWarnings = b; } + +private: + bool IssueBetaWarnings; }; /// \brief Check a function's CFG for thread-safety violations. |