clang API Documentation
#include <Stmt.h>
Public Member Functions | |
ForStmt (const ASTContext &C, Stmt *Init, Expr *Cond, VarDecl *condVar, Expr *Inc, Stmt *Body, SourceLocation FL, SourceLocation LP, SourceLocation RP) | |
ForStmt (EmptyShell Empty) | |
Build an empty for statement. | |
Stmt * | getInit () |
VarDecl * | getConditionVariable () const |
Retrieve the variable declared in this "for" statement, if any. | |
void | setConditionVariable (const ASTContext &C, VarDecl *V) |
const DeclStmt * | getConditionVariableDeclStmt () const |
Expr * | getCond () |
Expr * | getInc () |
Stmt * | getBody () |
const Stmt * | getInit () const |
const Expr * | getCond () const |
const Expr * | getInc () const |
const Stmt * | getBody () const |
void | setInit (Stmt *S) |
void | setCond (Expr *E) |
void | setInc (Expr *E) |
void | setBody (Stmt *S) |
SourceLocation | getForLoc () const |
void | setForLoc (SourceLocation L) |
SourceLocation | getLParenLoc () const |
void | setLParenLoc (SourceLocation L) |
SourceLocation | getRParenLoc () const |
void | setRParenLoc (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) |
ForStmt - This represents a 'for (init;cond;inc)' stmt. Note that any of the init/cond/inc parts of the ForStmt will be null if they were not specified in the source.
ForStmt::ForStmt | ( | const ASTContext & | C, |
Stmt * | Init, | ||
Expr * | Cond, | ||
VarDecl * | condVar, | ||
Expr * | Inc, | ||
Stmt * | Body, | ||
SourceLocation | FL, | ||
SourceLocation | LP, | ||
SourceLocation | RP | ||
) |
Definition at line 905 of file Stmt.cpp.
References setConditionVariable().
clang::ForStmt::ForStmt | ( | EmptyShell | Empty | ) | [inline, explicit] |
child_range clang::ForStmt::children | ( | ) | [inline] |
Reimplemented from clang::Stmt.
static bool clang::ForStmt::classof | ( | const Stmt * | T | ) | [inline, static] |
Definition at line 1199 of file Stmt.h.
References clang::Stmt::getStmtClass().
Stmt* clang::ForStmt::getBody | ( | ) | [inline] |
Definition at line 1175 of file Stmt.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitForStmt(), EvaluateStmt(), isIdenticalStmt(), and isInLoopBody().
const Stmt* clang::ForStmt::getBody | ( | ) | const [inline] |
Expr* clang::ForStmt::getCond | ( | ) | [inline] |
Definition at line 1173 of file Stmt.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitForStmt(), EvaluateStmt(), and isIdenticalStmt().
const Expr* clang::ForStmt::getCond | ( | ) | const [inline] |
VarDecl * ForStmt::getConditionVariable | ( | ) | const |
Retrieve the variable declared in this "for" statement, if any.
In the following example, "y" is the condition variable.
for (int x = random(); int y = mangle(x); ++x) { // ... }
Definition at line 917 of file Stmt.cpp.
References clang::DeclStmt::getSingleDecl().
Referenced by clang::CodeGen::CodeGenFunction::EmitForStmt(), and EvaluateStmt().
const DeclStmt* clang::ForStmt::getConditionVariableDeclStmt | ( | ) | const [inline] |
SourceLocation clang::ForStmt::getForLoc | ( | ) | const [inline] |
Expr* clang::ForStmt::getInc | ( | ) | [inline] |
Definition at line 1174 of file Stmt.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitForStmt(), EvaluateStmt(), isIdenticalStmt(), and isInLoopBody().
const Expr* clang::ForStmt::getInc | ( | ) | const [inline] |
Stmt* clang::ForStmt::getInit | ( | ) | [inline] |
Definition at line 1154 of file Stmt.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitForStmt(), EvaluateStmt(), and isIdenticalStmt().
const Stmt* clang::ForStmt::getInit | ( | ) | const [inline] |
SourceLocation clang::ForStmt::getLocEnd | ( | ) | const [inline] |
Reimplemented from clang::Stmt.
Definition at line 1195 of file Stmt.h.
References clang::Stmt::getLocEnd().
SourceLocation clang::ForStmt::getLocStart | ( | ) | const [inline] |
Reimplemented from clang::Stmt.
SourceLocation clang::ForStmt::getLParenLoc | ( | ) | const [inline] |
SourceLocation clang::ForStmt::getRParenLoc | ( | ) | const [inline] |
void clang::ForStmt::setBody | ( | Stmt * | S | ) | [inline] |
void clang::ForStmt::setCond | ( | Expr * | E | ) | [inline] |
void ForStmt::setConditionVariable | ( | const ASTContext & | C, |
VarDecl * | V | ||
) |
Definition at line 925 of file Stmt.cpp.
References AttributeLangSupport::C, clang::SourceRange::getBegin(), clang::SourceRange::getEnd(), and clang::VarDecl::getSourceRange().
Referenced by ForStmt().
void clang::ForStmt::setForLoc | ( | SourceLocation | L | ) | [inline] |
void clang::ForStmt::setInc | ( | Expr * | E | ) | [inline] |
void clang::ForStmt::setInit | ( | Stmt * | S | ) | [inline] |
void clang::ForStmt::setLParenLoc | ( | SourceLocation | L | ) | [inline] |
void clang::ForStmt::setRParenLoc | ( | SourceLocation | L | ) | [inline] |