clang  3.7.0
Public Member Functions | Static Public Member Functions | List of all members
clang::ForStmt Class Reference

#include <Stmt.h>

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

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. More...
 
StmtgetInit ()
 
VarDeclgetConditionVariable () const
 Retrieve the variable declared in this "for" statement, if any. More...
 
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 1144 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 913 of file Stmt.cpp.

References setConditionVariable().

clang::ForStmt::ForStmt ( EmptyShell  Empty)
inlineexplicit

Build an empty for statement.

Definition at line 1156 of file Stmt.h.

Member Function Documentation

child_range clang::ForStmt::children ( )
inline

Definition at line 1208 of file Stmt.h.

static bool clang::ForStmt::classof ( const Stmt T)
inlinestatic

Definition at line 1203 of file Stmt.h.

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

Definition at line 1184 of file Stmt.h.

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

Definition at line 1182 of file Stmt.h.

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 925 of file Stmt.cpp.

References clang::DeclStmt::getSingleDecl().

Referenced by clang::CodeGen::CodeGenFunction::EmitForStmt(), EvaluateStmt(), and clang::ASTNodeImporter::VisitForStmt().

const DeclStmt* clang::ForStmt::getConditionVariableDeclStmt ( ) const
inline

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

Definition at line 1173 of file Stmt.h.

SourceLocation clang::ForStmt::getForLoc ( ) const
inline

Definition at line 1191 of file Stmt.h.

Referenced by clang::ASTNodeImporter::VisitForStmt().

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

Definition at line 1183 of file Stmt.h.

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

Definition at line 1181 of file Stmt.h.

SourceLocation clang::ForStmt::getLocEnd ( ) const
inline

Definition at line 1199 of file Stmt.h.

SourceLocation clang::ForStmt::getLocStart ( ) const
inline

Definition at line 1198 of file Stmt.h.

SourceLocation clang::ForStmt::getLParenLoc ( ) const
inline

Definition at line 1193 of file Stmt.h.

Referenced by clang::ASTNodeImporter::VisitForStmt().

SourceLocation clang::ForStmt::getRParenLoc ( ) const
inline

Definition at line 1195 of file Stmt.h.

Referenced by clang::ASTNodeImporter::VisitForStmt().

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

Definition at line 1189 of file Stmt.h.

References S.

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

Definition at line 1187 of file Stmt.h.

void ForStmt::setConditionVariable ( const ASTContext C,
VarDecl V 
)
void clang::ForStmt::setForLoc ( SourceLocation  L)
inline

Definition at line 1192 of file Stmt.h.

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

Definition at line 1188 of file Stmt.h.

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

Definition at line 1186 of file Stmt.h.

References S.

void clang::ForStmt::setLParenLoc ( SourceLocation  L)
inline

Definition at line 1194 of file Stmt.h.

void clang::ForStmt::setRParenLoc ( SourceLocation  L)
inline

Definition at line 1196 of file Stmt.h.


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