13#ifndef LLVM_CLANG_AST_STMT_H
14#define LLVM_CLANG_AST_STMT_H
25#include "llvm/ADT/APFloat.h"
26#include "llvm/ADT/ArrayRef.h"
27#include "llvm/ADT/BitmaskEnum.h"
28#include "llvm/ADT/PointerIntPair.h"
29#include "llvm/ADT/StringRef.h"
30#include "llvm/ADT/iterator.h"
31#include "llvm/ADT/iterator_range.h"
32#include "llvm/Support/Casting.h"
33#include "llvm/Support/Compiler.h"
34#include "llvm/Support/ErrorHandling.h"
44class FoldingSetNodeID;
72class alignas(void *)
Stmt {
76#define STMT(CLASS, PARENT) CLASS##Class,
77#define STMT_RANGE(BASE, FIRST, LAST) \
78 first##BASE##Constant=FIRST##Class, last##BASE##Constant=LAST##Class,
79#define LAST_STMT_RANGE(BASE, FIRST, LAST) \
80 first##BASE##Constant=FIRST##Class, last##BASE##Constant=LAST##Class
81#define ABSTRACT_STMT(STMT)
82#include "clang/AST/StmtNodes.inc"
90 void *
operator new(
size_t bytes)
noexcept {
91 llvm_unreachable(
"Stmts cannot be allocated with regular 'new'.");
94 void operator delete(
void *data)
noexcept {
95 llvm_unreachable(
"Stmts cannot be released with regular 'delete'.");
122 unsigned HasLeadingEmptyMacro : 1;
136 unsigned HasFPFeatures : 1;
172 unsigned HasElse : 1;
178 unsigned HasInit : 1;
190 unsigned HasInit : 1;
198 unsigned AllEnumCasesCovered : 1;
269 unsigned HasNRVOCandidate : 1;
283 unsigned CaseStmtIsGNURange : 1;
317 unsigned ValueKind : 2;
318 unsigned ObjectKind : 3;
319 unsigned Dependent : llvm::BitWidth<ExprDependence>;
331 unsigned ResultKind : 2;
334 unsigned APValueKind : 4;
338 unsigned IsUnsigned : 1;
343 unsigned BitWidth : 7;
347 unsigned HasCleanup : 1;
350 unsigned IsImmediateInvocation : 1;
365 unsigned HasFunctionName : 1;
369 unsigned IsTransparent : 1;
381 unsigned HasQualifier : 1;
382 unsigned HasTemplateKWAndArgsInfo : 1;
383 unsigned HasFoundDecl : 1;
384 unsigned HadMultipleCandidates : 1;
385 unsigned RefersToEnclosingVariableOrCapture : 1;
399 llvm::APFloat::S_MaxSemantics < 16,
400 "Too many Semantics enum values to fit in bitfield of size 4");
401 unsigned Semantics : 4;
402 unsigned IsExact : 1;
418 unsigned CharByteWidth : 3;
420 unsigned IsPascal : 1;
424 unsigned NumConcatenated;
441 unsigned CanOverflow : 1;
446 unsigned HasFPFeatures : 1;
474 unsigned NumPreArgs : 1;
477 unsigned UsesADL : 1;
480 unsigned HasFPFeatures : 1;
488 unsigned OffsetToTrailingObjects : 8;
499 unsigned IsArrow : 1;
505 unsigned HasQualifierOrFoundDecl : 1;
512 unsigned HasTemplateKWAndArgsInfo : 1;
516 unsigned HadMultipleCandidates : 1;
534 unsigned PartOfExplicitCast : 1;
537 unsigned HasFPFeatures : 1;
541 unsigned BasePathSize;
554 unsigned HasFPFeatures : 1;
566 unsigned HadArrayRangeDesignator : 1;
597 unsigned NumSubExprs : 8;
621 unsigned TemplateDepth;
634 unsigned OperatorKind : 6;
643 unsigned IsReversed : 1;
673 unsigned IsImplicit : 1;
686 unsigned IsThrownVariableInScope : 1;
699 unsigned HasRewrittenInit : 1;
713 unsigned HasRewrittenInit : 1;
736 unsigned IsGlobalNew : 1;
740 unsigned IsArray : 1;
743 unsigned ShouldPassAlignment : 1;
747 unsigned UsualArrayDeleteWantsSize : 1;
752 unsigned StoredInitializationStyle : 2;
755 unsigned IsParenTypeId : 1;
758 unsigned NumPlacementArgs;
768 unsigned GlobalDelete : 1;
771 unsigned ArrayForm : 1;
776 unsigned ArrayFormAsWritten : 1;
780 unsigned UsualArrayDeleteWantsSize : 1;
815 unsigned HasTemplateKWAndArgsInfo : 1;
824 unsigned Elidable : 1;
825 unsigned HadMultipleCandidates : 1;
826 unsigned ListInitialization : 1;
827 unsigned StdInitListInitialization : 1;
828 unsigned ZeroInitialization : 1;
829 unsigned ConstructionKind : 3;
841 unsigned CleanupsHaveSideEffects : 1;
864 unsigned IsArrow : 1;
868 unsigned HasTemplateKWAndArgsInfo : 1;
872 unsigned HasFirstQualifierFoundInScope : 1;
886 unsigned HasTemplateKWAndArgsInfo : 1;
906 unsigned RequiresADL : 1;
910 unsigned Overloaded : 1;
913 "UnresolvedLookupExprBitfields must be <= than 4 bytes to"
914 "avoid trashing OverloadExprBitfields::NumResults!");
924 unsigned IsArrow : 1;
927 unsigned HasUnresolvedUsing : 1;
930 "UnresolvedMemberExprBitfields must be <= than 4 bytes to"
931 "avoid trashing OverloadExprBitfields::NumResults!");
961 unsigned CaptureDefault : 2;
965 unsigned ExplicitParams : 1;
968 unsigned ExplicitResultType : 1;
971 unsigned NumCaptures : 16;
981 unsigned IsSatisfied : 1;
992 unsigned IsImplicit : 1;
1002 unsigned ShouldCopy : 1;
1015 unsigned IsUnique : 1;
1103 unsigned alignment = 8);
1106 unsigned alignment = 8) {
1107 return operator new(
bytes, *
C, alignment);
1110 void *
operator new(
size_t bytes,
void *mem)
noexcept {
return mem; }
1114 void operator delete(
void *,
size_t)
noexcept {}
1115 void operator delete(
void *,
void *)
noexcept {}
1136 template<
typename T,
typename TPtr = T *,
typename StmtPtr = Stmt *>
1138 : llvm::iterator_adaptor_base<CastIterator<T, TPtr, StmtPtr>, StmtPtr *,
1139 std::random_access_iterator_tag, TPtr> {
1140 using Base =
typename CastIterator::iterator_adaptor_base;
1146 return cast_or_null<T>(*this->I);
1151 template <
typename T>
1159 static bool StatisticsEnabled;
1173 static_assert(
sizeof(*this) <= 8,
1174 "changing bitfields changed sizeof(Stmt)");
1175 static_assert(
sizeof(*this) %
alignof(
void *) == 0,
1176 "Insufficient alignment!");
1216 static
std::tuple<
bool, const
Attr *, const
Attr *>
1235 StringRef NewlineSymbol = "\n",
1239 unsigned Indentation = 0,
1240 StringRef NewlineSymbol = "\n",
1260 return const_cast<Stmt*
>(
1299 bool Canonical)
const;
1321 :
Stmt(DeclStmtClass), DG(dg), StartLoc(startLoc), EndLoc(endLoc) {}
1390 :
Stmt(NullStmtClass) {
1424 private llvm::TrailingObjects<CompoundStmt, Stmt *, FPOptionsOverride> {
1426 friend TrailingObjects;
1443 *getTrailingObjects<FPOptionsOverride>() = F;
1446 size_t numTrailingObjects(OverloadToken<Stmt *>)
const {
1451 static CompoundStmt *
Create(
const ASTContext &
C, ArrayRef<Stmt *> Stmts,
1452 FPOptionsOverride FPFeatures, SourceLocation LB,
1457 :
Stmt(CompoundStmtClass), LBraceLoc(Loc), RBraceLoc(Loc) {
1464 bool HasFPFeatures);
1474 return *getTrailingObjects<FPOptionsOverride>();
1497 return getTrailingObjects<Stmt *>();
1521 std::reverse_iterator<const_body_iterator>;
1540 for (
auto *B : llvm::reverse(
body())) {
1541 if (!isa<NullStmt>(B))
1608 return T->getStmtClass() == CaseStmtClass ||
1609 T->getStmtClass() == DefaultStmtClass;
1617 private llvm::TrailingObjects<CaseStmt, Stmt *, SourceLocation> {
1618 friend TrailingObjects;
1635 enum { LhsOffset = 0, SubStmtOffsetFromRhs = 1 };
1636 enum { NumMandatoryStmtPtr = 2 };
1638 unsigned numTrailingObjects(OverloadToken<Stmt *>)
const {
1642 unsigned numTrailingObjects(OverloadToken<SourceLocation>)
const {
1646 unsigned lhsOffset()
const {
return LhsOffset; }
1648 unsigned subStmtOffset()
const {
return rhsOffset() + SubStmtOffsetFromRhs; }
1654 :
SwitchCase(CaseStmtClass, caseLoc, colonLoc) {
1656 bool IsGNURange = rhs !=
nullptr;
1700 "setEllipsisLoc but this is not a case stmt of the form LHS ... RHS!");
1701 *getTrailingObjects<SourceLocation>() = L;
1705 return reinterpret_cast<Expr *
>(getTrailingObjects<Stmt *>()[lhsOffset()]);
1709 return reinterpret_cast<Expr *
>(getTrailingObjects<Stmt *>()[lhsOffset()]);
1713 getTrailingObjects<Stmt *>()[lhsOffset()] =
reinterpret_cast<Stmt *
>(Val);
1718 getTrailingObjects<Stmt *>()[rhsOffset()])
1724 getTrailingObjects<Stmt *>()[rhsOffset()])
1730 "setRHS but this is not a case stmt of the form LHS ... RHS!");
1731 getTrailingObjects<Stmt *>()[rhsOffset()] =
reinterpret_cast<Stmt *
>(Val);
1736 return getTrailingObjects<Stmt *>()[subStmtOffset()];
1740 getTrailingObjects<Stmt *>()[subStmtOffset()] = S;
1747 while (
const auto *CS2 = dyn_cast<CaseStmt>(CS->
getSubStmt()))
1760 getTrailingObjects<Stmt *>() +
1761 numTrailingObjects(OverloadToken<Stmt *>()));
1766 getTrailingObjects<Stmt *>() +
1767 numTrailingObjects(OverloadToken<Stmt *>()));
1776 :
SwitchCase(DefaultStmtClass, DL, CL), SubStmt(substmt) {}
1807 if (
const auto *CS = dyn_cast<CaseStmt>(
this))
1808 return CS->getEndLoc();
1809 else if (
const auto *DS = dyn_cast<DefaultStmt>(
this))
1810 return DS->getEndLoc();
1811 llvm_unreachable(
"SwitchCase is neither a CaseStmt nor a DefaultStmt!");
1815 if (
auto *CS = dyn_cast<CaseStmt>(
this))
1816 return CS->getSubStmt();
1817 else if (
auto *DS = dyn_cast<DefaultStmt>(
this))
1818 return DS->getSubStmt();
1819 llvm_unreachable(
"SwitchCase is neither a CaseStmt nor a DefaultStmt!");
1850 bool SideEntry =
false;
1855 :
ValueStmt(LabelStmtClass), TheDecl(D), SubStmt(substmt) {
1896 private llvm::TrailingObjects<AttributedStmt, const Attr *> {
1898 friend TrailingObjects;
1904 :
ValueStmt(AttributedStmtClass), SubStmt(SubStmt) {
1907 std::copy(Attrs.begin(), Attrs.end(), getAttrArrayPtr());
1911 :
ValueStmt(AttributedStmtClass, Empty) {
1914 std::fill_n(getAttrArrayPtr(), NumAttrs,
nullptr);
1917 const Attr *
const *getAttrArrayPtr()
const {
1918 return getTrailingObjects<const Attr *>();
1920 const Attr **getAttrArrayPtr() {
return getTrailingObjects<const Attr *>(); }
1923 static AttributedStmt *
Create(
const ASTContext &
C, SourceLocation Loc,
1924 ArrayRef<const Attr *> Attrs,
Stmt *SubStmt);
1927 static AttributedStmt *
CreateEmpty(
const ASTContext &
C,
unsigned NumAttrs);
1954 private llvm::TrailingObjects<IfStmt, Stmt *, SourceLocation> {
1955 friend TrailingObjects;
1979 enum { InitOffset = 0, ThenOffsetFromCond = 1, ElseOffsetFromCond = 2 };
1980 enum { NumMandatoryStmtPtr = 2 };
1984 unsigned numTrailingObjects(OverloadToken<Stmt *>)
const {
1989 unsigned numTrailingObjects(OverloadToken<SourceLocation>)
const {
1993 unsigned initOffset()
const {
return InitOffset; }
1994 unsigned varOffset()
const {
return InitOffset +
hasInitStorage(); }
1995 unsigned condOffset()
const {
1998 unsigned thenOffset()
const {
return condOffset() + ThenOffsetFromCond; }
1999 unsigned elseOffset()
const {
return condOffset() + ElseOffsetFromCond; }
2007 explicit IfStmt(
EmptyShell Empty,
bool HasElse,
bool HasVar,
bool HasInit);
2015 Stmt *Else =
nullptr);
2032 return reinterpret_cast<Expr *
>(getTrailingObjects<Stmt *>()[condOffset()]);
2036 return reinterpret_cast<Expr *
>(getTrailingObjects<Stmt *>()[condOffset()]);
2040 getTrailingObjects<Stmt *>()[condOffset()] =
reinterpret_cast<Stmt *
>(Cond);
2043 Stmt *
getThen() {
return getTrailingObjects<Stmt *>()[thenOffset()]; }
2045 return getTrailingObjects<Stmt *>()[thenOffset()];
2049 getTrailingObjects<Stmt *>()[thenOffset()] = Then;
2053 return hasElseStorage() ? getTrailingObjects<Stmt *>()[elseOffset()]
2058 return hasElseStorage() ? getTrailingObjects<Stmt *>()[elseOffset()]
2064 "This if statement has no storage for an else statement!");
2065 getTrailingObjects<Stmt *>()[elseOffset()] = Else;
2089 getTrailingObjects<Stmt *>()[varOffset()])
2095 getTrailingObjects<Stmt *>()[varOffset()])
2101 getTrailingObjects<Stmt *>()[varOffset()] = CondVar;
2105 return hasInitStorage() ? getTrailingObjects<Stmt *>()[initOffset()]
2110 return hasInitStorage() ? getTrailingObjects<Stmt *>()[initOffset()]
2116 "This if statement has no storage for an init statement!");
2117 getTrailingObjects<Stmt *>()[initOffset()] = Init;
2130 "This if statement has no storage for an else statement!");
2131 *getTrailingObjects<SourceLocation>() = ElseLoc;
2152 IfStmtBits.Kind =
static_cast<unsigned>(Kind);
2184 getTrailingObjects<Stmt *>() +
2185 numTrailingObjects(OverloadToken<Stmt *>()));
2193 getTrailingObjects<Stmt *>() +
2194 numTrailingObjects(OverloadToken<Stmt *>()));
2204 private llvm::TrailingObjects<SwitchStmt, Stmt *> {
2205 friend TrailingObjects;
2227 enum { InitOffset = 0, BodyOffsetFromCond = 1 };
2228 enum { NumMandatoryStmtPtr = 2 };
2232 unsigned numTrailingObjects(OverloadToken<Stmt *>)
const {
2236 unsigned initOffset()
const {
return InitOffset; }
2237 unsigned varOffset()
const {
return InitOffset +
hasInitStorage(); }
2238 unsigned condOffset()
const {
2241 unsigned bodyOffset()
const {
return condOffset() + BodyOffsetFromCond; }
2268 return reinterpret_cast<Expr *
>(getTrailingObjects<Stmt *>()[condOffset()]);
2272 return reinterpret_cast<Expr *
>(getTrailingObjects<Stmt *>()[condOffset()]);
2276 getTrailingObjects<Stmt *>()[condOffset()] =
reinterpret_cast<Stmt *
>(Cond);
2279 Stmt *
getBody() {
return getTrailingObjects<Stmt *>()[bodyOffset()]; }
2281 return getTrailingObjects<Stmt *>()[bodyOffset()];
2285 getTrailingObjects<Stmt *>()[bodyOffset()] = Body;
2289 return hasInitStorage() ? getTrailingObjects<Stmt *>()[initOffset()]
2294 return hasInitStorage() ? getTrailingObjects<Stmt *>()[initOffset()]
2300 "This switch statement has no storage for an init statement!");
2301 getTrailingObjects<Stmt *>()[initOffset()] = Init;
2326 getTrailingObjects<Stmt *>()[varOffset()])
2332 getTrailingObjects<Stmt *>()[varOffset()])
2338 getTrailingObjects<Stmt *>()[varOffset()] = CondVar;
2359 "case/default already added to a switch");
2383 getTrailingObjects<Stmt *>() +
2384 numTrailingObjects(OverloadToken<Stmt *>()));
2389 getTrailingObjects<Stmt *>() +
2390 numTrailingObjects(OverloadToken<Stmt *>()));
2400 private llvm::TrailingObjects<WhileStmt, Stmt *> {
2401 friend TrailingObjects;
2418 enum { VarOffset = 0, BodyOffsetFromCond = 1 };
2419 enum { NumMandatoryStmtPtr = 2 };
2423 unsigned varOffset()
const {
return VarOffset; }
2424 unsigned condOffset()
const {
return VarOffset +
hasVarStorage(); }
2425 unsigned bodyOffset()
const {
return condOffset() + BodyOffsetFromCond; }
2427 unsigned numTrailingObjects(OverloadToken<Stmt *>)
const {
2453 return reinterpret_cast<Expr *
>(getTrailingObjects<Stmt *>()[condOffset()]);
2457 return reinterpret_cast<Expr *
>(getTrailingObjects<Stmt *>()[condOffset()]);
2461 getTrailingObjects<Stmt *>()[condOffset()] =
reinterpret_cast<Stmt *
>(Cond);
2464 Stmt *
getBody() {
return getTrailingObjects<Stmt *>()[bodyOffset()]; }
2466 return getTrailingObjects<Stmt *>()[bodyOffset()];
2470 getTrailingObjects<Stmt *>()[bodyOffset()] = Body;
2494 getTrailingObjects<Stmt *>()[varOffset()])
2500 getTrailingObjects<Stmt *>()[varOffset()])
2506 getTrailingObjects<Stmt *>()[varOffset()] = CondVar;
2529 getTrailingObjects<Stmt *>() +
2530 numTrailingObjects(OverloadToken<Stmt *>()));
2535 getTrailingObjects<Stmt *>() +
2536 numTrailingObjects(OverloadToken<Stmt *>()));
2542 enum { BODY, COND, END_EXPR };
2543 Stmt *SubExprs[END_EXPR];
2550 :
Stmt(DoStmtClass), WhileLoc(WL), RParenLoc(RP) {
2561 return reinterpret_cast<Expr *
>(SubExprs[COND]);
2586 return child_range(&SubExprs[0], &SubExprs[0] + END_EXPR);
2600 enum { INIT, CONDVAR, COND, INC, BODY, END_EXPR };
2601 Stmt* SubExprs[END_EXPR];
2628 return reinterpret_cast<DeclStmt*
>(SubExprs[CONDVAR]);
2632 return reinterpret_cast<DeclStmt*
>(SubExprs[CONDVAR]);
2636 SubExprs[CONDVAR] = CondVar;
2669 return child_range(&SubExprs[0], &SubExprs[0]+END_EXPR);
2684 :
Stmt(GotoStmtClass),
Label(label), LabelLoc(LL) {
2723 :
Stmt(IndirectGotoStmtClass), StarLoc(starLoc) {
2730 :
Stmt(IndirectGotoStmtClass, Empty) {}
2739 return reinterpret_cast<const Expr *
>(
Target);
2835 private llvm::TrailingObjects<ReturnStmt, const VarDecl *> {
2836 friend TrailingObjects;
2845 bool hasNRVOCandidate()
const {
return ReturnStmtBits.HasNRVOCandidate; }
2847 unsigned numTrailingObjects(OverloadToken<const VarDecl *>)
const {
2848 return hasNRVOCandidate();
2860 const VarDecl *NRVOCandidate);
2876 return hasNRVOCandidate() ? *getTrailingObjects<const VarDecl *>()
2884 assert(hasNRVOCandidate() &&
2885 "This return statement has no storage for an NRVO candidate!");
2886 *getTrailingObjects<const VarDecl *>() = Var;
2937 unsigned numoutputs,
unsigned numinputs,
unsigned numclobbers)
3085 unsigned NumLabels = 0;
3089 bool isvolatile,
unsigned numoutputs,
unsigned numinputs,
3129 : MyKind(
Operand), Str(S), OperandNo(OpNo),
3143 assert(
isOperand() &&
"Range is currently used only for Operands.");
3169 return II->getName();
3177 return Constraints[i];
3180 return Constraints[i];
3197 return II->getName();
3221 return NumLabels > 0;
3264 void setOutputsAndInputsAndClobbers(
const ASTContext &
C,
3304 unsigned NumAsmToks = 0;
3306 Token *AsmToks =
nullptr;
3307 StringRef *Constraints =
nullptr;
3308 StringRef *Clobbers =
nullptr;
3341 return Constraints[i];
3382 void initialize(
const ASTContext &
C, StringRef AsmString,
3409 enum { FILTER_EXPR,
BLOCK };
3415 static SEHExceptStmt*
Create(
const ASTContext &
C,
3416 SourceLocation ExceptLoc,
3426 return reinterpret_cast<Expr*
>(Children[FILTER_EXPR]);
3430 return cast<CompoundStmt>(Children[
BLOCK]);
3489 enum { TRY = 0, HANDLER = 1 };
3499 static SEHTryStmt*
Create(
const ASTContext &
C,
bool isCXXTry,
3500 SourceLocation TryLoc,
Stmt *TryBlock,
3511 return cast<CompoundStmt>(Children[TRY]);
3539 :
Stmt(SEHLeaveStmtClass), LeaveLoc(LL) {}
3587 llvm::PointerIntPair<VarDecl *, 2, VariableCaptureKind> VarAndKind;
3638 unsigned NumCaptures;
3642 llvm::PointerIntPair<CapturedDecl *, 2, CapturedRegionKind> CapDeclAndKind;
3654 Stmt **getStoredStmts() {
return reinterpret_cast<Stmt **
>(
this + 1); }
3656 Stmt *
const *getStoredStmts()
const {
3657 return reinterpret_cast<Stmt *
const *
>(
this + 1);
3660 Capture *getStoredCaptures()
const;
3662 void setCapturedStmt(
Stmt *S) { getStoredStmts()[NumCaptures] = S; }
3674 unsigned NumCaptures);
3698 assert(D &&
"null RecordDecl");
3725 return getStoredCaptures() + NumCaptures;
3739 llvm::iterator_range<const_capture_init_iterator>;
3751 return reinterpret_cast<Expr **
>(getStoredStmts());
3755 return reinterpret_cast<Expr *
const *
>(getStoredStmts());
static StringRef bytes(const std::vector< T, Allocator > &v)
Defines the clang::IdentifierInfo, clang::IdentifierTable, and clang::Selector interfaces.
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
Defines the clang::LangOptions interface.
Defines the clang::SourceLocation class and associated facilities.
Defines various enumerations that describe declaration and type specifiers.
#define BLOCK(DERIVED, BASE)
__device__ __2f16 float bool s
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Reads an AST files chain containing the contents of a translation unit.
AddrLabelExpr - The GNU address of label extension, representing &&label.
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
AsmStmt is the base class for GCCAsmStmt and MSAsmStmt.
outputs_iterator begin_outputs()
void setAsmLoc(SourceLocation L)
const_outputs_iterator end_outputs() const
outputs_iterator end_outputs()
const_inputs_iterator begin_inputs() const
unsigned getNumPlusOperands() const
getNumPlusOperands - Return the number of output operands that have a "+" constraint.
AsmStmt(StmtClass SC, SourceLocation asmloc, bool issimple, bool isvolatile, unsigned numoutputs, unsigned numinputs, unsigned numclobbers)
static bool classof(const Stmt *T)
StringRef getOutputConstraint(unsigned i) const
getOutputConstraint - Return the constraint string for the specified output operand.
inputs_const_range inputs() const
SourceLocation getAsmLoc() const
const Expr * getInputExpr(unsigned i) const
SourceLocation getEndLoc() const LLVM_READONLY
llvm::iterator_range< inputs_iterator > inputs_range
bool isOutputPlusConstraint(unsigned i) const
isOutputPlusConstraint - Return true if the specified output constraint is a "+" constraint (which is...
unsigned getNumClobbers() const
const_inputs_iterator end_inputs() const
llvm::iterator_range< const_inputs_iterator > inputs_const_range
const_child_range children() const
bool IsSimple
True if the assembly statement does not have any input or output operands.
const Expr * getOutputExpr(unsigned i) const
StringRef getInputConstraint(unsigned i) const
getInputConstraint - Return the specified input constraint.
outputs_const_range outputs() const
inputs_iterator end_inputs()
unsigned getNumOutputs() const
SourceLocation getBeginLoc() const LLVM_READONLY
inputs_iterator begin_inputs()
AsmStmt(StmtClass SC, EmptyShell Empty)
Build an empty inline-assembly statement.
std::string generateAsmString(const ASTContext &C) const
Assemble final IR asm string.
bool IsVolatile
If true, treat this inline assembly as having side effects.
unsigned getNumInputs() const
llvm::iterator_range< outputs_iterator > outputs_range
StringRef getClobber(unsigned i) const
const_outputs_iterator begin_outputs() const
llvm::iterator_range< const_outputs_iterator > outputs_const_range
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load,...
Attr - This represents one attribute.
Represents an attribute applied to a statement.
static AttributedStmt * CreateEmpty(const ASTContext &C, unsigned NumAttrs)
const Stmt * getSubStmt() const
SourceLocation getAttrLoc() const
ArrayRef< const Attr * > getAttrs() const
const_child_range children() const
static AttributedStmt * Create(const ASTContext &C, SourceLocation Loc, ArrayRef< const Attr * > Attrs, Stmt *SubStmt)
static bool classof(const Stmt *T)
SourceLocation getEndLoc() const LLVM_READONLY
SourceLocation getBeginLoc() const
A builtin binary operation expression such as "x + y" or "x <= y".
BreakStmt - This represents a break.
SourceLocation getBreakLoc() const
SourceLocation getEndLoc() const
SourceLocation getBeginLoc() const
BreakStmt(SourceLocation BL)
const_child_range children() const
static bool classof(const Stmt *T)
void setBreakLoc(SourceLocation L)
BreakStmt(EmptyShell Empty)
Build an empty break statement.
A boolean literal, per ([C++ lex.bool] Boolean literals).
Represents a call to a C++ constructor.
A default argument (C++ [dcl.fct.default]).
A use of a default initializer in a constructor or in aggregate initialization.
Represents a delete expression for memory deallocation and destructor calls, e.g.
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)".
Represents a C++11 noexcept expression (C++ [expr.unary.noexcept]).
The null pointer literal (C++11 [lex.nullptr])
A call to an overloaded operator written using operator syntax.
A rewritten comparison expression that was originally written using operator syntax.
An expression "T()" which creates a value-initialized rvalue of type T, which is a non-class type.
Represents the this expression in C++.
A C++ throw-expression (C++ [except.throw]).
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Represents the body of a CapturedStmt, and serves as its DeclContext.
Describes the capture of either a variable, or 'this', or variable-length array type.
bool capturesVariableByCopy() const
Determine whether this capture handles a variable by copy.
VariableCaptureKind getCaptureKind() const
Determine the kind of capture.
VarDecl * getCapturedVar() const
Retrieve the declaration of the variable being captured.
bool capturesVariableArrayType() const
Determine whether this capture handles a variable-length array type.
bool capturesThis() const
Determine whether this capture handles the C++ 'this' pointer.
bool capturesVariable() const
Determine whether this capture handles a variable (by reference).
SourceLocation getLocation() const
Retrieve the source location at which the variable or 'this' was first used.
This captures a statement into a function.
unsigned capture_size() const
Retrieve the number of captures, including 'this'.
const_capture_iterator capture_begin() const
static CapturedStmt * CreateDeserialized(const ASTContext &Context, unsigned NumCaptures)
SourceLocation getEndLoc() const LLVM_READONLY
capture_init_range capture_inits()
void setCapturedRegionKind(CapturedRegionKind Kind)
Set the captured region kind.
const_capture_init_iterator capture_init_begin() const
CapturedDecl * getCapturedDecl()
Retrieve the outlined function declaration.
SourceRange getSourceRange() const LLVM_READONLY
capture_iterator capture_end() const
Retrieve an iterator pointing past the end of the sequence of captures.
const RecordDecl * getCapturedRecordDecl() const
Retrieve the record declaration for captured variables.
Stmt * getCapturedStmt()
Retrieve the statement being captured.
llvm::iterator_range< capture_init_iterator > capture_init_range
llvm::iterator_range< capture_iterator > capture_range
bool capturesVariable(const VarDecl *Var) const
True if this variable has been captured.
static bool classof(const Stmt *T)
capture_init_iterator capture_init_begin()
Retrieve the first initialization argument.
void setCapturedDecl(CapturedDecl *D)
Set the outlined function declaration.
capture_iterator capture_begin()
Retrieve an iterator pointing to the first capture.
llvm::iterator_range< const_capture_init_iterator > const_capture_init_range
static CapturedStmt * Create(const ASTContext &Context, Stmt *S, CapturedRegionKind Kind, ArrayRef< Capture > Captures, ArrayRef< Expr * > CaptureInits, CapturedDecl *CD, RecordDecl *RD)
const_capture_init_iterator capture_init_end() const
SourceLocation getBeginLoc() const LLVM_READONLY
void setCapturedRecordDecl(RecordDecl *D)
Set the record declaration for captured variables.
llvm::iterator_range< const_capture_iterator > capture_const_range
capture_init_iterator capture_init_end()
Retrieve the iterator pointing one past the last initialization argument.
Expr *const * const_capture_init_iterator
Const iterator that walks over the capture initialization arguments.
const Stmt * getCapturedStmt() const
capture_const_range captures() const
CapturedRegionKind getCapturedRegionKind() const
Retrieve the captured region kind.
VariableCaptureKind
The different capture forms: by 'this', by reference, capture for variable-length array type etc.
const_capture_init_range capture_inits() const
CaseStmt - Represent a case statement.
const Expr * getRHS() const
const_child_range children() const
SourceLocation getBeginLoc() const
void setEllipsisLoc(SourceLocation L)
Set the location of the ... in a case statement of the form LHS ... RHS.
static bool classof(const Stmt *T)
bool caseStmtIsGNURange() const
True if this case statement is of the form case LHS ... RHS, which is a GNU extension.
const Expr * getLHS() const
SourceLocation getEllipsisLoc() const
Get the location of the ... in a case statement of the form LHS ... RHS.
static CaseStmt * Create(const ASTContext &Ctx, Expr *lhs, Expr *rhs, SourceLocation caseLoc, SourceLocation ellipsisLoc, SourceLocation colonLoc)
Build a case statement.
void setCaseLoc(SourceLocation L)
SourceLocation getCaseLoc() const
static CaseStmt * CreateEmpty(const ASTContext &Ctx, bool CaseStmtIsGNURange)
Build an empty case statement.
const Stmt * getSubStmt() const
SourceLocation getEndLoc() const LLVM_READONLY
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Represents a character-granular source range.
Represents a 'co_await' expression.
CompoundStmt - This represents a group of statements like { stmt stmt }.
static bool classof(const Stmt *T)
std::reverse_iterator< const_body_iterator > const_reverse_body_iterator
body_const_range body() const
Stmt *const * const_body_iterator
const_reverse_body_iterator body_rend() const
llvm::iterator_range< const_body_iterator > body_const_range
std::reverse_iterator< body_iterator > reverse_body_iterator
reverse_body_iterator body_rbegin()
llvm::iterator_range< body_iterator > body_range
const Stmt * getStmtExprResult() const
FPOptionsOverride getStoredFPFeatures() const
Get FPOptionsOverride from trailing storage.
const Stmt * body_front() const
SourceLocation getBeginLoc() const
static CompoundStmt * CreateEmpty(const ASTContext &C, unsigned NumStmts, bool HasFPFeatures)
SourceLocation getLBracLoc() const
body_iterator body_begin()
SourceLocation getEndLoc() const
bool hasStoredFPFeatures() const
const_child_range children() const
reverse_body_iterator body_rend()
CompoundStmt(SourceLocation Loc)
const_body_iterator body_begin() const
static CompoundStmt * Create(const ASTContext &C, ArrayRef< Stmt * > Stmts, FPOptionsOverride FPFeatures, SourceLocation LB, SourceLocation RB)
Stmt * getStmtExprResult()
const Stmt * body_back() const
const_reverse_body_iterator body_rbegin() const
SourceLocation getRBracLoc() const
const_body_iterator body_end() const
ConstantExpr - An expression that occurs in a constant context and optionally the result of evaluatin...
ContinueStmt - This represents a continue.
ContinueStmt(EmptyShell Empty)
Build an empty continue statement.
ContinueStmt(SourceLocation CL)
static bool classof(const Stmt *T)
void setContinueLoc(SourceLocation L)
SourceLocation getContinueLoc() const
SourceLocation getEndLoc() const
const_child_range children() const
SourceLocation getBeginLoc() const
Decl *const * const_iterator
bool isSingleDecl() const
A reference to a declared variable, function, enum, etc.
DeclStmt - Adaptor class for mixing declarations with statements and expressions.
std::reverse_iterator< decl_iterator > reverse_decl_iterator
llvm::iterator_range< decl_iterator > decl_range
const_child_range children() const
SourceLocation getEndLoc() const
const DeclGroupRef getDeclGroup() const
DeclStmt(EmptyShell Empty)
Build an empty declaration statement.
bool isSingleDecl() const
isSingleDecl - This method returns true if this DeclStmt refers to a single Decl.
const_decl_iterator decl_begin() const
void setStartLoc(SourceLocation L)
DeclGroupRef::const_iterator const_decl_iterator
static bool classof(const Stmt *T)
void setEndLoc(SourceLocation L)
decl_iterator decl_begin()
void setDeclGroup(DeclGroupRef DGR)
const Decl * getSingleDecl() const
decl_const_range decls() const
const_decl_iterator decl_end() const
SourceLocation getBeginLoc() const LLVM_READONLY
DeclGroupRef getDeclGroup()
reverse_decl_iterator decl_rend()
llvm::iterator_range< const_decl_iterator > decl_const_range
reverse_decl_iterator decl_rbegin()
DeclStmt(DeclGroupRef dg, SourceLocation startLoc, SourceLocation endLoc)
Decl - This represents one declaration (or definition), e.g.
const Stmt * getSubStmt() const
SourceLocation getEndLoc() const LLVM_READONLY
void setDefaultLoc(SourceLocation L)
SourceLocation getDefaultLoc() const
DefaultStmt(EmptyShell Empty)
Build an empty default statement.
static bool classof(const Stmt *T)
DefaultStmt(SourceLocation DL, SourceLocation CL, Stmt *substmt)
const_child_range children() const
SourceLocation getBeginLoc() const
A qualified reference to a name whose declaration cannot yet be resolved.
Represents a C99 designated initializer expression.
DoStmt - This represents a 'do/while' stmt.
void setWhileLoc(SourceLocation L)
SourceLocation getBeginLoc() const
void setDoLoc(SourceLocation L)
SourceLocation getEndLoc() const
SourceLocation getWhileLoc() const
static bool classof(const Stmt *T)
const_child_range children() const
DoStmt(EmptyShell Empty)
Build an empty do-while statement.
SourceLocation getDoLoc() const
void setRParenLoc(SourceLocation L)
SourceLocation getRParenLoc() const
const Stmt * getBody() const
DoStmt(Stmt *Body, Expr *Cond, SourceLocation DL, SourceLocation WL, SourceLocation RP)
const Expr * getCond() const
Represents an expression – generally a full-expression – that introduces cleanups to be run at the en...
This represents one expression.
Represents difference between two FPOptions values.
ForStmt - This represents a 'for (init;cond;inc)' stmt.
VarDecl * getConditionVariable() const
Retrieve the variable declared in this "for" statement, if any.
SourceLocation getEndLoc() const
SourceLocation getRParenLoc() const
const_child_range children() const
const DeclStmt * getConditionVariableDeclStmt() const
void setForLoc(SourceLocation L)
const Expr * getInc() const
ForStmt(EmptyShell Empty)
Build an empty for statement.
void setLParenLoc(SourceLocation L)
const Expr * getCond() const
void setConditionVariableDeclStmt(DeclStmt *CondVar)
SourceLocation getBeginLoc() const
static bool classof(const Stmt *T)
const Stmt * getInit() const
void setConditionVariable(const ASTContext &C, VarDecl *V)
SourceLocation getForLoc() const
const Stmt * getBody() const
SourceLocation getLParenLoc() const
DeclStmt * getConditionVariableDeclStmt()
If this ForStmt has a condition variable, return the faux DeclStmt associated with the creation of th...
void setRParenLoc(SourceLocation L)
AsmStringPiece - this is part of a decomposed asm string specification (for use with the AnalyzeAsmSt...
AsmStringPiece(const std::string &S)
const std::string & getString() const
unsigned getOperandNo() const
CharSourceRange getRange() const
AsmStringPiece(unsigned OpNo, const std::string &S, SourceLocation Begin, SourceLocation End)
char getModifier() const
getModifier - Get the modifier for this operand, if present.
This represents a GCC inline-assembly statement extension.
const Expr * getInputExpr(unsigned i) const
const_labels_iterator end_labels() const
StringLiteral * getInputConstraintLiteral(unsigned i)
unsigned getNumLabels() const
const StringLiteral * getInputConstraintLiteral(unsigned i) const
std::string generateAsmString(const ASTContext &C) const
Assemble final IR asm string.
const StringLiteral * getClobberStringLiteral(unsigned i) const
SourceLocation getRParenLoc() const
StringRef getClobber(unsigned i) const
labels_const_range labels() const
StringLiteral * getOutputConstraintLiteral(unsigned i)
llvm::iterator_range< labels_iterator > labels_range
labels_iterator begin_labels()
IdentifierInfo * getInputIdentifier(unsigned i) const
labels_iterator end_labels()
StringRef getLabelName(unsigned i) const
unsigned AnalyzeAsmString(SmallVectorImpl< AsmStringPiece > &Pieces, const ASTContext &C, unsigned &DiagOffs) const
AnalyzeAsmString - Analyze the asm string of the current asm, decomposing it into pieces.
const StringLiteral * getOutputConstraintLiteral(unsigned i) const
void setRParenLoc(SourceLocation L)
StringRef getOutputConstraint(unsigned i) const
getOutputConstraint - Return the constraint string for the specified output operand.
void setInputExpr(unsigned i, Expr *E)
const StringLiteral * getAsmString() const
void setAsmString(StringLiteral *E)
static bool classof(const Stmt *T)
StringLiteral * getClobberStringLiteral(unsigned i)
StringRef getInputName(unsigned i) const
SourceLocation getEndLoc() const LLVM_READONLY
StringRef getOutputName(unsigned i) const
const_labels_iterator begin_labels() const
GCCAsmStmt(EmptyShell Empty)
Build an empty inline-assembly statement.
IdentifierInfo * getLabelIdentifier(unsigned i) const
IdentifierInfo * getOutputIdentifier(unsigned i) const
Expr * getOutputExpr(unsigned i)
StringLiteral * getAsmString()
llvm::iterator_range< const_labels_iterator > labels_const_range
int getNamedOperand(StringRef SymbolicName) const
getNamedOperand - Given a symbolic operand reference like %[foo], translate this into a numeric value...
const Expr * getOutputExpr(unsigned i) const
SourceLocation getBeginLoc() const LLVM_READONLY
Expr * getInputExpr(unsigned i)
AddrLabelExpr * getLabelExpr(unsigned i) const
StringRef getInputConstraint(unsigned i) const
getInputConstraint - Return the specified input constraint.
Represents a C11 generic selection.
GotoStmt - This represents a direct goto.
GotoStmt(LabelDecl *label, SourceLocation GL, SourceLocation LL)
SourceLocation getLabelLoc() const
SourceLocation getGotoLoc() const
void setLabel(LabelDecl *D)
GotoStmt(EmptyShell Empty)
Build an empty goto statement.