clang 22.0.0git
clang::threadSafety::SExprBuilder Class Reference

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

Classes

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

Public Member Functions

 SExprBuilder (til::MemRegionRef A)
til::LiteralPtrcreateThisPlaceholder ()
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::SExprtranslateVariable (const VarDecl *VD, CallingContext *Ctx)
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 ()
void setLookupLocalVarExpr (std::function< const Expr *(const NamedDecl *)> F)

Friends

class CFGWalker

Detailed Description

Definition at line 350 of file ThreadSafetyCommon.h.

Constructor & Destructor Documentation

◆ SExprBuilder()

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

Definition at line 384 of file ThreadSafetyCommon.h.

References clang::threadSafety::til::Variable::VK_SFun.

Member Function Documentation

◆ buildCFG()

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

◆ createThisPlaceholder()

til::LiteralPtr * clang::threadSafety::SExprBuilder::createThisPlaceholder ( )
inline

Definition at line 391 of file ThreadSafetyCommon.h.

◆ getCFG() [1/2]

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

Definition at line 419 of file ThreadSafetyCommon.h.

◆ getCFG() [2/2]

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

Definition at line 418 of file ThreadSafetyCommon.h.

◆ lookupBlock()

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

Definition at line 414 of file ThreadSafetyCommon.h.

References clang::CFGBlock::getBlockID().

◆ lookupStmt()

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

Definition at line 104 of file ThreadSafetyCommon.cpp.

Referenced by translate().

◆ setLookupLocalVarExpr()

void clang::threadSafety::SExprBuilder::setLookupLocalVarExpr ( std::function< const Expr *(const NamedDecl *)> F)
inline

Definition at line 421 of file ThreadSafetyCommon.h.

References std::function.

◆ translate()

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

◆ 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 198 of file ThreadSafetyCommon.cpp.

References clang::threadSafety::til::CAST_objToPtr, clang::Expr::getType(), clang::Expr::IgnoreImplicit(), clang::isa(), 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.

Parameters
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 125 of file ThreadSafetyCommon.cpp.

References clang::cast(), clang::threadSafety::SExprBuilder::CallingContext::FunArgs, clang::isa(), isCalleeArrow(), clang::threadSafety::SExprBuilder::CallingContext::NumArgs, clang::Self, clang::threadSafety::SExprBuilder::CallingContext::SelfArg, clang::threadSafety::SExprBuilder::CallingContext::SelfArrow, and translateAttrExpr().

Referenced by translateAttrExpr().

◆ translateVariable()

◆ CFGWalker

friend class CFGWalker
friend

Definition at line 427 of file ThreadSafetyCommon.h.

References clang::C, and CFGWalker.

Referenced by buildCFG(), and CFGWalker.


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