clang API Documentation
#include <Stmt.h>
Public Member Functions | |
WhileStmt (const ASTContext &C, VarDecl *Var, Expr *cond, Stmt *body, SourceLocation WL) | |
WhileStmt (EmptyShell Empty) | |
Build an empty while statement. | |
VarDecl * | getConditionVariable () const |
Retrieve the variable declared in this "while" statement, if any. | |
void | setConditionVariable (const ASTContext &C, VarDecl *V) |
const DeclStmt * | getConditionVariableDeclStmt () const |
Expr * | getCond () |
const Expr * | getCond () const |
void | setCond (Expr *E) |
Stmt * | getBody () |
const Stmt * | getBody () 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) |
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] |
child_range clang::WhileStmt::children | ( | ) | [inline] |
Reimplemented from clang::Stmt.
static bool clang::WhileStmt::classof | ( | const Stmt * | T | ) | [inline, static] |
Definition at line 1077 of file Stmt.h.
References clang::Stmt::getStmtClass().
Stmt* clang::WhileStmt::getBody | ( | ) | [inline] |
Definition at line 1065 of file Stmt.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitWhileStmt(), EvaluateStmt(), and isIdenticalStmt().
const Stmt* clang::WhileStmt::getBody | ( | ) | const [inline] |
Expr* clang::WhileStmt::getCond | ( | ) | [inline] |
Definition at line 1062 of file Stmt.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitWhileStmt(), EvaluateStmt(), and isIdenticalStmt().
const Expr* clang::WhileStmt::getCond | ( | ) | const [inline] |
VarDecl * WhileStmt::getConditionVariable | ( | ) | const |
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().
const DeclStmt* clang::WhileStmt::getConditionVariableDeclStmt | ( | ) | const [inline] |
SourceLocation clang::WhileStmt::getLocEnd | ( | ) | const [inline] |
Reimplemented from clang::Stmt.
Definition at line 1073 of file Stmt.h.
References clang::Stmt::getLocEnd().
SourceLocation clang::WhileStmt::getLocStart | ( | ) | const [inline] |
Reimplemented from clang::Stmt.
SourceLocation clang::WhileStmt::getWhileLoc | ( | ) | const [inline] |
void clang::WhileStmt::setBody | ( | Stmt * | S | ) | [inline] |
void clang::WhileStmt::setCond | ( | Expr * | E | ) | [inline] |
void WhileStmt::setConditionVariable | ( | const ASTContext & | C, |
VarDecl * | V | ||
) |
Definition at line 986 of file Stmt.cpp.
References AttributeLangSupport::C, clang::SourceRange::getBegin(), clang::SourceRange::getEnd(), and clang::VarDecl::getSourceRange().
Referenced by WhileStmt().
void clang::WhileStmt::setWhileLoc | ( | SourceLocation | L | ) | [inline] |