13 #ifndef LLVM_CLANG_AST_STMT_H 14 #define LLVM_CLANG_AST_STMT_H 22 #include "llvm/ADT/ArrayRef.h" 23 #include "llvm/ADT/PointerIntPair.h" 24 #include "llvm/ADT/StringRef.h" 25 #include "llvm/ADT/iterator.h" 26 #include "llvm/ADT/iterator_range.h" 27 #include "llvm/Support/Casting.h" 28 #include "llvm/Support/Compiler.h" 29 #include "llvm/Support/ErrorHandling.h" 38 class FoldingSetNodeID;
52 struct PrintingPolicy;
65 class alignas(void *)
Stmt {
69 #define STMT(CLASS, PARENT) CLASS##Class, 70 #define STMT_RANGE(BASE, FIRST, LAST) \ 71 first##BASE##Constant=FIRST##Class, last##BASE##Constant=LAST##Class, 72 #define LAST_STMT_RANGE(BASE, FIRST, LAST) \ 73 first##BASE##Constant=FIRST##Class, last##BASE##Constant=LAST##Class 74 #define ABSTRACT_STMT(STMT) 75 #include "clang/AST/StmtNodes.inc" 83 void *
operator new(
size_t bytes) noexcept {
84 llvm_unreachable(
"Stmts cannot be allocated with regular 'new'.");
87 void operator delete(
void *data) noexcept {
88 llvm_unreachable(
"Stmts cannot be released with regular 'delete'.");
99 enum { NumStmtBits = 8 };
106 unsigned : NumStmtBits;
113 unsigned HasLeadingEmptyMacro : 1;
123 unsigned : NumStmtBits;
125 unsigned NumStmts : 32 - NumStmtBits;
134 unsigned : NumStmtBits;
143 unsigned : NumStmtBits;
146 unsigned NumAttrs : 32 - NumStmtBits;
156 unsigned : NumStmtBits;
159 unsigned IsConstexpr : 1;
162 unsigned HasElse : 1;
168 unsigned HasInit : 1;
177 unsigned : NumStmtBits;
180 unsigned HasInit : 1;
188 unsigned AllEnumCasesCovered : 1;
198 unsigned : NumStmtBits;
210 unsigned : NumStmtBits;
219 unsigned : NumStmtBits;
229 unsigned : NumStmtBits;
238 unsigned : NumStmtBits;
247 unsigned : NumStmtBits;
256 unsigned : NumStmtBits;
259 unsigned HasNRVOCandidate : 1;
269 unsigned : NumStmtBits;
273 unsigned CaseStmtIsGNURange : 1;
284 friend class BlockDeclRefExpr;
305 unsigned : NumStmtBits;
307 unsigned ValueKind : 2;
308 unsigned ObjectKind : 3;
309 unsigned TypeDependent : 1;
310 unsigned ValueDependent : 1;
311 unsigned InstantiationDependent : 1;
312 unsigned ContainsUnexpandedParameterPack : 1;
314 enum { NumExprBits = NumStmtBits + 9 };
320 unsigned : NumExprBits;
328 unsigned HasFunctionName : 1;
338 unsigned : NumExprBits;
340 unsigned HasQualifier : 1;
341 unsigned HasTemplateKWAndArgsInfo : 1;
342 unsigned HasFoundDecl : 1;
343 unsigned HadMultipleCandidates : 1;
344 unsigned RefersToEnclosingVariableOrCapture : 1;
362 unsigned : NumExprBits;
364 unsigned Semantics : 3;
365 unsigned IsExact : 1;
372 unsigned : NumExprBits;
381 unsigned CharByteWidth : 3;
383 unsigned IsPascal : 1;
387 unsigned NumConcatenated;
393 unsigned : NumExprBits;
401 unsigned : NumExprBits;
404 unsigned CanOverflow : 1;
412 unsigned : NumExprBits;
421 unsigned : NumExprBits;
429 unsigned : NumExprBits;
431 unsigned NumPreArgs : 1;
434 unsigned UsesADL : 1;
437 unsigned : 24 - 2 - NumExprBits;
442 unsigned OffsetToTrailingObjects : 8;
444 enum { NumCallExprBits = 32 };
449 unsigned : NumExprBits;
452 unsigned IsArrow : 1;
458 unsigned HasQualifierOrFoundDecl : 1;
465 unsigned HasTemplateKWAndArgsInfo : 1;
469 unsigned HadMultipleCandidates : 1;
479 unsigned : NumExprBits;
482 unsigned PartOfExplicitCast : 1;
486 unsigned BasePathSize;
492 unsigned : NumExprBits;
498 unsigned FPFeatures : 3;
506 unsigned : NumExprBits;
510 unsigned HadArrayRangeDesignator : 1;
517 unsigned : NumExprBits;
527 unsigned : NumExprBits;
537 unsigned : NumExprBits;
541 unsigned NumSubExprs : 8;
542 unsigned ResultIndex : 32 - 8 - NumExprBits;
551 unsigned : NumCallExprBits;
555 unsigned OperatorKind : 6;
558 unsigned FPFeatures : 3;
564 unsigned : NumExprBits;
576 unsigned : NumExprBits;
585 unsigned : NumExprBits;
588 unsigned IsImplicit : 1;
598 unsigned : NumExprBits;
601 unsigned IsThrownVariableInScope : 1;
611 unsigned : NumExprBits;
621 unsigned : NumExprBits;
631 unsigned : NumExprBits;
641 unsigned : NumExprBits;
644 unsigned IsGlobalNew : 1;
648 unsigned IsArray : 1;
651 unsigned ShouldPassAlignment : 1;
655 unsigned UsualArrayDeleteWantsSize : 1;
660 unsigned StoredInitializationStyle : 2;
663 unsigned IsParenTypeId : 1;
666 unsigned NumPlacementArgs;
673 unsigned : NumExprBits;
676 unsigned GlobalDelete : 1;
679 unsigned ArrayForm : 1;
684 unsigned ArrayFormAsWritten : 1;
688 unsigned UsualArrayDeleteWantsSize : 1;
699 unsigned : NumExprBits;
709 unsigned NumArgs : 32 - 8 - 1 - NumExprBits;
717 unsigned : NumExprBits;
721 unsigned HasTemplateKWAndArgsInfo : 1;
728 unsigned : NumExprBits;
730 unsigned Elidable : 1;
731 unsigned HadMultipleCandidates : 1;
732 unsigned ListInitialization : 1;
733 unsigned StdInitListInitialization : 1;
734 unsigned ZeroInitialization : 1;
735 unsigned ConstructionKind : 3;
744 unsigned : NumExprBits;
747 unsigned CleanupsHaveSideEffects : 1;
749 unsigned NumObjects : 32 - 1 - NumExprBits;
756 unsigned : NumExprBits;
766 unsigned : NumExprBits;
770 unsigned IsArrow : 1;
774 unsigned HasTemplateKWAndArgsInfo : 1;
778 unsigned HasFirstQualifierFoundInScope : 1;
788 unsigned : NumExprBits;
792 unsigned HasTemplateKWAndArgsInfo : 1;
797 unsigned : 32 - NumExprBits - 1;
802 enum { NumOverloadExprBits = NumExprBits + 1 };
808 unsigned : NumOverloadExprBits;
812 unsigned RequiresADL : 1;
816 unsigned Overloaded : 1;
819 "UnresolvedLookupExprBitfields must be <= than 4 bytes to" 820 "avoid trashing OverloadExprBitfields::NumResults!");
826 unsigned : NumOverloadExprBits;
830 unsigned IsArrow : 1;
833 unsigned HasUnresolvedUsing : 1;
836 "UnresolvedMemberExprBitfields must be <= than 4 bytes to" 837 "avoid trashing OverloadExprBitfields::NumResults!");
843 unsigned : NumExprBits;
852 unsigned : NumExprBits;
863 unsigned : NumExprBits;
865 unsigned IsImplicit : 1;
873 unsigned : NumExprBits;
875 unsigned ShouldCopy : 1;
884 unsigned : NumExprBits;
888 unsigned IsUnique : 1;
968 unsigned alignment = 8);
971 unsigned alignment = 8) {
972 return operator new(
bytes, *C, alignment);
975 void *
operator new(
size_t bytes,
void *mem) noexcept {
return mem; }
977 void operator delete(
void *,
const ASTContext &, unsigned) noexcept {}
978 void operator delete(
void *,
const ASTContext *, unsigned) noexcept {}
979 void operator delete(
void *,
size_t) noexcept {}
980 void operator delete(
void *,
void *) noexcept {}
993 template<
typename T,
typename TPtr = T *,
typename StmtPtr = Stmt *>
995 : llvm::iterator_adaptor_base<CastIterator<T, TPtr, StmtPtr>, StmtPtr *,
996 std::random_access_iterator_tag, TPtr> {
997 using Base =
typename CastIterator::iterator_adaptor_base;
1003 return cast<T>(*this->I);
1008 template <
typename T>
1016 static bool StatisticsEnabled;
1024 static_assert(
sizeof(*
this) <= 8,
1025 "changing bitfields changed sizeof(Stmt)");
1026 static_assert(
sizeof(*
this) %
alignof(
void *) == 0,
1027 "Insufficient alignment!");
1028 StmtBits.sClass = SC;
1029 if (StatisticsEnabled) Stmt::addStmtClass(SC);
1033 return static_cast<StmtClass>(StmtBits.sClass);
1036 const char *getStmtClassName()
const;
1046 static void addStmtClass(
const StmtClass s);
1047 static void EnableStatistics();
1048 static void PrintStats();
1055 void dump(raw_ostream &OS)
const;
1058 int64_t
getID(
const ASTContext &Context)
const;
1061 void dumpColor()
const;
1065 void dumpPretty(
const ASTContext &Context)
const;
1068 StringRef NewlineSymbol =
"\n",
1069 const ASTContext *Context =
nullptr)
const;
1073 void viewAST()
const;
1077 Stmt *IgnoreContainers(
bool IgnoreCaptured =
false);
1079 return const_cast<Stmt *
>(
this)->IgnoreContainers(IgnoreCaptured);
1082 const Stmt *stripLabelLikeStatements()
const;
1084 return const_cast<Stmt*
>(
1085 const_cast<const Stmt*
>(
this)->stripLabelLikeStatements());
1122 void Profile(llvm::FoldingSetNodeID &
ID,
const ASTContext &Context,
1123 bool Canonical)
const;
1132 void ProcessODRHash(llvm::FoldingSetNodeID &ID,
ODRHash& Hash)
const;
1145 :
Stmt(DeclStmtClass), DG(dg), StartLoc(startLoc), EndLoc(endLoc) {}
1209 :
Stmt(NullStmtClass) {
1210 NullStmtBits.HasLeadingEmptyMacro = hasLeadingEmptyMacro;
1221 return NullStmtBits.HasLeadingEmptyMacro;
1256 :
Stmt(CompoundStmtClass), RBraceLoc(Loc) {
1257 CompoundStmtBits.NumStmts = 0;
1258 CompoundStmtBits.LBraceLoc = Loc;
1264 bool body_empty()
const {
return CompoundStmtBits.NumStmts == 0; }
1265 unsigned size()
const {
return CompoundStmtBits.NumStmts; }
1276 return !body_empty() ? body_begin()[size() - 1] :
nullptr;
1280 assert(!body_empty() &&
"setLastStmt");
1281 body_begin()[size() - 1] = S;
1292 return getTrailingObjects<Stmt *>();
1298 return !body_empty() ? body_begin()[0] :
nullptr;
1302 return !body_empty() ? body_begin()[size() - 1] :
nullptr;
1316 std::reverse_iterator<const_body_iterator>;
1358 :
Stmt(SC), ColonLoc(ColonLoc) {
1359 setKeywordLoc(KWLoc);
1374 inline Stmt *getSubStmt();
1376 return const_cast<SwitchCase *
>(
this)->getSubStmt();
1410 enum { LhsOffset = 0, SubStmtOffsetFromRhs = 1 };
1411 enum { NumMandatoryStmtPtr = 2 };
1413 unsigned numTrailingObjects(OverloadToken<Stmt *>)
const {
1414 return NumMandatoryStmtPtr + caseStmtIsGNURange();
1417 unsigned numTrailingObjects(OverloadToken<SourceLocation>)
const {
1418 return caseStmtIsGNURange();
1421 unsigned lhsOffset()
const {
return LhsOffset; }
1422 unsigned rhsOffset()
const {
return LhsOffset + caseStmtIsGNURange(); }
1423 unsigned subStmtOffset()
const {
return rhsOffset() + SubStmtOffsetFromRhs; }
1429 :
SwitchCase(CaseStmtClass, caseLoc, colonLoc) {
1431 bool IsGNURange = rhs !=
nullptr;
1432 SwitchCaseBits.CaseStmtIsGNURange = IsGNURange;
1434 setSubStmt(
nullptr);
1437 setEllipsisLoc(ellipsisLoc);
1444 SwitchCaseBits.CaseStmtIsGNURange = CaseStmtIsGNURange;
1466 return caseStmtIsGNURange() ? *getTrailingObjects<SourceLocation>()
1474 caseStmtIsGNURange() &&
1475 "setEllipsisLoc but this is not a case stmt of the form LHS ... RHS!");
1476 *getTrailingObjects<SourceLocation>() = L;
1480 return reinterpret_cast<Expr *
>(getTrailingObjects<Stmt *>()[lhsOffset()]);
1484 return reinterpret_cast<Expr *
>(getTrailingObjects<Stmt *>()[lhsOffset()]);
1488 getTrailingObjects<Stmt *>()[lhsOffset()] =
reinterpret_cast<Stmt *
>(Val);
1492 return caseStmtIsGNURange() ?
reinterpret_cast<Expr *
>(
1493 getTrailingObjects<Stmt *>()[rhsOffset()])
1498 return caseStmtIsGNURange() ?
reinterpret_cast<Expr *
>(
1499 getTrailingObjects<Stmt *>()[rhsOffset()])
1504 assert(caseStmtIsGNURange() &&
1505 "setRHS but this is not a case stmt of the form LHS ... RHS!");
1506 getTrailingObjects<Stmt *>()[rhsOffset()] =
reinterpret_cast<Stmt *
>(Val);
1511 return getTrailingObjects<Stmt *>()[subStmtOffset()];
1515 getTrailingObjects<Stmt *>()[subStmtOffset()] = S;
1522 while (
const auto *CS2 = dyn_cast<CaseStmt>(CS->
getSubStmt()))
1535 getTrailingObjects<Stmt *>() +
1536 numTrailingObjects(OverloadToken<Stmt *>()));
1545 :
SwitchCase(DefaultStmtClass, DL, CL), SubStmt(substmt) {}
1572 if (
const auto *CS = dyn_cast<CaseStmt>(
this))
1573 return CS->getEndLoc();
1574 else if (
const auto *DS = dyn_cast<DefaultStmt>(
this))
1575 return DS->getEndLoc();
1576 llvm_unreachable(
"SwitchCase is neither a CaseStmt nor a DefaultStmt!");
1580 if (
auto *CS = dyn_cast<CaseStmt>(
this))
1581 return CS->getSubStmt();
1582 else if (
auto *DS = dyn_cast<DefaultStmt>(
this))
1583 return DS->getSubStmt();
1584 llvm_unreachable(
"SwitchCase is neither a CaseStmt nor a DefaultStmt!");
1598 const Expr *getExprStmt()
const;
1619 :
ValueStmt(LabelStmtClass), TheDecl(D), SubStmt(substmt) {
1662 :
ValueStmt(AttributedStmtClass), SubStmt(SubStmt) {
1663 AttributedStmtBits.NumAttrs = Attrs.size();
1664 AttributedStmtBits.AttrLoc = Loc;
1665 std::copy(Attrs.begin(), Attrs.end(), getAttrArrayPtr());
1669 :
ValueStmt(AttributedStmtClass, Empty) {
1670 AttributedStmtBits.NumAttrs = NumAttrs;
1672 std::fill_n(getAttrArrayPtr(), NumAttrs,
nullptr);
1675 const Attr *
const *getAttrArrayPtr()
const {
1676 return getTrailingObjects<const Attr *>();
1678 const Attr **getAttrArrayPtr() {
return getTrailingObjects<const Attr *>(); }
1689 return llvm::makeArrayRef(getAttrArrayPtr(), AttributedStmtBits.NumAttrs);
1733 enum { InitOffset = 0, ThenOffsetFromCond = 1, ElseOffsetFromCond = 2 };
1734 enum { NumMandatoryStmtPtr = 2 };
1736 unsigned numTrailingObjects(OverloadToken<Stmt *>)
const {
1737 return NumMandatoryStmtPtr + hasElseStorage() + hasVarStorage() +
1741 unsigned numTrailingObjects(OverloadToken<SourceLocation>)
const {
1742 return hasElseStorage();
1745 unsigned initOffset()
const {
return InitOffset; }
1746 unsigned varOffset()
const {
return InitOffset + hasInitStorage(); }
1747 unsigned condOffset()
const {
1748 return InitOffset + hasInitStorage() + hasVarStorage();
1750 unsigned thenOffset()
const {
return condOffset() + ThenOffsetFromCond; }
1751 unsigned elseOffset()
const {
return condOffset() + ElseOffsetFromCond; }
1758 explicit IfStmt(
EmptyShell Empty,
bool HasElse,
bool HasVar,
bool HasInit);
1765 Stmt *Else =
nullptr);
1782 return reinterpret_cast<Expr *
>(getTrailingObjects<Stmt *>()[condOffset()]);
1786 return reinterpret_cast<Expr *
>(getTrailingObjects<Stmt *>()[condOffset()]);
1790 getTrailingObjects<Stmt *>()[condOffset()] =
reinterpret_cast<Stmt *
>(Cond);
1793 Stmt *
getThen() {
return getTrailingObjects<Stmt *>()[thenOffset()]; }
1795 return getTrailingObjects<Stmt *>()[thenOffset()];
1799 getTrailingObjects<Stmt *>()[thenOffset()] = Then;
1803 return hasElseStorage() ? getTrailingObjects<Stmt *>()[elseOffset()]
1808 return hasElseStorage() ? getTrailingObjects<Stmt *>()[elseOffset()]
1813 assert(hasElseStorage() &&
1814 "This if statement has no storage for an else statement!");
1815 getTrailingObjects<Stmt *>()[elseOffset()] = Else;
1826 VarDecl *getConditionVariable();
1828 return const_cast<IfStmt *
>(
this)->getConditionVariable();
1838 return hasVarStorage() ?
static_cast<DeclStmt *
>(
1839 getTrailingObjects<Stmt *>()[varOffset()])
1844 return hasVarStorage() ?
static_cast<DeclStmt *
>(
1845 getTrailingObjects<Stmt *>()[varOffset()])
1850 return hasInitStorage() ? getTrailingObjects<Stmt *>()[initOffset()]
1855 return hasInitStorage() ? getTrailingObjects<Stmt *>()[initOffset()]
1860 assert(hasInitStorage() &&
1861 "This if statement has no storage for an init statement!");
1862 getTrailingObjects<Stmt *>()[initOffset()] = Init;
1869 return hasElseStorage() ? *getTrailingObjects<SourceLocation>()
1874 assert(hasElseStorage() &&
1875 "This if statement has no storage for an else statement!");
1876 *getTrailingObjects<SourceLocation>() = ElseLoc;
1882 bool isObjCAvailabilityCheck()
const;
1887 return getElse()->getEndLoc();
1888 return getThen()->getEndLoc();
1895 getTrailingObjects<Stmt *>() +
1896 numTrailingObjects(OverloadToken<Stmt *>()));
1929 enum { InitOffset = 0, BodyOffsetFromCond = 1 };
1930 enum { NumMandatoryStmtPtr = 2 };
1932 unsigned numTrailingObjects(OverloadToken<Stmt *>)
const {
1933 return NumMandatoryStmtPtr + hasInitStorage() + hasVarStorage();
1936 unsigned initOffset()
const {
return InitOffset; }
1937 unsigned varOffset()
const {
return InitOffset + hasInitStorage(); }
1938 unsigned condOffset()
const {
1939 return InitOffset + hasInitStorage() + hasVarStorage();
1941 unsigned bodyOffset()
const {
return condOffset() + BodyOffsetFromCond; }
1966 return reinterpret_cast<Expr *
>(getTrailingObjects<Stmt *>()[condOffset()]);
1970 return reinterpret_cast<Expr *
>(getTrailingObjects<Stmt *>()[condOffset()]);
1974 getTrailingObjects<Stmt *>()[condOffset()] =
reinterpret_cast<Stmt *
>(Cond);
1977 Stmt *
getBody() {
return getTrailingObjects<Stmt *>()[bodyOffset()]; }
1979 return getTrailingObjects<Stmt *>()[bodyOffset()];
1983 getTrailingObjects<Stmt *>()[bodyOffset()] = Body;
1987 return hasInitStorage() ? getTrailingObjects<Stmt *>()[initOffset()]
1992 return hasInitStorage() ? getTrailingObjects<Stmt *>()[initOffset()]
1997 assert(hasInitStorage() &&
1998 "This switch statement has no storage for an init statement!");
1999 getTrailingObjects<Stmt *>()[initOffset()] = Init;
2011 VarDecl *getConditionVariable();
2013 return const_cast<SwitchStmt *
>(
this)->getConditionVariable();
2023 return hasVarStorage() ?
static_cast<DeclStmt *
>(
2024 getTrailingObjects<Stmt *>()[varOffset()])
2029 return hasVarStorage() ?
static_cast<DeclStmt *
>(
2030 getTrailingObjects<Stmt *>()[varOffset()])
2048 "case/default already added to a switch");
2060 return SwitchStmtBits.AllEnumCasesCovered;
2065 return getBody() ? getBody()->getEndLoc()
2066 :
reinterpret_cast<const Stmt *
>(getCond())->getEndLoc();
2072 getTrailingObjects<Stmt *>() +
2073 numTrailingObjects(OverloadToken<Stmt *>()));
2101 enum { VarOffset = 0, BodyOffsetFromCond = 1 };
2102 enum { NumMandatoryStmtPtr = 2 };
2104 unsigned varOffset()
const {
return VarOffset; }
2105 unsigned condOffset()
const {
return VarOffset + hasVarStorage(); }
2106 unsigned bodyOffset()
const {
return condOffset() + BodyOffsetFromCond; }
2108 unsigned numTrailingObjects(OverloadToken<Stmt *>)
const {
2109 return NumMandatoryStmtPtr + hasVarStorage();
2132 return reinterpret_cast<Expr *
>(getTrailingObjects<Stmt *>()[condOffset()]);
2136 return reinterpret_cast<Expr *
>(getTrailingObjects<Stmt *>()[condOffset()]);
2140 getTrailingObjects<Stmt *>()[condOffset()] =
reinterpret_cast<Stmt *
>(Cond);
2143 Stmt *
getBody() {
return getTrailingObjects<Stmt *>()[bodyOffset()]; }
2145 return getTrailingObjects<Stmt *>()[bodyOffset()];
2149 getTrailingObjects<Stmt *>()[bodyOffset()] = Body;
2160 VarDecl *getConditionVariable();
2162 return const_cast<WhileStmt *
>(
this)->getConditionVariable();
2172 return hasVarStorage() ?
static_cast<DeclStmt *
>(
2173 getTrailingObjects<Stmt *>()[varOffset()])
2178 return hasVarStorage() ?
static_cast<DeclStmt *
>(
2179 getTrailingObjects<Stmt *>()[varOffset()])
2188 return getBody()->getEndLoc();
2198 getTrailingObjects<Stmt *>() +
2199 numTrailingObjects(OverloadToken<Stmt *>()));
2205 enum { BODY, COND, END_EXPR };
2206 Stmt *SubExprs[END_EXPR];
2213 :
Stmt(DoStmtClass), WhileLoc(WL), RParenLoc(RP) {
2224 return reinterpret_cast<Expr *
>(SubExprs[COND]);
2249 return child_range(&SubExprs[0], &SubExprs[0] + END_EXPR);
2257 enum { INIT, CONDVAR, COND, INC, BODY, END_EXPR };
2258 Stmt* SubExprs[END_EXPR];
2279 VarDecl *getConditionVariable()
const;
2285 return reinterpret_cast<DeclStmt*
>(SubExprs[CONDVAR]);
2318 return child_range(&SubExprs[0], &SubExprs[0]+END_EXPR);
2329 :
Stmt(GotoStmtClass), Label(label), LabelLoc(LL) {
2364 :
Stmt(IndirectGotoStmtClass), StarLoc(starLoc) {
2366 setGotoLoc(gotoLoc);
2371 :
Stmt(IndirectGotoStmtClass, Empty) {}
2380 return reinterpret_cast<const Expr *
>(Target);
2474 bool hasNRVOCandidate()
const {
return ReturnStmtBits.HasNRVOCandidate; }
2476 unsigned numTrailingObjects(OverloadToken<const VarDecl *>)
const {
2477 return hasNRVOCandidate();
2489 const VarDecl *NRVOCandidate);
2505 return hasNRVOCandidate() ? *getTrailingObjects<const VarDecl *>()
2513 assert(hasNRVOCandidate() &&
2514 "This return statement has no storage for an NRVO candidate!");
2515 *getTrailingObjects<const VarDecl *>() = Var;
2523 return RetExpr ? RetExpr->
getEndLoc() : getReturnLoc();
2560 unsigned numoutputs,
unsigned numinputs,
unsigned numclobbers)
2561 :
Stmt (SC), AsmLoc(asmloc), IsSimple(issimple), IsVolatile(isvolatile),
2562 NumOutputs(numoutputs), NumInputs(numinputs),
2563 NumClobbers(numclobbers) {}
2584 std::string generateAsmString(
const ASTContext &
C)
const;
2593 StringRef getOutputConstraint(
unsigned i)
const;
2599 return getOutputConstraint(i)[0] ==
'+';
2602 const Expr *getOutputExpr(
unsigned i)
const;
2606 unsigned getNumPlusOperands()
const;
2614 StringRef getInputConstraint(
unsigned i)
const;
2616 const Expr *getInputExpr(
unsigned i)
const;
2621 StringRef getClobber(
unsigned i)
const;
2636 return &Exprs[0] + NumOutputs;
2640 return &Exprs[0] + NumOutputs + NumInputs;
2646 return &Exprs[0] + NumOutputs;
2650 return &Exprs[0] + NumOutputs + NumInputs;
2669 return &Exprs[0] + NumOutputs;
2681 return &Exprs[0] + NumOutputs;
2689 return child_range(&Exprs[0], &Exprs[0] + NumOutputs + NumInputs);
2707 bool isvolatile,
unsigned numoutputs,
unsigned numinputs,
2746 : MyKind(Operand), Str(S), OperandNo(OpNo),
2755 assert(isOperand());
2760 assert(isOperand() &&
"Range is currently used only for Operands.");
2775 const ASTContext &C,
unsigned &DiagOffs)
const;
2778 std::string generateAsmString(
const ASTContext &C)
const;
2786 return II->getName();
2791 StringRef getOutputConstraint(
unsigned i)
const;
2794 return Constraints[i];
2797 return Constraints[i];
2800 Expr *getOutputExpr(
unsigned i);
2803 return const_cast<GCCAsmStmt*
>(
this)->getOutputExpr(i);
2809 return Names[i + NumOutputs];
2814 return II->getName();
2819 StringRef getInputConstraint(
unsigned i)
const;
2822 return Constraints[i + NumOutputs];
2825 return Constraints[i + NumOutputs];
2828 Expr *getInputExpr(
unsigned i);
2829 void setInputExpr(
unsigned i,
Expr *E);
2832 return const_cast<GCCAsmStmt*
>(
this)->getInputExpr(i);
2836 void setOutputsAndInputsAndClobbers(
const ASTContext &C,
2840 unsigned NumOutputs,
2843 unsigned NumClobbers);
2851 int getNamedOperand(StringRef SymbolicName)
const;
2853 StringRef getClobber(
unsigned i)
const;
2875 unsigned NumAsmToks = 0;
2877 Token *AsmToks =
nullptr;
2878 StringRef *Constraints =
nullptr;
2879 StringRef *Clobbers =
nullptr;
2906 std::string generateAsmString(
const ASTContext &
C)
const;
2911 assert(i < NumOutputs);
2912 return Constraints[i];
2915 Expr *getOutputExpr(
unsigned i);
2918 return const_cast<MSAsmStmt*
>(
this)->getOutputExpr(i);
2924 assert(i < NumInputs);
2925 return Constraints[i + NumOutputs];
2928 Expr *getInputExpr(
unsigned i);
2929 void setInputExpr(
unsigned i,
Expr *E);
2932 return const_cast<MSAsmStmt*
>(
this)->getInputExpr(i);
2938 return llvm::makeArrayRef(Constraints, NumInputs + NumOutputs);
2942 return llvm::makeArrayRef(Clobbers, NumClobbers);
2946 return llvm::makeArrayRef(reinterpret_cast<Expr**>(Exprs),
2947 NumInputs + NumOutputs);
2950 StringRef
getClobber(
unsigned i)
const {
return getClobbers()[i]; }
2965 return child_range(&Exprs[0], &Exprs[NumInputs + NumOutputs]);
2976 enum { FILTER_EXPR,
BLOCK };
2993 return reinterpret_cast<Expr*
>(Children[FILTER_EXPR]);
2997 return cast<CompoundStmt>(Children[
BLOCK]);
3048 enum { TRY = 0, HANDLER = 1 };
3070 return cast<CompoundStmt>(Children[TRY]);
3094 :
Stmt(SEHLeaveStmtClass), LeaveLoc(LL) {}
3138 llvm::PointerIntPair<VarDecl *, 2, VariableCaptureKind> VarAndKind;
3169 return getCaptureKind() == VCK_ByCopy;
3175 return getCaptureKind() == VCK_VLAType;
3181 VarDecl *getCapturedVar()
const;
3186 unsigned NumCaptures;
3190 llvm::PointerIntPair<CapturedDecl *, 2, CapturedRegionKind> CapDeclAndKind;
3202 Stmt **getStoredStmts() {
return reinterpret_cast<Stmt **
>(
this + 1); }
3204 Stmt *
const *getStoredStmts()
const {
3205 return reinterpret_cast<Stmt *
const *
>(
this + 1);
3208 Capture *getStoredCaptures()
const;
3210 void setCapturedStmt(
Stmt *S) { getStoredStmts()[NumCaptures] = S; }
3222 unsigned NumCaptures);
3246 assert(D &&
"null RecordDecl");
3251 bool capturesVariable(
const VarDecl *Var)
const;
3273 return getStoredCaptures() + NumCaptures;
3287 llvm::iterator_range<const_capture_init_iterator>;
3299 return reinterpret_cast<Expr **
>(getStoredStmts());
3303 return reinterpret_cast<Expr *
const *
>(getStoredStmts());
3309 return capture_init_begin() + NumCaptures;
3313 return capture_init_begin() + NumCaptures;
3317 return getCapturedStmt()->getBeginLoc();
3321 return getCapturedStmt()->getEndLoc();
3325 return getCapturedStmt()->getSourceRange();
3337 #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
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
const Expr * getExprStmt() 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.
Represents a statement that could possibly have a value and type.
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.
static bool classof(const Stmt *T)
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
SourceLocation getEndLoc() const LLVM_READONLY
Represents the this expression in C++.
PredefinedExprBitfields PredefinedExprBits
const_decl_iterator decl_begin() const
StringLiteral * getAsmString()
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
GenericSelectionExprBitfields GenericSelectionExprBits
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 ...
typename CastIterator::iterator_adaptor_base Base
CompoundStmt(SourceLocation Loc)
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
Base::value_type operator*() 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.
Represents a C11 generic selection.
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
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
Iterator for iterating over Stmt * arrays that contain only T *.
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)
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