|
clang
3.8.0
|
A named variable, e.g. More...
#include <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 clang::ValueDecl *Cvd=nullptr) | |
| Variable (const Variable &Vd, SExpr *D) | |
| VariableKind | kind () const |
| Return the kind of variable (let, function param, or self) More... | |
| StringRef | name () const |
| Return the name of the variable, if any. More... | |
| const clang::ValueDecl * | clangDecl () const |
| Return the clang declaration for this variable, if any. More... | |
| SExpr * | definition () |
| Return the definition of the variable. More... | |
| const SExpr * | definition () const |
| void | setName (StringRef S) |
| void | setKind (VariableKind K) |
| void | setDefinition (SExpr *E) |
| void | setClangDecl (const clang::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 | |
| TIL_Opcode | opcode () const |
| void * | operator new (size_t S, MemRegionRef &R) |
| void | operator delete (void *)=delete |
| SExpr objects cannot be deleted. More... | |
| unsigned | id () const |
| Returns the instruction ID for this expression. More... | |
| BasicBlock * | block () const |
| Returns the block, if this is an instruction in a basic block, otherwise returns null. More... | |
| void | setID (BasicBlock *B, unsigned id) |
| Set the basic block and instruction ID for this expression. More... | |
Static Public Member Functions | |
| static bool | classof (const SExpr *E) |
Friends | |
| class | Function |
| class | SFunction |
| class | BasicBlock |
| class | Let |
Additional Inherited Members | |
Protected Member Functions inherited from clang::threadSafety::til::SExpr | |
| SExpr (TIL_Opcode Op) | |
| SExpr (const SExpr &E) | |
Protected Attributes inherited from clang::threadSafety::til::SExpr | |
| const unsigned char | Opcode |
| unsigned char | Reserved |
| unsigned short | Flags |
| unsigned | SExprID |
| BasicBlock * | Block |
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 345 of file ThreadSafetyTIL.h.
| Enumerator | |
|---|---|
| VK_Let |
Let-variable. |
| VK_Fun |
Function parameter. |
| VK_SFun |
SFunction (self) parameter. |
Definition at line 349 of file ThreadSafetyTIL.h.
|
inline |
Definition at line 355 of file ThreadSafetyTIL.h.
References clang::threadSafety::til::SExpr::Flags, and VK_Let.
|
inline |
Definition at line 359 of file ThreadSafetyTIL.h.
References clang::threadSafety::til::SExpr::Flags, and VK_Let.
Definition at line 364 of file ThreadSafetyTIL.h.
References clang::threadSafety::til::SExpr::Flags, and kind().
|
inline |
Return the clang declaration for this variable, if any.
Definition at line 376 of file ThreadSafetyTIL.h.
Definition at line 347 of file ThreadSafetyTIL.h.
References clang::threadSafety::til::SExpr::opcode().
|
inline |
Definition at line 396 of file ThreadSafetyTIL.h.
|
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 381 of file ThreadSafetyTIL.h.
Referenced by clang::threadSafety::til::Function::compare(), clang::threadSafety::til::Let::compare(), clang::threadSafety::til::PrettyPrinter< StdPrinter, std::ostream >::printFunction(), and clang::threadSafety::til::PrettyPrinter< StdPrinter, std::ostream >::printLet().
|
inline |
Definition at line 382 of file ThreadSafetyTIL.h.
|
inline |
Return the kind of variable (let, function param, or self)
Definition at line 370 of file ThreadSafetyTIL.h.
References clang::threadSafety::til::SExpr::Flags.
Referenced by clang::threadSafety::til::PrettyPrinter< StdPrinter, std::ostream >::printVariable(), and Variable().
|
inline |
Return the name of the variable, if any.
Definition at line 373 of file ThreadSafetyTIL.h.
Referenced by clang::threadSafety::til::PrettyPrinter< StdPrinter, std::ostream >::printVariable().
|
inline |
Definition at line 387 of file ThreadSafetyTIL.h.
|
inline |
Definition at line 386 of file ThreadSafetyTIL.h.
References E.
|
inline |
Definition at line 385 of file ThreadSafetyTIL.h.
References clang::threadSafety::til::SExpr::Flags.
Referenced by clang::threadSafety::til::Function::Function(), clang::threadSafety::til::Let::Let(), clang::threadSafety::SExprBuilder::SExprBuilder(), and clang::threadSafety::til::SFunction::SFunction().
|
inline |
Definition at line 384 of file ThreadSafetyTIL.h.
References S.
|
inline |
Definition at line 390 of file ThreadSafetyTIL.h.
Referenced by clang::threadSafety::til::Function::traverse(), clang::threadSafety::til::SFunction::traverse(), and clang::threadSafety::til::Let::traverse().
|
friend |
Definition at line 403 of file ThreadSafetyTIL.h.
|
friend |
Definition at line 401 of file ThreadSafetyTIL.h.
|
friend |
Definition at line 404 of file ThreadSafetyTIL.h.
|
friend |
Definition at line 402 of file ThreadSafetyTIL.h.
1.8.6