clang API Documentation

Public Types | Public Member Functions | Static Public Member Functions | Friends
clang::threadSafety::til::Variable Class Reference

#include <ThreadSafetyTIL.h>

Inheritance diagram for clang::threadSafety::til::Variable:
Inheritance graph
[legend]
Collaboration diagram for clang::threadSafety::til::Variable:
Collaboration graph
[legend]

List of all members.

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)
StringRef name () const
 Return the name of the variable, if any.
const clang::ValueDeclclangDecl () const
 Return the clang declaration for this variable, if any.
SExprdefinition ()
const SExprdefinition () 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

Static Public Member Functions

static bool classof (const SExpr *E)

Friends

class Function
class SFunction
class BasicBlock
class Let

Detailed Description

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 346 of file ThreadSafetyTIL.h.


Member Enumeration Documentation

Enumerator:
VK_Let 

Let-variable.

VK_Fun 

Function parameter.

VK_SFun 

SFunction (self) parameter.

Definition at line 350 of file ThreadSafetyTIL.h.


Constructor & Destructor Documentation

clang::threadSafety::til::Variable::Variable ( StringRef  s,
SExpr D = nullptr 
) [inline]

Definition at line 356 of file ThreadSafetyTIL.h.

References clang::threadSafety::til::SExpr::Flags.

clang::threadSafety::til::Variable::Variable ( SExpr D,
const clang::ValueDecl Cvd = nullptr 
) [inline]

Definition at line 360 of file ThreadSafetyTIL.h.

References clang::threadSafety::til::SExpr::Flags.

clang::threadSafety::til::Variable::Variable ( const Variable Vd,
SExpr D 
) [inline]

Definition at line 365 of file ThreadSafetyTIL.h.

References clang::threadSafety::til::SExpr::Flags, and kind().


Member Function Documentation

Return the clang declaration for this variable, if any.

Definition at line 377 of file ThreadSafetyTIL.h.

static bool clang::threadSafety::til::Variable::classof ( const SExpr E) [inline, static]

Definition at line 348 of file ThreadSafetyTIL.h.

References clang::threadSafety::til::SExpr::opcode().

template<class C >
C::CType clang::threadSafety::til::Variable::compare ( const Variable E,
C &  Cmp 
) const [inline]

Definition at line 397 of file ThreadSafetyTIL.h.

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 382 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().

Definition at line 383 of file ThreadSafetyTIL.h.

Return the kind of variable (let, function param, or self)

Definition at line 371 of file ThreadSafetyTIL.h.

References clang::threadSafety::til::SExpr::Flags.

Referenced by clang::threadSafety::til::PrettyPrinter< StdPrinter, std::ostream >::printVariable(), and Variable().

StringRef clang::threadSafety::til::Variable::name ( ) const [inline]

Return the name of the variable, if any.

Definition at line 374 of file ThreadSafetyTIL.h.

Referenced by clang::threadSafety::til::PrettyPrinter< StdPrinter, std::ostream >::printVariable().

Definition at line 388 of file ThreadSafetyTIL.h.

Definition at line 387 of file ThreadSafetyTIL.h.

void clang::threadSafety::til::Variable::setName ( StringRef  S) [inline]

Definition at line 385 of file ThreadSafetyTIL.h.

References S.

template<class V >
V::R_SExpr clang::threadSafety::til::Variable::traverse ( V &  Vs,
typename V::R_Ctx  Ctx 
) [inline]

Friends And Related Function Documentation

friend class BasicBlock [friend]

Definition at line 404 of file ThreadSafetyTIL.h.

friend class Function [friend]

Definition at line 402 of file ThreadSafetyTIL.h.

friend class Let [friend]

Definition at line 405 of file ThreadSafetyTIL.h.

friend class SFunction [friend]

Definition at line 403 of file ThreadSafetyTIL.h.


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