diff options
Diffstat (limited to 'include/clang/Analysis/Analyses')
-rw-r--r-- | include/clang/Analysis/Analyses/Dominators.h | 7 | ||||
-rw-r--r-- | include/clang/Analysis/Analyses/FormatString.h | 4 | ||||
-rw-r--r-- | include/clang/Analysis/Analyses/LiveVariables.h | 2 | ||||
-rw-r--r-- | include/clang/Analysis/Analyses/ThreadSafety.h | 23 | ||||
-rw-r--r-- | include/clang/Analysis/Analyses/UninitializedValues.h | 5 |
5 files changed, 24 insertions, 17 deletions
diff --git a/include/clang/Analysis/Analyses/Dominators.h b/include/clang/Analysis/Analyses/Dominators.h index e9a431a..2a806c8 100644 --- a/include/clang/Analysis/Analyses/Dominators.h +++ b/include/clang/Analysis/Analyses/Dominators.h @@ -15,12 +15,11 @@ #define LLVM_CLANG_DOMINATORS_H #include "clang/Analysis/AnalysisContext.h" - -#include "llvm/Module.h" -#include "llvm/ADT/GraphTraits.h" #include "clang/Analysis/CFG.h" -#include "llvm/Analysis/Dominators.h" +#include "llvm/ADT/GraphTraits.h" #include "llvm/Analysis/DominatorInternals.h" +#include "llvm/Analysis/Dominators.h" +#include "llvm/IR/Module.h" namespace clang { diff --git a/include/clang/Analysis/Analyses/FormatString.h b/include/clang/Analysis/Analyses/FormatString.h index 5cb9731..4bd989c 100644 --- a/include/clang/Analysis/Analyses/FormatString.h +++ b/include/clang/Analysis/Analyses/FormatString.h @@ -201,7 +201,7 @@ public: bool isPrintfKind() const { return IsPrintf; } - llvm::Optional<ConversionSpecifier> getStandardSpecifier() const; + Optional<ConversionSpecifier> getStandardSpecifier() const; protected: bool IsPrintf; @@ -361,7 +361,7 @@ public: bool hasStandardLengthModifier() const; - llvm::Optional<LengthModifier> getCorrectedLengthModifier() const; + Optional<LengthModifier> getCorrectedLengthModifier() const; bool hasStandardConversionSpecifier(const LangOptions &LangOpt) const; diff --git a/include/clang/Analysis/Analyses/LiveVariables.h b/include/clang/Analysis/Analyses/LiveVariables.h index c9f39b4..bbd2b02 100644 --- a/include/clang/Analysis/Analyses/LiveVariables.h +++ b/include/clang/Analysis/Analyses/LiveVariables.h @@ -14,8 +14,8 @@ #ifndef LLVM_CLANG_LIVEVARIABLES_H #define LLVM_CLANG_LIVEVARIABLES_H -#include "clang/Analysis/AnalysisContext.h" #include "clang/AST/Decl.h" +#include "clang/Analysis/AnalysisContext.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/ImmutableSet.h" diff --git a/include/clang/Analysis/Analyses/ThreadSafety.h b/include/clang/Analysis/Analyses/ThreadSafety.h index ef6b821..8a888e6 100644 --- a/include/clang/Analysis/Analyses/ThreadSafety.h +++ b/include/clang/Analysis/Analyses/ThreadSafety.h @@ -29,24 +29,24 @@ namespace thread_safety { /// This enum distinguishes between different kinds of operations that may /// need to be protected by locks. We use this enum in error handling. enum ProtectedOperationKind { - POK_VarDereference, /// Dereferencing a variable (e.g. p in *p = 5;) - POK_VarAccess, /// Reading or writing a variable (e.g. x in x = 5;) - POK_FunctionCall /// Making a function call (e.g. fool()) + POK_VarDereference, ///< Dereferencing a variable (e.g. p in *p = 5;) + POK_VarAccess, ///< Reading or writing a variable (e.g. x in x = 5;) + POK_FunctionCall ///< Making a function call (e.g. fool()) }; /// This enum distinguishes between different kinds of lock actions. For /// example, it is an error to write a variable protected by shared version of a /// mutex. enum LockKind { - LK_Shared, /// Shared/reader lock of a mutex - LK_Exclusive /// Exclusive/writer lock of a mutex + LK_Shared, ///< Shared/reader lock of a mutex. + LK_Exclusive ///< Exclusive/writer lock of a mutex. }; /// This enum distinguishes between different ways to access (read or write) a /// variable. enum AccessKind { - AK_Read, /// Reading a variable - AK_Written /// Writing a variable + AK_Read, ///< Reading a variable. + AK_Written ///< Writing a variable. }; /// This enum distinguishes between different situations where we warn due to @@ -67,7 +67,8 @@ enum LockErrorKind { /// Handler class for thread safety warnings. class ThreadSafetyHandler { public: - typedef llvm::StringRef Name; + typedef 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. diff --git a/include/clang/Analysis/Analyses/UninitializedValues.h b/include/clang/Analysis/Analyses/UninitializedValues.h index 45ce4de..e8810c3 100644 --- a/include/clang/Analysis/Analyses/UninitializedValues.h +++ b/include/clang/Analysis/Analyses/UninitializedValues.h @@ -15,6 +15,7 @@ #ifndef LLVM_CLANG_UNINIT_VALS_H #define LLVM_CLANG_UNINIT_VALS_H +#include "clang/AST/Stmt.h" #include "llvm/ADT/SmallVector.h" namespace clang { @@ -42,7 +43,7 @@ private: /// This use is always uninitialized if it occurs after any of these branches /// is taken. - llvm::SmallVector<Branch, 2> UninitBranches; + SmallVector<Branch, 2> UninitBranches; public: UninitUse(const Expr *User, bool AlwaysUninit) : @@ -71,7 +72,7 @@ public: !branch_empty() ? Sometimes : Maybe; } - typedef llvm::SmallVectorImpl<Branch>::const_iterator branch_iterator; + typedef SmallVectorImpl<Branch>::const_iterator branch_iterator; /// Branches which inevitably result in the variable being used uninitialized. branch_iterator branch_begin() const { return UninitBranches.begin(); } branch_iterator branch_end() const { return UninitBranches.end(); } |