clang API Documentation

Public Member Functions | Friends
clang::threadSafety::BuildLockset Class Reference

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. FIXME: In future, we may be able to not inherit from a visitor. More...

Inheritance diagram for clang::threadSafety::BuildLockset:
Inheritance graph
[legend]
Collaboration diagram for clang::threadSafety::BuildLockset:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 BuildLockset (ThreadSafetyAnalyzer *Anlzr, CFGBlockInfo &Info)
void VisitUnaryOperator (UnaryOperator *UO)
 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 VisitBinaryOperator (BinaryOperator *BO)
void VisitCastExpr (CastExpr *CE)
void VisitCallExpr (CallExpr *Exp)
void VisitCXXConstructExpr (CXXConstructExpr *Exp)
void VisitDeclStmt (DeclStmt *S)

Friends

class ThreadSafetyAnalyzer

Detailed Description

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. FIXME: In future, we may be able to not inherit from a visitor.

Definition at line 1273 of file ThreadSafety.cpp.


Constructor & Destructor Documentation

Definition at line 1296 of file ThreadSafety.cpp.


Member Function Documentation

For binary operations which assign to a variable (writes), we need to check whether we hold any required mutexes. FIXME: Deal with non-primitive types.

Definition at line 1655 of file ThreadSafety.cpp.

References clang::threadSafety::AK_Written, clang::BinaryOperator::getLHS(), clang::threadSafety::LocalVariableMap::getNextContext(), and clang::BinaryOperator::isAssignmentOp().

Whenever we do an LValue to Rvalue cast, we are reading a variable and need to ensure we hold any required mutexes. FIXME: Deal with non-primitive types.

Definition at line 1669 of file ThreadSafety.cpp.

References clang::threadSafety::AK_Read, clang::CK_LValueToRValue, clang::CastExpr::getCastKind(), and clang::CastExpr::getSubExpr().

For unary operations which read and write a variable, we need to check whether we hold any required mutexes. Reads are checked in VisitCastExpr.

Definition at line 1638 of file ThreadSafety.cpp.

References clang::threadSafety::AK_Written, clang::UnaryOperator::getOpcode(), clang::UnaryOperator::getSubExpr(), clang::UO_PostDec, clang::UO_PostInc, clang::UO_PreDec, and clang::UO_PreInc.


Friends And Related Function Documentation

friend class ThreadSafetyAnalyzer [friend]

Definition at line 1274 of file ThreadSafety.cpp.


The documentation for this class was generated from the following file: