|
clang 22.0.0git
|
A named variable, e.g. More...
#include "clang/Analysis/Analyses/ThreadSafetyTIL.h"
Public Types | |
| enum | VariableKind { VK_Let , VK_Fun , VK_SFun } |
Public Member Functions | |
| Variable (StringRef s, SExpr *D=nullptr) | |
| Variable (SExpr *D, const ValueDecl *Cvd=nullptr) | |
| Variable (const Variable &Vd, SExpr *D) | |
| VariableKind | kind () const |
| Return the kind of variable (let, function param, or self) | |
| StringRef | name () const |
| Return the name of the variable, if any. | |
| const ValueDecl * | clangDecl () const |
| Return the clang declaration for this variable, if any. | |
| SExpr * | definition () |
| Return the definition of the variable. | |
| const SExpr * | definition () const |
| void | setName (StringRef S) |
| void | setKind (VariableKind K) |
| void | setDefinition (SExpr *E) |
| void | setClangDecl (const ValueDecl *VD) |
| template<class V> | |
| V::R_SExpr | traverse (V &Vs, typename V::R_Ctx Ctx) |
| template<class C> | |
| C::CType | compare (const Variable *E, C &Cmp) const |
| Public Member Functions inherited from clang::threadSafety::til::SExpr | |
| SExpr ()=delete | |
| TIL_Opcode | opcode () const |
| void * | operator new (size_t S, MemRegionRef &R) |
| void * | operator new (size_t)=delete |
| SExpr objects must be created in an arena. | |
| void | operator delete (void *)=delete |
| SExpr objects cannot be deleted. | |
| unsigned | id () const |
| Returns the instruction ID for this expression. | |
| BasicBlock * | block () const |
| Returns the block, if this is an instruction in a basic block, otherwise returns null. | |
| void | setID (BasicBlock *B, unsigned id) |
| Set the basic block and instruction ID for this expression. | |
Static Public Member Functions | |
| static bool | classof (const SExpr *E) |
Friends | |
| class | BasicBlock |
| class | Function |
| class | Let |
| class | SFunction |
Additional Inherited Members | |
| Protected Member Functions inherited from clang::threadSafety::til::SExpr | |
| SExpr (TIL_Opcode Op) | |
| SExpr (const SExpr &E) | |
| SExpr & | operator= (const SExpr &)=delete |
| Protected Attributes inherited from clang::threadSafety::til::SExpr | |
| const TIL_Opcode | Opcode |
| unsigned char | Reserved = 0 |
| unsigned short | Flags = 0 |
| unsigned | SExprID = 0 |
| BasicBlock * | Block = nullptr |
A named variable, e.g.
"x".
There are two distinct places in which a Variable can appear in the AST. A variable declaration introduces a new variable, and can occur in 3 places: Let-expressions: (Let (x = t) u) Functions: (Function (x : t) u) Self-applicable functions (SFunction (x) t)
If a variable occurs in any other location, it is a reference to an existing variable declaration – e.g. 'x' in (x * y + z). To save space, we don't allocate a separate AST node for variable references; a reference is just a pointer to the original declaration.
Definition at line 356 of file ThreadSafetyTIL.h.
| Enumerator | |
|---|---|
| VK_Let | Let-variable. |
| VK_Fun | Function parameter. |
| VK_SFun | SFunction (self) parameter. |
Definition at line 358 of file ThreadSafetyTIL.h.
Definition at line 369 of file ThreadSafetyTIL.h.
References clang::threadSafety::til::SExpr::Flags, s, clang::threadSafety::til::SExpr::SExpr(), and VK_Let.
Referenced by compare(), and Variable().
Definition at line 374 of file ThreadSafetyTIL.h.
References clang::threadSafety::til::SExpr::Flags, clang::threadSafety::til::SExpr::SExpr(), and VK_Let.
Definition at line 380 of file ThreadSafetyTIL.h.
References clang::threadSafety::til::SExpr::Flags, kind(), clang::threadSafety::til::SExpr::SExpr(), and Variable().
|
inline |
Return the clang declaration for this variable, if any.
Definition at line 394 of file ThreadSafetyTIL.h.
Definition at line 385 of file ThreadSafetyTIL.h.
References clang::threadSafety::til::SExpr::opcode(), and clang::threadSafety::til::SExpr::SExpr().
|
inline |
Definition at line 414 of file ThreadSafetyTIL.h.
References clang::C, and Variable().
|
inline |
Return the definition of the variable.
For let-vars, this is the setting expression. For function and self parameters, it is the type of the variable.
Definition at line 399 of file ThreadSafetyTIL.h.
References clang::threadSafety::til::SExpr::SExpr().
Referenced by clang::threadSafety::til::Function::compare(), clang::threadSafety::til::Let::compare(), clang::threadSafety::til::PrettyPrinter< Self, StreamType >::printFunction(), and clang::threadSafety::til::PrettyPrinter< Self, StreamType >::printLet().
|
inline |
Definition at line 400 of file ThreadSafetyTIL.h.
References clang::threadSafety::til::SExpr::SExpr().
|
inline |
Return the kind of variable (let, function param, or self)
Definition at line 388 of file ThreadSafetyTIL.h.
References clang::threadSafety::til::SExpr::Flags.
Referenced by Variable().
|
inline |
Return the name of the variable, if any.
Definition at line 391 of file ThreadSafetyTIL.h.
|
inline |
Definition at line 405 of file ThreadSafetyTIL.h.
|
inline |
Definition at line 404 of file ThreadSafetyTIL.h.
References clang::threadSafety::til::SExpr::SExpr().
|
inline |
Definition at line 403 of file ThreadSafetyTIL.h.
References clang::threadSafety::til::SExpr::Flags.
Referenced by clang::threadSafety::til::Function::Function(), clang::threadSafety::til::Function::Function(), clang::threadSafety::til::Let::Let(), clang::threadSafety::til::Let::Let(), clang::threadSafety::til::SFunction::SFunction(), and clang::threadSafety::til::SFunction::SFunction().
|
inline |
Definition at line 402 of file ThreadSafetyTIL.h.
|
inline |
Definition at line 408 of file ThreadSafetyTIL.h.
References V.
Referenced by clang::threadSafety::til::Function::traverse(), clang::threadSafety::til::Let::traverse(), and clang::threadSafety::til::SFunction::traverse().
|
friend |
|
friend |
|
friend |
|
friend |
Definition at line 422 of file ThreadSafetyTIL.h.
References clang::threadSafety::til::SExpr::SExpr(), and SFunction.
Referenced by SFunction.