clang 18.0.0git
Classes | Public Member Functions | Friends | List of all members
clang::threadSafety::SExprBuilder Class Reference

#include "clang/Analysis/Analyses/ThreadSafetyCommon.h"


struct  CallingContext
 Encapsulates the lexical context of a function call. More...

Public Member Functions

 SExprBuilder (til::MemRegionRef A)
CapabilityExpr translateAttrExpr (const Expr *AttrExp, const NamedDecl *D, const Expr *DeclExp, til::SExpr *Self=nullptr)
 Translate a clang expression in an attribute to a til::SExpr.
CapabilityExpr translateAttrExpr (const Expr *AttrExp, CallingContext *Ctx)
 Translate a clang expression in an attribute to a til::SExpr.
til::LiteralPtrcreateVariable (const VarDecl *VD)
std::pair< til::LiteralPtr *, StringRef > createThisPlaceholder (const Expr *Exp)
til::SExprtranslate (const Stmt *S, CallingContext *Ctx)
til::SCFGbuildCFG (CFGWalker &Walker)
til::SExprlookupStmt (const Stmt *S)
til::BasicBlocklookupBlock (const CFGBlock *B)
const til::SCFGgetCFG () const
til::SCFGgetCFG ()


class CFGWalker

Detailed Description

Definition at line 339 of file ThreadSafetyCommon.h.

Constructor & Destructor Documentation

◆ SExprBuilder()

clang::threadSafety::SExprBuilder::SExprBuilder ( til::MemRegionRef  A)

Member Function Documentation

◆ buildCFG()

til::SCFG * SExprBuilder::buildCFG ( CFGWalker Walker)

Definition at line 74 of file ThreadSafetyCommon.cpp.

References clang::threadSafety::CFGWalker::walk().

◆ createThisPlaceholder()

std::pair< til::LiteralPtr *, StringRef > SExprBuilder::createThisPlaceholder ( const Expr Exp)

Definition at line 224 of file ThreadSafetyCommon.cpp.

References ClassifyDiagnostic(), and clang::Expr::getType().

◆ createVariable()

til::LiteralPtr * SExprBuilder::createVariable ( const VarDecl VD)

Definition at line 219 of file ThreadSafetyCommon.cpp.

◆ getCFG() [1/2]

til::SCFG * clang::threadSafety::SExprBuilder::getCFG ( )

Definition at line 407 of file ThreadSafetyCommon.h.

◆ getCFG() [2/2]

const til::SCFG * clang::threadSafety::SExprBuilder::getCFG ( ) const

Definition at line 406 of file ThreadSafetyCommon.h.

◆ lookupBlock()

til::BasicBlock * clang::threadSafety::SExprBuilder::lookupBlock ( const CFGBlock B)

Definition at line 402 of file ThreadSafetyCommon.h.

References clang::CFGBlock::getBlockID().

◆ lookupStmt()

til::SExpr * SExprBuilder::lookupStmt ( const Stmt S)

Definition at line 72 of file ThreadSafetyCommon.cpp.

Referenced by translate().

◆ translate()

til::SExpr * SExprBuilder::translate ( const Stmt S,
CallingContext Ctx 

Definition at line 232 of file ThreadSafetyCommon.cpp.

References lookupStmt(), and translate().

Referenced by translate(), and translateAttrExpr().

◆ translateAttrExpr() [1/2]

CapabilityExpr SExprBuilder::translateAttrExpr ( const Expr AttrExp,
CallingContext Ctx 

Translate a clang expression in an attribute to a til::SExpr.

Definition at line 172 of file ThreadSafetyCommon.cpp.

References clang::threadSafety::til::CAST_objToPtr, ClassifyDiagnostic(), clang::Expr::getType(), and translate().

◆ translateAttrExpr() [2/2]

CapabilityExpr SExprBuilder::translateAttrExpr ( const Expr AttrExp,
const NamedDecl D,
const Expr DeclExp,
til::SExpr Self = nullptr 

Translate a clang expression in an attribute to a til::SExpr.

Constructs the context from D, DeclExp, and SelfDecl.

AttrExpThe expression to translate.
DThe declaration to which the attribute is attached.
DeclExpAn expression involving the Decl to which the attribute is attached. E.g. the call to a function.
SelfS-expression to substitute for a CXXThisExpr in a call, or argument to a cleanup function.

Definition at line 115 of file ThreadSafetyCommon.cpp.

References ClassifyDiagnostic(), clang::threadSafety::SExprBuilder::CallingContext::FunArgs, getThisObjectType(), isCalleeArrow(), clang::threadSafety::SExprBuilder::CallingContext::NumArgs, clang::threadSafety::SExprBuilder::CallingContext::SelfArg, clang::threadSafety::SExprBuilder::CallingContext::SelfArrow, and translateAttrExpr().

Referenced by translateAttrExpr().

Friends And Related Function Documentation

◆ CFGWalker

friend class CFGWalker

Definition at line 411 of file ThreadSafetyCommon.h.

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