class WhileStmt

Declaration

class WhileStmt : public Stmt, private TrailingObjects { /* full declaration omitted */ };

Description

WhileStmt - This represents a 'while' stmt.

Declared at: clang/include/clang/AST/Stmt.h:2373

Inherits from: Stmt, TrailingObjects

Member Variables

private clang::SourceLocation LParenLoc
private clang::SourceLocation RParenLoc

Inherited from Stmt:

protected

Method Overview

  • public static clang::WhileStmt * Create(const clang::ASTContext & Ctx, clang::VarDecl * Var, clang::Expr * Cond, clang::Stmt * Body, clang::SourceLocation WL, clang::SourceLocation LParenLoc, clang::SourceLocation RParenLoc)
  • public static clang::WhileStmt * CreateEmpty(const clang::ASTContext & Ctx, bool HasVar)
  • private WhileStmt(const clang::ASTContext & Ctx, clang::VarDecl * Var, clang::Expr * Cond, clang::Stmt * Body, clang::SourceLocation WL, clang::SourceLocation LParenLoc, clang::SourceLocation RParenLoc)
  • private WhileStmt(clang::Stmt::EmptyShell Empty, bool HasVar)
  • private unsigned int bodyOffset() const
  • public clang::Stmt::const_child_range children() const
  • public clang::Stmt::child_range children()
  • public static bool classof(const clang::Stmt * T)
  • private unsigned int condOffset() const
  • public clang::SourceLocation getBeginLoc() const
  • public clang::Stmt * getBody()
  • public const clang::Stmt * getBody() const
  • public const clang::Expr * getCond() const
  • public clang::Expr * getCond()
  • public clang::VarDecl * getConditionVariable()
  • public const clang::VarDecl * getConditionVariable() const
  • public clang::DeclStmt * getConditionVariableDeclStmt()
  • public const clang::DeclStmt * getConditionVariableDeclStmt() const
  • public clang::SourceLocation getEndLoc() const
  • public clang::SourceLocation getLParenLoc() const
  • public clang::SourceLocation getRParenLoc() const
  • public clang::SourceLocation getWhileLoc() const
  • public bool hasVarStorage() const
  • private unsigned int numTrailingObjects(OverloadToken<clang::Stmt *>) const
  • public void setBody(clang::Stmt * Body)
  • public void setCond(clang::Expr * Cond)
  • public void setConditionVariable(const clang::ASTContext & Ctx, clang::VarDecl * V)
  • public void setLParenLoc(clang::SourceLocation L)
  • public void setRParenLoc(clang::SourceLocation L)
  • public void setWhileLoc(clang::SourceLocation L)
  • private unsigned int varOffset() const

Inherited from Stmt:

Methods

static clang::WhileStmt* Create(
    const clang::ASTContext& Ctx,
    clang::VarDecl* Var,
    clang::Expr* Cond,
    clang::Stmt* Body,
    clang::SourceLocation WL,
    clang::SourceLocation LParenLoc,
    clang::SourceLocation RParenLoc)

Description

Create a while statement.

Declared at: clang/include/clang/AST/Stmt.h:2415

Parameters

const clang::ASTContext& Ctx
clang::VarDecl* Var
clang::Expr* Cond
clang::Stmt* Body
clang::SourceLocation WL
clang::SourceLocation LParenLoc
clang::SourceLocation RParenLoc

static clang::WhileStmt* CreateEmpty(
    const clang::ASTContext& Ctx,
    bool HasVar)

Description

Create an empty while statement optionally with storage for a condition variable.

Declared at: clang/include/clang/AST/Stmt.h:2421

Parameters

const clang::ASTContext& Ctx
bool HasVar

WhileStmt(const clang::ASTContext& Ctx,
          clang::VarDecl* Var,
          clang::Expr* Cond,
          clang::Stmt* Body,
          clang::SourceLocation WL,
          clang::SourceLocation LParenLoc,
          clang::SourceLocation RParenLoc)

Description

Build a while statement.

Declared at: clang/include/clang/AST/Stmt.h:2406

Parameters

const clang::ASTContext& Ctx
clang::VarDecl* Var
clang::Expr* Cond
clang::Stmt* Body
clang::SourceLocation WL
clang::SourceLocation LParenLoc
clang::SourceLocation RParenLoc

WhileStmt(clang::Stmt::EmptyShell Empty,
          bool HasVar)

Description

Build an empty while statement.

Declared at: clang/include/clang/AST/Stmt.h:2411

Parameters

clang::Stmt::EmptyShell Empty
bool HasVar

unsigned int bodyOffset() const

Declared at: clang/include/clang/AST/Stmt.h:2399

clang::Stmt::const_child_range children() const

Declared at: clang/include/clang/AST/Stmt.h:2502

clang::Stmt::child_range children()

Declared at: clang/include/clang/AST/Stmt.h:2496

static bool classof(const clang::Stmt* T)

Declared at: clang/include/clang/AST/Stmt.h:2491

Parameters

const clang::Stmt* T

unsigned int condOffset() const

Declared at: clang/include/clang/AST/Stmt.h:2398

clang::SourceLocation getBeginLoc() const

Declared at: clang/include/clang/AST/Stmt.h:2486

clang::Stmt* getBody()

Declared at: clang/include/clang/AST/Stmt.h:2438

const clang::Stmt* getBody() const

Declared at: clang/include/clang/AST/Stmt.h:2439

const clang::Expr* getCond() const

Declared at: clang/include/clang/AST/Stmt.h:2430

clang::Expr* getCond()

Declared at: clang/include/clang/AST/Stmt.h:2426

clang::VarDecl* getConditionVariable()

Description

Retrieve the variable declared in this "while" statement, if any. In the following example, "x" is the condition variable.

Declared at: clang/include/clang/AST/Stmt.h:2455

const clang::VarDecl* getConditionVariable() const

Declared at: clang/include/clang/AST/Stmt.h:2456

clang::DeclStmt* getConditionVariableDeclStmt()

Description

If this WhileStmt has a condition variable, return the faux DeclStmt associated with the creation of that condition variable.

Declared at: clang/include/clang/AST/Stmt.h:2466

const clang::DeclStmt*
getConditionVariableDeclStmt() const

Declared at: clang/include/clang/AST/Stmt.h:2472

clang::SourceLocation getEndLoc() const

Declared at: clang/include/clang/AST/Stmt.h:2487

clang::SourceLocation getLParenLoc() const

Declared at: clang/include/clang/AST/Stmt.h:2481

clang::SourceLocation getRParenLoc() const

Declared at: clang/include/clang/AST/Stmt.h:2483

clang::SourceLocation getWhileLoc() const

Declared at: clang/include/clang/AST/Stmt.h:2478

bool hasVarStorage() const

Description

True if this WhileStmt has storage for a condition variable.

Declared at: clang/include/clang/AST/Stmt.h:2424

unsigned int numTrailingObjects(
    OverloadToken<clang::Stmt*>) const

Declared at: clang/include/clang/AST/Stmt.h:2401

Parameters

OverloadToken<clang::Stmt*>

void setBody(clang::Stmt* Body)

Declared at: clang/include/clang/AST/Stmt.h:2443

Parameters

clang::Stmt* Body

void setCond(clang::Expr* Cond)

Declared at: clang/include/clang/AST/Stmt.h:2434

Parameters

clang::Expr* Cond

void setConditionVariable(
    const clang::ASTContext& Ctx,
    clang::VarDecl* V)

Description

Set the condition variable of this while statement. The while statement must have storage for it.

Declared at: clang/include/clang/AST/Stmt.h:2462

Parameters

const clang::ASTContext& Ctx
clang::VarDecl* V

void setLParenLoc(clang::SourceLocation L)

Declared at: clang/include/clang/AST/Stmt.h:2482

Parameters

clang::SourceLocation L

void setRParenLoc(clang::SourceLocation L)

Declared at: clang/include/clang/AST/Stmt.h:2484

Parameters

clang::SourceLocation L

void setWhileLoc(clang::SourceLocation L)

Declared at: clang/include/clang/AST/Stmt.h:2479

Parameters

clang::SourceLocation L

unsigned int varOffset() const

Declared at: clang/include/clang/AST/Stmt.h:2397