clang  8.0.0svn
Public Member Functions | Static Public Member Functions | Friends | List of all members
clang::CXXForRangeStmt Class Reference

CXXForRangeStmt - This represents C++0x [stmt.ranged]'s ranged for statement, represented as 'for (range-declarator : range-expression)' or 'for (init-statement range-declarator : range-expression)'. More...

#include "clang/AST/StmtCXX.h"

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

Public Member Functions

 CXXForRangeStmt (Stmt *InitStmt, DeclStmt *Range, DeclStmt *Begin, DeclStmt *End, Expr *Cond, Expr *Inc, DeclStmt *LoopVar, Stmt *Body, SourceLocation FL, SourceLocation CAL, SourceLocation CL, SourceLocation RPL)
 
 CXXForRangeStmt (EmptyShell Empty)
 
StmtgetInit ()
 
VarDeclgetLoopVariable ()
 
ExprgetRangeInit ()
 
const StmtgetInit () const
 
const VarDeclgetLoopVariable () const
 
const ExprgetRangeInit () const
 
DeclStmtgetRangeStmt ()
 
DeclStmtgetBeginStmt ()
 
DeclStmtgetEndStmt ()
 
ExprgetCond ()
 
ExprgetInc ()
 
DeclStmtgetLoopVarStmt ()
 
StmtgetBody ()
 
const DeclStmtgetRangeStmt () const
 
const DeclStmtgetBeginStmt () const
 
const DeclStmtgetEndStmt () const
 
const ExprgetCond () const
 
const ExprgetInc () const
 
const DeclStmtgetLoopVarStmt () const
 
const StmtgetBody () const
 
void setInit (Stmt *S)
 
void setRangeInit (Expr *E)
 
void setRangeStmt (Stmt *S)
 
void setBeginStmt (Stmt *S)
 
void setEndStmt (Stmt *S)
 
void setCond (Expr *E)
 
void setInc (Expr *E)
 
void setLoopVarStmt (Stmt *S)
 
void setBody (Stmt *S)
 
SourceLocation getForLoc () const
 
SourceLocation getCoawaitLoc () const
 
SourceLocation getColonLoc () const
 
SourceLocation getRParenLoc () const
 
SourceLocation getBeginLoc () const LLVM_READONLY
 
SourceLocation getEndLoc () const LLVM_READONLY
 
child_range children ()
 
- Public Member Functions inherited from clang::Stmt
void * operator new (size_t bytes, const ASTContext &C, unsigned alignment=8)
 
void * operator new (size_t bytes, const ASTContext *C, unsigned alignment=8)
 
void * operator new (size_t bytes, void *mem) noexcept
 
void operator delete (void *, const ASTContext &, unsigned) noexcept
 
void operator delete (void *, const ASTContext *, unsigned) noexcept
 
void operator delete (void *, size_t) noexcept
 
void operator delete (void *, void *) noexcept
 
 Stmt (StmtClass SC)
 
StmtClass getStmtClass () const
 
const char * getStmtClassName () const
 
SourceRange getSourceRange () const LLVM_READONLY
 SourceLocation tokens are not useful in isolation - they are low level value objects created/interpreted by SourceManager. More...
 
SourceLocation getBeginLoc () const LLVM_READONLY
 
SourceLocation getEndLoc () const LLVM_READONLY
 
void dump () const
 Dumps the specified AST fragment and all subtrees to llvm::errs(). More...
 
void dump (SourceManager &SM) const
 
void dump (raw_ostream &OS, SourceManager &SM) const
 
void dump (raw_ostream &OS) const
 
int64_t getID (const ASTContext &Context) const
 
void dumpColor () const
 dumpColor - same as dump(), but forces color highlighting. More...
 
void dumpPretty (const ASTContext &Context) const
 dumpPretty/printPretty - These two methods do a "pretty print" of the AST back to its original source language syntax. More...
 
void printPretty (raw_ostream &OS, PrinterHelper *Helper, const PrintingPolicy &Policy, unsigned Indentation=0, StringRef NewlineSymbol="\, const ASTContext *Context=nullptr) const
 
void viewAST () const
 viewAST - Visualize an AST rooted at this Stmt* using GraphViz. More...
 
StmtIgnoreImplicit ()
 Skip past any implicit AST nodes which might surround this statement, such as ExprWithCleanups or ImplicitCastExpr nodes. More...
 
const StmtIgnoreImplicit () const
 
StmtIgnoreContainers (bool IgnoreCaptured=false)
 Skip no-op (attributed, compound) container stmts and skip captured stmt at the top, if IgnoreCaptured is true. More...
 
const StmtIgnoreContainers (bool IgnoreCaptured=false) const
 
const StmtstripLabelLikeStatements () const
 Strip off all label-like statements. More...
 
StmtstripLabelLikeStatements ()
 
child_range children ()
 
const_child_range children () const
 
child_iterator child_begin ()
 
child_iterator child_end ()
 
const_child_iterator child_begin () const
 
const_child_iterator child_end () const
 
void Profile (llvm::FoldingSetNodeID &ID, const ASTContext &Context, bool Canonical) const
 Produce a unique representation of the given statement. More...
 
void ProcessODRHash (llvm::FoldingSetNodeID &ID, ODRHash &Hash) const
 Calculate a unique representation for a statement that is stable across compiler invocations. More...
 

Static Public Member Functions

static bool classof (const Stmt *T)
 
- Static Public Member Functions inherited from clang::Stmt
static void addStmtClass (const StmtClass s)
 
static void EnableStatistics ()
 
static void PrintStats ()
 

Friends

class ASTStmtReader
 

Additional Inherited Members

- Public Types inherited from clang::Stmt
enum  StmtClass { NoStmtClass = 0 }
 
using child_iterator = StmtIterator
 Child Iterators: All subclasses must implement 'children' to permit easy iteration over the substatements/subexpessions of an AST node. More...
 
using const_child_iterator = ConstStmtIterator
 
using child_range = llvm::iterator_range< child_iterator >
 
using const_child_range = llvm::iterator_range< const_child_iterator >
 
- Protected Types inherited from clang::Stmt
enum  { NumStmtBits = 8 }
 
enum  { NumExprBits = NumStmtBits + 9 }
 
enum  APFloatSemantics {
  IEEEhalf, IEEEsingle, IEEEdouble, x87DoubleExtended,
  IEEEquad, PPCDoubleDouble
}
 
- Protected Member Functions inherited from clang::Stmt
void * operator new (size_t bytes) noexcept
 
void operator delete (void *data) noexcept
 
 Stmt (StmtClass SC, EmptyShell)
 Construct an empty statement. More...
 
- Protected Attributes inherited from clang::Stmt
union {
   StmtBitfields   StmtBits
 
   NullStmtBitfields   NullStmtBits
 
   CompoundStmtBitfields   CompoundStmtBits
 
   LabelStmtBitfields   LabelStmtBits
 
   AttributedStmtBitfields   AttributedStmtBits
 
   IfStmtBitfields   IfStmtBits
 
   SwitchStmtBitfields   SwitchStmtBits
 
   WhileStmtBitfields   WhileStmtBits
 
   DoStmtBitfields   DoStmtBits
 
   ForStmtBitfields   ForStmtBits
 
   GotoStmtBitfields   GotoStmtBits
 
   ContinueStmtBitfields   ContinueStmtBits
 
   BreakStmtBitfields   BreakStmtBits
 
   ReturnStmtBitfields   ReturnStmtBits
 
   SwitchCaseBitfields   SwitchCaseBits
 
   ExprBitfields   ExprBits
 
   PredefinedExprBitfields   PredefinedExprBits
 
   DeclRefExprBitfields   DeclRefExprBits
 
   FloatingLiteralBitfields   FloatingLiteralBits
 
   StringLiteralBitfields   StringLiteralBits
 
   CharacterLiteralBitfields   CharacterLiteralBits
 
   UnaryOperatorBitfields   UnaryOperatorBits
 
   UnaryExprOrTypeTraitExprBitfields   UnaryExprOrTypeTraitExprBits
 
   CallExprBitfields   CallExprBits
 
   MemberExprBitfields   MemberExprBits
 
   CastExprBitfields   CastExprBits
 
   BinaryOperatorBitfields   BinaryOperatorBits
 
   InitListExprBitfields   InitListExprBits
 
   PseudoObjectExprBitfields   PseudoObjectExprBits
 
   CXXBoolLiteralExprBitfields   CXXBoolLiteralExprBits
 
   CXXNullPtrLiteralExprBitfields   CXXNullPtrLiteralExprBits
 
   CXXThisExprBitfields   CXXThisExprBits
 
   CXXThrowExprBitfields   CXXThrowExprBits
 
   CXXDefaultArgExprBitfields   CXXDefaultArgExprBits
 
   CXXDefaultInitExprBitfields   CXXDefaultInitExprBits
 
   TypeTraitExprBitfields   TypeTraitExprBits
 
   ExprWithCleanupsBitfields   ExprWithCleanupsBits
 
   CoawaitExprBitfields   CoawaitBits
 
   ObjCIndirectCopyRestoreExprBitfields   ObjCIndirectCopyRestoreExprBits
 
   OpaqueValueExprBitfields   OpaqueValueExprBits
 
}; 
 

Detailed Description

CXXForRangeStmt - This represents C++0x [stmt.ranged]'s ranged for statement, represented as 'for (range-declarator : range-expression)' or 'for (init-statement range-declarator : range-expression)'.

This is stored in a partially-desugared form to allow full semantic analysis of the constituent components. The original syntactic components can be extracted using getLoopVariable and getRangeInit.

Definition at line 127 of file StmtCXX.h.

Constructor & Destructor Documentation

◆ CXXForRangeStmt() [1/2]

CXXForRangeStmt::CXXForRangeStmt ( Stmt InitStmt,
DeclStmt Range,
DeclStmt Begin,
DeclStmt End,
Expr Cond,
Expr Inc,
DeclStmt LoopVar,
Stmt Body,
SourceLocation  FL,
SourceLocation  CAL,
SourceLocation  CL,
SourceLocation  RPL 
)

Definition at line 48 of file StmtCXX.cpp.

◆ CXXForRangeStmt() [2/2]

clang::CXXForRangeStmt::CXXForRangeStmt ( EmptyShell  Empty)
inline

Definition at line 143 of file StmtCXX.h.

Member Function Documentation

◆ children()

child_range clang::CXXForRangeStmt::children ( )
inline

Definition at line 209 of file StmtCXX.h.

◆ classof()

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

Definition at line 204 of file StmtCXX.h.

References clang::Stmt::getStmtClass().

◆ getBeginLoc()

SourceLocation clang::CXXForRangeStmt::getBeginLoc ( ) const
inline

Definition at line 199 of file StmtCXX.h.

Referenced by DiagnoseForRangeVariableCopies().

◆ getBeginStmt() [1/2]

DeclStmt* clang::CXXForRangeStmt::getBeginStmt ( )
inline

Definition at line 155 of file StmtCXX.h.

◆ getBeginStmt() [2/2]

const DeclStmt* clang::CXXForRangeStmt::getBeginStmt ( ) const
inline

Definition at line 167 of file StmtCXX.h.

◆ getBody() [1/2]

Stmt* clang::CXXForRangeStmt::getBody ( )
inline

Definition at line 162 of file StmtCXX.h.

◆ getBody() [2/2]

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

Definition at line 182 of file StmtCXX.h.

◆ getCoawaitLoc()

SourceLocation clang::CXXForRangeStmt::getCoawaitLoc ( ) const
inline

Definition at line 195 of file StmtCXX.h.

◆ getColonLoc()

SourceLocation clang::CXXForRangeStmt::getColonLoc ( ) const
inline

Definition at line 196 of file StmtCXX.h.

References ColonLoc.

◆ getCond() [1/2]

Expr* clang::CXXForRangeStmt::getCond ( )
inline

Definition at line 159 of file StmtCXX.h.

◆ getCond() [2/2]

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

Definition at line 173 of file StmtCXX.h.

◆ getEndLoc()

SourceLocation clang::CXXForRangeStmt::getEndLoc ( ) const
inline

Definition at line 200 of file StmtCXX.h.

References clang::Stmt::getEndLoc().

◆ getEndStmt() [1/2]

DeclStmt* clang::CXXForRangeStmt::getEndStmt ( )
inline

Definition at line 158 of file StmtCXX.h.

◆ getEndStmt() [2/2]

const DeclStmt* clang::CXXForRangeStmt::getEndStmt ( ) const
inline

Definition at line 170 of file StmtCXX.h.

◆ getForLoc()

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

Definition at line 194 of file StmtCXX.h.

◆ getInc() [1/2]

Expr* clang::CXXForRangeStmt::getInc ( )
inline

Definition at line 160 of file StmtCXX.h.

◆ getInc() [2/2]

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

Definition at line 176 of file StmtCXX.h.

◆ getInit() [1/2]

Stmt* clang::CXXForRangeStmt::getInit ( )
inline

Definition at line 145 of file StmtCXX.h.

◆ getInit() [2/2]

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

Definition at line 149 of file StmtCXX.h.

◆ getLoopVariable() [1/2]

VarDecl * CXXForRangeStmt::getLoopVariable ( )

Definition at line 77 of file StmtCXX.cpp.

References getLoopVarStmt().

Referenced by DiagnoseForRangeVariableCopies(), and getLoopVariable().

◆ getLoopVariable() [2/2]

const VarDecl * CXXForRangeStmt::getLoopVariable ( ) const

Definition at line 83 of file StmtCXX.cpp.

References getLoopVariable().

◆ getLoopVarStmt() [1/2]

DeclStmt* clang::CXXForRangeStmt::getLoopVarStmt ( )
inline

Definition at line 161 of file StmtCXX.h.

Referenced by getLoopVariable().

◆ getLoopVarStmt() [2/2]

const DeclStmt* clang::CXXForRangeStmt::getLoopVarStmt ( ) const
inline

Definition at line 179 of file StmtCXX.h.

◆ getRangeInit() [1/2]

Expr * CXXForRangeStmt::getRangeInit ( )

◆ getRangeInit() [2/2]

const Expr * CXXForRangeStmt::getRangeInit ( ) const

Definition at line 73 of file StmtCXX.cpp.

References getRangeInit().

◆ getRangeStmt() [1/2]

DeclStmt* clang::CXXForRangeStmt::getRangeStmt ( )
inline

Definition at line 154 of file StmtCXX.h.

References RANGE.

Referenced by getRangeInit().

◆ getRangeStmt() [2/2]

const DeclStmt* clang::CXXForRangeStmt::getRangeStmt ( ) const
inline

Definition at line 164 of file StmtCXX.h.

References RANGE.

◆ getRParenLoc()

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

Definition at line 197 of file StmtCXX.h.

◆ setBeginStmt()

void clang::CXXForRangeStmt::setBeginStmt ( Stmt S)
inline

Definition at line 187 of file StmtCXX.h.

◆ setBody()

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

Definition at line 192 of file StmtCXX.h.

◆ setCond()

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

Definition at line 189 of file StmtCXX.h.

◆ setEndStmt()

void clang::CXXForRangeStmt::setEndStmt ( Stmt S)
inline

Definition at line 188 of file StmtCXX.h.

◆ setInc()

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

Definition at line 190 of file StmtCXX.h.

◆ setInit()

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

Definition at line 184 of file StmtCXX.h.

◆ setLoopVarStmt()

void clang::CXXForRangeStmt::setLoopVarStmt ( Stmt S)
inline

Definition at line 191 of file StmtCXX.h.

◆ setRangeInit()

void clang::CXXForRangeStmt::setRangeInit ( Expr E)
inline

Definition at line 185 of file StmtCXX.h.

References RANGE.

◆ setRangeStmt()

void clang::CXXForRangeStmt::setRangeStmt ( Stmt S)
inline

Definition at line 186 of file StmtCXX.h.

Friends And Related Function Documentation

◆ ASTStmtReader

friend class ASTStmtReader
friend

Definition at line 137 of file StmtCXX.h.


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