15 #ifndef LLVM_CLANG_AST_EXPRCXX_H
16 #define LLVM_CLANG_AST_EXPRCXX_H
26 #include "llvm/Support/Compiler.h"
32 class TemplateArgumentListInfo;
60 unsigned FPContractable : 1;
62 SourceRange getSourceRangeImpl()
const LLVM_READONLY;
67 :
CallExpr(C, CXXOperatorCallExprClass, fn, args, t, VK, operatorloc),
68 Operator(Op), FPContractable(fpContractable) {
69 Range = getSourceRangeImpl();
72 CallExpr(C, CXXOperatorCallExprClass, Empty) { }
87 return (Operator < OO_Plus || Operator >= OO_Arrow ||
88 Operator == OO_PlusPlus || Operator == OO_MinusMinus)
98 return T->getStmtClass() == CXXOperatorCallExprClass;
125 :
CallExpr(C, CXXMemberCallExprClass, fn, args, t, VK, RP) {}
128 :
CallExpr(C, CXXMemberCallExprClass, Empty) { }
155 return T->getStmtClass() == CXXMemberCallExprClass;
162 enum { CONFIG, END_PREARG };
168 :
CallExpr(C, CUDAKernelCallExprClass, fn, Config, args, t, VK, RP) {}
171 :
CallExpr(C, CUDAKernelCallExprClass, END_PREARG, Empty) { }
174 return cast_or_null<CallExpr>(
getPreArg(CONFIG));
184 "Cannot call setConfig if config is not null");
193 return T->getStmtClass() == CUDAKernelCallExprClass;
216 RParenLoc(RParenLoc), AngleBrackets(AngleBrackets) {}
238 switch (T->getStmtClass()) {
239 case CXXStaticCastExprClass:
240 case CXXDynamicCastExprClass:
241 case CXXReinterpretCastExprClass:
242 case CXXConstCastExprClass:
262 writtenTy, l, RParenLoc, AngleBrackets) {}
264 explicit CXXStaticCastExpr(EmptyShell Empty,
unsigned PathSize)
278 return T->getStmtClass() == CXXStaticCastExprClass;
298 writtenTy, l, RParenLoc, AngleBrackets) {}
300 explicit CXXDynamicCastExpr(EmptyShell Empty,
unsigned pathSize)
317 return T->getStmtClass() == CXXDynamicCastExprClass;
335 CXXBaseSpecifier *> {
337 Expr *op,
unsigned pathSize,
342 pathSize, writtenTy, l, RParenLoc, AngleBrackets) {}
344 CXXReinterpretCastExpr(EmptyShell Empty,
unsigned pathSize)
358 return T->getStmtClass() == CXXReinterpretCastExprClass;
379 0, writtenTy, l, RParenLoc, AngleBrackets) {}
381 explicit CXXConstCastExpr(EmptyShell Empty)
393 return T->getStmtClass() == CXXConstCastExprClass;
417 :
CallExpr(C, UserDefinedLiteralClass, Fn, Args, T, VK, LitEndLoc),
418 UDSuffixLoc(SuffixLoc) {}
420 :
CallExpr(C, UserDefinedLiteralClass, Empty) {}
447 return getArg(0)->getLocStart();
462 return S->getStmtClass() == UserDefinedLiteralClass;
478 Value(val), Loc(l) {}
481 :
Expr(CXXBoolLiteralExprClass, Empty) { }
493 return T->getStmtClass() == CXXBoolLiteralExprClass;
498 return child_range(child_iterator(), child_iterator());
514 :
Expr(CXXNullPtrLiteralExprClass, Empty) { }
523 return T->getStmtClass() == CXXNullPtrLiteralExprClass;
527 return child_range(child_iterator(), child_iterator());
537 :
Expr(CXXStdInitializerListExprClass, Empty), SubExpr(
nullptr) {}
551 return SubExpr->getLocStart();
554 return SubExpr->getLocEnd();
557 return SubExpr->getSourceRange();
561 return S->getStmtClass() == CXXStdInitializerListExprClass;
564 child_range
children() {
return child_range(&SubExpr, &SubExpr + 1); }
577 llvm::PointerUnion<Stmt *, TypeSourceInfo *> Operand;
586 Operand->
getType()->isDependentType(),
587 Operand->
getType()->isInstantiationDependentType(),
589 Operand(Operand), Range(R) { }
599 Operand(Operand), Range(R) { }
602 :
Expr(CXXTypeidExprClass, Empty) {
604 Operand = (
Expr*)
nullptr;
621 assert(
isTypeOperand() &&
"Cannot call getTypeOperand for typeid(expr)");
626 assert(
isTypeOperand() &&
"Cannot call getTypeOperand for typeid(expr)");
631 assert(!
isTypeOperand() &&
"Cannot call getExprOperand for typeid(type)");
632 return static_cast<Expr*
>(Operand.get<
Stmt *>());
636 assert(!
isTypeOperand() &&
"Cannot call getExprOperand for typeid(type)");
646 return T->getStmtClass() == CXXTypeidExprClass;
652 return child_range(child_iterator(), child_iterator());
654 return child_range(begin, begin + 1);
679 BaseExpr(baseExpr), TheDecl(decl),
680 MemberLoc(nameLoc), IsArrow(isArrow),
681 QualifierLoc(qualifierLoc) {}
693 return BaseExpr->getLocStart();
694 else if (QualifierLoc)
702 return child_range((
Stmt**)&BaseExpr, (
Stmt**)&BaseExpr + 1);
705 return T->getStmtClass() == MSPropertyRefExprClass;
730 enum { BASE_EXPR, IDX_EXPR, NUM_SUBEXPRS = 2 };
731 Stmt *SubExprs[NUM_SUBEXPRS];
734 void setBase(
Expr *
Base) { SubExprs[BASE_EXPR] = Base; }
735 void setIdx(
Expr *Idx) { SubExprs[IDX_EXPR] = Idx; }
743 RBracketLoc(RBracketLoc) {
744 SubExprs[BASE_EXPR] = Base;
745 SubExprs[IDX_EXPR] = Idx;
750 :
Expr(MSPropertySubscriptExprClass, Shell) {}
753 const Expr *
getBase()
const {
return cast<Expr>(SubExprs[BASE_EXPR]); }
756 const Expr *
getIdx()
const {
return cast<Expr>(SubExprs[IDX_EXPR]); }
759 return getBase()->getLocStart();
771 return T->getStmtClass() == MSPropertySubscriptExprClass;
776 return child_range(&SubExprs[0], &SubExprs[0] + NUM_SUBEXPRS);
786 llvm::PointerUnion<Stmt *, TypeSourceInfo *> Operand;
794 Operand->
getType()->isDependentType(),
795 Operand->
getType()->isInstantiationDependentType(),
797 Operand(Operand), UuidStr(UuidStr), Range(R) {}
803 Operand(Operand), UuidStr(UuidStr), Range(R) {}
806 :
Expr(CXXUuidofExprClass, Empty) {
808 Operand = (
Expr*)
nullptr;
821 assert(
isTypeOperand() &&
"Cannot call getTypeOperand for __uuidof(expr)");
826 assert(
isTypeOperand() &&
"Cannot call getTypeOperand for __uuidof(expr)");
831 assert(!
isTypeOperand() &&
"Cannot call getExprOperand for __uuidof(type)");
832 return static_cast<Expr*
>(Operand.get<
Stmt *>());
836 assert(!
isTypeOperand() &&
"Cannot call getExprOperand for __uuidof(type)");
849 return T->getStmtClass() == CXXUuidofExprClass;
855 return child_range(child_iterator(), child_iterator());
857 return child_range(begin, begin + 1);
882 Type->isDependentType(), Type->isDependentType(),
883 Type->isInstantiationDependentType(),
885 Loc(L), Implicit(isImplicit) { }
899 return T->getStmtClass() == CXXThisExprClass;
904 return child_range(child_iterator(), child_iterator());
917 unsigned IsThrownVariableInScope : 1;
926 bool IsThrownVariableInScope) :
930 Op(expr), ThrowLoc(l), IsThrownVariableInScope(IsThrownVariableInScope) {}
953 return T->getStmtClass() == CXXThrowExprClass;
958 return child_range(&Op, Op ? &Op+1 : &Op);
981 Param(param), Loc(Loc) { }
1017 return T->getStmtClass() == CXXDefaultArgExprClass;
1022 return child_range(child_iterator(), child_iterator());
1075 return T->getStmtClass() == CXXDefaultInitExprClass;
1080 return child_range(child_iterator(), child_iterator());
1093 : Destructor(destructor) { }
1125 :
Expr(CXXBindTemporaryExprClass, SubExpr->
getType(),
1130 Temp(temp), SubExpr(SubExpr) { }
1134 :
Expr(CXXBindTemporaryExprClass, Empty), Temp(nullptr), SubExpr(nullptr) {}
1148 return SubExpr->getLocStart();
1154 return T->getStmtClass() == CXXBindTemporaryExprClass;
1158 child_range
children() {
return child_range(&SubExpr, &SubExpr + 1); }
1176 unsigned NumArgs : 16;
1177 unsigned Elidable : 1;
1178 unsigned HadMultipleCandidates : 1;
1179 unsigned ListInitialization : 1;
1180 unsigned StdInitListInitialization : 1;
1181 unsigned ZeroInitialization : 1;
1182 unsigned ConstructKind : 2;
1190 CXXConstructorDecl *Ctor,
1192 ArrayRef<Expr *> Args,
1193 bool HadMultipleCandidates,
1194 bool ListInitialization,
1195 bool StdInitListInitialization,
1196 bool ZeroInitialization,
1198 SourceRange ParenOrBraceRange);
1202 :
Expr(SC, Empty), Constructor(nullptr), NumArgs(0), Elidable(
false),
1203 HadMultipleCandidates(
false), ListInitialization(
false),
1204 ZeroInitialization(
false), ConstructKind(0), Args(nullptr)
1217 bool HadMultipleCandidates,
1218 bool ListInitialization,
1219 bool StdInitListInitialization,
1220 bool ZeroInitialization,
1254 ZeroInitialization = ZeroInit;
1289 assert(Arg < NumArgs &&
"Arg access out of range!");
1290 return cast<Expr>(Args[Arg]);
1293 assert(Arg < NumArgs &&
"Arg access out of range!");
1294 return cast<Expr>(Args[Arg]);
1299 assert(Arg < NumArgs &&
"Arg access out of range!");
1300 Args[Arg] = ArgExpr;
1309 return T->getStmtClass() == CXXConstructExprClass ||
1310 T->getStmtClass() == CXXTemporaryObjectExprClass;
1315 return child_range(&Args[0], &Args[0]+NumArgs);
1333 unsigned ConstructsVirtualBase : 1;
1337 unsigned InheritedFromVirtualBase : 1;
1343 bool InheritedFromVirtualBase)
1346 Constructor(Ctor), Loc(Loc),
1347 ConstructsVirtualBase(ConstructsVirtualBase),
1348 InheritedFromVirtualBase(InheritedFromVirtualBase) {
1354 :
Expr(CXXInheritedCtorInitExprClass, Empty), Constructor(nullptr),
1355 ConstructsVirtualBase(
false), InheritedFromVirtualBase(
false) {}
1379 return T->getStmtClass() == CXXInheritedCtorInitExprClass;
1382 return child_range(child_iterator(), child_iterator());
1406 castExpr, pathSize, writtenTy),
1407 LParenLoc(lParenLoc), RParenLoc(rParenLoc) {}
1432 return T->getStmtClass() == CXXFunctionalCastExprClass;
1463 bool HadMultipleCandidates,
1464 bool ListInitialization,
1465 bool StdInitListInitialization,
1466 bool ZeroInitialization);
1476 return T->getStmtClass() == CXXTemporaryObjectExprClass;
1513 unsigned NumCaptures : 16;
1517 unsigned CaptureDefault : 2;
1521 unsigned ExplicitParams : 1;
1524 unsigned ExplicitResultType : 1;
1528 unsigned HasArrayIndexVars : 1;
1540 size_t numTrailingObjects(OverloadToken<Stmt *>)
const {
1541 return NumCaptures + 1;
1544 size_t numTrailingObjects(OverloadToken<unsigned>)
const {
1545 return HasArrayIndexVars ? NumCaptures + 1 : 0;
1552 bool ExplicitParams,
bool ExplicitResultType,
1555 bool ContainsUnexpandedParameterPack);
1558 LambdaExpr(EmptyShell Empty,
unsigned NumCaptures,
bool HasArrayIndexVars)
1559 :
Expr(LambdaExprClass, Empty),
1560 NumCaptures(NumCaptures), CaptureDefault(
LCD_None), ExplicitParams(
false),
1561 ExplicitResultType(
false), HasArrayIndexVars(
true) {
1562 getStoredStmts()[NumCaptures] =
nullptr;
1565 Stmt **getStoredStmts() {
return getTrailingObjects<Stmt *>(); }
1567 Stmt *
const *getStoredStmts()
const {
return getTrailingObjects<Stmt *>(); }
1571 unsigned *getArrayIndexStarts() {
return getTrailingObjects<unsigned>(); }
1573 const unsigned *getArrayIndexStarts()
const {
1574 return getTrailingObjects<unsigned>();
1578 VarDecl **getArrayIndexVars() {
return getTrailingObjects<VarDecl *>(); }
1580 VarDecl *
const *getArrayIndexVars()
const {
1581 return getTrailingObjects<VarDecl *>();
1593 bool ContainsUnexpandedParameterPack);
1598 unsigned NumCaptures,
1599 unsigned NumArrayIndexVars);
1608 return CaptureDefaultLoc;
1677 return reinterpret_cast<Expr **
>(getStoredStmts());
1683 return reinterpret_cast<Expr *
const *
>(getStoredStmts());
1744 return T->getStmtClass() == LambdaExprClass;
1754 return child_range(getStoredStmts(), getStoredStmts() + NumCaptures + 1);
1776 false,
false, Type->isInstantiationDependentType(),
1778 RParenLoc(rParenLoc), TypeInfo(TypeInfo) {}
1781 :
Expr(CXXScalarValueInitExprClass, Shell) { }
1793 return T->getStmtClass() == CXXScalarValueInitExprClass;
1798 return child_range(child_iterator(), child_iterator());
1828 unsigned GlobalNew : 1;
1833 unsigned UsualArrayDeleteWantsSize : 1;
1835 unsigned NumPlacementArgs : 13;
1839 unsigned StoredInitializationStyle : 2;
1851 FunctionDecl *operatorDelete,
bool usualArrayDeleteWantsSize,
1858 :
Expr(CXXNewExprClass, Shell), SubExprs(nullptr) { }
1864 assert(
getType()->isPointerType());
1869 return AllocatedTypeInfo;
1896 return Array ? cast<Expr>(SubExprs[0]) :
nullptr;
1899 return Array ? cast<Expr>(SubExprs[0]) :
nullptr;
1908 assert(i < NumPlacementArgs &&
"Index out of range");
1912 assert(i < NumPlacementArgs &&
"Index out of range");
1926 if (StoredInitializationStyle == 0)
1948 return UsualArrayDeleteWantsSize;
1997 return T->getStmtClass() == CXXNewExprClass;
2016 bool GlobalDelete : 1;
2022 bool ArrayFormAsWritten : 1;
2025 bool UsualArrayDeleteWantsSize : 1;
2028 bool arrayFormAsWritten,
bool usualArrayDeleteWantsSize,
2033 OperatorDelete(operatorDelete), Argument(arg), Loc(loc),
2034 GlobalDelete(globalDelete),
2035 ArrayForm(arrayForm), ArrayFormAsWritten(arrayFormAsWritten),
2036 UsualArrayDeleteWantsSize(usualArrayDeleteWantsSize) { }
2038 :
Expr(CXXDeleteExprClass, Shell), OperatorDelete(nullptr),
2039 Argument(nullptr) {}
2050 return UsualArrayDeleteWantsSize;
2068 return T->getStmtClass() == CXXDeleteExprClass;
2072 child_range
children() {
return child_range(&Argument, &Argument+1); }
2081 llvm::PointerUnion<TypeSourceInfo *, IdentifierInfo *>
Type;
2090 :
Type(II), Location(Loc) { }
2170 :
Expr(CXXPseudoDestructorExprClass, Shell),
2171 Base(nullptr), IsArrow(
false), QualifierLoc(), ScopeType(nullptr) { }
2257 return T->getStmtClass() == CXXPseudoDestructorExprClass;
2291 size_t numTrailingObjects(OverloadToken<TypeSourceInfo *>)
const {
2308 return static_cast<TypeTrait>(TypeTraitExprBits.Kind);
2313 return TypeTraitExprBits.Value;
2317 unsigned getNumArgs()
const {
return TypeTraitExprBits.NumArgs; }
2321 assert(I <
getNumArgs() &&
"Argument out-of-range");
2327 return llvm::makeArrayRef(getTrailingObjects<TypeSourceInfo *>(),
2335 return T->getStmtClass() == TypeTraitExprClass;
2340 return child_range(child_iterator(), child_iterator());
2357 virtual void anchor();
2383 (queried->
getType()->isInstantiationDependentType() ||
2386 ATT(att),
Value(value), Dimension(dimension),
2387 Loc(loc), RParen(rparen), QueriedType(queried) { }
2410 return T->getStmtClass() == ArrayTypeTraitExprClass;
2415 return child_range(child_iterator(), child_iterator());
2441 Expr* QueriedExpression;
2444 Expr *queried,
bool value,
2452 ET(et),
Value(value), Loc(loc), RParen(rparen),
2453 QueriedExpression(queried) { }
2457 QueriedExpression() { }
2469 return T->getStmtClass() == ExpressionTraitExprClass;
2474 return child_range(child_iterator(), child_iterator());
2495 unsigned NumResults;
2503 ASTTemplateKWAndArgsInfo *
2521 bool KnownDependent,
2522 bool KnownInstantiationDependent,
2523 bool KnownContainsUnexpandedParameterPack);
2526 :
Expr(K, Empty), QualifierLoc(), Results(nullptr), NumResults(0),
2551 if (isa<UnaryOperator>(E)) {
2552 assert(cast<UnaryOperator>(E)->getOpcode() == UO_AddrOf);
2553 E = cast<UnaryOperator>(
E)->getSubExpr();
2556 Result.HasFormOfMemberPointer = (E == Ovl && Ovl->
getQualifier());
2557 Result.IsAddressOfOperand =
true;
2558 Result.Expression = Ovl;
2560 Result.HasFormOfMemberPointer =
false;
2561 Result.IsAddressOfOperand =
false;
2562 Result.Expression = cast<OverloadExpr>(
E);
2576 llvm::iterator_range<decls_iterator>
decls()
const {
2652 return T->getStmtClass() == UnresolvedLookupExprClass ||
2653 T->getStmtClass() == UnresolvedMemberExprClass;
2674 UnresolvedLookupExpr, ASTTemplateKWAndArgsInfo, TemplateArgumentLoc> {
2691 size_t numTrailingObjects(OverloadToken<ASTTemplateKWAndArgsInfo>)
const {
2700 bool RequiresADL,
bool Overloaded,
2703 :
OverloadExpr(UnresolvedLookupExprClass, C, QualifierLoc, TemplateKWLoc,
2704 NameInfo, TemplateArgs, Begin, End,
false,
false,
false),
2705 RequiresADL(RequiresADL),
2706 Overloaded(Overloaded), NamingClass(NamingClass)
2711 RequiresADL(
false), Overloaded(
false), NamingClass(
nullptr)
2714 friend TrailingObjects;
2723 bool ADL,
bool Overloaded,
2728 ADL, Overloaded,
nullptr, Begin,
End);
2743 unsigned NumTemplateArgs);
2759 return l.getBeginLoc();
2769 return child_range(child_iterator(), child_iterator());
2773 return T->getStmtClass() == UnresolvedLookupExprClass;
2794 ASTTemplateKWAndArgsInfo,
2795 TemplateArgumentLoc> {
2805 bool HasTemplateKWAndArgsInfo;
2807 size_t numTrailingObjects(OverloadToken<ASTTemplateKWAndArgsInfo>)
const {
2808 return HasTemplateKWAndArgsInfo ? 1 : 0;
2825 bool HasTemplateKWAndArgsInfo,
2826 unsigned NumTemplateArgs);
2853 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->TemplateKWLoc;
2860 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->LAngleLoc;
2867 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->RAngleLoc;
2880 getTrailingObjects<ASTTemplateKWAndArgsInfo>()->copyInto(
2881 getTrailingObjects<TemplateArgumentLoc>(), List);
2888 return getTrailingObjects<TemplateArgumentLoc>();
2895 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->NumTemplateArgs;
2914 return T->getStmtClass() == DependentScopeDeclRefExprClass;
2918 return child_range(child_iterator(), child_iterator());
2953 friend TrailingObjects;
2958 unsigned numObjects);
2961 bool CleanupsHaveSideEffects,
2965 return llvm::makeArrayRef(getTrailingObjects<CleanupObject>(),
2979 return ExprWithCleanupsBits.CleanupsHaveSideEffects;
2987 return SubExpr->getLocStart();
2993 return T->getStmtClass() == ExprWithCleanupsClass;
2997 child_range
children() {
return child_range(&SubExpr, &SubExpr + 1); }
3042 :
Expr(CXXUnresolvedConstructExprClass, Empty), Type(), NumArgs(NumArgs) { }
3044 friend TrailingObjects;
3089 assert(I < NumArgs &&
"Argument index out-of-range");
3094 assert(I < NumArgs &&
"Argument index out-of-range");
3099 assert(I < NumArgs &&
"Argument index out-of-range");
3105 if (!RParenLoc.
isValid() && NumArgs > 0)
3106 return getArg(NumArgs - 1)->getLocEnd();
3111 return T->getStmtClass() == CXXUnresolvedConstructExprClass;
3117 return child_range(begin, begin + NumArgs);
3131 ASTTemplateKWAndArgsInfo,
3132 TemplateArgumentLoc> {
3147 bool HasTemplateKWAndArgsInfo : 1;
3170 size_t numTrailingObjects(OverloadToken<ASTTemplateKWAndArgsInfo>)
const {
3171 return HasTemplateKWAndArgsInfo ? 1 : 0;
3200 unsigned NumTemplateArgs);
3211 return cast<Expr>(Base);
3246 return FirstQualifierFoundInScope;
3252 return MemberNameInfo;
3267 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->TemplateKWLoc;
3274 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->LAngleLoc;
3281 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->RAngleLoc;
3295 getTrailingObjects<ASTTemplateKWAndArgsInfo>()->copyInto(
3296 getTrailingObjects<TemplateArgumentLoc>(), List);
3305 return getTrailingObjects<TemplateArgumentLoc>();
3314 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->NumTemplateArgs;
3323 return Base->getLocStart();
3336 return T->getStmtClass() == CXXDependentScopeMemberExprClass;
3342 return child_range(child_iterator(), child_iterator());
3343 return child_range(&Base, &Base + 1);
3369 UnresolvedMemberExpr, ASTTemplateKWAndArgsInfo, TemplateArgumentLoc> {
3376 bool HasUnresolvedUsing : 1;
3390 size_t numTrailingObjects(OverloadToken<ASTTemplateKWAndArgsInfo>)
const {
3404 :
OverloadExpr(UnresolvedMemberExprClass, Empty), IsArrow(
false),
3405 HasUnresolvedUsing(
false), Base(
nullptr) { }
3407 friend TrailingObjects;
3424 unsigned NumTemplateArgs);
3436 return cast<Expr>(Base);
3440 return cast<Expr>(Base);
3477 return Base->getLocStart();
3479 return l.getBeginLoc();
3489 return T->getStmtClass() == UnresolvedMemberExprClass;
3495 return child_range(child_iterator(), child_iterator());
3496 return child_range(&Base, &Base + 1);
3500 inline ASTTemplateKWAndArgsInfo *
3505 if (isa<UnresolvedLookupExpr>(
this))
3506 return cast<UnresolvedLookupExpr>(
this)
3507 ->getTrailingObjects<ASTTemplateKWAndArgsInfo>();
3509 return cast<UnresolvedMemberExpr>(
this)
3510 ->getTrailingObjects<ASTTemplateKWAndArgsInfo>();
3514 if (isa<UnresolvedLookupExpr>(
this))
3515 return cast<UnresolvedLookupExpr>(
this)
3516 ->getTrailingObjects<TemplateArgumentLoc>();
3518 return cast<UnresolvedMemberExpr>(
this)
3519 ->getTrailingObjects<TemplateArgumentLoc>();
3541 Value(Val ==
CT_Cannot), Operand(Operand), Range(Keyword, RParen)
3545 :
Expr(CXXNoexceptExprClass, Empty)
3557 return T->getStmtClass() == CXXNoexceptExprClass;
3561 child_range
children() {
return child_range(&Operand, &Operand + 1); }
3589 unsigned NumExpansions;
3603 EllipsisLoc(EllipsisLoc),
3604 NumExpansions(NumExpansions? *NumExpansions + 1 : 0),
3605 Pattern(Pattern) { }
3623 return NumExpansions - 1;
3629 return Pattern->getLocStart();
3634 return T->getStmtClass() == PackExpansionExprClass;
3639 return child_range(&Pattern, &Pattern + 1);
3680 friend TrailingObjects;
3693 OperatorLoc(OperatorLoc), PackLoc(PackLoc), RParenLoc(RParenLoc),
3694 Length(Length ? *Length : PartialArgs.size()), Pack(Pack) {
3695 assert((!Length || PartialArgs.empty()) &&
3696 "have partial args for non-dependent sizeof... expression");
3698 std::uninitialized_copy(PartialArgs.begin(), PartialArgs.end(), Args);
3703 :
Expr(SizeOfPackExprClass, Empty), Length(NumPartialArgs), Pack() {}
3707 NamedDecl *Pack, SourceLocation PackLoc,
3708 SourceLocation RParenLoc,
3709 Optional<unsigned> Length =
None,
3710 ArrayRef<TemplateArgument> PartialArgs =
None);
3712 unsigned NumPartialArgs);
3732 "Cannot get the length of a value-dependent pack size expression");
3749 return llvm::makeArrayRef(Args, Args + Length);
3756 return T->getStmtClass() == SizeOfPackExprClass;
3761 return child_range(child_iterator(), child_iterator());
3780 :
Expr(SubstNonTypeTemplateParmExprClass, Empty) { }
3788 :
Expr(SubstNonTypeTemplateParmExprClass, type, valueKind,
OK_Ordinary,
3792 Param(param),
Replacement(replacement), NameLoc(loc) {}
3803 return s->getStmtClass() == SubstNonTypeTemplateParmExprClass;
3831 unsigned NumArguments;
3839 :
Expr(SubstNonTypeTemplateParmPackExprClass, Empty) { }
3861 return T->getStmtClass() == SubstNonTypeTemplateParmPackExprClass;
3866 return child_range(child_iterator(), child_iterator());
3894 unsigned NumParameters;
3900 friend TrailingObjects;
3910 unsigned NumParams);
3934 return T->getStmtClass() == FunctionParmPackExprClass;
3938 return child_range(child_iterator(), child_iterator());
3973 unsigned ManglingNumber;
3975 llvm::PointerUnion<Stmt *, ExtraState *> State;
3980 void initializeExtraState(
const ValueDecl *ExtendedBy,
3981 unsigned ManglingNumber);
3985 bool BoundToLvalueReference)
3986 :
Expr(MaterializeTemporaryExprClass, T,
3994 :
Expr(MaterializeTemporaryExprClass, Empty) { }
3998 :
State.get<ExtraState *>()->Temporary;
4012 if (isa<FieldDecl>(ExtendingDecl))
4021 :
State.get<ExtraState *>()->ExtendingDecl;
4027 return State.is<
Stmt *>() ? 0 :
State.get<ExtraState *>()->ManglingNumber;
4044 return T->getStmtClass() == MaterializeTemporaryExprClass;
4050 return child_range(
State.getAddrOfPtr1(),
State.getAddrOfPtr1() + 1);
4052 auto ES =
State.get<ExtraState *>();
4053 return child_range(&ES->Temporary, &ES->Temporary + 1);
4081 LParenLoc(LParenLoc), EllipsisLoc(EllipsisLoc), RParenLoc(RParenLoc),
4113 return T->getStmtClass() == CXXFoldExprClass;
4117 child_range
children() {
return child_range(SubExprs, SubExprs + 2); }
4136 enum SubExpr { Common, Ready, Suspend, Resume, Count };
4147 KeywordLoc(KeywordLoc) {
4148 SubExprs[SubExpr::Common] = Common;
4149 SubExprs[SubExpr::Ready] = Ready;
4150 SubExprs[SubExpr::Suspend] = Suspend;
4151 SubExprs[SubExpr::Resume] = Resume;
4157 KeywordLoc(KeywordLoc) {
4159 "wrong constructor for non-dependent co_await/co_yield expression");
4160 SubExprs[SubExpr::Common] = Common;
4161 SubExprs[SubExpr::Ready] =
nullptr;
4162 SubExprs[SubExpr::Suspend] =
nullptr;
4163 SubExprs[SubExpr::Resume] =
nullptr;
4166 SubExprs[SubExpr::Common] =
nullptr;
4167 SubExprs[SubExpr::Ready] =
nullptr;
4168 SubExprs[SubExpr::Suspend] =
nullptr;
4169 SubExprs[SubExpr::Resume] =
nullptr;
4174 return static_cast<Expr*
>(SubExprs[SubExpr::Common]);
4178 return static_cast<Expr*
>(SubExprs[SubExpr::Ready]);
4181 return static_cast<Expr*
>(SubExprs[SubExpr::Suspend]);
4184 return static_cast<Expr*
>(SubExprs[SubExpr::Resume]);
4199 return T->getStmtClass() == CoawaitExprClass ||
4200 T->getStmtClass() == CoyieldExprClass;
4223 return T->getStmtClass() == CoawaitExprClass;
4246 return T->getStmtClass() == CoyieldExprClass;
CXXUuidofExpr(QualType Ty, TypeSourceInfo *Operand, StringRef UuidStr, SourceRange R)
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.
CXXConstructExpr::ConstructionKind getConstructionKind() const
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
ArrayRef< TemplateArgumentLoc > template_arguments() 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 UnresolvedLookupExpr * Create(const ASTContext &C, CXXRecordDecl *NamingClass, NestedNameSpecifierLoc QualifierLoc, const DeclarationNameInfo &NameInfo, bool ADL, bool Overloaded, UnresolvedSetIterator Begin, UnresolvedSetIterator End)
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)
static bool classof(const Stmt *T)
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
static CXXConstructExpr * Create(const ASTContext &C, QualType T, SourceLocation Loc, CXXConstructorDecl *Ctor, bool Elidable, ArrayRef< Expr * > Args, bool HadMultipleCandidates, bool ListInitialization, bool StdInitListInitialization, bool ZeroInitialization, ConstructionKind ConstructKind, SourceRange ParenOrBraceRange)
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
const Expr * getCallee() const
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.
void setContainsUnexpandedParameterPack(bool PP=true)
Set the bit that describes whether this expression contains an unexpanded parameter pack...
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.
CXXInheritedCtorInitExpr(EmptyShell Empty)
Construct an empty C++ inheriting construction 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)
CXXUuidofExpr(QualType Ty, Expr *Operand, StringRef UuidStr, SourceRange R)
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...
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
ArrayRef< TemplateArgumentLoc > template_arguments() 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]).
SourceLocation getExprLoc() const LLVM_READONLY
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.
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)
void setUuidStr(StringRef US)
ConstructionKind getConstructionKind() const
Determine whether this constructor is actually constructing a base class (rather than a complete obje...
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
StringRef getUuidStr() 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...
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)
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will call.
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]).
bool cleanupsHaveSideEffects() const
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...
Represents a call to an inherited base class constructor from an inheriting constructor.
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
Expr * getSuspendExpr() const
CXXConstructExpr(const ASTContext &C, StmtClass SC, QualType T, SourceLocation Loc, CXXConstructorDecl *Ctor, bool Elidable, ArrayRef< Expr * > Args, bool HadMultipleCandidates, bool ListInitialization, bool StdInitListInitialization, bool ZeroInitialization, ConstructionKind ConstructKind, SourceRange ParenOrBraceRange)
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)
Sets the kernel configuration expression.
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...
SourceLocation getLocation() const LLVM_READONLY
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
void setInstantiationDependent(bool ID)
Set whether this expression is instantiation-dependent or not.
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)
SourceLocation getLocEnd() const LLVM_READONLY
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)
SourceLocation getLocStart() const LLVM_READONLY
void setArg(unsigned Arg, Expr *ArgExpr)
Set the specified argument.
CXXInheritedCtorInitExpr(SourceLocation Loc, QualType T, CXXConstructorDecl *Ctor, bool ConstructsVirtualBase, bool InheritedFromVirtualBase)
Construct a C++ inheriting construction expression.
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
Get the constructor that this expression will (ultimately) call.
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
bool inheritedFromVBase() const
Determine whether the inherited constructor is inherited from a virtual base of the object we constru...
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.
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate.h) and friends (in DeclFriend.h).
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 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.
bool constructsVBase() const
Determine whether this constructor is actually constructing a base class (rather than a complete obje...
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
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.
ArrayRef< TemplateArgumentLoc > template_arguments() const
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)