return child_range(getTrailingObjects<Stmt *>(),
getTrailingObjects<Stmt *>() + hasFunctionName());
}
+
+ const_child_range children() const {
+ return const_child_range(getTrailingObjects<Stmt *>(),
+ getTrailingObjects<Stmt *>() + hasFunctionName());
+ }
};
/// ParenExpr - This represents a parethesized expression, e.g. "(1)". This
child_range children() {
return child_range(child_iterator(), child_iterator());
}
+
+ const_child_range children() const {
+ return const_child_range(const_child_iterator(), const_child_iterator());
+ }
};
/// The null pointer literal (C++11 [lex.nullptr])
child_range children() {
return child_range(child_iterator(), child_iterator());
}
+
+ const_child_range children() const {
+ return const_child_range(const_child_iterator(), const_child_iterator());
+ }
};
/// Implicit construction of a std::initializer_list<T> object from an
}
child_range children() { return child_range(&SubExpr, &SubExpr + 1); }
+
+ const_child_range children() const {
+ return const_child_range(&SubExpr, &SubExpr + 1);
+ }
};
/// A C++ \c typeid expression (C++ [expr.typeid]), which gets
auto **begin = reinterpret_cast<Stmt **>(&Operand);
return child_range(begin, begin + 1);
}
+
+ const_child_range children() const {
+ if (isTypeOperand())
+ return const_child_range(const_child_iterator(), const_child_iterator());
+
+ auto **begin =
+ reinterpret_cast<Stmt **>(&const_cast<CXXTypeidExpr *>(this)->Operand);
+ return const_child_range(begin, begin + 1);
+ }
};
/// A member reference to an MSPropertyDecl.
return child_range((Stmt**)&BaseExpr, (Stmt**)&BaseExpr + 1);
}
+ const_child_range children() const {
+ auto Children = const_cast<MSPropertyRefExpr *>(this)->children();
+ return const_child_range(Children.begin(), Children.end());
+ }
+
static bool classof(const Stmt *T) {
return T->getStmtClass() == MSPropertyRefExprClass;
}
child_range children() {
return child_range(&SubExprs[0], &SubExprs[0] + NUM_SUBEXPRS);
}
+
+ const_child_range children() const {
+ return const_child_range(&SubExprs[0], &SubExprs[0] + NUM_SUBEXPRS);
+ }
};
/// A Microsoft C++ @c __uuidof expression, which gets
auto **begin = reinterpret_cast<Stmt **>(&Operand);
return child_range(begin, begin + 1);
}
+
+ const_child_range children() const {
+ if (isTypeOperand())
+ return const_child_range(const_child_iterator(), const_child_iterator());
+ auto **begin =
+ reinterpret_cast<Stmt **>(&const_cast<CXXUuidofExpr *>(this)->Operand);
+ return const_child_range(begin, begin + 1);
+ }
};
/// Represents the \c this expression in C++.
child_range children() {
return child_range(child_iterator(), child_iterator());
}
+
+ const_child_range children() const {
+ return const_child_range(const_child_iterator(), const_child_iterator());
+ }
};
/// A C++ throw-expression (C++ [except.throw]).
child_range children() {
return child_range(&Operand, Operand ? &Operand + 1 : &Operand);
}
+
+ const_child_range children() const {
+ return const_child_range(&Operand, Operand ? &Operand + 1 : &Operand);
+ }
};
/// A default argument (C++ [dcl.fct.default]).
child_range children() {
return child_range(child_iterator(), child_iterator());
}
+
+ const_child_range children() const {
+ return const_child_range(const_child_iterator(), const_child_iterator());
+ }
};
/// A use of a default initializer in a constructor or in aggregate
child_range children() {
return child_range(child_iterator(), child_iterator());
}
+
+ const_child_range children() const {
+ return const_child_range(const_child_iterator(), const_child_iterator());
+ }
};
/// Represents a C++ temporary.
// Iterators
child_range children() { return child_range(&SubExpr, &SubExpr + 1); }
+
+ const_child_range children() const {
+ return const_child_range(&SubExpr, &SubExpr + 1);
+ }
};
/// Represents a call to a C++ constructor.
child_range children() {
return child_range(getTrailingArgs(), getTrailingArgs() + getNumArgs());
}
+
+ const_child_range children() const {
+ auto Children = const_cast<CXXConstructExpr *>(this)->children();
+ return const_child_range(Children.begin(), Children.end());
+ }
};
/// Represents a call to an inherited base class constructor from an
child_range children() {
return child_range(child_iterator(), child_iterator());
}
+
+ const_child_range children() const {
+ return const_child_range(const_child_iterator(), const_child_iterator());
+ }
};
/// Represents an explicit C++ type conversion that uses "functional"
// Includes initialization exprs plus body stmt
return child_range(getStoredStmts(), getStoredStmts() + NumCaptures + 1);
}
+
+ const_child_range children() const {
+ return const_child_range(getStoredStmts(),
+ getStoredStmts() + NumCaptures + 1);
+ }
};
/// An expression "T()" which creates a value-initialized rvalue of type
child_range children() {
return child_range(child_iterator(), child_iterator());
}
+
+ const_child_range children() const {
+ return const_child_range(const_child_iterator(), const_child_iterator());
+ }
};
/// Represents a new-expression for memory allocation and constructor
// Iterators
child_range children() { return child_range(raw_arg_begin(), raw_arg_end()); }
+
+ const_child_range children() const {
+ return const_child_range(const_cast<CXXNewExpr *>(this)->children());
+ }
};
/// Represents a \c delete expression for memory deallocation and
// Iterators
child_range children() { return child_range(&Argument, &Argument + 1); }
+
+ const_child_range children() const {
+ return const_child_range(&Argument, &Argument + 1);
+ }
};
/// Stores the type being destroyed by a pseudo-destructor expression.
// Iterators
child_range children() { return child_range(&Base, &Base + 1); }
+
+ const_child_range children() const {
+ return const_child_range(&Base, &Base + 1);
+ }
};
/// A type trait used in the implementation of various C++11 and
child_range children() {
return child_range(child_iterator(), child_iterator());
}
+
+ const_child_range children() const {
+ return const_child_range(const_child_iterator(), const_child_iterator());
+ }
};
/// An Embarcadero array type trait, as used in the implementation of
child_range children() {
return child_range(child_iterator(), child_iterator());
}
+
+ const_child_range children() const {
+ return const_child_range(const_child_iterator(), const_child_iterator());
+ }
};
/// An expression trait intrinsic.
child_range children() {
return child_range(child_iterator(), child_iterator());
}
+
+ const_child_range children() const {
+ return const_child_range(const_child_iterator(), const_child_iterator());
+ }
};
/// A reference to an overloaded function set, either an
return child_range(child_iterator(), child_iterator());
}
+ const_child_range children() const {
+ return const_child_range(const_child_iterator(), const_child_iterator());
+ }
+
static bool classof(const Stmt *T) {
return T->getStmtClass() == UnresolvedLookupExprClass;
}
child_range children() {
return child_range(child_iterator(), child_iterator());
}
+
+ const_child_range children() const {
+ return const_child_range(const_child_iterator(), const_child_iterator());
+ }
};
/// Represents an expression -- generally a full-expression -- that
// Iterators
child_range children() { return child_range(&SubExpr, &SubExpr + 1); }
+
+ const_child_range children() const {
+ return const_child_range(&SubExpr, &SubExpr + 1);
+ }
};
/// Describes an explicit type conversion that uses functional
auto **begin = reinterpret_cast<Stmt **>(arg_begin());
return child_range(begin, begin + arg_size());
}
+
+ const_child_range children() const {
+ auto **begin = reinterpret_cast<Stmt **>(
+ const_cast<CXXUnresolvedConstructExpr *>(this)->arg_begin());
+ return const_child_range(begin, begin + arg_size());
+ }
};
/// Represents a C++ member access expression where the actual
return child_range(child_iterator(), child_iterator());
return child_range(&Base, &Base + 1);
}
+
+ const_child_range children() const {
+ if (isImplicitAccess())
+ return const_child_range(const_child_iterator(), const_child_iterator());
+ return const_child_range(&Base, &Base + 1);
+ }
};
/// Represents a C++ member access expression for which lookup
return child_range(child_iterator(), child_iterator());
return child_range(&Base, &Base + 1);
}
+
+ const_child_range children() const {
+ if (isImplicitAccess())
+ return const_child_range(const_child_iterator(), const_child_iterator());
+ return const_child_range(&Base, &Base + 1);
+ }
};
DeclAccessPair *OverloadExpr::getTrailingResults() {
// Iterators
child_range children() { return child_range(&Operand, &Operand + 1); }
+
+ const_child_range children() const {
+ return const_child_range(&Operand, &Operand + 1);
+ }
};
/// Represents a C++11 pack expansion that produces a sequence of
child_range children() {
return child_range(&Pattern, &Pattern + 1);
}
+
+ const_child_range children() const {
+ return const_child_range(&Pattern, &Pattern + 1);
+ }
};
/// Represents an expression that computes the length of a parameter
child_range children() {
return child_range(child_iterator(), child_iterator());
}
+
+ const_child_range children() const {
+ return const_child_range(const_child_iterator(), const_child_iterator());
+ }
};
/// Represents a reference to a non-type template parameter
// Iterators
child_range children() { return child_range(&Replacement, &Replacement + 1); }
+
+ const_child_range children() const {
+ return const_child_range(&Replacement, &Replacement + 1);
+ }
};
/// Represents a reference to a non-type template parameter pack that
child_range children() {
return child_range(child_iterator(), child_iterator());
}
+
+ const_child_range children() const {
+ return const_child_range(const_child_iterator(), const_child_iterator());
+ }
};
/// Represents a reference to a function parameter pack that has been
child_range children() {
return child_range(child_iterator(), child_iterator());
}
+
+ const_child_range children() const {
+ return const_child_range(const_child_iterator(), const_child_iterator());
+ }
};
/// Represents a prvalue temporary that is written into memory so that
auto ES = State.get<ExtraState *>();
return child_range(&ES->Temporary, &ES->Temporary + 1);
}
+
+ const_child_range children() const {
+ if (State.is<Stmt *>())
+ return const_child_range(State.getAddrOfPtr1(),
+ State.getAddrOfPtr1() + 1);
+
+ auto ES = State.get<ExtraState *>();
+ return const_child_range(&ES->Temporary, &ES->Temporary + 1);
+ }
};
/// Represents a folding of a pack over an operator.
// Iterators
child_range children() { return child_range(SubExprs, SubExprs + 2); }
+
+ const_child_range children() const {
+ return const_child_range(SubExprs, SubExprs + 2);
+ }
};
/// Represents an expression that might suspend coroutine execution;
return child_range(SubExprs, SubExprs + SubExpr::Count);
}
+ const_child_range children() const {
+ return const_child_range(SubExprs, SubExprs + SubExpr::Count);
+ }
+
static bool classof(const Stmt *T) {
return T->getStmtClass() == CoawaitExprClass ||
T->getStmtClass() == CoyieldExprClass;
child_range children() { return child_range(SubExprs, SubExprs + 2); }
+ const_child_range children() const {
+ return const_child_range(SubExprs, SubExprs + 2);
+ }
+
static bool classof(const Stmt *T) {
return T->getStmtClass() == DependentCoawaitExprClass;
}
// Iterators
child_range children() { return child_range(&String, &String+1); }
+ const_child_range children() const {
+ return const_child_range(&String, &String + 1);
+ }
+
static bool classof(const Stmt *T) {
return T->getStmtClass() == ObjCStringLiteralClass;
}
return child_range(child_iterator(), child_iterator());
}
+ const_child_range children() const {
+ return const_child_range(const_child_iterator(), const_child_iterator());
+ }
+
static bool classof(const Stmt *T) {
return T->getStmtClass() == ObjCBoolLiteralExprClass;
}
// Iterators
child_range children() { return child_range(&SubExpr, &SubExpr+1); }
+ const_child_range children() const {
+ return const_child_range(&SubExpr, &SubExpr + 1);
+ }
+
using const_arg_iterator = ConstExprIterator;
const_arg_iterator arg_begin() const {
reinterpret_cast<Stmt **>(getElements()) + NumElements);
}
+ const_child_range children() const {
+ auto Children = const_cast<ObjCArrayLiteral *>(this)->children();
+ return const_child_range(Children.begin(), Children.end());
+ }
+
static bool classof(const Stmt *T) {
return T->getStmtClass() == ObjCArrayLiteralClass;
}
NumElements * 2);
}
+ const_child_range children() const {
+ auto Children = const_cast<ObjCDictionaryLiteral *>(this)->children();
+ return const_child_range(Children.begin(), Children.end());
+ }
+
static bool classof(const Stmt *T) {
return T->getStmtClass() == ObjCDictionaryLiteralClass;
}
return child_range(child_iterator(), child_iterator());
}
+ const_child_range children() const {
+ return const_child_range(const_child_iterator(), const_child_iterator());
+ }
+
static bool classof(const Stmt *T) {
return T->getStmtClass() == ObjCEncodeExprClass;
}
return child_range(child_iterator(), child_iterator());
}
+ const_child_range children() const {
+ return const_child_range(const_child_iterator(), const_child_iterator());
+ }
+
static bool classof(const Stmt *T) {
return T->getStmtClass() == ObjCSelectorExprClass;
}
return child_range(child_iterator(), child_iterator());
}
+ const_child_range children() const {
+ return const_child_range(const_child_iterator(), const_child_iterator());
+ }
+
static bool classof(const Stmt *T) {
return T->getStmtClass() == ObjCProtocolExprClass;
}
// Iterators
child_range children() { return child_range(&Base, &Base+1); }
+ const_child_range children() const {
+ return const_child_range(&Base, &Base + 1);
+ }
+
static bool classof(const Stmt *T) {
return T->getStmtClass() == ObjCIvarRefExprClass;
}
return child_range(child_iterator(), child_iterator());
}
+ const_child_range children() const {
+ auto Children = const_cast<ObjCPropertyRefExpr *>(this)->children();
+ return const_child_range(Children.begin(), Children.end());
+ }
+
static bool classof(const Stmt *T) {
return T->getStmtClass() == ObjCPropertyRefExprClass;
}
return child_range(SubExprs, SubExprs+END_EXPR);
}
+ const_child_range children() const {
+ return const_child_range(SubExprs, SubExprs + END_EXPR);
+ }
+
static bool classof(const Stmt *T) {
return T->getStmtClass() == ObjCSubscriptRefExprClass;
}
// Iterators
child_range children();
+ const_child_range children() const;
+
using arg_iterator = ExprIterator;
using const_arg_iterator = ConstExprIterator;
// Iterators
child_range children() { return child_range(&Base, &Base+1); }
+ const_child_range children() const {
+ return const_child_range(&Base, &Base + 1);
+ }
+
static bool classof(const Stmt *T) {
return T->getStmtClass() == ObjCIsaExprClass;
}
child_range children() { return child_range(&Operand, &Operand+1); }
+ const_child_range children() const {
+ return const_child_range(&Operand, &Operand + 1);
+ }
+
// Source locations are determined by the subexpression.
SourceLocation getBeginLoc() const LLVM_READONLY {
return Operand->getBeginLoc();
return child_range(child_iterator(), child_iterator());
}
+ const_child_range children() const {
+ return const_child_range(const_child_iterator(), const_child_iterator());
+ }
+
static bool classof(const Stmt *T) {
return T->getStmtClass() == ObjCAvailabilityCheckExprClass;
}
child_range children() {
return child_range(&SubExprs[BASE], &SubExprs[END_EXPR]);
}
+
+ const_child_range children() const {
+ return const_child_range(&SubExprs[BASE], &SubExprs[END_EXPR]);
+ }
};
} // end namespace clang
child_range children() { return child_range(&Allocator, &Allocator + 1); }
+ const_child_range children() const {
+ return const_child_range(&Allocator, &Allocator + 1);
+ }
+
static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_allocator;
}
reinterpret_cast<Stmt **>(varlist_end()));
}
+ const_child_range children() const {
+ auto Children = const_cast<OMPAllocateClause *>(this)->children();
+ return const_child_range(Children.begin(), Children.end());
+ }
+
static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_allocate;
}
child_range children() { return child_range(&Condition, &Condition + 1); }
+ const_child_range children() const {
+ return const_child_range(&Condition, &Condition + 1);
+ }
+
static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_if;
}
child_range children() { return child_range(&Condition, &Condition + 1); }
+ const_child_range children() const {
+ return const_child_range(&Condition, &Condition + 1);
+ }
+
static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_final;
}
child_range children() { return child_range(&NumThreads, &NumThreads + 1); }
+ const_child_range children() const {
+ return const_child_range(&NumThreads, &NumThreads + 1);
+ }
+
static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_num_threads;
}
child_range children() { return child_range(&Safelen, &Safelen + 1); }
+ const_child_range children() const {
+ return const_child_range(&Safelen, &Safelen + 1);
+ }
+
static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_safelen;
}
child_range children() { return child_range(&Simdlen, &Simdlen + 1); }
+ const_child_range children() const {
+ return const_child_range(&Simdlen, &Simdlen + 1);
+ }
+
static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_simdlen;
}
child_range children() { return child_range(&NumForLoops, &NumForLoops + 1); }
+ const_child_range children() const {
+ return const_child_range(&NumForLoops, &NumForLoops + 1);
+ }
+
static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_collapse;
}
return child_range(child_iterator(), child_iterator());
}
+ const_child_range children() const {
+ return const_child_range(const_child_iterator(), const_child_iterator());
+ }
+
static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_default;
}
return child_range(child_iterator(), child_iterator());
}
+ const_child_range children() const {
+ return const_child_range(const_child_iterator(), const_child_iterator());
+ }
+
static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_proc_bind;
}
return child_range(child_iterator(), child_iterator());
}
+ const_child_range children() const {
+ return const_child_range(const_child_iterator(), const_child_iterator());
+ }
+
static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_unified_address;
}
return child_range(child_iterator(), child_iterator());
}
+ const_child_range children() const {
+ return const_child_range(const_child_iterator(), const_child_iterator());
+ }
+
static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_unified_shared_memory;
}
return child_range(child_iterator(), child_iterator());
}
+ const_child_range children() const {
+ return const_child_range(const_child_iterator(), const_child_iterator());
+ }
+
static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_reverse_offload;
}
return child_range(child_iterator(), child_iterator());
}
+ const_child_range children() const {
+ return const_child_range(const_child_iterator(), const_child_iterator());
+ }
+
static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_dynamic_allocators;
}
return child_range(child_iterator(), child_iterator());
}
+ const_child_range children() const {
+ return const_child_range(const_child_iterator(), const_child_iterator());
+ }
+
static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_atomic_default_mem_order;
}
reinterpret_cast<Stmt **>(&ChunkSize) + 1);
}
+ const_child_range children() const {
+ auto Children = const_cast<OMPScheduleClause *>(this)->children();
+ return const_child_range(Children.begin(), Children.end());
+ }
+
static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_schedule;
}
child_range children() { return child_range(&NumForLoops, &NumForLoops + 1); }
+ const_child_range children() const {
+ return const_child_range(&NumForLoops, &NumForLoops + 1);
+ }
+
static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_ordered;
}
return child_range(child_iterator(), child_iterator());
}
+ const_child_range children() const {
+ return const_child_range(const_child_iterator(), const_child_iterator());
+ }
+
static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_nowait;
}
return child_range(child_iterator(), child_iterator());
}
+ const_child_range children() const {
+ return const_child_range(const_child_iterator(), const_child_iterator());
+ }
+
static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_untied;
}
return child_range(child_iterator(), child_iterator());
}
+ const_child_range children() const {
+ return const_child_range(const_child_iterator(), const_child_iterator());
+ }
+
static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_mergeable;
}
return child_range(child_iterator(), child_iterator());
}
+ const_child_range children() const {
+ return const_child_range(const_child_iterator(), const_child_iterator());
+ }
+
static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_read;
}
return child_range(child_iterator(), child_iterator());
}
+ const_child_range children() const {
+ return const_child_range(const_child_iterator(), const_child_iterator());
+ }
+
static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_write;
}
return child_range(child_iterator(), child_iterator());
}
+ const_child_range children() const {
+ return const_child_range(const_child_iterator(), const_child_iterator());
+ }
+
static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_update;
}
return child_range(child_iterator(), child_iterator());
}
+ const_child_range children() const {
+ return const_child_range(const_child_iterator(), const_child_iterator());
+ }
+
static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_capture;
}
return child_range(child_iterator(), child_iterator());
}
+ const_child_range children() const {
+ return const_child_range(const_child_iterator(), const_child_iterator());
+ }
+
static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_seq_cst;
}
reinterpret_cast<Stmt **>(varlist_end()));
}
+ const_child_range children() const {
+ auto Children = const_cast<OMPPrivateClause *>(this)->children();
+ return const_child_range(Children.begin(), Children.end());
+ }
+
static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_private;
}
reinterpret_cast<Stmt **>(varlist_end()));
}
+ const_child_range children() const {
+ auto Children = const_cast<OMPFirstprivateClause *>(this)->children();
+ return const_child_range(Children.begin(), Children.end());
+ }
+
static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_firstprivate;
}
reinterpret_cast<Stmt **>(varlist_end()));
}
+ const_child_range children() const {
+ auto Children = const_cast<OMPLastprivateClause *>(this)->children();
+ return const_child_range(Children.begin(), Children.end());
+ }
+
static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_lastprivate;
}
reinterpret_cast<Stmt **>(varlist_end()));
}
+ const_child_range children() const {
+ auto Children = const_cast<OMPSharedClause *>(this)->children();
+ return const_child_range(Children.begin(), Children.end());
+ }
+
static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_shared;
}
reinterpret_cast<Stmt **>(varlist_end()));
}
+ const_child_range children() const {
+ auto Children = const_cast<OMPReductionClause *>(this)->children();
+ return const_child_range(Children.begin(), Children.end());
+ }
+
static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_reduction;
}
reinterpret_cast<Stmt **>(varlist_end()));
}
+ const_child_range children() const {
+ auto Children = const_cast<OMPTaskReductionClause *>(this)->children();
+ return const_child_range(Children.begin(), Children.end());
+ }
+
static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_task_reduction;
}
reinterpret_cast<Stmt **>(varlist_end()));
}
+ const_child_range children() const {
+ auto Children = const_cast<OMPInReductionClause *>(this)->children();
+ return const_child_range(Children.begin(), Children.end());
+ }
+
static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_in_reduction;
}
reinterpret_cast<Stmt **>(varlist_end()));
}
+ const_child_range children() const {
+ auto Children = const_cast<OMPLinearClause *>(this)->children();
+ return const_child_range(Children.begin(), Children.end());
+ }
+
static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_linear;
}
reinterpret_cast<Stmt **>(varlist_end()));
}
+ const_child_range children() const {
+ auto Children = const_cast<OMPAlignedClause *>(this)->children();
+ return const_child_range(Children.begin(), Children.end());
+ }
+
static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_aligned;
}
reinterpret_cast<Stmt **>(varlist_end()));
}
+ const_child_range children() const {
+ auto Children = const_cast<OMPCopyinClause *>(this)->children();
+ return const_child_range(Children.begin(), Children.end());
+ }
+
static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_copyin;
}
reinterpret_cast<Stmt **>(varlist_end()));
}
+ const_child_range children() const {
+ auto Children = const_cast<OMPCopyprivateClause *>(this)->children();
+ return const_child_range(Children.begin(), Children.end());
+ }
+
static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_copyprivate;
}
reinterpret_cast<Stmt **>(varlist_end()));
}
+ const_child_range children() const {
+ auto Children = const_cast<OMPFlushClause *>(this)->children();
+ return const_child_range(Children.begin(), Children.end());
+ }
+
static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_flush;
}
reinterpret_cast<Stmt **>(varlist_end()));
}
+ const_child_range children() const {
+ auto Children = const_cast<OMPDependClause *>(this)->children();
+ return const_child_range(Children.begin(), Children.end());
+ }
+
static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_depend;
}
child_range children() { return child_range(&Device, &Device + 1); }
+ const_child_range children() const {
+ return const_child_range(&Device, &Device + 1);
+ }
+
static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_device;
}
return child_range(child_iterator(), child_iterator());
}
+ const_child_range children() const {
+ return const_child_range(const_child_iterator(), const_child_iterator());
+ }
+
static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_threads;
}
return child_range(child_iterator(), child_iterator());
}
+ const_child_range children() const {
+ return const_child_range(const_child_iterator(), const_child_iterator());
+ }
+
static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_simd;
}
reinterpret_cast<Stmt **>(varlist_end()));
}
+ const_child_range children() const {
+ auto Children = const_cast<OMPMapClause *>(this)->children();
+ return const_child_range(Children.begin(), Children.end());
+ }
+
static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_map;
}
child_range children() { return child_range(&NumTeams, &NumTeams + 1); }
+ const_child_range children() const {
+ return const_child_range(&NumTeams, &NumTeams + 1);
+ }
+
static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_num_teams;
}
child_range children() { return child_range(&ThreadLimit, &ThreadLimit + 1); }
+ const_child_range children() const {
+ return const_child_range(&ThreadLimit, &ThreadLimit + 1);
+ }
+
static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_thread_limit;
}
child_range children() { return child_range(&Priority, &Priority + 1); }
+ const_child_range children() const {
+ return const_child_range(&Priority, &Priority + 1);
+ }
+
static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_priority;
}
child_range children() { return child_range(&Grainsize, &Grainsize + 1); }
+ const_child_range children() const {
+ return const_child_range(&Grainsize, &Grainsize + 1);
+ }
+
static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_grainsize;
}
return child_range(child_iterator(), child_iterator());
}
+ const_child_range children() const {
+ return const_child_range(const_child_iterator(), const_child_iterator());
+ }
+
static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_nogroup;
}
child_range children() { return child_range(&NumTasks, &NumTasks + 1); }
+ const_child_range children() const {
+ return const_child_range(&NumTasks, &NumTasks + 1);
+ }
+
static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_num_tasks;
}
child_range children() { return child_range(&Hint, &Hint + 1); }
+ const_child_range children() const {
+ return const_child_range(&Hint, &Hint + 1);
+ }
+
static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_hint;
}
reinterpret_cast<Stmt **>(&ChunkSize) + 1);
}
+ const_child_range children() const {
+ auto Children = const_cast<OMPDistScheduleClause *>(this)->children();
+ return const_child_range(Children.begin(), Children.end());
+ }
+
static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_dist_schedule;
}
return child_range(child_iterator(), child_iterator());
}
+ const_child_range children() const {
+ return const_child_range(const_child_iterator(), const_child_iterator());
+ }
+
static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_defaultmap;
}
reinterpret_cast<Stmt **>(varlist_end()));
}
+ const_child_range children() const {
+ auto Children = const_cast<OMPToClause *>(this)->children();
+ return const_child_range(Children.begin(), Children.end());
+ }
+
static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_to;
}
reinterpret_cast<Stmt **>(varlist_end()));
}
+ const_child_range children() const {
+ auto Children = const_cast<OMPFromClause *>(this)->children();
+ return const_child_range(Children.begin(), Children.end());
+ }
+
static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_from;
}
reinterpret_cast<Stmt **>(varlist_end()));
}
+ const_child_range children() const {
+ auto Children = const_cast<OMPUseDevicePtrClause *>(this)->children();
+ return const_child_range(Children.begin(), Children.end());
+ }
+
static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_use_device_ptr;
}
reinterpret_cast<Stmt **>(varlist_end()));
}
+ const_child_range children() const {
+ auto Children = const_cast<OMPIsDevicePtrClause *>(this)->children();
+ return const_child_range(Children.begin(), Children.end());
+ }
+
static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_is_device_ptr;
}
child_iterator(DG.end(), DG.end()));
}
+ const_child_range children() const {
+ auto Children = const_cast<DeclStmt *>(this)->children();
+ return const_child_range(Children);
+ }
+
using decl_iterator = DeclGroupRef::iterator;
using const_decl_iterator = DeclGroupRef::const_iterator;
using decl_range = llvm::iterator_range<decl_iterator>;
child_range children() {
return child_range(child_iterator(), child_iterator());
}
+
+ const_child_range children() const {
+ return const_child_range(const_child_iterator(), const_child_iterator());
+ }
};
/// CompoundStmt - This represents a group of statements like { stmt stmt }.
getTrailingObjects<Stmt *>() +
numTrailingObjects(OverloadToken<Stmt *>()));
}
+
+ const_child_range children() const {
+ return const_child_range(getTrailingObjects<Stmt *>(),
+ getTrailingObjects<Stmt *>() +
+ numTrailingObjects(OverloadToken<Stmt *>()));
+ }
};
class DefaultStmt : public SwitchCase {
// Iterators
child_range children() { return child_range(&SubStmt, &SubStmt + 1); }
+
+ const_child_range children() const {
+ return const_child_range(&SubStmt, &SubStmt + 1);
+ }
};
SourceLocation SwitchCase::getEndLoc() const {
child_range children() { return child_range(&SubStmt, &SubStmt + 1); }
+ const_child_range children() const {
+ return const_child_range(&SubStmt, &SubStmt + 1);
+ }
+
static bool classof(const Stmt *T) {
return T->getStmtClass() == LabelStmtClass;
}
child_range children() { return child_range(&SubStmt, &SubStmt + 1); }
+ const_child_range children() const {
+ return const_child_range(&SubStmt, &SubStmt + 1);
+ }
+
static bool classof(const Stmt *T) {
return T->getStmtClass() == AttributedStmtClass;
}
numTrailingObjects(OverloadToken<Stmt *>()));
}
+ const_child_range children() const {
+ return const_child_range(getTrailingObjects<Stmt *>(),
+ getTrailingObjects<Stmt *>() +
+ numTrailingObjects(OverloadToken<Stmt *>()));
+ }
+
static bool classof(const Stmt *T) {
return T->getStmtClass() == IfStmtClass;
}
numTrailingObjects(OverloadToken<Stmt *>()));
}
+ const_child_range children() const {
+ return const_child_range(getTrailingObjects<Stmt *>(),
+ getTrailingObjects<Stmt *>() +
+ numTrailingObjects(OverloadToken<Stmt *>()));
+ }
+
static bool classof(const Stmt *T) {
return T->getStmtClass() == SwitchStmtClass;
}
getTrailingObjects<Stmt *>() +
numTrailingObjects(OverloadToken<Stmt *>()));
}
+
+ const_child_range children() const {
+ return const_child_range(getTrailingObjects<Stmt *>(),
+ getTrailingObjects<Stmt *>() +
+ numTrailingObjects(OverloadToken<Stmt *>()));
+ }
};
/// DoStmt - This represents a 'do/while' stmt.
child_range children() {
return child_range(&SubExprs[0], &SubExprs[0] + END_EXPR);
}
+
+ const_child_range children() const {
+ return const_child_range(&SubExprs[0], &SubExprs[0] + END_EXPR);
+ }
};
/// ForStmt - This represents a 'for (init;cond;inc)' stmt. Note that any of
child_range children() {
return child_range(&SubExprs[0], &SubExprs[0]+END_EXPR);
}
+
+ const_child_range children() const {
+ return const_child_range(&SubExprs[0], &SubExprs[0] + END_EXPR);
+ }
};
/// GotoStmt - This represents a direct goto.
child_range children() {
return child_range(child_iterator(), child_iterator());
}
+
+ const_child_range children() const {
+ return const_child_range(const_child_iterator(), const_child_iterator());
+ }
};
/// IndirectGotoStmt - This represents an indirect goto.
// Iterators
child_range children() { return child_range(&Target, &Target + 1); }
+
+ const_child_range children() const {
+ return const_child_range(&Target, &Target + 1);
+ }
};
/// ContinueStmt - This represents a continue.
child_range children() {
return child_range(child_iterator(), child_iterator());
}
+
+ const_child_range children() const {
+ return const_child_range(const_child_iterator(), const_child_iterator());
+ }
};
/// BreakStmt - This represents a break.
child_range children() {
return child_range(child_iterator(), child_iterator());
}
+
+ const_child_range children() const {
+ return const_child_range(const_child_iterator(), const_child_iterator());
+ }
};
/// ReturnStmt - This represents a return, optionally of an expression:
return child_range(&RetExpr, &RetExpr + 1);
return child_range(child_iterator(), child_iterator());
}
+
+ const_child_range children() const {
+ if (RetExpr)
+ return const_child_range(&RetExpr, &RetExpr + 1);
+ return const_child_range(const_child_iterator(), const_child_iterator());
+ }
};
/// AsmStmt is the base class for GCCAsmStmt and MSAsmStmt.
child_range children() {
return child_range(&Exprs[0], &Exprs[0] + NumOutputs + NumInputs);
}
+
+ const_child_range children() const {
+ return const_child_range(&Exprs[0], &Exprs[0] + NumOutputs + NumInputs);
+ }
};
/// This represents a GCC inline-assembly statement extension.
child_range children() {
return child_range(&Exprs[0], &Exprs[NumInputs + NumOutputs]);
}
+
+ const_child_range children() const {
+ return const_child_range(&Exprs[0], &Exprs[NumInputs + NumOutputs]);
+ }
};
class SEHExceptStmt : public Stmt {
return child_range(Children, Children+2);
}
+ const_child_range children() const {
+ return const_child_range(Children, Children + 2);
+ }
+
static bool classof(const Stmt *T) {
return T->getStmtClass() == SEHExceptStmtClass;
}
return child_range(&Block,&Block+1);
}
+ const_child_range children() const {
+ return const_child_range(&Block, &Block + 1);
+ }
+
static bool classof(const Stmt *T) {
return T->getStmtClass() == SEHFinallyStmtClass;
}
return child_range(Children, Children+2);
}
+ const_child_range children() const {
+ return const_child_range(Children, Children + 2);
+ }
+
static bool classof(const Stmt *T) {
return T->getStmtClass() == SEHTryStmtClass;
}
child_range children() {
return child_range(child_iterator(), child_iterator());
}
+
+ const_child_range children() const {
+ return const_child_range(const_child_iterator(), const_child_iterator());
+ }
};
/// This captures a statement into a function. For example, the following
}
child_range children();
+
+ const_child_range children() const;
};
} // namespace clang
child_range children() { return child_range(&HandlerBlock, &HandlerBlock+1); }
+ const_child_range children() const {
+ return const_child_range(&HandlerBlock, &HandlerBlock + 1);
+ }
+
friend class ASTStmtReader;
};
child_range children() {
return child_range(getStmts(), getStmts() + getNumHandlers() + 1);
}
+
+ const_child_range children() const {
+ return const_child_range(getStmts(), getStmts() + getNumHandlers() + 1);
+ }
};
/// CXXForRangeStmt - This represents C++0x [stmt.ranged]'s ranged for
child_range children() {
return child_range(&SubExprs[0], &SubExprs[END]);
}
+
+ const_child_range children() const {
+ return const_child_range(&SubExprs[0], &SubExprs[END]);
+ }
};
/// Representation of a Microsoft __if_exists or __if_not_exists
return child_range(&SubStmt, &SubStmt+1);
}
+ const_child_range children() const {
+ return const_child_range(&SubStmt, &SubStmt + 1);
+ }
+
static bool classof(const Stmt *T) {
return T->getStmtClass() == MSDependentExistsStmtClass;
}
getStoredStmts() + SubStmt::FirstParamMove + NumParams);
}
+ const_child_range children() const {
+ return const_child_range(getStoredStmts(), getStoredStmts() +
+ SubStmt::FirstParamMove +
+ NumParams);
+ }
+
static bool classof(const Stmt *T) {
return T->getStmtClass() == CoroutineBodyStmtClass;
}
return child_range(SubStmts, SubStmts + SubStmt::Count);
}
+ const_child_range children() const {
+ if (!getOperand())
+ return const_child_range(SubStmts + SubStmt::PromiseCall,
+ SubStmts + SubStmt::Count);
+ return const_child_range(SubStmts, SubStmts + SubStmt::Count);
+ }
+
static bool classof(const Stmt *T) {
return T->getStmtClass() == CoreturnStmtClass;
}
child_range children() {
return child_range(&SubExprs[0], &SubExprs[END_EXPR]);
}
+
+ const_child_range children() const {
+ return const_child_range(&SubExprs[0], &SubExprs[END_EXPR]);
+ }
};
/// Represents Objective-C's \@catch statement.
}
child_range children() { return child_range(&Body, &Body + 1); }
+
+ const_child_range children() const {
+ return const_child_range(&Body, &Body + 1);
+ }
};
/// Represents Objective-C's \@finally statement
child_range children() {
return child_range(&AtFinallyStmt, &AtFinallyStmt+1);
}
+
+ const_child_range children() const {
+ return const_child_range(&AtFinallyStmt, &AtFinallyStmt + 1);
+ }
};
/// Represents Objective-C's \@try ... \@catch ... \@finally statement.
return child_range(getStmts(),
getStmts() + 1 + NumCatchStmts + HasFinally);
}
+
+ const_child_range children() const {
+ return const_child_range(const_cast<ObjCAtTryStmt *>(this)->children());
+ }
};
/// Represents Objective-C's \@synchronized statement.
child_range children() {
return child_range(&SubStmts[0], &SubStmts[0]+END_EXPR);
}
+
+ const_child_range children() const {
+ return const_child_range(&SubStmts[0], &SubStmts[0] + END_EXPR);
+ }
};
/// Represents Objective-C's \@throw statement.
}
child_range children() { return child_range(&Throw, &Throw+1); }
+
+ const_child_range children() const {
+ return const_child_range(&Throw, &Throw + 1);
+ }
};
/// Represents Objective-C's \@autoreleasepool Statement
}
child_range children() { return child_range(&SubStmt, &SubStmt + 1); }
+
+ const_child_range children() const {
+ return const_child_range(&SubStmt, &SubStmt + 1);
+ }
};
} // end namespace clang
return child_range(ChildStorage, ChildStorage + 1);
}
+ const_child_range children() const {
+ if (!hasAssociatedStmt())
+ return const_child_range(const_child_iterator(), const_child_iterator());
+ Stmt **ChildStorage = reinterpret_cast<Stmt **>(
+ const_cast<OMPExecutableDirective *>(this)->getClauses().end());
+ return const_child_range(ChildStorage, ChildStorage + 1);
+ }
+
ArrayRef<OMPClause *> clauses() { return getClauses(); }
ArrayRef<OMPClause *> clauses() const {
reinterpret_cast<Stmt **>(getArgs() + getNumArgs()));
}
+Stmt::const_child_range ObjCMessageExpr::children() const {
+ auto Children = const_cast<ObjCMessageExpr *>(this)->children();
+ return const_child_range(Children.begin(), Children.end());
+}
+
StringRef ObjCBridgedCastExpr::getBridgeKindName() const {
switch (getBridgeKind()) {
case OBC_Bridge:
return child_range(getStoredStmts(), getStoredStmts() + NumCaptures);
}
+Stmt::const_child_range CapturedStmt::children() const {
+ return const_child_range(getStoredStmts(), getStoredStmts() + NumCaptures);
+}
+
CapturedDecl *CapturedStmt::getCapturedDecl() {
return CapDeclAndKind.getPointer();
}