clang API Documentation

Public Member Functions | Static Public Member Functions
clang::WhileStmt Class Reference

#include <Stmt.h>

Inheritance diagram for clang::WhileStmt:
Inheritance graph
[legend]
Collaboration diagram for clang::WhileStmt:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 WhileStmt (const ASTContext &C, VarDecl *Var, Expr *cond, Stmt *body, SourceLocation WL)
 WhileStmt (EmptyShell Empty)
 Build an empty while statement.
VarDeclgetConditionVariable () const
 Retrieve the variable declared in this "while" statement, if any.
void setConditionVariable (const ASTContext &C, VarDecl *V)
const DeclStmtgetConditionVariableDeclStmt () const
ExprgetCond ()
const ExprgetCond () const
void setCond (Expr *E)
StmtgetBody ()
const StmtgetBody () const
void setBody (Stmt *S)
SourceLocation getWhileLoc () const
void setWhileLoc (SourceLocation L)
SourceLocation getLocStart () const LLVM_READONLY
SourceLocation getLocEnd () const LLVM_READONLY
child_range children ()

Static Public Member Functions

static bool classof (const Stmt *T)

Detailed Description

WhileStmt - This represents a 'while' stmt.

Definition at line 1034 of file Stmt.h.


Constructor & Destructor Documentation

WhileStmt::WhileStmt ( const ASTContext C,
VarDecl Var,
Expr cond,
Stmt body,
SourceLocation  WL 
)

Definition at line 969 of file Stmt.cpp.

References setConditionVariable().

clang::WhileStmt::WhileStmt ( EmptyShell  Empty) [inline, explicit]

Build an empty while statement.

Definition at line 1043 of file Stmt.h.


Member Function Documentation

Reimplemented from clang::Stmt.

Definition at line 1082 of file Stmt.h.

static bool clang::WhileStmt::classof ( const Stmt T) [inline, static]

Definition at line 1077 of file Stmt.h.

References clang::Stmt::getStmtClass().

const Stmt* clang::WhileStmt::getBody ( ) const [inline]

Definition at line 1066 of file Stmt.h.

const Expr* clang::WhileStmt::getCond ( ) const [inline]

Definition at line 1063 of file Stmt.h.

Retrieve the variable declared in this "while" statement, if any.

In the following example, "x" is the condition variable.

 while (int x = random()) {
   // ...
 }

Definition at line 978 of file Stmt.cpp.

References clang::DeclStmt::getSingleDecl().

Referenced by clang::CodeGen::CodeGenFunction::EmitWhileStmt(), and EvaluateStmt().

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

Definition at line 1058 of file Stmt.h.

Reimplemented from clang::Stmt.

Definition at line 1073 of file Stmt.h.

References clang::Stmt::getLocEnd().

Reimplemented from clang::Stmt.

Definition at line 1072 of file Stmt.h.

Definition at line 1069 of file Stmt.h.

void clang::WhileStmt::setBody ( Stmt S) [inline]

Definition at line 1067 of file Stmt.h.

References S.

void clang::WhileStmt::setCond ( Expr E) [inline]

Definition at line 1064 of file Stmt.h.

void WhileStmt::setConditionVariable ( const ASTContext C,
VarDecl V 
)

Definition at line 1070 of file Stmt.h.


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