clang  3.9.0
Public Member Functions | Static Public Member Functions | List of all members
clang::WhileStmt Class Reference

WhileStmt - This represents a 'while' stmt. More...

#include <Stmt.h>

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

Public Member Functions

 WhileStmt (const ASTContext &C, VarDecl *Var, Expr *cond, Stmt *body, SourceLocation WL)
 
 WhileStmt (EmptyShell Empty)
 Build an empty while statement. More...
 
VarDeclgetConditionVariable () const
 Retrieve the variable declared in this "while" statement, if any. More...
 
void setConditionVariable (const ASTContext &C, VarDecl *V)
 
const DeclStmtgetConditionVariableDeclStmt () const
 If this WhileStmt has a condition variable, return the faux DeclStmt associated with the creation of that condition variable. More...
 
ExprgetCond ()
 
const ExprgetCond () const
 
void setCond (Expr *E)
 
StmtgetBody ()
 
const StmtgetBody () 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)
 

Detailed Description

WhileStmt - This represents a 'while' stmt.

Definition at line 1047 of file Stmt.h.

Constructor & Destructor Documentation

WhileStmt::WhileStmt ( const ASTContext C,
VarDecl Var,
Expr cond,
Stmt body,
SourceLocation  WL 
)

Definition at line 862 of file Stmt.cpp.

References setConditionVariable().

clang::WhileStmt::WhileStmt ( EmptyShell  Empty)
inlineexplicit

Build an empty while statement.

Definition at line 1056 of file Stmt.h.

Member Function Documentation

child_range clang::WhileStmt::children ( )
inline

Definition at line 1095 of file Stmt.h.

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

Definition at line 1090 of file Stmt.h.

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

Definition at line 1079 of file Stmt.h.

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

Definition at line 1076 of file Stmt.h.

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

References clang::DeclStmt::getSingleDecl().

Referenced by clang::CodeGen::CodeGenFunction::EmitWhileStmt(), EvaluateStmt(), and clang::ASTNodeImporter::VisitWhileStmt().

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

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

Definition at line 1071 of file Stmt.h.

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

Definition at line 1086 of file Stmt.h.

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

Definition at line 1085 of file Stmt.h.

SourceLocation clang::WhileStmt::getWhileLoc ( ) const
inline

Definition at line 1082 of file Stmt.h.

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

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

Definition at line 1080 of file Stmt.h.

References S.

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

Definition at line 1077 of file Stmt.h.

References E.

void WhileStmt::setConditionVariable ( const ASTContext C,
VarDecl V 
)
void clang::WhileStmt::setWhileLoc ( SourceLocation  L)
inline

Definition at line 1083 of file Stmt.h.


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