Home | History | Annotate | Download | only in AST

Lines Matching refs:stmt

1 //===--- Stmt.cpp - Statement AST Node Implementation ---------------------===//
10 // This file implements the Stmt class and statement subclasses.
19 #include "clang/AST/Stmt.h"
35 } StmtClassInfo[Stmt::lastStmtConstant+1];
37 static StmtClassNameTable &getStmtInfoTableEntry(Stmt::StmtClass E) {
44 #define ABSTRACT_STMT(STMT)
45 #define STMT(CLASS, PARENT) \
46 StmtClassInfo[(unsigned)Stmt::CLASS##Class].Name = #CLASS; \
47 StmtClassInfo[(unsigned)Stmt::CLASS##Class].Size = sizeof(CLASS);
53 void *Stmt::operator new(size_t bytes, const ASTContext& C,
58 const char *Stmt::getStmtClassName() const {
62 void Stmt::PrintStats() {
64 getStmtInfoTableEntry(Stmt::NullStmtClass);
67 llvm::errs() << "\n*** Stmt/Expr Stats:\n";
68 for (int i = 0; i != Stmt::lastStmtConstant+1; i++) {
74 for (int i = 0; i != Stmt::lastStmtConstant+1; i++) {
87 void Stmt::addStmtClass(StmtClass s) {
91 bool Stmt::StatisticsEnabled = false;
92 void Stmt::EnableStatistics() {
96 Stmt *Stmt::IgnoreImplicit() {
97 Stmt *s = this;
115 /// stmt at the top, if \a IgnoreCaptured is true.
116 Stmt *Stmt::IgnoreContainers(bool IgnoreCaptured) {
117 Stmt *S = this;
138 const Stmt *Stmt::stripLabelLikeStatements() const {
139 const Stmt *S = this;
161 typedef Stmt::child_range children_t();
166 static inline bad implements_children(children_t Stmt::*) {
175 static inline bad implements_getLocStart(getLocStart_t Stmt::*) {
184 static inline bad implements_getLocEnd(getLocEnd_t Stmt::*) {
196 /// Check whether the various Stmt classes implement their member
201 #define STMT(type, base) \
208 Stmt::child_range Stmt::children() {
210 case Stmt::NoStmtClass: llvm_unreachable("statement without class");
212 #define STMT(type, base) \
213 case Stmt::type##Class: \
228 SourceRange getSourceRangeImpl(const Stmt *stmt,
230 return static_cast<const S*>(stmt)->getSourceRange();
238 SourceRange getSourceRangeImpl(const Stmt *stmt,
239 SourceRange (Stmt::*v)() const) {
240 return SourceRange(static_cast<const S*>(stmt)->getLocStart(),
241 static_cast<const S*>(stmt)->getLocEnd());
245 SourceRange Stmt::getSourceRange() const {
247 case Stmt::NoStmtClass: llvm_unreachable("statement without class");
249 #define STMT(type, base) \
250 case Stmt::type##Class: \
257 SourceLocation Stmt::getLocStart() const {
260 case Stmt::NoStmtClass: llvm_unreachable("statement without class");
262 #define STMT(type, base) \
263 case Stmt::type##Class: \
270 SourceLocation Stmt::getLocEnd() const {
272 case Stmt::NoStmtClass: llvm_unreachable("statement without class");
274 #define STMT(type, base) \
275 case Stmt::type##Class: \
282 CompoundStmt::CompoundStmt(const ASTContext &C, ArrayRef<Stmt*> Stmts,
284 : Stmt(CompoundStmtClass), LBraceLoc(LB), RBraceLoc(RB) {
294 Body = new (C) Stmt*[Stmts.size()];
298 void CompoundStmt::setStmts(const ASTContext &C, ArrayRef<Stmt *> Stmts) {
305 Body = new (C) Stmt*[Stmts.size()];
315 Stmt *SubStmt) {
424 Stmt **Exprs,
440 this->Exprs = new (C) Stmt*[NumExprs];
698 Exprs = new (C) Stmt*[NumExprs];
739 Exprs = new (C) Stmt*[exprs.size()];
760 Stmt *then, SourceLocation EL, Stmt *elsev)
761 : Stmt(IfStmtClass), IfLoc(IL), ElseLoc(EL)
788 ForStmt::ForStmt(const ASTContext &C, Stmt *Init, Expr *Cond, VarDecl *condVar,
789 Expr *Inc, Stmt *Body, SourceLocation FL, SourceLocation LP,
791 : Stmt(ForStmtClass), ForLoc(FL), LParenLoc(LP), RParenLoc(RP)
820 : Stmt(SwitchStmtClass), FirstCase(nullptr, false) {
845 Stmt *SwitchCase::getSubStmt() {
851 WhileStmt::WhileStmt(const ASTContext &C, VarDecl *Var, Expr *cond, Stmt *body,
853 : Stmt(WhileStmtClass) {
897 Stmt *TryBlock,
898 Stmt *Handler)
899 : Stmt(SEHTryStmtClass),
908 SourceLocation TryLoc, Stmt *TryBlock,
909 Stmt *Handler) {
923 Stmt *Block)
924 : Stmt(SEHExceptStmtClass),
932 Expr *FilterExpr, Stmt *Block) {
937 Stmt *Block)
938 : Stmt(SEHFinallyStmtClass),
944 Stmt *Block) {
976 unsigned Size = sizeof(CapturedStmt) + sizeof(Stmt *) * (NumCaptures + 1);
987 CapturedStmt::CapturedStmt(Stmt *S, CapturedRegionKind Kind,
992 : Stmt
999 Stmt **Stored = getStoredStmts();
1012 : Stmt(CapturedStmtClass, Empty), NumCaptures(NumCaptures),
1017 CapturedStmt *CapturedStmt::Create(const ASTContext &Context, Stmt *S,
1034 unsigned Size = sizeof(CapturedStmt) + sizeof(Stmt *) * (Captures.size() + 1);
1047 unsigned Size = sizeof(CapturedStmt) + sizeof(Stmt *) * (NumCaptures + 1);
1058 Stmt::child_range CapturedStmt::children() {