15 #ifndef LLVM_CLANG_AST_EXPRCXX_H
16 #define LLVM_CLANG_AST_EXPRCXX_H
25 #include "llvm/Support/Compiler.h"
29 class CXXConstructorDecl;
30 class CXXDestructorDecl;
34 class TemplateArgumentListInfo;
62 unsigned FPContractable : 1;
64 SourceRange getSourceRangeImpl()
const LLVM_READONLY;
69 :
CallExpr(C, CXXOperatorCallExprClass, fn, 0, args, t, VK,
71 Operator(Op), FPContractable(fpContractable) {
72 Range = getSourceRangeImpl();
75 CallExpr(C, CXXOperatorCallExprClass, Empty) { }
90 return (Operator < OO_Plus || Operator >= OO_Arrow ||
91 Operator == OO_PlusPlus || Operator == OO_MinusMinus)
101 return T->getStmtClass() == CXXOperatorCallExprClass;
128 :
CallExpr(C, CXXMemberCallExprClass, fn, 0, args, t, VK, RP) {}
131 :
CallExpr(C, CXXMemberCallExprClass, Empty) { }
150 return T->getStmtClass() == CXXMemberCallExprClass;
157 enum { CONFIG, END_PREARG };
163 :
CallExpr(C, CUDAKernelCallExprClass, fn, END_PREARG, args, t, VK, RP) {
168 :
CallExpr(C, CUDAKernelCallExprClass, END_PREARG, Empty) { }
171 return cast_or_null<CallExpr>(
getPreArg(CONFIG));
177 return T->getStmtClass() == CUDAKernelCallExprClass;
200 RParenLoc(RParenLoc), AngleBrackets(AngleBrackets) {}
222 switch (T->getStmtClass()) {
223 case CXXStaticCastExprClass:
224 case CXXDynamicCastExprClass:
225 case CXXReinterpretCastExprClass:
226 case CXXConstCastExprClass:
246 writtenTy, l, RParenLoc, AngleBrackets) {}
248 explicit CXXStaticCastExpr(EmptyShell Empty,
unsigned PathSize)
262 return T->getStmtClass() == CXXStaticCastExprClass;
282 writtenTy, l, RParenLoc, AngleBrackets) {}
284 explicit CXXDynamicCastExpr(EmptyShell Empty,
unsigned pathSize)
301 return T->getStmtClass() == CXXDynamicCastExprClass;
319 CXXBaseSpecifier *> {
321 Expr *op,
unsigned pathSize,
326 pathSize, writtenTy, l, RParenLoc, AngleBrackets) {}
328 CXXReinterpretCastExpr(EmptyShell Empty,
unsigned pathSize)
342 return T->getStmtClass() == CXXReinterpretCastExprClass;
363 0, writtenTy, l, RParenLoc, AngleBrackets) {}
365 explicit CXXConstCastExpr(EmptyShell Empty)
377 return T->getStmtClass() == CXXConstCastExprClass;
401 :
CallExpr(C, UserDefinedLiteralClass, Fn, 0, Args, T, VK, LitEndLoc),
402 UDSuffixLoc(SuffixLoc) {}
404 :
CallExpr(C, UserDefinedLiteralClass, Empty) {}
431 return getArg(0)->getLocStart();
446 return S->getStmtClass() == UserDefinedLiteralClass;
462 Value(val), Loc(l) {}
465 :
Expr(CXXBoolLiteralExprClass, Empty) { }
477 return T->getStmtClass() == CXXBoolLiteralExprClass;
482 return child_range(child_iterator(), child_iterator());
498 :
Expr(CXXNullPtrLiteralExprClass, Empty) { }
507 return T->getStmtClass() == CXXNullPtrLiteralExprClass;
511 return child_range(child_iterator(), child_iterator());
521 :
Expr(CXXStdInitializerListExprClass, Empty), SubExpr(
nullptr) {}
535 return SubExpr->getLocStart();
538 return SubExpr->getLocEnd();
541 return SubExpr->getSourceRange();
545 return S->getStmtClass() == CXXStdInitializerListExprClass;
548 child_range
children() {
return child_range(&SubExpr, &SubExpr + 1); }
561 llvm::PointerUnion<Stmt *, TypeSourceInfo *> Operand;
570 Operand->
getType()->isDependentType(),
571 Operand->
getType()->isInstantiationDependentType(),
573 Operand(Operand), Range(R) { }
583 Operand(Operand), Range(R) { }
586 :
Expr(CXXTypeidExprClass, Empty) {
588 Operand = (
Expr*)
nullptr;
605 assert(
isTypeOperand() &&
"Cannot call getTypeOperand for typeid(expr)");
610 assert(
isTypeOperand() &&
"Cannot call getTypeOperand for typeid(expr)");
615 assert(!
isTypeOperand() &&
"Cannot call getExprOperand for typeid(type)");
616 return static_cast<Expr*
>(Operand.get<
Stmt *>());
620 assert(!
isTypeOperand() &&
"Cannot call getExprOperand for typeid(type)");
630 return T->getStmtClass() == CXXTypeidExprClass;
636 return child_range(child_iterator(), child_iterator());
638 return child_range(begin, begin + 1);
663 BaseExpr(baseExpr), TheDecl(decl),
664 MemberLoc(nameLoc), IsArrow(isArrow),
665 QualifierLoc(qualifierLoc) {}
677 return BaseExpr->getLocStart();
678 else if (QualifierLoc)
686 return child_range((
Stmt**)&BaseExpr, (
Stmt**)&BaseExpr + 1);
689 return T->getStmtClass() == MSPropertyRefExprClass;
714 enum { BASE_EXPR, IDX_EXPR, NUM_SUBEXPRS = 2 };
715 Stmt *SubExprs[NUM_SUBEXPRS];
718 void setBase(
Expr *
Base) { SubExprs[BASE_EXPR] = Base; }
719 void setIdx(
Expr *Idx) { SubExprs[IDX_EXPR] = Idx; }
727 RBracketLoc(RBracketLoc) {
728 SubExprs[BASE_EXPR] = Base;
729 SubExprs[IDX_EXPR] = Idx;
734 :
Expr(MSPropertySubscriptExprClass, Shell) {}
737 const Expr *
getBase()
const {
return cast<Expr>(SubExprs[BASE_EXPR]); }
740 const Expr *
getIdx()
const {
return cast<Expr>(SubExprs[IDX_EXPR]); }
743 return getBase()->getLocStart();
755 return T->getStmtClass() == MSPropertySubscriptExprClass;
760 return child_range(&SubExprs[0], &SubExprs[0] + NUM_SUBEXPRS);
770 llvm::PointerUnion<Stmt *, TypeSourceInfo *> Operand;
777 Operand->
getType()->isInstantiationDependentType(),
779 Operand(Operand), Range(R) { }
786 Operand(Operand), Range(R) { }
789 :
Expr(CXXUuidofExprClass, Empty) {
791 Operand = (
Expr*)
nullptr;
804 assert(
isTypeOperand() &&
"Cannot call getTypeOperand for __uuidof(expr)");
809 assert(
isTypeOperand() &&
"Cannot call getTypeOperand for __uuidof(expr)");
814 assert(!
isTypeOperand() &&
"Cannot call getExprOperand for __uuidof(type)");
815 return static_cast<Expr*
>(Operand.get<
Stmt *>());
819 assert(!
isTypeOperand() &&
"Cannot call getExprOperand for __uuidof(type)");
831 return T->getStmtClass() == CXXUuidofExprClass;
837 bool *HasMultipleGUIDsPtr =
nullptr);
842 return child_range(child_iterator(), child_iterator());
844 return child_range(begin, begin + 1);
869 Type->isDependentType(), Type->isDependentType(),
870 Type->isInstantiationDependentType(),
872 Loc(L), Implicit(isImplicit) { }
886 return T->getStmtClass() == CXXThisExprClass;
891 return child_range(child_iterator(), child_iterator());
904 unsigned IsThrownVariableInScope : 1;
913 bool IsThrownVariableInScope) :
917 Op(expr), ThrowLoc(l), IsThrownVariableInScope(IsThrownVariableInScope) {}
940 return T->getStmtClass() == CXXThrowExprClass;
945 return child_range(&Op, Op ? &Op+1 : &Op);
968 Param(param), Loc(Loc) { }
1004 return T->getStmtClass() == CXXDefaultArgExprClass;
1009 return child_range(child_iterator(), child_iterator());
1062 return T->getStmtClass() == CXXDefaultInitExprClass;
1067 return child_range(child_iterator(), child_iterator());
1080 : Destructor(destructor) { }
1112 :
Expr(CXXBindTemporaryExprClass, SubExpr->
getType(),
1117 Temp(temp), SubExpr(SubExpr) { }
1121 :
Expr(CXXBindTemporaryExprClass, Empty), Temp(nullptr), SubExpr(nullptr) {}
1135 return SubExpr->getLocStart();
1141 return T->getStmtClass() == CXXBindTemporaryExprClass;
1145 child_range
children() {
return child_range(&SubExpr, &SubExpr + 1); }
1163 unsigned NumArgs : 16;
1165 bool HadMultipleCandidates : 1;
1166 bool ListInitialization : 1;
1167 bool StdInitListInitialization : 1;
1168 bool ZeroInitialization : 1;
1169 unsigned ConstructKind : 2;
1177 bool HadMultipleCandidates,
1178 bool ListInitialization,
1179 bool StdInitListInitialization,
1180 bool ZeroInitialization,
1186 :
Expr(SC, Empty), Constructor(nullptr), NumArgs(0), Elidable(
false),
1187 HadMultipleCandidates(
false), ListInitialization(
false),
1188 ZeroInitialization(
false), ConstructKind(0), Args(nullptr)
1194 :
Expr(CXXConstructExprClass, Empty), Constructor(nullptr),
1195 NumArgs(0), Elidable(
false), HadMultipleCandidates(
false),
1196 ListInitialization(
false), ZeroInitialization(
false),
1197 ConstructKind(0), Args(nullptr)
1204 bool HadMultipleCandidates,
1205 bool ListInitialization,
1206 bool StdInitListInitialization,
1207 bool ZeroInitialization,
1241 ZeroInitialization = ZeroInit;
1276 assert(Arg < NumArgs &&
"Arg access out of range!");
1277 return cast<Expr>(Args[Arg]);
1280 assert(Arg < NumArgs &&
"Arg access out of range!");
1281 return cast<Expr>(Args[Arg]);
1286 assert(Arg < NumArgs &&
"Arg access out of range!");
1287 Args[Arg] = ArgExpr;
1296 return T->getStmtClass() == CXXConstructExprClass ||
1297 T->getStmtClass() == CXXTemporaryObjectExprClass;
1302 return child_range(&Args[0], &Args[0]+NumArgs);
1326 castExpr, pathSize, writtenTy),
1327 LParenLoc(lParenLoc), RParenLoc(rParenLoc) {}
1352 return T->getStmtClass() == CXXFunctionalCastExprClass;
1382 bool HadMultipleCandidates,
1383 bool ListInitialization,
1384 bool StdInitListInitialization,
1385 bool ZeroInitialization);
1395 return T->getStmtClass() == CXXTemporaryObjectExprClass;
1432 unsigned NumCaptures : 16;
1436 unsigned CaptureDefault : 2;
1440 unsigned ExplicitParams : 1;
1443 unsigned ExplicitResultType : 1;
1447 unsigned HasArrayIndexVars : 1;
1459 size_t numTrailingObjects(OverloadToken<Stmt *>)
const {
1460 return NumCaptures + 1;
1463 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
1464 return HasArrayIndexVars ? NumCaptures + 1 : 0;
1471 bool ExplicitParams,
bool ExplicitResultType,
1474 bool ContainsUnexpandedParameterPack);
1477 LambdaExpr(EmptyShell Empty,
unsigned NumCaptures,
bool HasArrayIndexVars)
1478 :
Expr(LambdaExprClass, Empty),
1479 NumCaptures(NumCaptures), CaptureDefault(
LCD_None), ExplicitParams(
false),
1480 ExplicitResultType(
false), HasArrayIndexVars(
true) {
1481 getStoredStmts()[NumCaptures] =
nullptr;
1484 Stmt **getStoredStmts() {
return getTrailingObjects<Stmt *>(); }
1486 Stmt *
const *getStoredStmts()
const {
return getTrailingObjects<Stmt *>(); }
1490 unsigned *getArrayIndexStarts() {
return getTrailingObjects<unsigned>(); }
1492 const unsigned *getArrayIndexStarts()
const {
1493 return getTrailingObjects<unsigned>();
1497 VarDecl **getArrayIndexVars() {
return getTrailingObjects<VarDecl *>(); }
1499 VarDecl *
const *getArrayIndexVars()
const {
1500 return getTrailingObjects<VarDecl *>();
1512 bool ContainsUnexpandedParameterPack);
1517 unsigned NumCaptures,
1518 unsigned NumArrayIndexVars);
1527 return CaptureDefaultLoc;
1596 return reinterpret_cast<Expr **
>(getStoredStmts());
1602 return reinterpret_cast<Expr *
const *
>(getStoredStmts());
1663 return T->getStmtClass() == LambdaExprClass;
1673 return child_range(getStoredStmts(), getStoredStmts() + NumCaptures + 1);
1695 false,
false, Type->isInstantiationDependentType(),
1697 RParenLoc(rParenLoc), TypeInfo(TypeInfo) {}
1700 :
Expr(CXXScalarValueInitExprClass, Shell) { }
1712 return T->getStmtClass() == CXXScalarValueInitExprClass;
1717 return child_range(child_iterator(), child_iterator());
1752 bool UsualArrayDeleteWantsSize : 1;
1754 unsigned NumPlacementArgs : 13;
1758 unsigned StoredInitializationStyle : 2;
1770 FunctionDecl *operatorDelete,
bool usualArrayDeleteWantsSize,
1777 :
Expr(CXXNewExprClass, Shell), SubExprs(nullptr) { }
1783 assert(
getType()->isPointerType());
1788 return AllocatedTypeInfo;
1815 return Array ? cast<Expr>(SubExprs[0]) :
nullptr;
1818 return Array ? cast<Expr>(SubExprs[0]) :
nullptr;
1827 assert(i < NumPlacementArgs &&
"Index out of range");
1831 assert(i < NumPlacementArgs &&
"Index out of range");
1845 if (StoredInitializationStyle == 0)
1867 return UsualArrayDeleteWantsSize;
1916 return T->getStmtClass() == CXXNewExprClass;
1935 bool GlobalDelete : 1;
1941 bool ArrayFormAsWritten : 1;
1944 bool UsualArrayDeleteWantsSize : 1;
1947 bool arrayFormAsWritten,
bool usualArrayDeleteWantsSize,
1952 OperatorDelete(operatorDelete), Argument(arg), Loc(loc),
1953 GlobalDelete(globalDelete),
1954 ArrayForm(arrayForm), ArrayFormAsWritten(arrayFormAsWritten),
1955 UsualArrayDeleteWantsSize(usualArrayDeleteWantsSize) { }
1957 :
Expr(CXXDeleteExprClass, Shell), OperatorDelete(nullptr),
1958 Argument(nullptr) {}
1969 return UsualArrayDeleteWantsSize;
1987 return T->getStmtClass() == CXXDeleteExprClass;
1991 child_range
children() {
return child_range(&Argument, &Argument+1); }
2000 llvm::PointerUnion<TypeSourceInfo *, IdentifierInfo *>
Type;
2009 :
Type(II), Location(Loc) { }
2089 :
Expr(CXXPseudoDestructorExprClass, Shell),
2090 Base(nullptr), IsArrow(
false), QualifierLoc(), ScopeType(nullptr) { }
2176 return T->getStmtClass() == CXXPseudoDestructorExprClass;
2210 size_t numTrailingObjects(OverloadToken<TypeSourceInfo *>)
const {
2227 return static_cast<TypeTrait>(TypeTraitExprBits.Kind);
2232 return TypeTraitExprBits.Value;
2236 unsigned getNumArgs()
const {
return TypeTraitExprBits.NumArgs; }
2240 assert(I <
getNumArgs() &&
"Argument out-of-range");
2246 return llvm::makeArrayRef(getTrailingObjects<TypeSourceInfo *>(),
2254 return T->getStmtClass() == TypeTraitExprClass;
2259 return child_range(child_iterator(), child_iterator());
2276 virtual void anchor();
2302 (queried->
getType()->isInstantiationDependentType() ||
2305 ATT(att),
Value(value), Dimension(dimension),
2306 Loc(loc), RParen(rparen), QueriedType(queried) { }
2329 return T->getStmtClass() == ArrayTypeTraitExprClass;
2334 return child_range(child_iterator(), child_iterator());
2360 Expr* QueriedExpression;
2363 Expr *queried,
bool value,
2371 ET(et),
Value(value), Loc(loc), RParen(rparen),
2372 QueriedExpression(queried) { }
2376 QueriedExpression() { }
2388 return T->getStmtClass() == ExpressionTraitExprClass;
2393 return child_range(child_iterator(), child_iterator());
2414 unsigned NumResults;
2422 ASTTemplateKWAndArgsInfo *
2440 bool KnownDependent,
2441 bool KnownInstantiationDependent,
2442 bool KnownContainsUnexpandedParameterPack);
2445 :
Expr(K, Empty), QualifierLoc(), Results(nullptr), NumResults(0),
2470 if (isa<UnaryOperator>(E)) {
2471 assert(cast<UnaryOperator>(E)->getOpcode() ==
UO_AddrOf);
2472 E = cast<UnaryOperator>(
E)->getSubExpr();
2475 Result.HasFormOfMemberPointer = (E == Ovl && Ovl->
getQualifier());
2476 Result.IsAddressOfOperand =
true;
2477 Result.Expression = Ovl;
2479 Result.HasFormOfMemberPointer =
false;
2480 Result.IsAddressOfOperand =
false;
2481 Result.Expression = cast<OverloadExpr>(
E);
2495 llvm::iterator_range<decls_iterator>
decls()
const {
2567 return T->getStmtClass() == UnresolvedLookupExprClass ||
2568 T->getStmtClass() == UnresolvedMemberExprClass;
2589 UnresolvedLookupExpr, ASTTemplateKWAndArgsInfo, TemplateArgumentLoc> {
2606 size_t numTrailingObjects(OverloadToken<ASTTemplateKWAndArgsInfo>)
const {
2615 bool RequiresADL,
bool Overloaded,
2618 :
OverloadExpr(UnresolvedLookupExprClass, C, QualifierLoc, TemplateKWLoc,
2619 NameInfo, TemplateArgs, Begin, End,
false,
false,
false),
2620 RequiresADL(RequiresADL),
2621 Overloaded(Overloaded), NamingClass(NamingClass)
2626 RequiresADL(
false), Overloaded(
false), NamingClass(
nullptr)
2629 friend TrailingObjects;
2638 bool ADL,
bool Overloaded,
2643 ADL, Overloaded,
nullptr, Begin,
End);
2658 unsigned NumTemplateArgs);
2674 return l.getBeginLoc();
2684 return child_range(child_iterator(), child_iterator());
2688 return T->getStmtClass() == UnresolvedLookupExprClass;
2709 ASTTemplateKWAndArgsInfo,
2710 TemplateArgumentLoc> {
2720 bool HasTemplateKWAndArgsInfo;
2722 size_t numTrailingObjects(OverloadToken<ASTTemplateKWAndArgsInfo>)
const {
2723 return HasTemplateKWAndArgsInfo ? 1 : 0;
2740 bool HasTemplateKWAndArgsInfo,
2741 unsigned NumTemplateArgs);
2768 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->TemplateKWLoc;
2775 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->LAngleLoc;
2782 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->RAngleLoc;
2795 getTrailingObjects<ASTTemplateKWAndArgsInfo>()->copyInto(
2796 getTrailingObjects<TemplateArgumentLoc>(), List);
2803 return getTrailingObjects<TemplateArgumentLoc>();
2810 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->NumTemplateArgs;
2825 return T->getStmtClass() == DependentScopeDeclRefExprClass;
2829 return child_range(child_iterator(), child_iterator());
2863 friend TrailingObjects;
2868 unsigned numObjects);
2874 return llvm::makeArrayRef(getTrailingObjects<CleanupObject>(),
2893 return SubExpr->getLocStart();
2899 return T->getStmtClass() == ExprWithCleanupsClass;
2903 child_range
children() {
return child_range(&SubExpr, &SubExpr + 1); }
2948 :
Expr(CXXUnresolvedConstructExprClass, Empty), Type(), NumArgs(NumArgs) { }
2950 friend TrailingObjects;
2995 assert(I < NumArgs &&
"Argument index out-of-range");
3000 assert(I < NumArgs &&
"Argument index out-of-range");
3005 assert(I < NumArgs &&
"Argument index out-of-range");
3011 if (!RParenLoc.
isValid() && NumArgs > 0)
3012 return getArg(NumArgs - 1)->getLocEnd();
3017 return T->getStmtClass() == CXXUnresolvedConstructExprClass;
3023 return child_range(begin, begin + NumArgs);
3037 ASTTemplateKWAndArgsInfo,
3038 TemplateArgumentLoc> {
3053 bool HasTemplateKWAndArgsInfo : 1;
3076 size_t numTrailingObjects(OverloadToken<ASTTemplateKWAndArgsInfo>)
const {
3077 return HasTemplateKWAndArgsInfo ? 1 : 0;
3106 unsigned NumTemplateArgs);
3117 return cast<Expr>(Base);
3152 return FirstQualifierFoundInScope;
3158 return MemberNameInfo;
3173 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->TemplateKWLoc;
3180 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->LAngleLoc;
3187 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->RAngleLoc;
3201 getTrailingObjects<ASTTemplateKWAndArgsInfo>()->copyInto(
3202 getTrailingObjects<TemplateArgumentLoc>(), List);
3211 return getTrailingObjects<TemplateArgumentLoc>();
3220 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->NumTemplateArgs;
3225 return Base->getLocStart();
3238 return T->getStmtClass() == CXXDependentScopeMemberExprClass;
3244 return child_range(child_iterator(), child_iterator());
3245 return child_range(&Base, &Base + 1);
3271 UnresolvedMemberExpr, ASTTemplateKWAndArgsInfo, TemplateArgumentLoc> {
3278 bool HasUnresolvedUsing : 1;
3292 size_t numTrailingObjects(OverloadToken<ASTTemplateKWAndArgsInfo>)
const {
3306 :
OverloadExpr(UnresolvedMemberExprClass, Empty), IsArrow(
false),
3307 HasUnresolvedUsing(
false), Base(
nullptr) { }
3309 friend TrailingObjects;
3326 unsigned NumTemplateArgs);
3338 return cast<Expr>(Base);
3342 return cast<Expr>(Base);
3379 return Base->getLocStart();
3381 return l.getBeginLoc();
3391 return T->getStmtClass() == UnresolvedMemberExprClass;
3397 return child_range(child_iterator(), child_iterator());
3398 return child_range(&Base, &Base + 1);
3402 inline ASTTemplateKWAndArgsInfo *
3407 if (isa<UnresolvedLookupExpr>(
this))
3408 return cast<UnresolvedLookupExpr>(
this)
3409 ->getTrailingObjects<ASTTemplateKWAndArgsInfo>();
3411 return cast<UnresolvedMemberExpr>(
this)
3412 ->getTrailingObjects<ASTTemplateKWAndArgsInfo>();
3416 if (isa<UnresolvedLookupExpr>(
this))
3417 return cast<UnresolvedLookupExpr>(
this)
3418 ->getTrailingObjects<TemplateArgumentLoc>();
3420 return cast<UnresolvedMemberExpr>(
this)
3421 ->getTrailingObjects<TemplateArgumentLoc>();
3443 Value(Val ==
CT_Cannot), Operand(Operand), Range(Keyword, RParen)
3447 :
Expr(CXXNoexceptExprClass, Empty)
3459 return T->getStmtClass() == CXXNoexceptExprClass;
3463 child_range
children() {
return child_range(&Operand, &Operand + 1); }
3491 unsigned NumExpansions;
3505 EllipsisLoc(EllipsisLoc),
3506 NumExpansions(NumExpansions? *NumExpansions + 1 : 0),
3507 Pattern(Pattern) { }
3525 return NumExpansions - 1;
3531 return Pattern->getLocStart();
3536 return T->getStmtClass() == PackExpansionExprClass;
3541 return child_range(&Pattern, &Pattern + 1);
3582 friend TrailingObjects;
3595 OperatorLoc(OperatorLoc), PackLoc(PackLoc), RParenLoc(RParenLoc),
3596 Length(Length ? *Length : PartialArgs.size()), Pack(Pack) {
3597 assert((!Length || PartialArgs.empty()) &&
3598 "have partial args for non-dependent sizeof... expression");
3600 std::uninitialized_copy(PartialArgs.begin(), PartialArgs.end(), Args);
3605 :
Expr(SizeOfPackExprClass, Empty), Length(NumPartialArgs), Pack() {}
3609 NamedDecl *Pack, SourceLocation PackLoc,
3610 SourceLocation RParenLoc,
3611 Optional<unsigned> Length =
None,
3612 ArrayRef<TemplateArgument> PartialArgs =
None);
3614 unsigned NumPartialArgs);
3634 "Cannot get the length of a value-dependent pack size expression");
3651 return llvm::makeArrayRef(Args, Args + Length);
3658 return T->getStmtClass() == SizeOfPackExprClass;
3663 return child_range(child_iterator(), child_iterator());
3682 :
Expr(SubstNonTypeTemplateParmExprClass, Empty) { }
3690 :
Expr(SubstNonTypeTemplateParmExprClass, type, valueKind,
OK_Ordinary,
3694 Param(param), Replacement(replacement), NameLoc(loc) {}
3705 return s->getStmtClass() == SubstNonTypeTemplateParmExprClass;
3709 child_range
children() {
return child_range(&Replacement, &Replacement+1); }
3733 unsigned NumArguments;
3741 :
Expr(SubstNonTypeTemplateParmPackExprClass, Empty) { }
3763 return T->getStmtClass() == SubstNonTypeTemplateParmPackExprClass;
3768 return child_range(child_iterator(), child_iterator());
3796 unsigned NumParameters;
3802 friend TrailingObjects;
3812 unsigned NumParams);
3836 return T->getStmtClass() == FunctionParmPackExprClass;
3840 return child_range(child_iterator(), child_iterator());
3875 unsigned ManglingNumber;
3877 llvm::PointerUnion<Stmt *, ExtraState *> State;
3882 void initializeExtraState(
const ValueDecl *ExtendedBy,
3883 unsigned ManglingNumber);
3887 bool BoundToLvalueReference)
3888 :
Expr(MaterializeTemporaryExprClass, T,
3896 :
Expr(MaterializeTemporaryExprClass, Empty) { }
3900 :
State.get<ExtraState *>()->Temporary;
3914 if (isa<FieldDecl>(ExtendingDecl))
3923 :
State.get<ExtraState *>()->ExtendingDecl;
3929 return State.is<
Stmt *>() ? 0 :
State.get<ExtraState *>()->ManglingNumber;
3946 return T->getStmtClass() == MaterializeTemporaryExprClass;
3952 return child_range(
State.getAddrOfPtr1(),
State.getAddrOfPtr1() + 1);
3954 auto ES =
State.get<ExtraState *>();
3955 return child_range(&ES->Temporary, &ES->Temporary + 1);
3983 LParenLoc(LParenLoc), EllipsisLoc(EllipsisLoc), RParenLoc(RParenLoc),
4015 return T->getStmtClass() == CXXFoldExprClass;
4019 child_range
children() {
return child_range(SubExprs, SubExprs + 2); }
4038 enum SubExpr { Common, Ready, Suspend, Resume, Count };
4049 KeywordLoc(KeywordLoc) {
4050 SubExprs[SubExpr::Common] = Common;
4051 SubExprs[SubExpr::Ready] = Ready;
4052 SubExprs[SubExpr::Suspend] = Suspend;
4053 SubExprs[SubExpr::Resume] = Resume;
4059 KeywordLoc(KeywordLoc) {
4061 "wrong constructor for non-dependent co_await/co_yield expression");
4062 SubExprs[SubExpr::Common] = Common;
4063 SubExprs[SubExpr::Ready] =
nullptr;
4064 SubExprs[SubExpr::Suspend] =
nullptr;
4065 SubExprs[SubExpr::Resume] =
nullptr;
4068 SubExprs[SubExpr::Common] =
nullptr;
4069 SubExprs[SubExpr::Ready] =
nullptr;
4070 SubExprs[SubExpr::Suspend] =
nullptr;
4071 SubExprs[SubExpr::Resume] =
nullptr;
4076 return static_cast<Expr*
>(SubExprs[SubExpr::Common]);
4080 return static_cast<Expr*
>(SubExprs[SubExpr::Ready]);
4083 return static_cast<Expr*
>(SubExprs[SubExpr::Suspend]);
4086 return static_cast<Expr*
>(SubExprs[SubExpr::Resume]);
4101 return T->getStmtClass() == CoawaitExprClass ||
4102 T->getStmtClass() == CoyieldExprClass;
4125 return T->getStmtClass() == CoawaitExprClass;
4148 return T->getStmtClass() == CoyieldExprClass;
SourceLocation getLocStart() const LLVM_READONLY
A call to an overloaded operator written using operator syntax.
Raw form: operator "" X (const char *)
SourceRange getParenOrBraceRange() const
MSPropertySubscriptExpr(EmptyShell Shell)
Create an empty array subscript expression.
void copyTemplateArgumentsInto(TemplateArgumentListInfo &List) const
Copies the template arguments into the given structure.
CXXDeleteExpr(EmptyShell Shell)
void setRParenLoc(SourceLocation L)
LiteralOperatorKind
The kind of literal operator which is invoked.
operator "" X (long double)
DeclarationName getMember() const
Retrieve the name of the member that this expression refers to.
CXXNewExpr(const ASTContext &C, bool globalNew, FunctionDecl *operatorNew, FunctionDecl *operatorDelete, bool usualArrayDeleteWantsSize, ArrayRef< Expr * > placementArgs, SourceRange typeIdParens, Expr *arraySize, InitializationStyle initializationStyle, Expr *initializer, QualType ty, TypeSourceInfo *AllocatedTypeInfo, SourceRange Range, SourceRange directInitRange)
SourceLocation getEnd() const
ParmVarDecl *const * iterator
Iterators over the parameters which the parameter pack expanded into.
The null pointer literal (C++11 [lex.nullptr])
ExprObjectKind getObjectKind() const
getObjectKind - The object kind that this expression produces.
FunctionDecl - An instance of this class is created to represent a function declaration or definition...
TypeSourceInfo * getDestroyedTypeInfo() const
Retrieve the source location information for the type being destroyed.
unsigned arg_size() const
Retrieve the number of arguments.
const internal::VariadicDynCastAllOfMatcher< Stmt, Expr > expr
Matches expressions.
void setPreArg(unsigned i, Stmt *PreArg)
SourceRange getSourceRange() const LLVM_READONLY
bool isImplicitAccess() const
static bool classof(const Stmt *T)
bool hasExplicitResultType() const
Whether this lambda had its result type explicitly specified.
bool isFPContractable() const
PointerType - C99 6.7.5.1 - Pointer Declarators.
llvm::iterator_range< arg_iterator > placement_arguments()
Stores the type being destroyed by a pseudo-destructor expression.
A (possibly-)qualified type.
CXXBoolLiteralExpr(EmptyShell Empty)
bool hasExplicitTemplateArgs() const
Determines whether this expression had explicit template arguments.
bool containsUnexpandedParameterPack() const
Whether this expression contains an unexpanded parameter pack (for C++11 variadic templates)...
bool isRightFold() const
Does this produce a right-associated sequence of operators?
bool isSpecificBuiltinType(unsigned K) const
Test for a particular builtin type.
SourceLocation getLParenLoc() const
Retrieve the location of the left parentheses ('(') that precedes the argument list.
Expr * getArg(unsigned Arg)
getArg - Return the specified argument.
SourceLocation getOperatorLoc() const
Retrieve the location of the '->' or '.' operator.
SourceLocation getThrowLoc() const
Defines enumerations for the type traits support.
void setLocation(SourceLocation L)
bool isElidable() const
Whether this construction is elidable.
Expr(StmtClass SC, QualType T, ExprValueKind VK, ExprObjectKind OK, bool TD, bool VD, bool ID, bool ContainsUnexpandedParameterPack)
SourceLocation getLocStart() const LLVM_READONLY
SourceLocation getLocEnd() const LLVM_READONLY
llvm::iterator_range< const_arg_iterator > arg_const_range
CoawaitExpr(EmptyShell Empty)
const Expr * getArg(unsigned Arg) const
static CXXDependentScopeMemberExpr * Create(const ASTContext &C, Expr *Base, QualType BaseType, bool IsArrow, SourceLocation OperatorLoc, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, NamedDecl *FirstQualifierFoundInScope, DeclarationNameInfo MemberNameInfo, const TemplateArgumentListInfo *TemplateArgs)
CoawaitExpr(SourceLocation CoawaitLoc, QualType Ty, Expr *Operand)
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
CXXDeleteExpr(QualType ty, bool globalDelete, bool arrayForm, bool arrayFormAsWritten, bool usualArrayDeleteWantsSize, FunctionDecl *operatorDelete, Expr *arg, SourceLocation loc)
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the member name, with source location information...
static CXXConstructExpr * Create(const ASTContext &C, QualType T, SourceLocation Loc, CXXConstructorDecl *D, bool Elidable, ArrayRef< Expr * > Args, bool HadMultipleCandidates, bool ListInitialization, bool StdInitListInitialization, bool ZeroInitialization, ConstructionKind ConstructKind, SourceRange ParenOrBraceRange)
static UnresolvedLookupExpr * Create(const ASTContext &C, CXXRecordDecl *NamingClass, NestedNameSpecifierLoc QualifierLoc, const DeclarationNameInfo &NameInfo, bool ADL, bool Overloaded, UnresolvedSetIterator Begin, UnresolvedSetIterator End)
StringRef getUuidAsStringRef(ASTContext &Context) const
TypeSourceInfo * getScopeTypeInfo() const
Retrieve the scope type in a qualified pseudo-destructor expression.
SourceLocation getLocStart() const LLVM_READONLY
SourceLocation getEndLoc() const
getEndLoc - Retrieve the location of the last token.
SourceLocation getPackLoc() const
Determine the location of the parameter pack.
Expr * getResumeExpr() const
static CXXDynamicCastExpr * Create(const ASTContext &Context, QualType T, ExprValueKind VK, CastKind Kind, Expr *Op, const CXXCastPath *Path, TypeSourceInfo *Written, SourceLocation L, SourceLocation RParenLoc, SourceRange AngleBrackets)
bool isGlobalDelete() const
static bool classof(const Stmt *T)
Expr * GetTemporaryExpr() const
Retrieve the temporary-generating subexpression whose value will be materialized into a glvalue...
bool hasQualifier() const
Evalutes true when this nested-name-specifier location is empty.
SourceLocation getLocStart() const LLVM_READONLY
Expr * getOperand() const
ConstExprIterator const_arg_iterator
SourceRange getTypeIdParens() const
ArrayRef< TypeSourceInfo * > getArgs() const
Retrieve the argument types.
unsigned getPackLength() const
Retrieve the length of the parameter pack.
SourceLocation getLocStart() const LLVM_READONLY
SourceLocation getLocStart() const LLVM_READONLY
LambdaCaptureDefault
The default, if any, capture method for a lambda expression.
const_arg_iterator arg_end() const
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
capture_range captures() const
Retrieve this lambda's captures.
bool isBoundToLvalueReference() const
Determine whether this materialized temporary is bound to an lvalue reference; otherwise, it's bound to an rvalue reference.
TypeSourceInfo * getArg(unsigned I) const
Retrieve the Ith argument.
SourceLocation getLocEnd() const LLVM_READONLY
The base class of the type hierarchy.
static bool classof(const Stmt *T)
SourceLocation getLAngleLoc() const
Retrieve the location of the left angle bracket starting the explicit template argument list followin...
Represents a call to a C++ constructor.
bool hasExplicitTemplateArgs() const
Determines whether this lookup had explicit template arguments.
TypeSourceInfo * getTypeSourceInfo() const
An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent...
static bool classof(const Stmt *S)
A container of type source information.
StorageDuration
The storage duration for an object (per C++ [basic.stc]).
MS property subscript expression.
SourceLocation getLocStart() const LLVM_READONLY
static CXXFunctionalCastExpr * Create(const ASTContext &Context, QualType T, ExprValueKind VK, TypeSourceInfo *Written, CastKind Kind, Expr *Op, const CXXCastPath *Path, SourceLocation LPLoc, SourceLocation RPLoc)
void setLocation(SourceLocation Loc)
Describes the capture of a variable or of this, or of a C++1y init-capture.
Represents a C++ constructor within a class.
Represents a prvalue temporary that is written into memory so that a reference can bind to it...
unsigned getNumTemplateArgs() const
SourceLocation getLocEnd() const LLVM_READONLY
Expr * getInClassInitializer() const
getInClassInitializer - Get the C++11 in-class initializer for this member, or null if one has not be...
capture_iterator capture_begin() const
Retrieve an iterator pointing to the first lambda capture.
const CXXTemporary * getTemporary() const
void setRParenLoc(SourceLocation L)
SourceLocation getKeywordLoc() const
SourceLocation getLocStart() const LLVM_READONLY
bool doesUsualArrayDeleteWantSize() const
Answers whether the usual array deallocation function for the allocated type expects the size of the ...
SourceLocation getLocStart() const LLVM_READONLY
Expr *const * const_capture_init_iterator
Const iterator that walks over the capture initialization arguments.
SourceRange getSourceRange() const LLVM_READONLY
Expr * getOperand() const
ArrayRef< TemplateArgument > getPartialArguments() const
Get.
VarDecl - An instance of this class is created to represent a variable declaration or definition...
SourceRange getSourceRange() const LLVM_READONLY
void setFPContractable(bool FPC)
SourceLocation getLocEnd() const LLVM_READONLY
static FunctionParmPackExpr * CreateEmpty(const ASTContext &Context, unsigned NumParams)
CoyieldExpr(SourceLocation CoyieldLoc, Expr *Operand, Expr *Ready, Expr *Suspend, Expr *Resume)
static DependentScopeDeclRefExpr * CreateEmpty(const ASTContext &C, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
const Expr * getArg(unsigned I) const
SourceLocation getLocation() const
Retrieve the location of the name within the expression.
bool hasExplicitParameters() const
Determine whether this lambda has an explicit parameter list vs.
static bool classof(const Stmt *T)
bool hasTemplateKeyword() const
Determines whether the member name was preceded by the template keyword.
friend class OverloadExpr
SourceLocation getRAngleLoc() const
Retrieve the location of the right angle bracket ending the explicit template argument list following...
Implicit construction of a std::initializer_list<T> object from an array temporary within list-initia...
SourceLocation getRAngleLoc() const
Retrieve the location of the right angle bracket ending the explicit template argument list following...
static bool classof(const Stmt *T)
Stores a list of template parameters for a TemplateDecl and its derived classes.
SourceLocation getOperatorLoc() const
Returns the location of the operator symbol in the expression.
static bool classof(const Stmt *T)
SourceLocation getLocStart() const LLVM_READONLY
const ParmVarDecl * getParam() const
raw_arg_iterator raw_arg_begin()
void initializeResults(const ASTContext &C, UnresolvedSetIterator Begin, UnresolvedSetIterator End)
A C++ throw-expression (C++ [except.throw]).
Represents an expression – generally a full-expression – that introduces cleanups to be run at the en...
ParmVarDecl - Represents a parameter to a function.
QualType getBaseType() const
CXXDefaultArgExpr(EmptyShell Empty)
ArrayTypeTrait getTrait() const
void copyTemplateArgumentsInto(TemplateArgumentListInfo &List) const
Copies the template arguments (if present) into the given structure.
TypeSourceInfo * getTypeSourceInfo() const
Retrieve the type source information for the type being constructed.
SourceLocation getDestroyedTypeLoc() const
Retrieve the starting location of the type being destroyed.
A C++ static_cast expression (C++ [expr.static.cast]).
SourceLocation getLocEnd() const LLVM_READONLY
static CXXUnresolvedConstructExpr * Create(const ASTContext &C, TypeSourceInfo *Type, SourceLocation LParenLoc, ArrayRef< Expr * > Args, SourceLocation RParenLoc)
UserDefinedLiteral(const ASTContext &C, Expr *Fn, ArrayRef< Expr * > Args, QualType T, ExprValueKind VK, SourceLocation LitEndLoc, SourceLocation SuffixLoc)
void AllocateArgsArray(const ASTContext &C, bool isArray, unsigned numPlaceArgs, bool hasInitializer)
CXXConstructExpr(StmtClass SC, EmptyShell Empty)
Construct an empty C++ construction expression.
SourceLocation getLocEnd() const LLVM_READONLY
SourceLocation getLocEnd() const LLVM_READONLY
DeclarationName getMemberName() const
Retrieve the name of the member that this expression refers to.
SourceLocation getLocEnd() const LLVM_READONLY
DeclarationName getName() const
getName - Returns the embedded declaration name.
One of these records is kept for each identifier that is lexed.
SourceLocation getLocEnd() const LLVM_READONLY
void setExprOperand(Expr *E)
ExpressionTraitExpr(SourceLocation loc, ExpressionTrait et, Expr *queried, bool value, SourceLocation rparen, QualType resultType)
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
A C++ nested-name-specifier augmented with source location information.
static bool classof(const Stmt *T)
SourceLocation getStartLoc() const
LambdaCaptureDefault getCaptureDefault() const
Determine the default capture kind for this lambda.
const_capture_init_iterator capture_init_begin() const
Retrieve the first initialization argument for this lambda expression (which initializes the first ca...
static bool classof(const Stmt *T)
SourceLocation getLocStart() const LLVM_READONLY
bool isImplicitCXXThis() const
Whether this expression is an implicit reference to 'this' in C++.
FieldDecl - An instance of this class is created by Sema::ActOnField to represent a member of a struc...
CXXRecordDecl * getNamingClass() const
Gets the naming class of this lookup, if any.
Expr * getBase()
Retrieve the base object of this member expressions, e.g., the x in x.m.
static bool classof(const Stmt *T)
SourceLocation getLocStart() const LLVM_READONLY
unsigned getManglingNumber() const
const_arg_iterator placement_arg_begin() const
const Expr *const * const_arg_iterator
SourceLocation getLocStart() const LLVM_READONLY
Expr * getImplicitObjectArgument() const
Retrieves the implicit object argument for the member call.
void setRequiresZeroInitialization(bool ZeroInit)
const internal::VariadicAllOfMatcher< Decl > decl
Matches declarations.
CXXTemporaryObjectExpr(const ASTContext &C, CXXConstructorDecl *Cons, TypeSourceInfo *Type, ArrayRef< Expr * > Args, SourceRange ParenOrBraceRange, bool HadMultipleCandidates, bool ListInitialization, bool StdInitListInitialization, bool ZeroInitialization)
void setArg(unsigned I, Expr *E)
SourceLocation getLocEnd() const LLVM_READONLY
The iterator over UnresolvedSets.
TypeSourceInfo * getTypeSourceInfo() const
bool isPotentiallyEvaluated() const
Determine whether this typeid has a type operand which is potentially evaluated, per C++11 [expr...
CXXMethodDecl * getCallOperator() const
Retrieve the function call operator associated with this lambda expression.
Expr * getPlacementArg(unsigned i)
Expr * getArg(unsigned I)
Represents a C++ member access expression for which lookup produced a set of overloaded functions...
const DeclarationNameInfo & getNameInfo() const
Gets the full name info.
CXXScalarValueInitExpr(QualType Type, TypeSourceInfo *TypeInfo, SourceLocation rParenLoc)
Create an explicitly-written scalar-value initialization expression.
CUDAKernelCallExpr(ASTContext &C, Expr *fn, CallExpr *Config, ArrayRef< Expr * > args, QualType t, ExprValueKind VK, SourceLocation RP)
QualType getQueriedType() const
SourceLocation getLocStart() const LLVM_READONLY
static bool classof(const Stmt *T)
Represents a reference to a non-type template parameter pack that has been substituted with a non-tem...
SourceLocation getLocStart() const LLVM_READONLY
SourceLocation getRParenLoc() const
SourceLocation getLocEnd() const LLVM_READONLY
An r-value expression (a pr-value in the C++11 taxonomy) produces a temporary value.
void setDestroyedType(TypeSourceInfo *Info)
Set the destroyed type.
bool isOverloaded() const
True if this lookup is overloaded.
SubstNonTypeTemplateParmExpr(QualType type, ExprValueKind valueKind, SourceLocation loc, NonTypeTemplateParmDecl *param, Expr *replacement)
const Expr * getArgument() const
A C++ typeid expression (C++ [expr.typeid]), which gets the type_info that corresponds to the supplie...
void setConstructor(CXXConstructorDecl *C)
bool isGenericLambda() const
Whether this is a generic lambda.
bool isAlwaysNull() const
isAlwaysNull - Return whether the result of the dynamic_cast is proven to always be null...
SourceLocation getLocStart() const LLVM_READONLY
MSPropertyRefExpr(Expr *baseExpr, MSPropertyDecl *decl, bool isArrow, QualType ty, ExprValueKind VK, NestedNameSpecifierLoc qualifierLoc, SourceLocation nameLoc)
CXXThisExpr(SourceLocation L, QualType Type, bool isImplicit)
SourceLocation getLocStart() const LLVM_READONLY
SourceLocation getLocStart() const LLVM_READONLY
void setOperatorNew(FunctionDecl *D)
IdentifierInfo * getIdentifier() const
void setLocation(SourceLocation L)
IdentifierInfo * getDestroyedTypeIdentifier() const
In a dependent pseudo-destructor expression for which we do not have full type information on the des...
static bool classof(const Stmt *T)
bool HasFormOfMemberPointer
A convenient class for passing around template argument information.
PseudoDestructorTypeStorage(IdentifierInfo *II, SourceLocation Loc)
const ValueDecl * getExtendingDecl() const
Get the declaration which triggered the lifetime-extension of this temporary, if any.
const_arg_iterator placement_arg_end() const
ArrayRef< VarDecl * > getCaptureInitIndexVars(const_capture_init_iterator Iter) const
Retrieve the set of index variables used in the capture initializer of an array captured by copy...
capture_init_iterator capture_init_begin()
Retrieve the first initialization argument for this lambda expression (which initializes the first ca...
Expr * getInitializer()
The initializer of this new-expression.
An x-value expression is a reference to an object with independent storage but which can be "moved"...
Expr * getExprOperand() const
SourceLocation getLocStart() const LLVM_READONLY
static bool classof(const Stmt *T)
CXXFoldExpr(QualType T, SourceLocation LParenLoc, Expr *LHS, BinaryOperatorKind Opcode, SourceLocation EllipsisLoc, Expr *RHS, SourceLocation RParenLoc)
const DeclarationNameInfo & getMemberNameInfo() const
Retrieve the full name info for the member that this expression refers to.
ParmVarDecl * getExpansion(unsigned I) const
Get an expansion of the parameter pack by index.
capture_iterator capture_end() const
Retrieve an iterator pointing past the end of the sequence of lambda captures.
SourceLocation getTemplateKeywordLoc() const
Retrieve the location of the template keyword preceding the member name, if any.
SourceLocation getLocation() const
InitializationStyle getInitializationStyle() const
The kind of initializer this new-expression has.
bool isValueDependent() const
isValueDependent - Determines whether this expression is value-dependent (C++ [temp.dep.constexpr]).
SourceLocation getRAngleLoc() const
Retrieve the location of the right angle bracket ending the explicit template argument list following...
bool requiresADL() const
True if this declaration should be extended by argument-dependent lookup.
SourceLocation getTemplateKeywordLoc() const
Retrieve the location of the template keyword preceding this name, if any.
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies this declaration.
static bool classof(const Stmt *T)
SourceLocation getEndLoc() const
SourceLocation getLocStart() const LLVM_READONLY
Expr * getBaseExpr() const
New-expression has a C++98 paren-delimited initializer.
SourceLocation getLocEnd() const LLVM_READONLY
void setListInitialization(bool V)
TypeSourceInfo * getTypeSourceInfo() const
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
FieldDecl * getField()
Get the field whose initializer will be used.
CXXStdInitializerListExpr(QualType Ty, Expr *SubExpr)
QualType getDestroyedType() const
Retrieve the type being destroyed.
Represents binding an expression to a temporary.
const Expr *const * getArgs() const
CompoundStmt * getBody() const
Retrieve the body of the lambda.
void setDestroyedType(IdentifierInfo *II, SourceLocation Loc)
Set the name of destroyed type for a dependent pseudo-destructor expression.
ArrayTypeTrait
Names for the array type traits.
CXXTemporary * getTemporary()
static bool classof(const Stmt *T)
SourceLocation getLocStart() const LLVM_READONLY
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
QualType getTypeOperand(ASTContext &Context) const
Retrieves the type operand of this __uuidof() expression after various required adjustments (removing...
SourceLocation getLocEnd() const LLVM_READONLY
An ordinary object is located at an address in memory.
Represents a C++ member access expression where the actual member referenced could not be resolved be...
CleanupObject getObject(unsigned i) const
bool isArrow() const
Determine whether this pseudo-destructor expression was written using an '->' (otherwise, it used a '.
capture_iterator implicit_capture_end() const
Retrieve an iterator pointing past the end of the sequence of implicit lambda captures.
CXXBindTemporaryExpr(EmptyShell Empty)
detail::InMemoryDirectory::const_iterator I
llvm::iterator_range< const_capture_init_iterator > capture_inits() const
Retrieve the initialization expressions for this lambda's captures.
SourceLocation getUsedLocation() const
Retrieve the location where this default argument was actually used.
SourceLocation getLocStart() const
A default argument (C++ [dcl.fct.default]).
ExpressionTrait getTrait() const
void setSourceRange(SourceRange R)
arg_iterator placement_arg_end()
Represents the this expression in C++.
bool hadMultipleCandidates() const
Whether the referred constructor was resolved from an overloaded set having size greater than 1...
MSPropertyDecl * getPropertyDecl() const
New-expression has no initializer as written.
SourceLocation getLoc() const
getLoc - Returns the main location of the declaration name.
TypeTrait
Names for traits that operate specifically on types.
SourceLocation getCaptureDefaultLoc() const
Retrieve the location of this lambda's capture-default, if any.
Optional< unsigned > getNumExpansions() const
Determine the number of expansions that will be produced when this pack expansion is instantiated...
QualType getTypeAsWritten() const
Retrieve the type that is being constructed, as specified in the source code.
SourceLocation getTemplateKeywordLoc() const
Retrieve the location of the template keyword preceding this name, if any.
const Expr * getBase() const
SourceLocation getLocation() const
FunctionDecl * getOperatorDelete() const
UserDefinedLiteral(const ASTContext &C, EmptyShell Empty)
SourceLocation getColonColonLoc() const
Retrieve the location of the '::' in a qualified pseudo-destructor expression.
CXXScalarValueInitExpr(EmptyShell Shell)
unsigned getNumDecls() const
Gets the number of declarations in the unresolved set.
static LambdaExpr * CreateDeserialized(const ASTContext &C, unsigned NumCaptures, unsigned NumArrayIndexVars)
Construct a new lambda expression that will be deserialized from an external source.
Represents a C++ pseudo-destructor (C++ [expr.pseudo]).
SourceLocation getMemberLoc() const
ASTTemplateKWAndArgsInfo * getTrailingASTTemplateKWAndArgsInfo()
Return the optional template keyword and arguments info.
CompoundStmt - This represents a group of statements like { stmt stmt }.
static bool classof(const Stmt *T)
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the member name.
CXXTypeidExpr(QualType Ty, TypeSourceInfo *Operand, SourceRange R)
CXXMethodDecl * getMethodDecl() const
Retrieves the declaration of the called method.
unsigned getNumArgs() const
Determine the number of arguments to this type trait.
ArrayTypeTraitExpr(EmptyShell Empty)
unsigned getNumObjects() const
llvm::iterator_range< decls_iterator > decls() const
CastKind
CastKind - The kind of operation required for a conversion.
unsigned getNumExpansions() const
Get the number of parameters in this parameter pack.
static bool classof(const Stmt *T)
CXXTypeidExpr(QualType Ty, Expr *Operand, SourceRange R)
Expr * getQueriedExpression() const
NestedNameSpecifierLoc getQualifierLoc() const
Stmt * getPreArg(unsigned i)
static bool classof(const Stmt *T)
SourceLocation getLocStart() const LLVM_READONLY
bool isInstantiationDependent() const
Whether this expression is instantiation-dependent, meaning that it depends in some way on a template...
const Expr * getExpr() const
Get the initialization expression that will be used.
static CXXDefaultArgExpr * Create(const ASTContext &C, SourceLocation Loc, ParmVarDecl *Param)
bool HasTemplateKWAndArgsInfo
Whether the name includes info for explicit template keyword and arguments.
FunctionDecl * getOperatorDelete() const
NamedDecl * getFirstQualifierFoundInScope() const
Retrieve the first part of the nested-name-specifier that was found in the scope of the member access...
SourceLocation getLocEnd() const LLVM_READONLY
bool requiresZeroInitialization() const
Whether this construction first requires zero-initialization before the initializer is called...
PseudoDestructorTypeStorage()
SourceLocation getLocEnd() const LLVM_READONLY
void setOperatorDelete(FunctionDecl *D)
An expression "T()" which creates a value-initialized rvalue of type T, which is a non-class type...
SourceLocation getLocEnd() const LLVM_READONLY
SourceRange getSourceRange() const LLVM_READONLY
BlockDecl - This represents a block literal declaration, which is like an unnamed FunctionDecl...
static bool classof(const Stmt *T)
bool isMutable() const
Determine whether the lambda is mutable, meaning that any captures values can be modified.
ValueDecl - Represent the declaration of a variable (in which case it is an lvalue) a function (in wh...
Expr - This represents one expression.
static bool classof(const Stmt *T)
SourceLocation getLocEnd() const LLVM_READONLY
SourceLocation getLocStart() const LLVM_READONLY
ExprValueKind
The categorization of expression values, currently following the C++11 scheme.
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
SourceLocation getLocEnd() const LLVM_READONLY
CXXOperatorCallExpr(ASTContext &C, OverloadedOperatorKind Op, Expr *fn, ArrayRef< Expr * > args, QualType t, ExprValueKind VK, SourceLocation operatorloc, bool fpContractable)
NestedNameSpecifierLoc getQualifierLoc() const
Fetches the nested-name qualifier with source-location information, if one was given.
decls_iterator decls_end() const
SourceLocation getLocStart() const LLVM_READONLY
SourceLocation getNameLoc() const
Gets the location of the name.
bool isListInitialization() const
Whether this constructor call was written as list-initialization.
static FindResult find(Expr *E)
Finds the overloaded expression in the given expression E of OverloadTy.
const Expr * getSubExpr() const
StorageDuration getStorageDuration() const
Retrieve the storage duration for the materialized temporary.
Represents a C++ functional cast expression that builds a temporary object.
SourceLocation getMemberLoc() const
A C++ const_cast expression (C++ [expr.const.cast]).
void setTypeOperandSourceInfo(TypeSourceInfo *TSI)
Represents a C++ destructor within a class.
New-expression has a C++11 list-initializer.
SourceRange getSourceRange() const
const DeclarationNameInfo & getNameInfo() const
Retrieve the name that this expression refers to.
const Expr * getCookedLiteral() const
bool hasExplicitTemplateArgs() const
Determines whether this member expression actually had a C++ template argument list explicitly specif...
bool hasTemplateKeyword() const
Determines whether the name was preceded by the template keyword.
CXXConstructExpr(const ASTContext &C, StmtClass SC, QualType T, SourceLocation Loc, CXXConstructorDecl *d, bool elidable, ArrayRef< Expr * > Args, bool HadMultipleCandidates, bool ListInitialization, bool StdInitListInitialization, bool ZeroInitialization, ConstructionKind ConstructKind, SourceRange ParenOrBraceRange)
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name, with source location information.
raw_arg_iterator raw_arg_end()
static CXXStaticCastExpr * Create(const ASTContext &Context, QualType T, ExprValueKind VK, CastKind K, Expr *Op, const CXXCastPath *Path, TypeSourceInfo *Written, SourceLocation L, SourceLocation RParenLoc, SourceRange AngleBrackets)
SourceLocation getLocation() const
static CXXReinterpretCastExpr * CreateEmpty(const ASTContext &Context, unsigned pathSize)
ConstructionKind getConstructionKind() const
Determine whether this constructor is actually constructing a base class (rather than a complete obje...
CXXUuidofExpr(QualType Ty, Expr *Operand, SourceRange R)
bool isImplicitAccess() const
True if this is an implicit access, i.e., one in which the member being accessed was not written in t...
static bool classof(const Stmt *T)
Represents an expression that computes the length of a parameter pack.
static bool classof(const Stmt *T)
NonTypeTemplateParmDecl - Declares a non-type template parameter, e.g., "Size" in.
ArrayTypeTraitExpr(SourceLocation loc, ArrayTypeTrait att, TypeSourceInfo *queried, uint64_t value, Expr *dimension, SourceLocation rparen, QualType ty)
static bool classof(const Stmt *s)
static DependentScopeDeclRefExpr * Create(const ASTContext &C, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, const DeclarationNameInfo &NameInfo, const TemplateArgumentListInfo *TemplateArgs)
static bool classof(const Stmt *T)
SourceLocation getLocStart() const LLVM_READONLY
CXXRecordDecl * getNamingClass() const
Retrieve the naming class of this lookup.
NonTypeTemplateParmDecl * getParameterPack() const
Retrieve the non-type template parameter pack being substituted.
SourceRange getAngleBrackets() const LLVM_READONLY
SourceLocation getLocEnd() const LLVM_READONLY
bool shouldNullCheckAllocation(const ASTContext &Ctx) const
True if the allocation result needs to be null-checked.
QualType getAllocatedType() const
SourceLocation getExprLoc() const LLVM_READONLY
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
SourceLocation getBeginLoc() const
getBeginLoc - Retrieve the location of the first token.
static bool classof(const Stmt *T)
Stmt * getTemporary() const
Represents a folding of a pack over an operator.
static bool classof(const Stmt *T)
const Expr * getBase() const
Expr * getDimensionExpression() const
SourceLocation getLocEnd() const LLVM_READONLY
A member reference to an MSPropertyDecl.
Represents a reference to a non-type template parameter that has been substituted with a template arg...
CXXUuidofExpr(QualType Ty, TypeSourceInfo *Operand, SourceRange R)
class LLVM_ALIGNAS(8) TemplateSpecializationType unsigned NumArgs
Represents a type template specialization; the template must be a class template, a type alias templa...
CXXMemberCallExpr(ASTContext &C, EmptyShell Empty)
NestedNameSpecifier * getQualifier() const
If the member name was qualified, retrieves the nested-name-specifier that precedes the member name...
The result type of a method or function.
SourceRange getSourceRange() const LLVM_READONLY
capture_iterator implicit_capture_begin() const
Retrieve an iterator pointing to the first implicit lambda capture.
Expr * getReadyExpr() const
const_arg_iterator arg_begin() const
MSPropertyRefExpr(EmptyShell Empty)
CoyieldExpr(EmptyShell Empty)
SourceLocation getLocStart() const LLVM_READONLY
UnresolvedSetImpl::iterator decls_iterator
CXXNewExpr(EmptyShell Shell)
ExplicitCastExpr(StmtClass SC, QualType exprTy, ExprValueKind VK, CastKind kind, Expr *op, unsigned PathSize, TypeSourceInfo *writtenTy)
MSPropertySubscriptExpr(Expr *Base, Expr *Idx, QualType Ty, ExprValueKind VK, ExprObjectKind OK, SourceLocation RBracketLoc)
const LambdaCapture * capture_iterator
An iterator that walks over the captures of the lambda, both implicit and explicit.
SourceLocation getParameterPackLocation() const
Retrieve the location of the parameter pack name.
static bool classof(const Stmt *T)
static bool classof(const Stmt *T)
void setTypeOperandSourceInfo(TypeSourceInfo *TSI)
BlockDecl * CleanupObject
The type of objects that are kept in the cleanup.
decls_iterator decls_begin() const
unsigned getNumTemplateArgs() const
static bool classof(const Stmt *T)
SourceRange getSourceRange() const LLVM_READONLY
static bool classof(const Stmt *S)
const Expr * getInitializer() const
const TemplateArgumentLoc * getTemplateArgs() const
Retrieve the template arguments provided as part of this template-id.
CanThrowResult
Possible results from evaluation of a noexcept expression.
void setLParenLoc(SourceLocation L)
llvm::iterator_range< const_arg_iterator > placement_arguments() const
A C++ dynamic_cast expression (C++ [expr.dynamic.cast]).
SourceLocation getLocStart() const LLVM_READONLY
SourceLocation getLocEnd() const LLVM_READONLY
ArrayRef< CleanupObject > getObjects() const
MaterializeTemporaryExpr(EmptyShell Empty)
static CXXConstCastExpr * Create(const ASTContext &Context, QualType T, ExprValueKind VK, Expr *Op, TypeSourceInfo *WrittenTy, SourceLocation L, SourceLocation RParenLoc, SourceRange AngleBrackets)
static CXXBindTemporaryExpr * Create(const ASTContext &C, CXXTemporary *Temp, Expr *SubExpr)
A reference to an overloaded function set, either an UnresolvedLookupExpr or an UnresolvedMemberExpr...
operator "" X (const CharT *, size_t)
Expr ** getPlacementArgs()
static bool classof(const Stmt *T)
SourceLocation getLocEnd() const LLVM_READONLY
SourceLocation getLocStart() const LLVM_READONLY
Raw form: operator "" X<cs...> ()
static CXXDynamicCastExpr * CreateEmpty(const ASTContext &Context, unsigned pathSize)
SourceLocation getOperatorLoc() const
Determine the location of the 'sizeof' keyword.
CXXRecordDecl * getRecordDecl() const
Retrieves the CXXRecordDecl for the underlying type of the implicit object argument.
void setHadMultipleCandidates(bool V)
Encodes a location in the source.
TemplateArgumentLoc const * getTemplateArgs() const
const_arg_iterator arg_end() const
SourceLocation getLocEnd() const LLVM_READONLY
Defines enumerations for expression traits intrinsics.
static bool classof(const Stmt *T)
CXXNamedCastExpr(StmtClass SC, QualType ty, ExprValueKind VK, CastKind kind, Expr *op, unsigned PathSize, TypeSourceInfo *writtenTy, SourceLocation l, SourceLocation RParenLoc, SourceRange AngleBrackets)
Represents a C++ temporary.
SourceLocation getLocEnd() const LLVM_READONLY
static CXXDependentScopeMemberExpr * CreateEmpty(const ASTContext &C, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
PackExpansionExpr(EmptyShell Empty)
static CXXConstCastExpr * CreateEmpty(const ASTContext &Context)
bool isValid() const
Return true if this is a valid SourceLocation object.
NonTypeTemplateParmDecl * getParameter() const
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)"...
SourceLocation getLocEnd() const
SourceLocation getOperatorLoc() const
Retrieve the location of the '.' or '->' operator.
A call to a literal operator (C++11 [over.literal]) written as a user-defined literal (C++11 [lit...
SourceLocation getLocEnd() const
void setSourceRange(SourceRange R)
static SizeOfPackExpr * Create(ASTContext &Context, SourceLocation OperatorLoc, NamedDecl *Pack, SourceLocation PackLoc, SourceLocation RParenLoc, Optional< unsigned > Length=None, ArrayRef< TemplateArgument > PartialArgs=None)
Represents a call to a member function that may be written either with member call syntax (e...
SourceLocation getBeginLoc() const
Retrieve the location of the beginning of this nested-name-specifier.
llvm::iterator_range< capture_init_iterator > capture_inits()
Retrieve the initialization expressions for this lambda's captures.
static bool classof(const Stmt *T)
SourceLocation getRParenLoc() const
static const UuidAttr * GetUuidAttrOfType(QualType QT, bool *HasMultipleGUIDsPtr=nullptr)
Grabs __declspec(uuid()) off a type, or returns 0 if we cannot resolve to a single GUID...
Expr * getSuspendExpr() const
OverloadExpr(StmtClass K, const ASTContext &C, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, const DeclarationNameInfo &NameInfo, const TemplateArgumentListInfo *TemplateArgs, UnresolvedSetIterator Begin, UnresolvedSetIterator End, bool KnownDependent, bool KnownInstantiationDependent, bool KnownContainsUnexpandedParameterPack)
TemplateParameterList * getTemplateParameterList() const
If this is a generic lambda expression, retrieve the template parameter list associated with it...
TemplateArgument getArgumentPack() const
Retrieve the template argument pack containing the substituted template arguments.
ExprObjectKind
A further classification of the kind of object referenced by an l-value or x-value.
SourceLocation getLocStart() const LLVM_READONLY
Represents a static or instance method of a struct/union/class.
void setTemporary(CXXTemporary *T)
static ExprWithCleanups * Create(const ASTContext &C, EmptyShell empty, unsigned numObjects)
static bool classof(const Stmt *T)
static bool classof(const Stmt *T)
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
void setDestructor(const CXXDestructorDecl *Dtor)
const DeclarationNameInfo & getMemberNameInfo() const
Retrieve the name of the member that this expression refers to.
bool isImplicitAccess() const
True if this is an implicit access, i.e.
SourceLocation getLocStart() const LLVM_READONLY
void setConfig(CallExpr *E)
bool hasQualifier() const
Determines whether this member expression actually had a C++ nested-name-specifier prior to the name ...
NamedDecl * getPack() const
Retrieve the parameter pack.
bool hasInitializer() const
Whether this new-expression has any initializer at all.
SourceRange getIntroducerRange() const
Retrieve the source range covering the lambda introducer, which contains the explicit capture list su...
static bool classof(const Stmt *T)
QualType getBaseType() const
bool isInitCapture(const LambdaCapture *Capture) const
Determine whether one of this lambda's captures is an init-capture.
SourceLocation getOperatorLoc() const
Retrieve the location of the cast operator keyword, e.g., static_cast.
CXXNamedCastExpr(StmtClass SC, EmptyShell Shell, unsigned PathSize)
static CXXDefaultInitExpr * Create(const ASTContext &C, SourceLocation Loc, FieldDecl *Field)
Field is the non-static data member whose default initializer is used by this expression.
SourceLocation getLocEnd() const LLVM_READONLY
LiteralOperatorKind getLiteralOperatorKind() const
Returns the kind of literal operator invocation which this expression represents. ...
capture_iterator explicit_capture_end() const
Retrieve an iterator pointing past the end of the sequence of explicit lambda captures.
ParmVarDecl * getParameterPack() const
Get the parameter pack which this expression refers to.
SourceLocation getBegin() const
TypeTrait getTrait() const
Determine which type trait this expression uses.
bool isTypeDependent() const
isTypeDependent - Determines whether this expression is type-dependent (C++ [temp.dep.expr]), which means that its type could change from one template instantiation to the next.
OverloadExpr(StmtClass K, EmptyShell Empty)
bool isArrow() const
Determine whether this member expression used the '->' operator; otherwise, it used the '...
An expression trait intrinsic.
Expr * getCommonExpr() const
CXXOperatorCallExpr(ASTContext &C, EmptyShell Empty)
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
uint64_t getValue() const
SourceLocation getLocStart() const LLVM_READONLY
static SizeOfPackExpr * CreateDeserialized(ASTContext &Context, unsigned NumPartialArgs)
CoyieldExpr(SourceLocation CoyieldLoc, QualType Ty, Expr *Operand)
Expr ** capture_init_iterator
Iterator that walks over the capture initialization arguments.
SourceLocation getLocStart() const
bool isParenTypeId() const
QualType getType() const
Return the type wrapped by this type source info.
static CXXReinterpretCastExpr * Create(const ASTContext &Context, QualType T, ExprValueKind VK, CastKind Kind, Expr *Op, const CXXCastPath *Path, TypeSourceInfo *WrittenTy, SourceLocation L, SourceLocation RParenLoc, SourceRange AngleBrackets)
SourceLocation getExprLoc() const LLVM_READONLY
getExprLoc - Return the preferred location for the arrow when diagnosing a problem with a generic exp...
PackExpansionExpr(QualType T, Expr *Pattern, SourceLocation EllipsisLoc, Optional< unsigned > NumExpansions)
SourceLocation getNameLoc() const
A qualified reference to a name whose declaration cannot yet be resolved.
void setRBracketLoc(SourceLocation L)
SourceLocation getLocEnd() const LLVM_READONLY
SourceLocation getRBracketLoc() const
bool isPartiallySubstituted() const
Determine whether this represents a partially-substituted sizeof...
A POD class for pairing a NamedDecl* with an access specifier.
SourceLocation getLocEnd() const LLVM_READONLY
const Expr * getIdx() const
const char * getCastName() const
getCastName - Get the name of the C++ cast being used, e.g., "static_cast", "dynamic_cast", "reinterpret_cast", or "const_cast".
SourceLocation getLocStart() const LLVM_READONLY
DeclarationName getDeclName() const
Retrieve the name that this expression refers to.
SourceLocation getEllipsisLoc() const
Retrieve the location of the ellipsis that describes this pack expansion.
Represents a reference to a function parameter pack that has been substituted but not yet expanded...
Represents a template argument.
Expr * getReplacement() const
const Expr * getSubExpr() const
CXXTemporaryObjectExpr(EmptyShell Empty)
static bool classof(const Stmt *T)
const Expr * getSubExpr() const
void setExtendingDecl(const ValueDecl *ExtendedBy, unsigned ManglingNumber)
SourceLocation getLocStart() const LLVM_READONLY
SourceLocation getLocStart() const LLVM_READONLY
const Expr * getExpr() const
SourceLocation getLocEnd() const LLVM_READONLY
QualType getTypeOperand(ASTContext &Context) const
Retrieves the type operand of this typeid() expression after various required adjustments (removing r...
Represents a delete expression for memory deallocation and destructor calls, e.g. ...
SourceLocation getLocEnd() const LLVM_READONLY
static bool classof(const Stmt *T)
bool hasUnparsedDefaultArg() const
hasUnparsedDefaultArg - Determines whether this parameter has a default argument that has not yet bee...
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
TemplateArgumentLoc const * getTemplateArgs() const
const internal::VariadicAllOfMatcher< Type > type
Matches Types in the clang AST.
CXXNoexceptExpr(EmptyShell Empty)
NestedNameSpecifierLoc getQualifierLoc() const
Retrieves the nested-name-specifier that qualifies the type name, with source-location information...
Expr * getInit() const
Get the operand that doesn't contain a pack, for a binary fold.
CXXFoldExpr(EmptyShell Empty)
bool isThrownVariableInScope() const
Determines whether the variable thrown by this expression (if any!) is within the innermost try block...
Reads an AST files chain containing the contents of a translation unit.
ExprIterator arg_iterator
SourceLocation getLocStart() const LLVM_READONLY
SourceLocation getLParenLoc() const
const_arg_iterator raw_arg_end() const
A C++ reinterpret_cast expression (C++ [expr.reinterpret.cast]).
CXXNoexceptExpr(QualType Ty, Expr *Operand, CanThrowResult Val, SourceLocation Keyword, SourceLocation RParen)
SourceLocation getTildeLoc() const
Retrieve the location of the '~'.
SourceLocation getLocEnd() const LLVM_READONLY
SourceLocation getLAngleLoc() const
Retrieve the location of the left angle bracket starting the explicit template argument list followin...
Represents a 'co_yield' expression.
void setConstructionKind(ConstructionKind CK)
CoroutineSuspendExpr(StmtClass SC, SourceLocation KeywordLoc, Expr *Common, Expr *Ready, Expr *Suspend, Expr *Resume)
SourceLocation getMemberLoc() const
DeclarationName - The name of a declaration.
const FieldDecl * getField() const
virtual ~ArrayTypeTraitExpr()
OverloadExpr * Expression
Represents a C++11 pack expansion that produces a sequence of expressions.
static bool classof(const Stmt *T)
unsigned getNumPlacementArgs() const
SourceLocation getLocEnd() const LLVM_READONLY
SourceLocation getLocEnd() const LLVM_READONLY
SourceLocation getLocEnd() const LLVM_READONLY
const Expr * getArraySize() const
bool isTypeOperand() const
detail::InMemoryDirectory::const_iterator E
const Expr * getPlacementArg(unsigned i) const
friend class OverloadExpr
SourceLocation getLocation() const
CXXNullPtrLiteralExpr(QualType Ty, SourceLocation l)
ExplicitCastExpr - An explicit cast written in the source code.
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspnd...
unsigned getNumArgs() const
SourceLocation getParameterPackLocation() const
Get the location of the parameter pack.
SourceLocation getLocEnd() const LLVM_READONLY
CXXMemberCallExpr(ASTContext &C, Expr *fn, ArrayRef< Expr * > args, QualType t, ExprValueKind VK, SourceLocation RP)
CXXNullPtrLiteralExpr(EmptyShell Empty)
CXXRecordDecl * getNamingClass() const
Gets the 'naming class' (in the sense of C++0x [class.access.base]p5) of the lookup.
llvm::iterator_range< arg_iterator > arg_range
QualType getNonReferenceType() const
If Type is a reference type (e.g., const int&), returns the type that the reference refers to ("const...
Represents a C++11 noexcept expression (C++ [expr.unary.noexcept]).
TemplateArgumentLoc * getTrailingTemplateArgumentLoc()
Return the optional template arguments.
Location wrapper for a TemplateArgument.
Expr * getBase() const
Retrieve the base object of this member expressions, e.g., the x in x.m.
SourceLocation getOperatorLoc() const
Retrieve the location of the '->' or '.' operator.
llvm::iterator_range< capture_iterator > capture_range
An iterator over a range of lambda captures.
SourceLocation getLocEnd() const LLVM_READONLY
FunctionDecl * getOperatorNew() const
const T * getAs() const
Member-template getAs<specific type>'.
unsigned capture_size() const
Determine the number of captures in this lambda.
SourceLocation getExprLoc() const LLVM_READONLY
static bool classof(const Stmt *T)
capture_iterator explicit_capture_begin() const
Retrieve an iterator pointing to the first explicit lambda capture.
SourceLocation getLocEnd() const LLVM_READONLY
CoroutineSuspendExpr(StmtClass SC, EmptyShell Empty)
static UnresolvedMemberExpr * CreateEmpty(const ASTContext &C, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
void setSubExpr(Expr *E)
As with any mutator of the AST, be very careful when modifying an existing AST to preserve its invari...
const_arg_iterator raw_arg_begin() const
Represents a call to a CUDA kernel function.
Represents a 'co_await' expression.
MaterializeTemporaryExpr(QualType T, Expr *Temporary, bool BoundToLvalueReference)
void setParenOrBraceRange(SourceRange Range)
void setArg(unsigned Arg, Expr *ArgExpr)
Set the specified argument.
SourceLocation getLocStart() const LLVM_READONLY
Note: getLocStart() is the start of the whole DependentScopeDeclRefExpr, and differs from getLocation...
Expr * getArg(unsigned Arg)
Return the specified argument.
CXXConstructorDecl * getConstructor() const
Expr * getPattern() const
Get the pattern, that is, the operand that contains an unexpanded pack.
SourceLocation getLAngleLoc() const
Retrieve the location of the left angle bracket starting the explicit template argument list followin...
Expr * getExprOperand() const
CXXBoolLiteralExpr(bool val, QualType Ty, SourceLocation l)
static bool classof(const Stmt *T)
SourceLocation getLocStart() const LLVM_READONLY
Default argument expressions have no representation in the source, so they have an empty source range...
static bool classof(const Stmt *T)
SourceLocation getRParenLoc() const
Retrieve the location of the right parentheses (')') that follows the argument list.
static CXXFunctionalCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize)
SourceLocation getRParenLoc() const
CXXThrowExpr(EmptyShell Empty)
SourceLocation getLocStart() const LLVM_READONLY
SourceRange getDirectInitRange() const
arg_iterator placement_arg_begin()
SourceLocation getLocation() const
Represents an expression that might suspend coroutine execution; either a co_await or co_yield expres...
static FunctionParmPackExpr * Create(const ASTContext &Context, QualType T, ParmVarDecl *ParamPack, SourceLocation NameLoc, ArrayRef< ParmVarDecl * > Params)
SourceLocation getLocEnd() const LLVM_READONLY
void setLParenLoc(SourceLocation L)
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
CoawaitExpr(SourceLocation CoawaitLoc, Expr *Operand, Expr *Ready, Expr *Suspend, Expr *Resume)
A use of a default initializer in a constructor or in aggregate initialization.
const CXXConstructExpr * getConstructExpr() const
Returns the CXXConstructExpr from this new-expression, or null.
void setLocation(SourceLocation L)
static UnresolvedMemberExpr * Create(const ASTContext &C, bool HasUnresolvedUsing, Expr *Base, QualType BaseType, bool IsArrow, SourceLocation OperatorLoc, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, const DeclarationNameInfo &MemberNameInfo, const TemplateArgumentListInfo *TemplateArgs, UnresolvedSetIterator Begin, UnresolvedSetIterator End)
static UnresolvedLookupExpr * CreateEmpty(const ASTContext &C, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
const internal::VariadicDynCastAllOfMatcher< Stmt, CastExpr > castExpr
Matches any cast nodes of Clang's AST.
capture_range explicit_captures() const
Retrieve this lambda's explicit captures.
bool isArrayFormAsWritten() const
ConstExprIterator const_arg_iterator
OverloadedOperatorKind getOperator() const
Returns the kind of overloaded operator that this expression refers to.
CoroutineSuspendExpr(StmtClass SC, SourceLocation KeywordLoc, QualType Ty, Expr *Common)
SourceLocation getLocStart() const LLVM_READONLY
const IdentifierInfo * getUDSuffix() const
Returns the ud-suffix specified for this literal.
SourceLocation getRParenLoc() const
Retrieve the location of the closing parenthesis.
Represents a C++ struct/union/class.
SourceLocation getExprLoc() const LLVM_READONLY
const Expr * getPattern() const
Retrieve the pattern of the pack expansion.
static CXXStaticCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize)
SourceLocation getLocStart() const LLVM_READONLY
SourceLocation getEllipsisLoc() const
capture_range implicit_captures() const
Retrieve this lambda's implicit captures.
static CXXTemporary * Create(const ASTContext &C, const CXXDestructorDecl *Destructor)
static CXXUnresolvedConstructExpr * CreateEmpty(const ASTContext &C, unsigned NumArgs)
Represents an explicit C++ type conversion that uses "functional" notation (C++ [expr.type.conv]).
static bool classof(const Stmt *T)
static TypeTraitExpr * Create(const ASTContext &C, QualType T, SourceLocation Loc, TypeTrait Kind, ArrayRef< TypeSourceInfo * > Args, SourceLocation RParenLoc, bool Value)
Create a new type trait expression.
static TypeTraitExpr * CreateDeserialized(const ASTContext &C, unsigned NumArgs)
bool doesUsualArrayDeleteWantSize() const
Answers whether the usual array deallocation function for the allocated type expects the size of the ...
NestedNameSpecifier * getNestedNameSpecifier() const
Retrieve the nested-name-specifier to which this instance refers.
ExpressionTraitExpr(EmptyShell Empty)
bool isLeftFold() const
Does this produce a left-associated sequence of operators?
SourceLocation getUDSuffixLoc() const
Returns the location of a ud-suffix in the expression.
const ASTTemplateKWAndArgsInfo * getTrailingASTTemplateKWAndArgsInfo() const
Return the optional template keyword and arguments info.
TypeSourceInfo * getQueriedTypeSourceInfo() const
const_arg_iterator arg_begin() const
SourceLocation getLocEnd() const LLVM_READONLY
unsigned kind
All of the diagnostics that can be emitted by the frontend.
void setExprOperand(Expr *E)
Full-expression storage duration (for temporaries).
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
SourceLocation getExprLoc() const LLVM_READONLY
CXXUuidofExpr(EmptyShell Empty, bool isExpr)
DeclarationName getName() const
Gets the name looked up.
CXXPseudoDestructorExpr(const ASTContext &Context, Expr *Base, bool isArrow, SourceLocation OperatorLoc, NestedNameSpecifierLoc QualifierLoc, TypeSourceInfo *ScopeType, SourceLocation ColonColonLoc, SourceLocation TildeLoc, PseudoDestructorTypeStorage DestroyedType)
Expr * getPattern()
Retrieve the pattern of the pack expansion.
CXXTypeidExpr(EmptyShell Empty, bool isExpr)
static bool classof(const Stmt *T)
Abstract class common to all of the C++ "named"/"keyword" casts.
bool isStdInitListInitialization() const
Whether this constructor call was written as list-initialization, but was interpreted as forming a st...
SourceLocation getLocEnd() const LLVM_READONLY
CK_NoOp - A conversion which does not affect the type other than (possibly) adding qualifiers...
capture_init_iterator capture_init_end()
Retrieve the iterator pointing one past the last initialization argument for this lambda expression...
static bool classof(const Stmt *T)
ExprValueKind getValueKind() const
getValueKind - The value kind that this expression produces.
CUDAKernelCallExpr(ASTContext &C, EmptyShell Empty)
const Expr * getSubExpr() const
TypeSourceInfo * getAllocatedTypeSourceInfo() const
bool hasTemplateKeyword() const
Determines whether the name was preceded by the template keyword.
ExprIterator arg_iterator
An instance of this class represents the declaration of a property member.
BinaryOperatorKind getOperator() const
An l-value expression is a reference to an object with independent storage.
SourceLocation getRParenLoc() const
Determine the location of the right parenthesis.
const_capture_init_iterator capture_init_end() const
Retrieve the iterator pointing one past the last initialization argument for this lambda expression...
arg_const_range arguments() const
A trivial tuple used to represent a source range.
NamedDecl - This represents a decl with a name.
A boolean literal, per ([C++ lex.bool] Boolean literals).
NestedNameSpecifier * getQualifier() const
Fetches the nested-name qualifier, if one was given.
static bool classof(const Stmt *T)
CXXPseudoDestructorExpr(EmptyShell Shell)
QualType getDestroyedType() const
Retrieve the type being destroyed.
A Microsoft C++ __uuidof expression, which gets the _GUID that corresponds to the supplied type or ex...
Expr * getOperand() const
Automatic storage duration (most local variables).
void copyTemplateArgumentsInto(TemplateArgumentListInfo &List) const
Copies the template arguments (if present) into the given structure.
void setStdInitListInitialization(bool V)
const CallExpr * getConfig() const
bool isTypeOperand() const
static bool classof(const Stmt *T)
static bool classof(const Stmt *T)
CXXThrowExpr(Expr *expr, QualType Ty, SourceLocation l, bool IsThrownVariableInScope)
static LambdaExpr * Create(const ASTContext &C, CXXRecordDecl *Class, SourceRange IntroducerRange, LambdaCaptureDefault CaptureDefault, SourceLocation CaptureDefaultLoc, ArrayRef< LambdaCapture > Captures, bool ExplicitParams, bool ExplicitResultType, ArrayRef< Expr * > CaptureInits, ArrayRef< VarDecl * > ArrayIndexVars, ArrayRef< unsigned > ArrayIndexStarts, SourceLocation ClosingBrace, bool ContainsUnexpandedParameterPack)
Construct a new lambda expression.
bool isArrow() const
Determine whether this member expression used the '->' operator; otherwise, it used the '...
const CXXDestructorDecl * getDestructor() const
static bool classof(const Stmt *T)
CXXThisExpr(EmptyShell Empty)
CXXRecordDecl * getLambdaClass() const
Retrieve the class that corresponds to the lambda.
operator "" X (unsigned long long)
Defines the LambdaCapture class.
Expr * getCookedLiteral()
If this is not a raw user-defined literal, get the underlying cooked literal (representing the litera...
CXXConstructExpr(EmptyShell Empty)
Construct an empty C++ construction expression.
Expr * IgnoreParens() LLVM_READONLY
IgnoreParens - Ignore parentheses.
SourceLocation getLocEnd() const LLVM_READONLY
bool hasUnresolvedUsing() const
Determine whether the lookup results contain an unresolved using declaration.
static bool classof(const Stmt *T)