• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/contrib/llvm-project/clang/lib/AST/

Lines Matching refs:Stmt

1 //===- Stmt.cpp - Statement AST Node Implementation -----------------------===//
9 // This file implements the Stmt class and statement subclasses.
13 #include "clang/AST/Stmt.h"
53 } StmtClassInfo[Stmt::lastStmtConstant+1];
55 static StmtClassNameTable &getStmtInfoTableEntry(Stmt::StmtClass E) {
64 StmtClassInfo[(unsigned)Stmt::CLASS##Class].Name = #CLASS; \
65 StmtClassInfo[(unsigned)Stmt::CLASS##Class].Size = sizeof(CLASS);
71 void *Stmt::operator new(size_t bytes, const ASTContext& C,
76 const char *Stmt::getStmtClassName() const {
98 void Stmt::PrintStats() {
100 getStmtInfoTableEntry(Stmt::NullStmtClass);
103 llvm::errs() << "\n*** Stmt/Expr Stats:\n";
104 for (int i = 0; i != Stmt::lastStmtConstant+1; i++) {
110 for (int i = 0; i != Stmt::lastStmtConstant+1; i++) {
123 void Stmt::addStmtClass(StmtClass s) {
127 bool Stmt::StatisticsEnabled = false;
128 void Stmt::EnableStatistics() {
134 Stmt *Stmt::IgnoreContainers(bool IgnoreCaptured) {
135 Stmt *S = this;
156 const Stmt *Stmt::stripLabelLikeStatements() const {
157 const Stmt *S = this;
180 typedef Stmt::child_range children_t();
185 static bad implements_children(children_t Stmt::*) {
194 static bad implements_getBeginLoc(getBeginLoc_t Stmt::*) { return bad(); }
201 static bad implements_getEndLoc(getLocEnd_t Stmt::*) { return bad(); }
212 /// Check whether the various Stmt classes implement their member
224 Stmt::child_range Stmt::children() {
226 case Stmt::NoStmtClass: llvm_unreachable("statement without class");
229 case Stmt::type##Class: \
245 SourceRange getSourceRangeImpl(const Stmt *stmt,
255 SourceRange getSourceRangeImpl(const Stmt *stmt,
256 SourceRange (Stmt::*v)() const) {
263 SourceRange Stmt::getSourceRange() const {
265 case Stmt::NoStmtClass: llvm_unreachable("statement without class");
268 case Stmt::type##Class: \
275 SourceLocation Stmt::getBeginLoc() const {
277 case Stmt::NoStmtClass: llvm_unreachable("statement without class");
280 case Stmt::type##Class: \
287 SourceLocation Stmt::getEndLoc() const {
289 case Stmt::NoStmtClass: llvm_unreachable("statement without class");
292 case Stmt::type##Class: \
299 int64_t Stmt::getID(const ASTContext &Context) const {
300 return Context.getAllocator().identifyKnownAlignedObject<Stmt>(this);
303 CompoundStmt::CompoundStmt(ArrayRef<Stmt *> Stmts, SourceLocation LB,
305 : Stmt(CompoundStmtClass), RBraceLoc(RB) {
311 void CompoundStmt::setStmts(ArrayRef<Stmt *> Stmts) {
318 CompoundStmt *CompoundStmt::Create(const ASTContext &C, ArrayRef<Stmt *> Stmts,
321 C.Allocate(totalSizeToAlloc<Stmt *>(Stmts.size()), alignof(CompoundStmt));
328 C.Allocate(totalSizeToAlloc<Stmt *>(NumStmts), alignof(CompoundStmt));
335 const Stmt *S = this;
357 Stmt *SubStmt) {
475 Stmt **Exprs,
494 this->Exprs = new (C) Stmt*[NumExprs];
768 Exprs = new (C) Stmt*[NumExprs];
809 Exprs = new (C) Stmt*[exprs.size()];
830 Stmt *Init, VarDecl *Var, Expr *Cond, Stmt *Then,
831 SourceLocation EL, Stmt *Else)
832 : Stmt(IfStmtClass) {
857 : Stmt(IfStmtClass, Empty) {
864 bool IsConstexpr, Stmt *Init, VarDecl *Var, Expr *Cond,
865 Stmt *Then, SourceLocation EL, Stmt *Else) {
870 totalSizeToAlloc<Stmt *, SourceLocation>(
880 totalSizeToAlloc<Stmt *, SourceLocation>(
898 getTrailingObjects<Stmt *>()[varOffset()] = nullptr;
903 getTrailingObjects<Stmt *>()[varOffset()] = new (Ctx)
911 Optional<const Stmt*> IfStmt::getNondiscardedCase(const ASTContext &Ctx) const {
917 ForStmt::ForStmt(const ASTContext &C, Stmt *Init, Expr *Cond, VarDecl *condVar,
918 Expr *Inc, Stmt *Body, SourceLocation FL, SourceLocation LP,
920 : Stmt(ForStmtClass), LParenLoc(LP), RParenLoc(RP)
949 SwitchStmt::SwitchStmt(const ASTContext &Ctx, Stmt *Init, VarDecl *Var,
951 : Stmt(SwitchStmtClass), FirstCase(nullptr) {
969 : Stmt(SwitchStmtClass, Empty) {
975 SwitchStmt *SwitchStmt::Create(const ASTContext &Ctx, Stmt *Init, VarDecl *Var,
980 totalSizeToAlloc<Stmt *>(NumMandatoryStmtPtr + HasInit + HasVar),
988 totalSizeToAlloc<Stmt *>(NumMandatoryStmtPtr + HasInit + HasVar),
1005 getTrailingObjects<Stmt *>()[varOffset()] = nullptr;
1010 getTrailingObjects<Stmt *>()[varOffset()] = new (Ctx)
1015 Stmt *Body, SourceLocation WL, SourceLocation LParenLoc,
1017 : Stmt(WhileStmtClass) {
1032 : Stmt(WhileStmtClass, Empty) {
1037 Stmt *Body, SourceLocation WL,
1042 Ctx.Allocate(totalSizeToAlloc<Stmt *>(NumMandatoryStmtPtr + HasVar),
1049 Ctx.Allocate(totalSizeToAlloc<Stmt *>(NumMandatoryStmtPtr + HasVar),
1066 getTrailingObjects<Stmt *>()[varOffset()] = nullptr;
1071 getTrailingObjects<Stmt *>()[varOffset()] = new (Ctx)
1084 : Stmt(ReturnStmtClass), RetExpr(E) {
1093 : Stmt(ReturnStmtClass, Empty) {
1118 totalSizeToAlloc<Stmt *, SourceLocation>(
1127 totalSizeToAlloc<Stmt *, SourceLocation>(
1133 SEHTryStmt::SEHTryStmt(bool IsCXXTry, SourceLocation TryLoc, Stmt *TryBlock,
1134 Stmt *Handler)
1135 : Stmt(SEHTryStmtClass), IsCXXTry(IsCXXTry), TryLoc(TryLoc) {
1141 SourceLocation TryLoc, Stmt *TryBlock,
1142 Stmt *Handler) {
1154 SEHExceptStmt::SEHExceptStmt(SourceLocation Loc, Expr *FilterExpr, Stmt *Block)
1155 : Stmt(SEHExceptStmtClass), Loc(Loc) {
1161 Expr *FilterExpr, Stmt *Block) {
1165 SEHFinallyStmt::SEHFinallyStmt(SourceLocation Loc, Stmt *Block)
1166 : Stmt(SEHFinallyStmtClass), Loc(Loc), Block(Block) {}
1169 Stmt *Block) {
1212 unsigned Size = sizeof(CapturedStmt) + sizeof(Stmt *) * (NumCaptures + 1);
1222 CapturedStmt::CapturedStmt(Stmt *S, CapturedRegionKind Kind,
1227 : Stmt(CapturedStmtClass), NumCaptures(Captures.size()),
1234 Stmt **Stored = getStoredStmts();
1247 : Stmt(CapturedStmtClass, Empty), NumCaptures(NumCaptures),
1252 CapturedStmt *CapturedStmt::Create(const ASTContext &Context, Stmt *S,
1269 unsigned Size = sizeof(CapturedStmt) + sizeof(Stmt *) * (Captures.size() + 1);
1282 unsigned Size = sizeof(CapturedStmt) + sizeof(Stmt *) * (NumCaptures + 1);
1293 Stmt::child_range CapturedStmt::children() {
1298 Stmt::const_child_range CapturedStmt::children() const {