clang API Documentation

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

#include <Stmt.h>

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

List of all members.

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.
StmtgetInit ()
VarDeclgetConditionVariable () const
 Retrieve the variable declared in this "for" statement, if any.
void setConditionVariable (const ASTContext &C, VarDecl *V)
const DeclStmtgetConditionVariableDeclStmt () const
ExprgetCond ()
ExprgetInc ()
StmtgetBody ()
const StmtgetInit () const
const ExprgetCond () const
const ExprgetInc () const
const StmtgetBody () 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)

Detailed Description

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.

Definition at line 1140 of file Stmt.h.


Constructor & Destructor Documentation

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]

Build an empty for statement.

Definition at line 1152 of file Stmt.h.


Member Function Documentation

Reimplemented from clang::Stmt.

Definition at line 1204 of file Stmt.h.

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

Definition at line 1199 of file Stmt.h.

References clang::Stmt::getStmtClass().

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

Definition at line 1180 of file Stmt.h.

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

Definition at line 1178 of file Stmt.h.

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().

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

Definition at line 1169 of file Stmt.h.

Definition at line 1187 of file Stmt.h.

const Expr* clang::ForStmt::getInc ( ) const [inline]

Definition at line 1179 of file Stmt.h.

const Stmt* clang::ForStmt::getInit ( ) const [inline]

Definition at line 1177 of file Stmt.h.

Reimplemented from clang::Stmt.

Definition at line 1195 of file Stmt.h.

References clang::Stmt::getLocEnd().

Reimplemented from clang::Stmt.

Definition at line 1194 of file Stmt.h.

Definition at line 1189 of file Stmt.h.

Definition at line 1191 of file Stmt.h.

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

Definition at line 1185 of file Stmt.h.

References S.

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

Definition at line 1183 of file Stmt.h.

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

Definition at line 1188 of file Stmt.h.

void clang::ForStmt::setInc ( Expr E) [inline]

Definition at line 1184 of file Stmt.h.

void clang::ForStmt::setInit ( Stmt S) [inline]

Definition at line 1182 of file Stmt.h.

References S.

Definition at line 1190 of file Stmt.h.

Definition at line 1192 of file Stmt.h.


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