class Variable

Declaration

class Variable : public SExpr { /* full declaration omitted */ };

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.

Declared at: clang/include/clang/Analysis/Analyses/ThreadSafetyTIL.h:355

Inherits from: SExpr

Member Variables

private llvm::StringRef Name
private clang::threadSafety::til::SExpr* Definition
private const clang::ValueDecl* Cvdecl = nullptr

Inherited from SExpr:

protected Opcode
protected Reserved = 0
protected Flags = 0
protected SExprID = 0
protected Block = nullptr

Method Overview

  • public Variable(llvm::StringRef s, clang::threadSafety::til::SExpr * D = nullptr)
  • public Variable(clang::threadSafety::til::SExpr * D, const clang::ValueDecl * Cvd = nullptr)
  • public Variable(const clang::threadSafety::til::Variable & Vd, clang::threadSafety::til::SExpr * D)
  • public const clang::ValueDecl * clangDecl() const
  • public static bool classof(const clang::threadSafety::til::SExpr * E)
  • public template <class C>typename C::CType compare(const clang::threadSafety::til::Variable * E, C & Cmp) const
  • public clang::threadSafety::til::SExpr * definition()
  • public const clang::threadSafety::til::SExpr * definition() const
  • public clang::threadSafety::til::Variable::VariableKind kind() const
  • public llvm::StringRef name() const
  • public void setClangDecl(const clang::ValueDecl * VD)
  • public void setDefinition(clang::threadSafety::til::SExpr * E)
  • public void setKind(clang::threadSafety::til::Variable::VariableKind K)
  • public void setName(llvm::StringRef S)
  • public template <class V>typename V::R_SExpr traverse(V & Vs, typename V::R_Ctx Ctx)

Inherited from SExpr:

Methods

Variable(
    llvm::StringRef s,
    clang::threadSafety::til::SExpr* D = nullptr)

Declared at: clang/include/clang/Analysis/Analyses/ThreadSafetyTIL.h:368

Parameters

llvm::StringRef s
clang::threadSafety::til::SExpr* D = nullptr

Variable(clang::threadSafety::til::SExpr* D,
         const clang::ValueDecl* Cvd = nullptr)

Declared at: clang/include/clang/Analysis/Analyses/ThreadSafetyTIL.h:373

Parameters

clang::threadSafety::til::SExpr* D
const clang::ValueDecl* Cvd = nullptr

Variable(
    const clang::threadSafety::til::Variable& Vd,
    clang::threadSafety::til::SExpr* D)

Declared at: clang/include/clang/Analysis/Analyses/ThreadSafetyTIL.h:379

Parameters

const clang::threadSafety::til::Variable& Vd
clang::threadSafety::til::SExpr* D

const clang::ValueDecl* clangDecl() const

Description

Return the clang declaration for this variable, if any.

Declared at: clang/include/clang/Analysis/Analyses/ThreadSafetyTIL.h:393

static bool classof(
    const clang::threadSafety::til::SExpr* E)

Declared at: clang/include/clang/Analysis/Analyses/ThreadSafetyTIL.h:384

Parameters

const clang::threadSafety::til::SExpr* E

template <class C>
typename C::CType compare(
    const clang::threadSafety::til::Variable* E,
    C& Cmp) const

Declared at: clang/include/clang/Analysis/Analyses/ThreadSafetyTIL.h:413

Templates

C

Parameters

const clang::threadSafety::til::Variable* E
C& Cmp

clang::threadSafety::til::SExpr* definition()

Description

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.

Declared at: clang/include/clang/Analysis/Analyses/ThreadSafetyTIL.h:398

const clang::threadSafety::til::SExpr*
definition() const

Declared at: clang/include/clang/Analysis/Analyses/ThreadSafetyTIL.h:399

clang::threadSafety::til::Variable::VariableKind
kind() const

Description

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

Declared at: clang/include/clang/Analysis/Analyses/ThreadSafetyTIL.h:387

llvm::StringRef name() const

Description

Return the name of the variable, if any.

Declared at: clang/include/clang/Analysis/Analyses/ThreadSafetyTIL.h:390

void setClangDecl(const clang::ValueDecl* VD)

Declared at: clang/include/clang/Analysis/Analyses/ThreadSafetyTIL.h:404

Parameters

const clang::ValueDecl* VD

void setDefinition(
    clang::threadSafety::til::SExpr* E)

Declared at: clang/include/clang/Analysis/Analyses/ThreadSafetyTIL.h:403

Parameters

clang::threadSafety::til::SExpr* E

void setKind(clang::threadSafety::til::Variable::
                 VariableKind K)

Declared at: clang/include/clang/Analysis/Analyses/ThreadSafetyTIL.h:402

Parameters

clang::threadSafety::til::Variable::VariableKind K

void setName(llvm::StringRef S)

Declared at: clang/include/clang/Analysis/Analyses/ThreadSafetyTIL.h:401

Parameters

llvm::StringRef S

template <class V>
typename V::R_SExpr traverse(
    V& Vs,
    typename V::R_Ctx Ctx)

Declared at: clang/include/clang/Analysis/Analyses/ThreadSafetyTIL.h:407

Templates

V

Parameters

V& Vs
typename V::R_Ctx Ctx