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

ForStmt - This represents a 'for (init;cond;inc)' stmt. More...

#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
 If this ForStmt has a condition variable, return the faux DeclStmt associated with the creation of that condition variable. More...
 
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 1131 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 788 of file Stmt.cpp.

References setConditionVariable().

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

Build an empty for statement.

Definition at line 1143 of file Stmt.h.

Member Function Documentation

child_range clang::ForStmt::children ( )
inline

Definition at line 1195 of file Stmt.h.

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

Definition at line 1190 of file Stmt.h.

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

Definition at line 1171 of file Stmt.h.

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

Definition at line 1169 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 800 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 1160 of file Stmt.h.

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

Definition at line 1178 of file Stmt.h.

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

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

Definition at line 1170 of file Stmt.h.

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

Definition at line 1168 of file Stmt.h.

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

Definition at line 1186 of file Stmt.h.

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

Definition at line 1185 of file Stmt.h.

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

Definition at line 1180 of file Stmt.h.

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

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

Definition at line 1182 of file Stmt.h.

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

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

Definition at line 1176 of file Stmt.h.

References S.

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

Definition at line 1174 of file Stmt.h.

References E.

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

Definition at line 1179 of file Stmt.h.

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

Definition at line 1175 of file Stmt.h.

References E.

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

Definition at line 1173 of file Stmt.h.

References S.

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

Definition at line 1181 of file Stmt.h.

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

Definition at line 1183 of file Stmt.h.


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