14 #ifndef LLVM_CLANG_AST_STMT_H 15 #define LLVM_CLANG_AST_STMT_H 23 #include "llvm/ADT/ArrayRef.h" 24 #include "llvm/ADT/PointerIntPair.h" 25 #include "llvm/ADT/StringRef.h" 26 #include "llvm/ADT/iterator.h" 27 #include "llvm/ADT/iterator_range.h" 28 #include "llvm/Support/Casting.h" 29 #include "llvm/Support/Compiler.h" 30 #include "llvm/Support/ErrorHandling.h" 39 class FoldingSetNodeID;
53 struct PrintingPolicy;
66 class alignas(void *)
Stmt {
70 #define STMT(CLASS, PARENT) CLASS##Class, 71 #define STMT_RANGE(BASE, FIRST, LAST) \ 72 first##BASE##Constant=FIRST##Class, last##BASE##Constant=LAST##Class, 73 #define LAST_STMT_RANGE(BASE, FIRST, LAST) \ 74 first##BASE##Constant=FIRST##Class, last##BASE##Constant=LAST##Class 75 #define ABSTRACT_STMT(STMT) 76 #include "clang/AST/StmtNodes.inc" 84 void *
operator new(
size_t bytes) noexcept {
85 llvm_unreachable(
"Stmts cannot be allocated with regular 'new'.");
88 void operator delete(
void *data) noexcept {
89 llvm_unreachable(
"Stmts cannot be released with regular 'delete'.");
100 enum { NumStmtBits = 8 };
107 unsigned : NumStmtBits;
114 unsigned HasLeadingEmptyMacro : 1;
124 unsigned : NumStmtBits;
126 unsigned NumStmts : 32 - NumStmtBits;
135 unsigned : NumStmtBits;
144 unsigned : NumStmtBits;
147 unsigned NumAttrs : 32 - NumStmtBits;
157 unsigned : NumStmtBits;
160 unsigned IsConstexpr : 1;
163 unsigned HasElse : 1;
169 unsigned HasInit : 1;
178 unsigned : NumStmtBits;
181 unsigned HasInit : 1;
189 unsigned AllEnumCasesCovered : 1;
199 unsigned : NumStmtBits;
211 unsigned : NumStmtBits;
220 unsigned : NumStmtBits;
230 unsigned : NumStmtBits;
239 unsigned : NumStmtBits;
248 unsigned : NumStmtBits;
257 unsigned : NumStmtBits;
260 unsigned HasNRVOCandidate : 1;
270 unsigned : NumStmtBits;
274 unsigned CaseStmtIsGNURange : 1;
285 friend class BlockDeclRefExpr;
306 unsigned : NumStmtBits;
308 unsigned ValueKind : 2;
309 unsigned ObjectKind : 3;
310 unsigned TypeDependent : 1;
311 unsigned ValueDependent : 1;
312 unsigned InstantiationDependent : 1;
313 unsigned ContainsUnexpandedParameterPack : 1;
315 enum { NumExprBits = NumStmtBits + 9 };
321 unsigned : NumExprBits;
329 unsigned HasFunctionName : 1;
339 unsigned : NumExprBits;
341 unsigned HasQualifier : 1;
342 unsigned HasTemplateKWAndArgsInfo : 1;
343 unsigned HasFoundDecl : 1;
344 unsigned HadMultipleCandidates : 1;
345 unsigned RefersToEnclosingVariableOrCapture : 1;
363 unsigned : NumExprBits;
365 unsigned Semantics : 3;
366 unsigned IsExact : 1;
373 unsigned : NumExprBits;
382 unsigned CharByteWidth : 3;
384 unsigned IsPascal : 1;
388 unsigned NumConcatenated;
394 unsigned : NumExprBits;
402 unsigned : NumExprBits;
405 unsigned CanOverflow : 1;
413 unsigned : NumExprBits;
422 unsigned : NumExprBits;
430 unsigned : NumExprBits;
432 unsigned NumPreArgs : 1;
435 unsigned UsesADL : 1;
438 unsigned : 24 - 2 - NumExprBits;
443 unsigned OffsetToTrailingObjects : 8;
445 enum { NumCallExprBits = 32 };
450 unsigned : NumExprBits;
453 unsigned IsArrow : 1;
459 unsigned HasQualifierOrFoundDecl : 1;
466 unsigned HasTemplateKWAndArgsInfo : 1;
470 unsigned HadMultipleCandidates : 1;
480 unsigned : NumExprBits;
483 unsigned PartOfExplicitCast : 1;
487 unsigned BasePathSize;
493 unsigned : NumExprBits;
499 unsigned FPFeatures : 3;
507 unsigned : NumExprBits;
511 unsigned HadArrayRangeDesignator : 1;
518 unsigned : NumExprBits;
528 unsigned : NumExprBits;
532 unsigned NumSubExprs : 8;
533 unsigned ResultIndex : 32 - 8 - NumExprBits;
542 unsigned : NumCallExprBits;
546 unsigned OperatorKind : 6;
549 unsigned FPFeatures : 3;
555 unsigned : NumExprBits;
567 unsigned : NumExprBits;
576 unsigned : NumExprBits;
579 unsigned IsImplicit : 1;
589 unsigned : NumExprBits;
592 unsigned IsThrownVariableInScope : 1;
602 unsigned : NumExprBits;
612 unsigned : NumExprBits;
622 unsigned : NumExprBits;
632 unsigned : NumExprBits;
635 unsigned IsGlobalNew : 1;
639 unsigned IsArray : 1;
642 unsigned ShouldPassAlignment : 1;
646 unsigned UsualArrayDeleteWantsSize : 1;
651 unsigned StoredInitializationStyle : 2;
654 unsigned IsParenTypeId : 1;
657 unsigned NumPlacementArgs;
664 unsigned : NumExprBits;
667 unsigned GlobalDelete : 1;
670 unsigned ArrayForm : 1;
675 unsigned ArrayFormAsWritten : 1;
679 unsigned UsualArrayDeleteWantsSize : 1;
690 unsigned : NumExprBits;
700 unsigned NumArgs : 32 - 8 - 1 - NumExprBits;
708 unsigned : NumExprBits;
712 unsigned HasTemplateKWAndArgsInfo : 1;
719 unsigned : NumExprBits;
721 unsigned Elidable : 1;
722 unsigned HadMultipleCandidates : 1;
723 unsigned ListInitialization : 1;
724 unsigned StdInitListInitialization : 1;
725 unsigned ZeroInitialization : 1;
726 unsigned ConstructionKind : 3;
735 unsigned : NumExprBits;
738 unsigned CleanupsHaveSideEffects : 1;
740 unsigned NumObjects : 32 - 1 - NumExprBits;
747 unsigned : NumExprBits;
757 unsigned : NumExprBits;
761 unsigned IsArrow : 1;
765 unsigned HasTemplateKWAndArgsInfo : 1;
769 unsigned HasFirstQualifierFoundInScope : 1;
779 unsigned : NumExprBits;
783 unsigned HasTemplateKWAndArgsInfo : 1;
788 unsigned : 32 - NumExprBits - 1;
793 enum { NumOverloadExprBits = NumExprBits + 1 };
799 unsigned : NumOverloadExprBits;
803 unsigned RequiresADL : 1;
807 unsigned Overloaded : 1;
810 "UnresolvedLookupExprBitfields must be <= than 4 bytes to" 811 "avoid trashing OverloadExprBitfields::NumResults!");
817 unsigned : NumOverloadExprBits;
821 unsigned IsArrow : 1;
824 unsigned HasUnresolvedUsing : 1;
827 "UnresolvedMemberExprBitfields must be <= than 4 bytes to" 828 "avoid trashing OverloadExprBitfields::NumResults!");
834 unsigned : NumExprBits;
843 unsigned : NumExprBits;
854 unsigned : NumExprBits;
856 unsigned IsImplicit : 1;
864 unsigned : NumExprBits;
866 unsigned ShouldCopy : 1;
875 unsigned : NumExprBits;
879 unsigned IsUnique : 1;
958 unsigned alignment = 8);
961 unsigned alignment = 8) {
962 return operator new(
bytes, *C, alignment);
965 void *
operator new(
size_t bytes,
void *mem) noexcept {
return mem; }
967 void operator delete(
void *,
const ASTContext &, unsigned) noexcept {}
968 void operator delete(
void *,
const ASTContext *, unsigned) noexcept {}
969 void operator delete(
void *,
size_t) noexcept {}
970 void operator delete(
void *,
void *) noexcept {}
984 : llvm::iterator_adaptor_base<ExprIterator, Stmt **,
985 std::random_access_iterator_tag, Expr *> {
990 assert((*I)->getStmtClass() >= firstExprConstant &&
991 (*I)->getStmtClass() <= lastExprConstant);
992 return *
reinterpret_cast<Expr **
>(I);
998 : llvm::iterator_adaptor_base<ConstExprIterator, const Stmt *const *,
999 std::random_access_iterator_tag,
1000 const Expr *const> {
1005 assert((*I)->getStmtClass() >= firstExprConstant &&
1006 (*I)->getStmtClass() <= lastExprConstant);
1007 return *
reinterpret_cast<const Expr *
const *
>(I);
1013 static bool StatisticsEnabled;
1021 static_assert(
sizeof(*
this) <= 8,
1022 "changing bitfields changed sizeof(Stmt)");
1023 static_assert(
sizeof(*
this) %
alignof(
void *) == 0,
1024 "Insufficient alignment!");
1025 StmtBits.sClass = SC;
1026 if (StatisticsEnabled) Stmt::addStmtClass(SC);
1030 return static_cast<StmtClass>(StmtBits.sClass);
1033 const char *getStmtClassName()
const;
1043 static void addStmtClass(
const StmtClass s);
1044 static void EnableStatistics();
1045 static void PrintStats();
1052 void dump(raw_ostream &OS)
const;
1055 int64_t
getID(
const ASTContext &Context)
const;
1058 void dumpColor()
const;
1062 void dumpPretty(
const ASTContext &Context)
const;
1065 StringRef NewlineSymbol =
"\n",
1066 const ASTContext *Context =
nullptr)
const;
1070 void viewAST()
const;
1074 Stmt *IgnoreImplicit();
1076 return const_cast<Stmt *
>(
this)->IgnoreImplicit();
1081 Stmt *IgnoreContainers(
bool IgnoreCaptured =
false);
1083 return const_cast<Stmt *
>(
this)->IgnoreContainers(IgnoreCaptured);
1086 const Stmt *stripLabelLikeStatements()
const;
1088 return const_cast<Stmt*
>(
1089 const_cast<const Stmt*
>(
this)->stripLabelLikeStatements());
1126 void Profile(llvm::FoldingSetNodeID &
ID,
const ASTContext &Context,
1127 bool Canonical)
const;
1136 void ProcessODRHash(llvm::FoldingSetNodeID &ID,
ODRHash& Hash)
const;
1149 :
Stmt(DeclStmtClass), DG(dg), StartLoc(startLoc), EndLoc(endLoc) {}
1213 :
Stmt(NullStmtClass) {
1214 NullStmtBits.HasLeadingEmptyMacro = hasLeadingEmptyMacro;
1225 return NullStmtBits.HasLeadingEmptyMacro;
1260 :
Stmt(CompoundStmtClass), RBraceLoc(Loc) {
1261 CompoundStmtBits.NumStmts = 0;
1262 CompoundStmtBits.LBraceLoc = Loc;
1268 bool body_empty()
const {
return CompoundStmtBits.NumStmts == 0; }
1269 unsigned size()
const {
return CompoundStmtBits.NumStmts; }
1280 return !body_empty() ? body_begin()[size() - 1] :
nullptr;
1284 assert(!body_empty() &&
"setLastStmt");
1285 body_begin()[size() - 1] = S;
1296 return getTrailingObjects<Stmt *>();
1302 return !body_empty() ? body_begin()[0] :
nullptr;
1306 return !body_empty() ? body_begin()[size() - 1] :
nullptr;
1320 std::reverse_iterator<const_body_iterator>;
1362 :
Stmt(SC), ColonLoc(ColonLoc) {
1363 setKeywordLoc(KWLoc);
1378 inline Stmt *getSubStmt();
1380 return const_cast<SwitchCase *
>(
this)->getSubStmt();
1414 enum { LhsOffset = 0, SubStmtOffsetFromRhs = 1 };
1415 enum { NumMandatoryStmtPtr = 2 };
1417 unsigned numTrailingObjects(OverloadToken<Stmt *>)
const {
1418 return NumMandatoryStmtPtr + caseStmtIsGNURange();
1421 unsigned numTrailingObjects(OverloadToken<SourceLocation>)
const {
1422 return caseStmtIsGNURange();
1425 unsigned lhsOffset()
const {
return LhsOffset; }
1426 unsigned rhsOffset()
const {
return LhsOffset + caseStmtIsGNURange(); }
1427 unsigned subStmtOffset()
const {
return rhsOffset() + SubStmtOffsetFromRhs; }
1433 :
SwitchCase(CaseStmtClass, caseLoc, colonLoc) {
1435 bool IsGNURange = rhs !=
nullptr;
1436 SwitchCaseBits.CaseStmtIsGNURange = IsGNURange;
1438 setSubStmt(
nullptr);
1441 setEllipsisLoc(ellipsisLoc);
1448 SwitchCaseBits.CaseStmtIsGNURange = CaseStmtIsGNURange;
1470 return caseStmtIsGNURange() ? *getTrailingObjects<SourceLocation>()
1478 caseStmtIsGNURange() &&
1479 "setEllipsisLoc but this is not a case stmt of the form LHS ... RHS!");
1480 *getTrailingObjects<SourceLocation>() = L;
1484 return reinterpret_cast<Expr *
>(getTrailingObjects<Stmt *>()[lhsOffset()]);
1488 return reinterpret_cast<Expr *
>(getTrailingObjects<Stmt *>()[lhsOffset()]);
1492 getTrailingObjects<Stmt *>()[lhsOffset()] =
reinterpret_cast<Stmt *
>(Val);
1496 return caseStmtIsGNURange() ?
reinterpret_cast<Expr *
>(
1497 getTrailingObjects<Stmt *>()[rhsOffset()])
1502 return caseStmtIsGNURange() ?
reinterpret_cast<Expr *
>(
1503 getTrailingObjects<Stmt *>()[rhsOffset()])
1508 assert(caseStmtIsGNURange() &&
1509 "setRHS but this is not a case stmt of the form LHS ... RHS!");
1510 getTrailingObjects<Stmt *>()[rhsOffset()] =
reinterpret_cast<Stmt *
>(Val);
1515 return getTrailingObjects<Stmt *>()[subStmtOffset()];
1519 getTrailingObjects<Stmt *>()[subStmtOffset()] = S;
1526 while (
const auto *CS2 = dyn_cast<CaseStmt>(CS->
getSubStmt()))
1539 getTrailingObjects<Stmt *>() +
1540 numTrailingObjects(OverloadToken<Stmt *>()));
1549 :
SwitchCase(DefaultStmtClass, DL, CL), SubStmt(substmt) {}
1576 if (
const auto *CS = dyn_cast<CaseStmt>(
this))
1577 return CS->getEndLoc();
1578 else if (
const auto *DS = dyn_cast<DefaultStmt>(
this))
1579 return DS->getEndLoc();
1580 llvm_unreachable(
"SwitchCase is neither a CaseStmt nor a DefaultStmt!");
1584 if (
auto *CS = dyn_cast<CaseStmt>(
this))
1585 return CS->getSubStmt();
1586 else if (
auto *DS = dyn_cast<DefaultStmt>(
this))
1587 return DS->getSubStmt();
1588 llvm_unreachable(
"SwitchCase is neither a CaseStmt nor a DefaultStmt!");
1600 :
Stmt(LabelStmtClass), TheDecl(D), SubStmt(substmt) {
1643 :
Stmt(AttributedStmtClass), SubStmt(SubStmt) {
1644 AttributedStmtBits.NumAttrs = Attrs.size();
1645 AttributedStmtBits.AttrLoc = Loc;
1646 std::copy(Attrs.begin(), Attrs.end(), getAttrArrayPtr());
1650 :
Stmt(AttributedStmtClass, Empty) {
1651 AttributedStmtBits.NumAttrs = NumAttrs;
1653 std::fill_n(getAttrArrayPtr(), NumAttrs,
nullptr);
1656 const Attr *
const *getAttrArrayPtr()
const {
1657 return getTrailingObjects<const Attr *>();
1659 const Attr **getAttrArrayPtr() {
return getTrailingObjects<const Attr *>(); }
1670 return llvm::makeArrayRef(getAttrArrayPtr(), AttributedStmtBits.NumAttrs);
1714 enum { InitOffset = 0, ThenOffsetFromCond = 1, ElseOffsetFromCond = 2 };
1715 enum { NumMandatoryStmtPtr = 2 };
1717 unsigned numTrailingObjects(OverloadToken<Stmt *>)
const {
1718 return NumMandatoryStmtPtr + hasElseStorage() + hasVarStorage() +
1722 unsigned numTrailingObjects(OverloadToken<SourceLocation>)
const {
1723 return hasElseStorage();
1726 unsigned initOffset()
const {
return InitOffset; }
1727 unsigned varOffset()
const {
return InitOffset + hasInitStorage(); }
1728 unsigned condOffset()
const {
1729 return InitOffset + hasInitStorage() + hasVarStorage();
1731 unsigned thenOffset()
const {
return condOffset() + ThenOffsetFromCond; }
1732 unsigned elseOffset()
const {
return condOffset() + ElseOffsetFromCond; }
1739 explicit IfStmt(
EmptyShell Empty,
bool HasElse,
bool HasVar,
bool HasInit);
1746 Stmt *Else =
nullptr);
1763 return reinterpret_cast<Expr *
>(getTrailingObjects<Stmt *>()[condOffset()]);
1767 return reinterpret_cast<Expr *
>(getTrailingObjects<Stmt *>()[condOffset()]);
1771 getTrailingObjects<Stmt *>()[condOffset()] =
reinterpret_cast<Stmt *
>(Cond);
1774 Stmt *
getThen() {
return getTrailingObjects<Stmt *>()[thenOffset()]; }
1776 return getTrailingObjects<Stmt *>()[thenOffset()];
1780 getTrailingObjects<Stmt *>()[thenOffset()] = Then;
1784 return hasElseStorage() ? getTrailingObjects<Stmt *>()[elseOffset()]
1789 return hasElseStorage() ? getTrailingObjects<Stmt *>()[elseOffset()]
1794 assert(hasElseStorage() &&
1795 "This if statement has no storage for an else statement!");
1796 getTrailingObjects<Stmt *>()[elseOffset()] = Else;
1807 VarDecl *getConditionVariable();
1809 return const_cast<IfStmt *
>(
this)->getConditionVariable();
1819 return hasVarStorage() ?
static_cast<DeclStmt *
>(
1820 getTrailingObjects<Stmt *>()[varOffset()])
1825 return hasVarStorage() ?
static_cast<DeclStmt *
>(
1826 getTrailingObjects<Stmt *>()[varOffset()])
1831 return hasInitStorage() ? getTrailingObjects<Stmt *>()[initOffset()]
1836 return hasInitStorage() ? getTrailingObjects<Stmt *>()[initOffset()]
1841 assert(hasInitStorage() &&
1842 "This if statement has no storage for an init statement!");
1843 getTrailingObjects<Stmt *>()[initOffset()] = Init;
1850 return hasElseStorage() ? *getTrailingObjects<SourceLocation>()
1855 assert(hasElseStorage() &&
1856 "This if statement has no storage for an else statement!");
1857 *getTrailingObjects<SourceLocation>() = ElseLoc;
1863 bool isObjCAvailabilityCheck()
const;
1868 return getElse()->getEndLoc();
1869 return getThen()->getEndLoc();
1876 getTrailingObjects<Stmt *>() +
1877 numTrailingObjects(OverloadToken<Stmt *>()));
1910 enum { InitOffset = 0, BodyOffsetFromCond = 1 };
1911 enum { NumMandatoryStmtPtr = 2 };
1913 unsigned numTrailingObjects(OverloadToken<Stmt *>)
const {
1914 return NumMandatoryStmtPtr + hasInitStorage() + hasVarStorage();
1917 unsigned initOffset()
const {
return InitOffset; }
1918 unsigned varOffset()
const {
return InitOffset + hasInitStorage(); }
1919 unsigned condOffset()
const {
1920 return InitOffset + hasInitStorage() + hasVarStorage();
1922 unsigned bodyOffset()
const {
return condOffset() + BodyOffsetFromCond; }
1947 return reinterpret_cast<Expr *
>(getTrailingObjects<Stmt *>()[condOffset()]);
1951 return reinterpret_cast<Expr *
>(getTrailingObjects<Stmt *>()[condOffset()]);
1955 getTrailingObjects<Stmt *>()[condOffset()] =
reinterpret_cast<Stmt *
>(Cond);
1958 Stmt *
getBody() {
return getTrailingObjects<Stmt *>()[bodyOffset()]; }
1960 return getTrailingObjects<Stmt *>()[bodyOffset()];
1964 getTrailingObjects<Stmt *>()[bodyOffset()] = Body;
1968 return hasInitStorage() ? getTrailingObjects<Stmt *>()[initOffset()]
1973 return hasInitStorage() ? getTrailingObjects<Stmt *>()[initOffset()]
1978 assert(hasInitStorage() &&
1979 "This switch statement has no storage for an init statement!");
1980 getTrailingObjects<Stmt *>()[initOffset()] = Init;
1992 VarDecl *getConditionVariable();
1994 return const_cast<SwitchStmt *
>(
this)->getConditionVariable();
2004 return hasVarStorage() ?
static_cast<DeclStmt *
>(
2005 getTrailingObjects<Stmt *>()[varOffset()])
2010 return hasVarStorage() ?
static_cast<DeclStmt *
>(
2011 getTrailingObjects<Stmt *>()[varOffset()])
2029 "case/default already added to a switch");
2041 return SwitchStmtBits.AllEnumCasesCovered;
2046 return getBody() ? getBody()->getEndLoc()
2047 :
reinterpret_cast<const Stmt *
>(getCond())->getEndLoc();
2053 getTrailingObjects<Stmt *>() +
2054 numTrailingObjects(OverloadToken<Stmt *>()));
2082 enum { VarOffset = 0, BodyOffsetFromCond = 1 };
2083 enum { NumMandatoryStmtPtr = 2 };
2085 unsigned varOffset()
const {
return VarOffset; }
2086 unsigned condOffset()
const {
return VarOffset + hasVarStorage(); }
2087 unsigned bodyOffset()
const {
return condOffset() + BodyOffsetFromCond; }
2089 unsigned numTrailingObjects(OverloadToken<Stmt *>)
const {
2090 return NumMandatoryStmtPtr + hasVarStorage();
2113 return reinterpret_cast<Expr *
>(getTrailingObjects<Stmt *>()[condOffset()]);
2117 return reinterpret_cast<Expr *
>(getTrailingObjects<Stmt *>()[condOffset()]);
2121 getTrailingObjects<Stmt *>()[condOffset()] =
reinterpret_cast<Stmt *
>(Cond);
2124 Stmt *
getBody() {
return getTrailingObjects<Stmt *>()[bodyOffset()]; }
2126 return getTrailingObjects<Stmt *>()[bodyOffset()];
2130 getTrailingObjects<Stmt *>()[bodyOffset()] = Body;
2141 VarDecl *getConditionVariable();
2143 return const_cast<WhileStmt *
>(
this)->getConditionVariable();
2153 return hasVarStorage() ?
static_cast<DeclStmt *
>(
2154 getTrailingObjects<Stmt *>()[varOffset()])
2159 return hasVarStorage() ?
static_cast<DeclStmt *
>(
2160 getTrailingObjects<Stmt *>()[varOffset()])
2169 return getBody()->getEndLoc();
2179 getTrailingObjects<Stmt *>() +
2180 numTrailingObjects(OverloadToken<Stmt *>()));
2186 enum { BODY, COND, END_EXPR };
2187 Stmt *SubExprs[END_EXPR];
2194 :
Stmt(DoStmtClass), WhileLoc(WL), RParenLoc(RP) {
2205 return reinterpret_cast<Expr *
>(SubExprs[COND]);
2230 return child_range(&SubExprs[0], &SubExprs[0] + END_EXPR);
2238 enum { INIT, CONDVAR, COND, INC, BODY, END_EXPR };
2239 Stmt* SubExprs[END_EXPR];
2260 VarDecl *getConditionVariable()
const;
2266 return reinterpret_cast<DeclStmt*
>(SubExprs[CONDVAR]);
2299 return child_range(&SubExprs[0], &SubExprs[0]+END_EXPR);
2310 :
Stmt(GotoStmtClass), Label(label), LabelLoc(LL) {
2345 :
Stmt(IndirectGotoStmtClass), StarLoc(starLoc) {
2347 setGotoLoc(gotoLoc);
2352 :
Stmt(IndirectGotoStmtClass, Empty) {}
2361 return reinterpret_cast<const Expr *
>(Target);
2455 bool hasNRVOCandidate()
const {
return ReturnStmtBits.HasNRVOCandidate; }
2457 unsigned numTrailingObjects(OverloadToken<const VarDecl *>)
const {
2458 return hasNRVOCandidate();
2470 const VarDecl *NRVOCandidate);
2486 return hasNRVOCandidate() ? *getTrailingObjects<const VarDecl *>()
2494 assert(hasNRVOCandidate() &&
2495 "This return statement has no storage for an NRVO candidate!");
2496 *getTrailingObjects<const VarDecl *>() = Var;
2504 return RetExpr ? RetExpr->
getEndLoc() : getReturnLoc();
2541 unsigned numoutputs,
unsigned numinputs,
unsigned numclobbers)
2542 :
Stmt (SC), AsmLoc(asmloc), IsSimple(issimple), IsVolatile(isvolatile),
2543 NumOutputs(numoutputs), NumInputs(numinputs),
2544 NumClobbers(numclobbers) {}
2565 std::string generateAsmString(
const ASTContext &
C)
const;
2574 StringRef getOutputConstraint(
unsigned i)
const;
2580 return getOutputConstraint(i)[0] ==
'+';
2583 const Expr *getOutputExpr(
unsigned i)
const;
2587 unsigned getNumPlusOperands()
const;
2595 StringRef getInputConstraint(
unsigned i)
const;
2597 const Expr *getInputExpr(
unsigned i)
const;
2602 StringRef getClobber(
unsigned i)
const;
2617 return &Exprs[0] + NumOutputs;
2621 return &Exprs[0] + NumOutputs + NumInputs;
2627 return &Exprs[0] + NumOutputs;
2631 return &Exprs[0] + NumOutputs + NumInputs;
2650 return &Exprs[0] + NumOutputs;
2662 return &Exprs[0] + NumOutputs;
2670 return child_range(&Exprs[0], &Exprs[0] + NumOutputs + NumInputs);
2688 bool isvolatile,
unsigned numoutputs,
unsigned numinputs,
2727 : MyKind(Operand), Str(S), OperandNo(OpNo),
2736 assert(isOperand());
2741 assert(isOperand() &&
"Range is currently used only for Operands.");
2756 const ASTContext &C,
unsigned &DiagOffs)
const;
2759 std::string generateAsmString(
const ASTContext &C)
const;
2767 return II->getName();
2772 StringRef getOutputConstraint(
unsigned i)
const;
2775 return Constraints[i];
2778 return Constraints[i];
2781 Expr *getOutputExpr(
unsigned i);
2784 return const_cast<GCCAsmStmt*
>(
this)->getOutputExpr(i);
2790 return Names[i + NumOutputs];
2795 return II->getName();
2800 StringRef getInputConstraint(
unsigned i)
const;
2803 return Constraints[i + NumOutputs];
2806 return Constraints[i + NumOutputs];
2809 Expr *getInputExpr(
unsigned i);
2810 void setInputExpr(
unsigned i,
Expr *E);
2813 return const_cast<GCCAsmStmt*
>(
this)->getInputExpr(i);
2817 void setOutputsAndInputsAndClobbers(
const ASTContext &C,
2821 unsigned NumOutputs,
2824 unsigned NumClobbers);
2832 int getNamedOperand(StringRef SymbolicName)
const;
2834 StringRef getClobber(
unsigned i)
const;
2856 unsigned NumAsmToks = 0;
2858 Token *AsmToks =
nullptr;
2859 StringRef *Constraints =
nullptr;
2860 StringRef *Clobbers =
nullptr;
2887 std::string generateAsmString(
const ASTContext &
C)
const;
2892 assert(i < NumOutputs);
2893 return Constraints[i];
2896 Expr *getOutputExpr(
unsigned i);
2899 return const_cast<MSAsmStmt*
>(
this)->getOutputExpr(i);
2905 assert(i < NumInputs);
2906 return Constraints[i + NumOutputs];
2909 Expr *getInputExpr(
unsigned i);
2910 void setInputExpr(
unsigned i,
Expr *E);
2913 return const_cast<MSAsmStmt*
>(
this)->getInputExpr(i);
2919 return llvm::makeArrayRef(Constraints, NumInputs + NumOutputs);
2923 return llvm::makeArrayRef(Clobbers, NumClobbers);
2927 return llvm::makeArrayRef(reinterpret_cast<Expr**>(Exprs),
2928 NumInputs + NumOutputs);
2931 StringRef
getClobber(
unsigned i)
const {
return getClobbers()[i]; }
2946 return child_range(&Exprs[0], &Exprs[NumInputs + NumOutputs]);
2957 enum { FILTER_EXPR,
BLOCK };
2974 return reinterpret_cast<Expr*
>(Children[FILTER_EXPR]);
2978 return cast<CompoundStmt>(Children[
BLOCK]);
3029 enum { TRY = 0, HANDLER = 1 };
3051 return cast<CompoundStmt>(Children[TRY]);
3075 :
Stmt(SEHLeaveStmtClass), LeaveLoc(LL) {}
3119 llvm::PointerIntPair<VarDecl *, 2, VariableCaptureKind> VarAndKind;
3150 return getCaptureKind() == VCK_ByCopy;
3156 return getCaptureKind() == VCK_VLAType;
3162 VarDecl *getCapturedVar()
const;
3167 unsigned NumCaptures;
3171 llvm::PointerIntPair<CapturedDecl *, 2, CapturedRegionKind> CapDeclAndKind;
3183 Stmt **getStoredStmts() {
return reinterpret_cast<Stmt **
>(
this + 1); }
3185 Stmt *
const *getStoredStmts()
const {
3186 return reinterpret_cast<Stmt *
const *
>(
this + 1);
3189 Capture *getStoredCaptures()
const;
3191 void setCapturedStmt(
Stmt *S) { getStoredStmts()[NumCaptures] = S; }
3203 unsigned NumCaptures);
3227 assert(D &&
"null RecordDecl");
3232 bool capturesVariable(
const VarDecl *Var)
const;
3254 return getStoredCaptures() + NumCaptures;
3268 llvm::iterator_range<const_capture_init_iterator>;
3280 return reinterpret_cast<Expr **
>(getStoredStmts());
3284 return reinterpret_cast<Expr *
const *
>(getStoredStmts());
3290 return capture_init_begin() + NumCaptures;
3294 return capture_init_begin() + NumCaptures;
3298 return getCapturedStmt()->getBeginLoc();
3302 return getCapturedStmt()->getEndLoc();
3306 return getCapturedStmt()->getSourceRange();
3318 #endif // LLVM_CLANG_AST_STMT_H SourceLocation getRParenLoc() const
child_iterator child_begin()
SourceLocation getEndLoc() const LLVM_READONLY
static std::enable_if< std::is_base_of< Attr, AttrInfo >::value, SourceLocation >::type getAttrLoc(const AttrInfo &AL)
A helper function to provide Attribute Location for the Attr types AND the ParsedAttr.
ObjCIndirectCopyRestoreExpr - Represents the passing of a function argument by indirect copy-restore ...
A call to an overloaded operator written using operator syntax.
GotoStmt(EmptyShell Empty)
Build an empty goto statement.
SourceLocation getRBracLoc() const
IdentifierInfo * getInputIdentifier(unsigned i) const
static bool classof(const Stmt *T)
SourceLocation getRParenLoc() const
The null pointer literal (C++11 [lex.nullptr])
This represents a GCC inline-assembly statement extension.
SourceLocation getBeginLoc() const
const Stmt * getElse() const
unsigned getNumInputs() const
SourceLocation getBeginLoc() const
UnresolvedMemberExprBitfields UnresolvedMemberExprBits
CompoundStmt * getBlock() const
SourceLocation getForLoc() const
SourceLocation getEndLoc() const
const Stmt * getBody() const
capture_init_iterator capture_init_begin()
Retrieve the first initialization argument.
capture_const_range captures() const
const_child_iterator child_end() const
CXXDeleteExprBitfields CXXDeleteExprBits
ConstExprIterator(const Stmt *const *I)
DefaultStmt(SourceLocation DL, SourceLocation CL, Stmt *substmt)
SourceLocation getEllipsisLoc() const
Get the location of the ... in a case statement of the form LHS ... RHS.
void setNRVOCandidate(const VarDecl *Var)
Set the variable that might be used for the named return value optimization.
static bool classof(const Stmt *T)
__SIZE_TYPE__ size_t
The unsigned integer type of the result of the sizeof operator.
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
bool hasVarStorage() const
True if this IfStmt has storage for a variable declaration.
DominatorTree GraphTraits specialization so the DominatorTree can be iterable by generic graph iterat...
const_reverse_body_iterator body_rbegin() const
outputs_iterator end_outputs()
const DeclStmt * getConditionVariableDeclStmt() const
If this ForStmt has a condition variable, return the faux DeclStmt associated with the creation of th...
CXXThisExprBitfields CXXThisExprBits
IndirectGotoStmt(EmptyShell Empty)
Build an empty indirect goto statement.
std::reverse_iterator< const_body_iterator > const_reverse_body_iterator
CXXUnresolvedConstructExprBitfields CXXUnresolvedConstructExprBits
Stmt - This represents one statement.
SourceLocation getEndLoc() const
IfStmt - This represents an if/then/else.
AsmStmt(StmtClass SC, EmptyShell Empty)
Build an empty inline-assembly statement.
bool capturesThis() const
Determine whether this capture handles the C++ 'this' pointer.
unsigned getNumOutputs() const
llvm::iterator_range< body_iterator > body_range
ContinueStmt(EmptyShell Empty)
Build an empty continue statement.
const StringLiteral * getAsmString() const
void setRParenLoc(SourceLocation L)
void setContinueLoc(SourceLocation L)
Decl - This represents one declaration (or definition), e.g.
void setDeclGroup(DeclGroupRef DGR)
bool hasLeadingEmptyMacro() const
LabelStmtBitfields LabelStmtBits
FloatingLiteralBitfields FloatingLiteralBits
NullStmt(EmptyShell Empty)
Build an empty null statement.
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
const Expr * getOutputExpr(unsigned i) const
SourceLocation getIdentLoc() const
Represents an attribute applied to a statement.
const Expr * getOutputExpr(unsigned i) const
llvm::iterator_range< child_iterator > child_range
const RecordDecl * getCapturedRecordDecl() const
Retrieve the record declaration for captured variables.
DeclRefExprBitfields DeclRefExprBits
Represents a call to a C++ constructor.
SourceLocation getBeginLoc() const LLVM_READONLY
The l-value was an access to a declared entity or something equivalently strong, like the address of ...
void setSwitchCaseList(SwitchCase *SC)
NullStmt(SourceLocation L, bool hasLeadingEmptyMacro=false)
bool hasVarStorage() const
True if this SwitchStmt has storage for a condition variable.
void setStartLoc(SourceLocation L)
SourceLocation getGotoLoc() const
void setForLoc(SourceLocation L)
const_child_iterator child_begin() const
Represents a variable declaration or definition.
const VarDecl * getNRVOCandidate() const
Retrieve the variable that might be used for the named return value optimization. ...
SourceLocation getLParenLoc() const
static bool classof(const Stmt *T)
void setAsmLoc(SourceLocation L)
AttributedStmtBitfields AttributedStmtBits
bool hasInitStorage() const
True if this SwitchStmt has storage for an init statement.
const_outputs_iterator begin_outputs() const
const Expr * getCond() const
SourceLocation getIfLoc() const
Describes how types, statements, expressions, and declarations should be printed. ...
capture_iterator capture_begin()
Retrieve an iterator pointing to the first capture.
static StringRef bytes(const std::vector< T, Allocator > &v)
A C++ throw-expression (C++ [except.throw]).
Represents an expression – generally a full-expression – that introduces cleanups to be run at the ...
llvm::iterator_range< decl_iterator > decl_range
StringRef getInputName(unsigned i) const
std::string getName(ArrayRef< StringRef > Parts) const
Get the platform-specific name separator.
void setBody(Stmt *S, SourceLocation SL)
Stmt(StmtClass SC, EmptyShell)
Construct an empty statement.
CoawaitExprBitfields CoawaitBits
static bool classof(const Stmt *T)
ArraySubscriptExprBitfields ArraySubscriptExprBits
LabelStmt - Represents a label, which has a substatement.
Represents a struct/union/class.
Represents a C99 designated initializer expression.
const Expr * getTarget() const
inputs_iterator begin_inputs()
One of these records is kept for each identifier that is lexed.
const_outputs_iterator end_outputs() const
ShuffleVectorExpr - clang-specific builtin-in function __builtin_shufflevector.
SourceLocation ColonLoc
The location of the ":".
DeclGroupRef::const_iterator const_decl_iterator
DeclStmt * getConditionVariableDeclStmt()
If this SwitchStmt has a condition variable, return the faux DeclStmt associated with the creation of...
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
const_body_iterator body_begin() const
SourceLocation getEndLoc() const
SourceLocation getBeginLoc() const LLVM_READONLY
LabelStmt(SourceLocation IL, LabelDecl *D, Stmt *substmt)
Build a label statement.
CharSourceRange getRange() const
CharacterLiteralBitfields CharacterLiteralBits
ArrayRef< Expr * > getAllExprs() const
SourceLocation getBeginLoc() const LLVM_READONLY
SourceLocation getBeginLoc() const LLVM_READONLY
SourceLocation getBeginLoc() const
SourceLocation getEndLoc() const
Token - This structure provides full information about a lexed token.
ObjCIndirectCopyRestoreExprBitfields ObjCIndirectCopyRestoreExprBits
Stmt *const * const_body_iterator
void setReturnLoc(SourceLocation L)
llvm::iterator_range< const_inputs_iterator > inputs_const_range
MSAsmStmt(EmptyShell Empty)
Build an empty MS-style inline-assembly statement.
const VarDecl * getConditionVariable() const
Represents a C++ member access expression for which lookup produced a set of overloaded functions...
const DeclGroupRef getDeclGroup() const
void setIfLoc(SourceLocation IfLoc)
bool isAllEnumCasesCovered() const
Returns true if the SwitchStmt is a switch of an enum value and all cases have been explicitly covere...
static bool classof(const Stmt *T)
ObjCArrayLiteral - used for objective-c array containers; as in: @["Hello", NSApp, [NSNumber numberWithInt:42]];.
SwitchCase(StmtClass SC, SourceLocation KWLoc, SourceLocation ColonLoc)
WhileStmtBitfields WhileStmtBits
const Stmt * getSubStmt() const
void addSwitchCase(SwitchCase *SC)
SourceLocation getEndLoc() const LLVM_READONLY
static bool classof(const Stmt *T)
IndirectGotoStmt - This represents an indirect goto.
Describes an C or C++ initializer list.
SwitchCase(StmtClass SC, EmptyShell)
Expr *const * const_capture_init_iterator
Const iterator that walks over the capture initialization arguments.
GCCAsmStmt(EmptyShell Empty)
Build an empty inline-assembly statement.
ForStmt - This represents a 'for (init;cond;inc)' stmt.
SourceLocation getBeginLoc() const
outputs_iterator begin_outputs()
CXXScalarValueInitExprBitfields CXXScalarValueInitExprBits
SourceLocation getEndLoc() const LLVM_READONLY
static void dump(llvm::raw_ostream &OS, StringRef FunctionName, ArrayRef< CounterExpression > Expressions, ArrayRef< CounterMappingRegion > Regions)
LabelDecl * getDecl() const
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
SourceLocation getLBracLoc() const
void setEndLoc(SourceLocation L)
DeclStmt(EmptyShell Empty)
Build an empty declaration statement.
SwitchCaseBitfields SwitchCaseBits
llvm::iterator_range< const_outputs_iterator > outputs_const_range
A builtin binary operation expression such as "x + y" or "x <= y".
DoStmt(Stmt *Body, Expr *Cond, SourceLocation DL, SourceLocation WL, SourceLocation RP)
SwitchStmtBitfields SwitchStmtBits
const StringLiteral * getInputConstraintLiteral(unsigned i) const
SourceLocation getBeginLoc() const LLVM_READONLY
bool hasElseStorage() const
True if this IfStmt has storage for an else statement.
SourceLocation getEndLoc() const LLVM_READONLY
void setAsmString(StringLiteral *E)
static bool classof(const Stmt *T)
AsmStmt(StmtClass SC, SourceLocation asmloc, bool issimple, bool isvolatile, unsigned numoutputs, unsigned numinputs, unsigned numclobbers)
const Stmt * getInit() const
SourceLocation getEndLoc() const
const VarDecl * getConditionVariable() const
const Expr * getInc() const
CaseStmt - Represent a case statement.
SourceLocation getContinueLoc() const
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
StringLiteral * getClobberStringLiteral(unsigned i)
StringRef getOutputName(unsigned i) const
ReturnStmtBitfields ReturnStmtBits
SourceLocation getEndLoc() const LLVM_READONLY
bool isOutputPlusConstraint(unsigned i) const
isOutputPlusConstraint - Return true if the specified output constraint is a "+" constraint (which is...
const Expr * getCond() const
SourceLocation getTryLoc() const
void setEndLoc(SourceLocation L)
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Represents the body of a CapturedStmt, and serves as its DeclContext.
const Expr * getLHS() const
A default argument (C++ [dcl.fct.default]).
const_body_iterator body_end() const
Iterator for iterating over Stmt * arrays that contain only Expr *.
SourceLocation getEndLoc() const LLVM_READONLY
Represents the this expression in C++.
PredefinedExprBitfields PredefinedExprBits
const_decl_iterator decl_begin() const
StringLiteral * getAsmString()
Const iterator for iterating over Stmt * arrays that contain only Expr *.
llvm::iterator_range< const_child_iterator > const_child_range
void setBreakLoc(SourceLocation L)
CompoundStmt - This represents a group of statements like { stmt stmt }.
Describes the capture of either a variable, or 'this', or variable-length array type.
Stmt * stripLabelLikeStatements()
static bool classof(const Stmt *T)
const_inputs_iterator begin_inputs() const
void setSemiLoc(SourceLocation L)
const Expr * getRetValue() const
SourceLocation getBeginLoc() const LLVM_READONLY
bool IsVolatile
If true, treat this inline assembly as having side effects.
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand...
BreakStmtBitfields BreakStmtBits
static bool classof(const Stmt *T)
static bool classof(const Stmt *T)
SourceLocation getEndLoc() const LLVM_READONLY
unsigned getOperandNo() const
const DeclStmt * getConditionVariableDeclStmt() const
SourceLocation getBeginLoc() const
SourceLocation getLabelLoc() const
llvm::iterator_range< const_capture_iterator > capture_const_range
void setLeaveLoc(SourceLocation L)
const Stmt * getSubStmt() const
SubstNonTypeTemplateParmExprBitfields SubstNonTypeTemplateParmExprBits
const Stmt * getSubStmt() const
void setRParenLoc(SourceLocation L)
SourceLocation getFinallyLoc() const
An expression "T()" which creates a value-initialized rvalue of type T, which is a non-class type...
GotoStmt(LabelDecl *label, SourceLocation GL, SourceLocation LL)
This represents one expression.
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation getElseLoc() const
void setWhileLoc(SourceLocation L)
Represents a character-granular source range.
inputs_const_range inputs() const
llvm::iterator_range< const_capture_init_iterator > const_capture_init_range
ArrayRef< StringRef > getClobbers() const
InitListExprBitfields InitListExprBits
static bool classof(const Stmt *T)
StringRef getClobber(unsigned i) const
SourceLocation getDefaultLoc() const
void setLParenLoc(SourceLocation L)
const StringLiteral * getClobberStringLiteral(unsigned i) const
SourceLocation getEndLoc() const LLVM_READONLY
SourceLocation getWhileLoc() const
const Stmt * getThen() const
SourceLocation getEndLoc() const
AsmStringPiece - this is part of a decomposed asm string specification (for use with the AnalyzeAsmSt...
const Expr * getInputExpr(unsigned i) const
const Stmt * getCapturedStmt() const
void setRetValue(Expr *E)
GotoStmtBitfields GotoStmtBits
ObjCDictionaryLiteral - AST node to represent objective-c dictionary literals; as in:"name" : NSUserN...
CXXDefaultInitExprBitfields CXXDefaultInitExprBits
SourceLocation getBeginLoc() const
ExprWithCleanupsBitfields ExprWithCleanupsBits
std::reverse_iterator< body_iterator > reverse_body_iterator
static bool classof(const Stmt *T)
CompoundStmtBitfields CompoundStmtBits
Defines the clang::IdentifierInfo, clang::IdentifierTable, and clang::Selector interfaces.
capture_init_range capture_inits()
StringLiteralBitfields StringLiteralBits
static OMPLinearClause * CreateEmpty(const ASTContext &C, unsigned NumVars)
Creates an empty clause with the place for NumVars variables.
AsmStringPiece(const std::string &S)
ForStmt(EmptyShell Empty)
Build an empty for statement.
SourceLocation getSwitchLoc() const
StringLiteral * getOutputConstraintLiteral(unsigned i)
LabelDecl * getLabel() const
ReturnStmt - This represents a return, optionally of an expression: return; return 4;...
An expression that sends a message to the given Objective-C object or class.
This represents a Microsoft inline-assembly statement extension.
void setColonLoc(SourceLocation L)
SourceLocation getDoLoc() const
SwitchCase * getSwitchCaseList()
UnaryOperator - This represents the unary-expression's (except sizeof and alignof), the postinc/postdec operators from postfix-expression, and various extensions.
llvm::iterator_range< const_decl_iterator > decl_const_range
Represents a reference to a non-type template parameter that has been substituted with a template arg...
SourceLocation getEndLoc() const
SourceLocation getBeginLoc() const
static bool classof(const Stmt *T)
SourceLocation getEndLoc() const
const_inputs_iterator end_inputs() const
const Expr * getCond() const
SourceLocation getEndLoc() const LLVM_READONLY
DoStmt - This represents a 'do/while' stmt.
AsmStmt is the base class for GCCAsmStmt and MSAsmStmt.
std::reverse_iterator< decl_iterator > reverse_decl_iterator
const Stmt * IgnoreContainers(bool IgnoreCaptured=false) const
SourceLocation getEndLoc() const
OpaqueValueExprBitfields OpaqueValueExprBits
llvm::DOTGraphTraits< ExplodedGraph * > DefaultDOTGraphTraits const ExplodedNode const ExplodedNode *Out<< "\l\|";Out<< "StateID: ST"<< State-> getID()<< "
decl_const_range decls() const
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class...
void setDecl(LabelDecl *D)
ParenListExprBitfields ParenListExprBits
static bool classof(const Stmt *T)
A reference to an overloaded function set, either an UnresolvedLookupExpr or an UnresolvedMemberExpr...
This captures a statement into a function.
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
SourceLocation getBeginLoc() const
void setGotoLoc(SourceLocation L)
ContinueStmtBitfields ContinueStmtBits
Encodes a location in the source.
StringRef getOutputConstraint(unsigned i) const
bool hasVarStorage() const
True if this WhileStmt has storage for a condition variable.
PseudoObjectExprBitfields PseudoObjectExprBits
UnresolvedLookupExprBitfields UnresolvedLookupExprBits
IfStmtBitfields IfStmtBits
CXXThrowExprBitfields CXXThrowExprBits
SEHLeaveStmt(EmptyShell Empty)
Build an empty __leave statement.
const SwitchCase * getSwitchCaseList() const
void setDoLoc(SourceLocation L)
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)"...
void setLastStmt(Stmt *S)
void setConstexpr(bool C)
SourceLocation getExceptLoc() const
const_capture_iterator capture_begin() const
void setIdentLoc(SourceLocation L)
const_child_range children() const
DeclStmt - Adaptor class for mixing declarations with statements and expressions. ...
Represents the declaration of a label.
bool capturesVariable() const
Determine whether this capture handles a variable (by reference).
reverse_body_iterator body_rend()
ForStmtBitfields ForStmtBits
SourceLocation getLBraceLoc() const
const std::string & getString() const
void setAllEnumCasesCovered()
Set a flag in the SwitchStmt indicating that if the 'switch (X)' is a switch over an enum value then ...
CompoundStmt(SourceLocation Loc)
reference operator*() const
static bool classof(const Stmt *T)
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load, __atomic_store, and __atomic_compare_exchange_*, for the similarly-named C++11 instructions, and __c11 variants for <stdatomic.h>, and corresponding __opencl_atomic_* for OpenCL 2.0.
SourceLocation getBeginLoc() const LLVM_READONLY
decl_iterator decl_begin()
SourceLocation getBeginLoc() const LLVM_READONLY
SourceLocation getGotoLoc() const
reverse_decl_iterator decl_rbegin()
SEHLeaveStmt(SourceLocation LL)
const StringLiteral * getOutputConstraintLiteral(unsigned i) const
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Stmt * getCapturedStmt()
Retrieve the statement being captured.
const Stmt * body_front() const
const VarDecl * getConditionVariable() const
unsigned capture_size() const
Retrieve the number of captures, including 'this'.
const Stmt * getBody() const
void setCaseLoc(SourceLocation L)
SourceLocation getEndLoc() const
DoStmtBitfields DoStmtBits
NullStmtBitfields NullStmtBits
LabelStmt(EmptyShell Empty)
Build an empty label statement.
const_capture_init_range capture_inits() const
DeclStmt * getConditionVariableDeclStmt()
If this WhileStmt has a condition variable, return the faux DeclStmt associated with the creation of ...
SourceLocation getKeywordLoc() const
MemberExprBitfields MemberExprBits
SourceLocation getBeginLoc() const
SourceLocation getStarLoc() const
const DeclStmt * getConditionVariableDeclStmt() const
void setCapturedRecordDecl(RecordDecl *D)
Set the record declaration for captured variables.
A placeholder type used to construct an empty shell of a type, that will be filled in later (e...
A qualified reference to a name whose declaration cannot yet be resolved.
const_child_range children() const
void setGotoLoc(SourceLocation L)
NullStmt - This is the null statement ";": C99 6.8.3p3.
StringRef getInputConstraint(unsigned i) const
Dataflow Directional Tag Classes.
bool isValid() const
Return true if this is a valid SourceLocation object.
[C99 6.4.2.2] - A predefined identifier such as func.
CXXNullPtrLiteralExprBitfields CXXNullPtrLiteralExprBits
Represents a delete expression for memory deallocation and destructor calls, e.g. ...
IdentifierInfo * getOutputIdentifier(unsigned i) const
llvm::iterator_range< outputs_iterator > outputs_range
ArrayRef< const Attr * > getAttrs() const
bool hasInitStorage() const
True if this IfStmt has the storage for an init statement.
const Stmt * body_back() const
Reads an AST files chain containing the contents of a translation unit.
SourceLocation getEndLoc() const LLVM_READONLY
static bool classof(const Stmt *T)
DoStmt(EmptyShell Empty)
Build an empty do-while statement.
Stmt * getHandler() const
SourceLocation getSemiLoc() const
StmtClass getStmtClass() const
reference operator*() const
SwitchCase * getNextSwitchCase()
bool isSingleDecl() const
UnaryOperatorBitfields UnaryOperatorBits
static bool classof(const Stmt *T)
SourceLocation getEndLoc() const
SourceLocation getEndLoc() const LLVM_READONLY
void setEllipsisLoc(SourceLocation L)
Set the location of the ...
DependentScopeDeclRefExprBitfields DependentScopeDeclRefExprBits
const Decl * getSingleDecl() const
static bool classof(const Stmt *T)
BreakStmt(EmptyShell Empty)
Build an empty break statement.
SourceLocation getBeginLoc() const LLVM_READONLY
const Stmt * getSubStmt() const
bool isSingleDecl() const
isSingleDecl - This method returns true if this DeclStmt refers to a single Decl. ...
body_iterator body_begin()
DeclStmt * getConditionVariableDeclStmt()
If this IfStmt has a condition variable, return the faux DeclStmt associated with the creation of tha...
static bool classof(const Stmt *T)
IndirectGotoStmt(SourceLocation gotoLoc, SourceLocation starLoc, Expr *target)
const Stmt * getBody() const
CXXNewExprBitfields CXXNewExprBits
llvm::iterator_range< const_body_iterator > body_const_range
Represents a __leave statement.
Represents a C++11 noexcept expression (C++ [expr.unary.noexcept]).
bool capturesVariableByCopy() const
Determine whether this capture handles a variable by copy.
SwitchStmt - This represents a 'switch' stmt.
CXXConstructExprBitfields CXXConstructExprBits
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
SourceLocation getLeaveLoc() const
const_capture_init_iterator capture_init_end() const
static bool classof(const Stmt *T)
DefaultStmt(EmptyShell Empty)
Build an empty default statement.
reverse_decl_iterator decl_rend()
SourceLocation getBeginLoc() const
StringLiteral * getInputConstraintLiteral(unsigned i)
DeclGroupRef getDeclGroup()
Represents a 'co_await' expression.
const Expr * getInputExpr(unsigned i) const
TypeTraitExprBitfields TypeTraitExprBits
void setSwitchLoc(SourceLocation L)
const Stmt * IgnoreImplicit() const
static bool classof(const Stmt *T)
CXXBoolLiteralExprBitfields CXXBoolLiteralExprBits
AsmStringPiece(unsigned OpNo, const std::string &S, SourceLocation Begin, SourceLocation End)
bool IsSimple
True if the assembly statement does not have any input or output operands.
static bool classof(const Stmt *T)
StringRef getAsmString() const
ArrayRef< StringRef > getAllConstraints() const
SourceLocation getEndLoc() const LLVM_READONLY
UnaryExprOrTypeTraitExprBitfields UnaryExprOrTypeTraitExprBits
SourceLocation getColonLoc() const
unsigned getNumClobbers() const
SourceLocation getRParenLoc() const
void setElseLoc(SourceLocation ElseLoc)
void setStarLoc(SourceLocation L)
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
SourceLocation getAsmLoc() const
GotoStmt - This represents a direct goto.
A use of a default initializer in a constructor or in aggregate initialization.
Decl *const * const_iterator
const SwitchCase * getNextSwitchCase() const
OverloadExprBitfields OverloadExprBits
SourceLocation getBeginLoc() const
static bool classof(const Stmt *T)
llvm::iterator_range< capture_iterator > capture_range
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
SourceLocation getWhileLoc() const
Defines the clang::SourceLocation class and associated facilities.
llvm::iterator_range< inputs_iterator > inputs_range
ContinueStmt - This represents a continue.
SourceLocation getBeginLoc() const
const_decl_iterator decl_end() const
const Expr * getRHS() const
reverse_body_iterator body_rbegin()
void setLBraceLoc(SourceLocation L)
CXXDefaultArgExprBitfields CXXDefaultArgExprBits
Expr * getFilterExpr() const
SourceLocation getAttrLoc() const
ContinueStmt(SourceLocation CL)
const Stmt * getInit() const
OpenMPLinearClauseKind getModifier() const
Return modifier.
WhileStmt - This represents a 'while' stmt.
CXXOperatorCallExprBitfields CXXOperatorCallExprBits
llvm::iterator_range< capture_init_iterator > capture_init_range
static bool classof(const Stmt *T)
SourceLocation getBeginLoc() const
const Stmt * getSubStmt() const
void setDefaultLoc(SourceLocation L)
SourceLocation getBreakLoc() const
SourceLocation getCaseLoc() const
capture_iterator capture_end() const
Retrieve an iterator pointing past the end of the sequence of captures.
VariableCaptureKind
The different capture forms: by 'this', by reference, capture for variable-length array type etc...
StringLiteral - This represents a string literal expression, e.g.
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
static bool classof(const Stmt *T)
SourceLocation getEndLoc() const LLVM_READONLY
void setRParenLoc(SourceLocation L)
void setNextSwitchCase(SwitchCase *SC)
void initialize(TemplateInstantiationCallbackPtrs &Callbacks, const Sema &TheSema)
SourceLocation getBeginLoc() const
body_const_range body() const
A reference to a declared variable, function, enum, etc.
SourceLocation getBeginLoc() const
void setLabel(LabelDecl *D)
SourceLocation getBeginLoc() const
static bool classof(const Stmt *T)
BreakStmt - This represents a break.
const Stmt * getInit() const
SourceLocation getBeginLoc() const
void setSubStmt(Stmt *SS)
CallExprBitfields CallExprBits
CapturedRegionKind
The different kinds of captured statement.
const Stmt * getBody() const
CastExprBitfields CastExprBits
DeclStmt(DeclGroupRef dg, SourceLocation startLoc, SourceLocation endLoc)
CXXNoexceptExprBitfields CXXNoexceptExprBits
const Expr * getCond() const
A trivial tuple used to represent a source range.
A boolean literal, per ([C++ lex.bool] Boolean literals).
OffsetOfExpr - [C99 7.17] - This represents an expression of the form offsetof(record-type, member-designator).
const_reverse_body_iterator body_rend() const
SourceLocation getEndLoc() const LLVM_READONLY
const Expr * getCond() const
capture_init_iterator capture_init_end()
Retrieve the iterator pointing one past the last initialization argument.
BinaryOperatorBitfields BinaryOperatorBits
SourceLocation ColonLoc
Location of ':'.
void setWhileLoc(SourceLocation L)
bool caseStmtIsGNURange() const
True if this case statement is of the form case LHS ...
This class handles loading and caching of source files into memory.
BreakStmt(SourceLocation BL)
CompoundStmt * getTryBlock() const
CompoundStmt * getBlock() const
void setKeywordLoc(SourceLocation L)
SourceLocation getReturnLoc() const
bool capturesVariableArrayType() const
Determine whether this capture handles a variable-length array type.
Attr - This represents one attribute.
void setLabelLoc(SourceLocation L)
static OMPLinearClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, OpenMPLinearClauseKind Modifier, SourceLocation ModifierLoc, SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef< Expr *> VL, ArrayRef< Expr *> PL, ArrayRef< Expr *> IL, Expr *Step, Expr *CalcStep, Stmt *PreInit, Expr *PostUpdate)
Creates clause with a list of variables VL and a linear step Step.
child_iterator child_end()
#define BLOCK(DERIVED, BASE)
SourceLocation getEndLoc() const
CXXDependentScopeMemberExprBitfields CXXDependentScopeMemberExprBits
const_capture_init_iterator capture_init_begin() const
SourceLocation getLocation() const
Retrieve the source location at which the variable or 'this' was first used.
const DeclStmt * getConditionVariableDeclStmt() const
inputs_iterator end_inputs()
outputs_const_range outputs() const
const LabelDecl * getConstantTarget() const