diff options
Diffstat (limited to 'clang/lib/Analysis/ThreadSafety.cpp')
-rw-r--r-- | clang/lib/Analysis/ThreadSafety.cpp | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/clang/lib/Analysis/ThreadSafety.cpp b/clang/lib/Analysis/ThreadSafety.cpp index 0456df20ac7..8895dec02b9 100644 --- a/clang/lib/Analysis/ThreadSafety.cpp +++ b/clang/lib/Analysis/ThreadSafety.cpp @@ -86,11 +86,11 @@ static void warnInvalidLock(ThreadSafetyHandler &Handler, namespace { -/// \brief A set of CapabilityInfo objects, which are compiled from the +/// A set of CapabilityInfo objects, which are compiled from the /// requires attributes on a function. class CapExprSet : public SmallVector<CapabilityExpr, 4> { public: - /// \brief Push M onto list, but discard duplicates. + /// Push M onto list, but discard duplicates. void push_back_nodup(const CapabilityExpr &CapE) { iterator It = std::find_if(begin(), end(), [=](const CapabilityExpr &CapE2) { @@ -104,7 +104,7 @@ public: class FactManager; class FactSet; -/// \brief This is a helper class that stores a fact that is known at a +/// This is a helper class that stores a fact that is known at a /// particular point in program execution. Currently, a fact is a capability, /// along with additional information, such as where it was acquired, whether /// it is exclusive or shared, etc. @@ -157,7 +157,7 @@ public: using FactID = unsigned short; -/// \brief FactManager manages the memory for all facts that are created during +/// FactManager manages the memory for all facts that are created during /// the analysis of a single routine. class FactManager { private: @@ -173,7 +173,7 @@ public: FactEntry &operator[](FactID F) { return *Facts[F]; } }; -/// \brief A FactSet is the set of facts that are known to be true at a +/// A FactSet is the set of facts that are known to be true at a /// particular program point. FactSets must be small, because they are /// frequently copied, and are thus implemented as a set of indices into a /// table maintained by a FactManager. A typical FactSet only holds 1 or 2 @@ -948,7 +948,7 @@ public: } }; -/// \brief Class which implements the core thread safety analysis routines. +/// Class which implements the core thread safety analysis routines. class ThreadSafetyAnalyzer { friend class BuildLockset; friend class threadSafety::BeforeSet; @@ -1130,7 +1130,7 @@ void BeforeSet::checkBeforeAfter(const ValueDecl* StartVd, Info->Visited = 0; } -/// \brief Gets the value decl pointer from DeclRefExprs or MemberExprs. +/// Gets the value decl pointer from DeclRefExprs or MemberExprs. static const ValueDecl *getValueDecl(const Expr *Exp) { if (const auto *CE = dyn_cast<ImplicitCastExpr>(Exp)) return getValueDecl(CE->getSubExpr()); @@ -1223,7 +1223,7 @@ bool ThreadSafetyAnalyzer::inCurrentScope(const CapabilityExpr &CapE) { return false; } -/// \brief Add a new lock to the lockset, warning if the lock is already there. +/// Add a new lock to the lockset, warning if the lock is already there. /// \param ReqAttr -- true if this is part of an initial Requires attribute. void ThreadSafetyAnalyzer::addLock(FactSet &FSet, std::unique_ptr<FactEntry> Entry, @@ -1261,7 +1261,7 @@ void ThreadSafetyAnalyzer::addLock(FactSet &FSet, } } -/// \brief Remove a lock from the lockset, warning if the lock is not there. +/// Remove a lock from the lockset, warning if the lock is not there. /// \param UnlockLoc The source location of the unlock (only used in error msg) void ThreadSafetyAnalyzer::removeLock(FactSet &FSet, const CapabilityExpr &Cp, SourceLocation UnlockLoc, @@ -1287,7 +1287,7 @@ void ThreadSafetyAnalyzer::removeLock(FactSet &FSet, const CapabilityExpr &Cp, DiagKind); } -/// \brief Extract the list of mutexIDs from the attribute on an expression, +/// Extract the list of mutexIDs from the attribute on an expression, /// and push them onto Mtxs, discarding any duplicates. template <typename AttrType> void ThreadSafetyAnalyzer::getMutexIDs(CapExprSet &Mtxs, AttrType *Attr, @@ -1318,7 +1318,7 @@ void ThreadSafetyAnalyzer::getMutexIDs(CapExprSet &Mtxs, AttrType *Attr, } } -/// \brief Extract the list of mutexIDs from a trylock attribute. If the +/// Extract the list of mutexIDs from a trylock attribute. If the /// trylock applies to the given edge, then push them onto Mtxs, discarding /// any duplicates. template <class AttrType> @@ -1418,7 +1418,7 @@ const CallExpr* ThreadSafetyAnalyzer::getTrylockCallExpr(const Stmt *Cond, return nullptr; } -/// \brief Find the lockset that holds on the edge between PredBlock +/// Find the lockset that holds on the edge between PredBlock /// and CurrBlock. The edge set is the exit set of PredBlock (passed /// as the ExitSet parameter) plus any trylocks, which are conditionally held. void ThreadSafetyAnalyzer::getEdgeLockset(FactSet& Result, @@ -1491,7 +1491,7 @@ void ThreadSafetyAnalyzer::getEdgeLockset(FactSet& Result, namespace { -/// \brief We use this class to visit different types of expressions in +/// We use this class to visit different types of expressions in /// CFGBlocks, and build up the lockset. /// An expression may cause us to add or remove locks from the lockset, or else /// output error messages related to missing locks. @@ -1533,7 +1533,7 @@ public: } // namespace -/// \brief Warn if the LSet does not contain a lock sufficient to protect access +/// Warn if the LSet does not contain a lock sufficient to protect access /// of at least the passed in AccessKind. void BuildLockset::warnIfMutexNotHeld(const NamedDecl *D, const Expr *Exp, AccessKind AK, Expr *MutexExp, @@ -1597,7 +1597,7 @@ void BuildLockset::warnIfMutexNotHeld(const NamedDecl *D, const Expr *Exp, } } -/// \brief Warn if the LSet contains the given lock. +/// Warn if the LSet contains the given lock. void BuildLockset::warnIfMutexHeld(const NamedDecl *D, const Expr *Exp, Expr *MutexExp, StringRef DiagKind) { CapabilityExpr Cp = Analyzer->SxBuilder.translateAttrExpr(MutexExp, D, Exp); @@ -1615,7 +1615,7 @@ void BuildLockset::warnIfMutexHeld(const NamedDecl *D, const Expr *Exp, } } -/// \brief Checks guarded_by and pt_guarded_by attributes. +/// Checks guarded_by and pt_guarded_by attributes. /// Whenever we identify an access (read or write) to a DeclRefExpr that is /// marked with guarded_by, we must ensure the appropriate mutexes are held. /// Similarly, we check if the access is to an expression that dereferences @@ -1671,7 +1671,7 @@ void BuildLockset::checkAccess(const Expr *Exp, AccessKind AK, ClassifyDiagnostic(I), Loc); } -/// \brief Checks pt_guarded_by and pt_guarded_var attributes. +/// Checks pt_guarded_by and pt_guarded_var attributes. /// POK is the same operationKind that was passed to checkAccess. void BuildLockset::checkPtAccess(const Expr *Exp, AccessKind AK, ProtectedOperationKind POK) { @@ -1710,7 +1710,7 @@ void BuildLockset::checkPtAccess(const Expr *Exp, AccessKind AK, ClassifyDiagnostic(I), Exp->getExprLoc()); } -/// \brief Process a function call, method call, constructor call, +/// Process a function call, method call, constructor call, /// or destructor call. This involves looking at the attributes on the /// corresponding function/method/constructor/destructor, issuing warnings, /// and updating the locksets accordingly. @@ -1876,7 +1876,7 @@ void BuildLockset::handleCall(Expr *Exp, const NamedDecl *D, VarDecl *VD) { Analyzer->removeLock(FSet, M, Loc, Dtor, LK_Generic, CapDiagKind); } -/// \brief For unary operations which read and write a variable, we need to +/// For unary operations which read and write a variable, we need to /// check whether we hold any required mutexes. Reads are checked in /// VisitCastExpr. void BuildLockset::VisitUnaryOperator(UnaryOperator *UO) { @@ -2089,7 +2089,7 @@ void BuildLockset::VisitDeclStmt(DeclStmt *S) { } } -/// \brief Compute the intersection of two locksets and issue warnings for any +/// Compute the intersection of two locksets and issue warnings for any /// locks in the symmetric difference. /// /// This function is used at a merge point in the CFG when comparing the lockset @@ -2166,7 +2166,7 @@ static bool neverReturns(const CFGBlock *B) { return false; } -/// \brief Check a function's CFG for thread-safety violations. +/// Check a function's CFG for thread-safety violations. /// /// We traverse the blocks in the CFG, compute the set of mutexes that are held /// at the end of each block, and issue warnings for thread safety violations. @@ -2462,7 +2462,7 @@ void ThreadSafetyAnalyzer::runAnalysis(AnalysisDeclContext &AC) { Handler.leaveFunction(CurrentFunction); } -/// \brief Check a function's CFG for thread-safety violations. +/// Check a function's CFG for thread-safety violations. /// /// We traverse the blocks in the CFG, compute the set of mutexes that are held /// at the end of each block, and issue warnings for thread safety violations. @@ -2478,7 +2478,7 @@ void threadSafety::runThreadSafetyAnalysis(AnalysisDeclContext &AC, void threadSafety::threadSafetyCleanup(BeforeSet *Cache) { delete Cache; } -/// \brief Helper function that returns a LockKind required for the given level +/// Helper function that returns a LockKind required for the given level /// of access. LockKind threadSafety::getLockKindFromAccessKind(AccessKind AK) { switch (AK) { |