14 #ifndef LLVM_CLANG_AST_EXPRCXX_H
15 #define LLVM_CLANG_AST_EXPRCXX_H
42 #include "llvm/ADT/ArrayRef.h"
43 #include "llvm/ADT/PointerUnion.h"
44 #include "llvm/ADT/StringRef.h"
45 #include "llvm/ADT/iterator_range.h"
46 #include "llvm/Support/Casting.h"
47 #include "llvm/Support/Compiler.h"
48 #include "llvm/Support/TrailingObjects.h"
61 class NonTypeTemplateParmDecl;
62 class TemplateParameterList;
90 SourceRange getSourceRangeImpl() const LLVM_READONLY;
107 unsigned NumArgs,
bool HasFPFeatures,
117 return Opc == OO_Equal || Opc == OO_StarEqual || Opc == OO_SlashEqual ||
118 Opc == OO_PercentEqual || Opc == OO_PlusEqual ||
119 Opc == OO_MinusEqual || Opc == OO_LessLessEqual ||
120 Opc == OO_GreaterGreaterEqual || Opc == OO_AmpEqual ||
121 Opc == OO_CaretEqual || Opc == OO_PipeEqual;
128 case OO_ExclaimEqual:
130 case OO_GreaterEqual:
153 return (Operator < OO_Plus || Operator >= OO_Arrow ||
154 Operator == OO_PlusPlus || Operator == OO_MinusMinus)
164 return T->getStmtClass() == CXXOperatorCallExprClass;
191 unsigned MinNumArgs = 0);
226 return T->getStmtClass() == CXXMemberCallExprClass;
234 enum { CONFIG, END_PREARG };
251 unsigned MinNumArgs = 0);
254 unsigned NumArgs,
bool HasFPFeatures,
258 return cast_or_null<CallExpr>(
getPreArg(CONFIG));
263 return T->getStmtClass() == CUDAKernelCallExprClass;
291 :
Expr(CXXRewrittenBinaryOperatorClass, SemanticForm->
getType(),
293 SemanticForm(SemanticForm) {
298 :
Expr(CXXRewrittenBinaryOperatorClass,
Empty), SemanticForm() {}
357 return child_range(&SemanticForm, &SemanticForm + 1);
361 return T->getStmtClass() == CXXRewrittenBinaryOperatorClass;
387 Expr *op,
unsigned PathSize,
bool HasFPFeatures,
392 Loc(l), RParenLoc(RParenLoc), AngleBrackets(AngleBrackets) {}
413 switch (
T->getStmtClass()) {
414 case CXXStaticCastExprClass:
415 case CXXDynamicCastExprClass:
416 case CXXReinterpretCastExprClass:
417 case CXXConstCastExprClass:
418 case CXXAddrspaceCastExprClass:
432 private llvm::TrailingObjects<CXXStaticCastExpr, CXXBaseSpecifier *,
450 unsigned numTrailingObjects(OverloadToken<CXXBaseSpecifier *>)
const {
464 unsigned PathSize,
bool hasFPFeatures);
467 return T->getStmtClass() == CXXStaticCastExprClass;
478 private llvm::TrailingObjects<CXXDynamicCastExpr, CXXBaseSpecifier *> {
484 false, writtenTy, l, RParenLoc,
508 return T->getStmtClass() == CXXDynamicCastExprClass;
522 private llvm::TrailingObjects<CXXReinterpretCastExpr,
523 CXXBaseSpecifier *> {
529 pathSize,
false, writtenTy, l,
530 RParenLoc, AngleBrackets) {}
550 return T->getStmtClass() == CXXReinterpretCastExprClass;
563 private llvm::TrailingObjects<CXXConstCastExpr, CXXBaseSpecifier *> {
568 false, writtenTy, l, RParenLoc,
587 return T->getStmtClass() == CXXConstCastExprClass;
601 private llvm::TrailingObjects<CXXAddrspaceCastExpr, CXXBaseSpecifier *> {
606 false, writtenTy, l, RParenLoc,
624 return T->getStmtClass() == CXXAddrspaceCastExprClass;
661 unsigned NumArgs,
bool HasFPOptions,
715 return S->getStmtClass() == UserDefinedLiteralClass;
730 :
Expr(CXXBoolLiteralExprClass,
Empty) {}
747 return T->getStmtClass() == CXXBoolLiteralExprClass;
774 :
Expr(CXXNullPtrLiteralExprClass,
Empty) {}
783 return T->getStmtClass() == CXXNullPtrLiteralExprClass;
798 Stmt *SubExpr =
nullptr;
801 :
Expr(CXXStdInitializerListExprClass,
Empty) {}
830 return S->getStmtClass() == CXXStdInitializerListExprClass;
849 llvm::PointerUnion<Stmt *, TypeSourceInfo *> Operand;
868 Operand = (
Expr*)
nullptr;
889 assert(
isTypeOperand() &&
"Cannot call getTypeOperand for typeid(expr)");
893 assert(!
isTypeOperand() &&
"Cannot call getExprOperand for typeid(type)");
894 return static_cast<Expr*
>(Operand.get<
Stmt *>());
903 return T->getStmtClass() == CXXTypeidExprClass;
910 auto **begin =
reinterpret_cast<Stmt **
>(&Operand);
946 :
Expr(MSPropertyRefExprClass, ty, VK,
OK_Ordinary), BaseExpr(baseExpr),
947 TheDecl(
decl), MemberLoc(nameLoc), IsArrow(
isArrow),
948 QualifierLoc(qualifierLoc) {
965 else if (QualifierLoc)
983 return T->getStmtClass() == MSPropertyRefExprClass;
1007 enum { BASE_EXPR, IDX_EXPR, NUM_SUBEXPRS = 2 };
1009 Stmt *SubExprs[NUM_SUBEXPRS];
1012 void setBase(
Expr *
Base) { SubExprs[BASE_EXPR] =
Base; }
1013 void setIdx(
Expr *Idx) { SubExprs[IDX_EXPR] = Idx; }
1018 :
Expr(MSPropertySubscriptExprClass, Ty, VK, OK),
1019 RBracketLoc(RBracketLoc) {
1020 SubExprs[BASE_EXPR] =
Base;
1021 SubExprs[IDX_EXPR] = Idx;
1027 :
Expr(MSPropertySubscriptExprClass, Shell) {}
1030 const Expr *
getBase()
const {
return cast<Expr>(SubExprs[BASE_EXPR]); }
1033 const Expr *
getIdx()
const {
return cast<Expr>(SubExprs[IDX_EXPR]); }
1049 return T->getStmtClass() == MSPropertySubscriptExprClass;
1054 return child_range(&SubExprs[0], &SubExprs[0] + NUM_SUBEXPRS);
1070 llvm::PointerUnion<Stmt *, TypeSourceInfo *> Operand;
1078 Guid(Guid),
Range(R) {
1084 Guid(Guid),
Range(R) {
1091 Operand = (
Expr*)
nullptr;
1104 assert(
isTypeOperand() &&
"Cannot call getTypeOperand for __uuidof(expr)");
1108 assert(!
isTypeOperand() &&
"Cannot call getExprOperand for __uuidof(type)");
1109 return static_cast<Expr*
>(Operand.get<
Stmt *>());
1120 return T->getStmtClass() == CXXUuidofExprClass;
1127 auto **begin =
reinterpret_cast<Stmt **
>(&Operand);
1156 CXXThisExprBits.CapturedByCopyInLambdaWithExplicitObjectParameter =
false;
1179 return CXXThisExprBits.CapturedByCopyInLambdaWithExplicitObjectParameter;
1188 return T->getStmtClass() == CXXThisExprClass;
1218 bool IsThrownVariableInScope)
1248 return T->getStmtClass() == CXXThrowExprClass;
1253 return child_range(&Operand, Operand ? &Operand + 1 : &Operand);
1268 private llvm::TrailingObjects<CXXDefaultArgExpr, Expr *> {
1271 friend TrailingObjects;
1282 Param->hasUnparsedDefaultArg()
1283 ? Param->
getType().getNonReferenceType()
1284 : Param->getDefaultArg()->
getType(),
1287 Param(Param), UsedContext(UsedContext) {
1291 *getTrailingObjects<Expr *>() = RewrittenExpr;
1301 static CXXDefaultArgExpr *
CreateEmpty(
const ASTContext &
C,
1302 bool HasRewrittenInit);
1306 static CXXDefaultArgExpr *
Create(
const ASTContext &
C, SourceLocation
Loc,
1307 ParmVarDecl *Param,
Expr *RewrittenExpr,
1308 DeclContext *UsedContext);
1352 return T->getStmtClass() == CXXDefaultArgExprClass;
1375 private llvm::TrailingObjects<CXXDefaultInitExpr, Expr *> {
1379 friend TrailingObjects;
1388 Expr *RewrittenInitExpr);
1391 :
Expr(CXXDefaultInitExprClass,
Empty) {
1397 bool HasRewrittenInit);
1402 Expr *RewrittenInitExpr);
1422 return *getTrailingObjects<Expr *>();
1429 return *getTrailingObjects<Expr *>();
1443 return T->getStmtClass() == CXXDefaultInitExprClass;
1462 : Destructor(destructor) {}
1493 Stmt *SubExpr =
nullptr;
1496 :
Expr(CXXBindTemporaryExprClass, SubExpr->getType(),
VK_PRValue,
1498 Temp(temp), SubExpr(SubExpr) {
1504 :
Expr(CXXBindTemporaryExprClass,
Empty) {}
1527 return T->getStmtClass() == CXXBindTemporaryExprClass;
1573 inline Stmt **getTrailingArgs();
1574 const Stmt *
const *getTrailingArgs()
const {
1583 bool ListInitialization,
bool StdInitListInitialization,
1593 return NumArgs *
sizeof(
Stmt *);
1601 bool HadMultipleCandidates,
bool ListInitialization,
1602 bool StdInitListInitialization,
bool ZeroInitialization,
1682 return reinterpret_cast<const Expr *
const *
>(getTrailingArgs());
1690 assert(Arg <
getNumArgs() &&
"Arg access out of range!");
1694 assert(Arg <
getNumArgs() &&
"Arg access out of range!");
1700 assert(Arg <
getNumArgs() &&
"Arg access out of range!");
1718 return T->getStmtClass() == CXXConstructExprClass ||
1719 T->getStmtClass() == CXXTemporaryObjectExprClass;
1745 LLVM_PREFERRED_TYPE(
bool)
1746 unsigned ConstructsVirtualBase : 1;
1750 LLVM_PREFERRED_TYPE(
bool)
1751 unsigned InheritedFromVirtualBase : 1;
1759 bool InheritedFromVirtualBase)
1761 Constructor(Ctor),
Loc(
Loc),
1762 ConstructsVirtualBase(ConstructsVirtualBase),
1763 InheritedFromVirtualBase(InheritedFromVirtualBase) {
1770 :
Expr(CXXInheritedCtorInitExprClass,
Empty),
1771 ConstructsVirtualBase(
false), InheritedFromVirtualBase(
false) {}
1795 return T->getStmtClass() == CXXInheritedCtorInitExprClass;
1816 private llvm::TrailingObjects<CXXFunctionalCastExpr, CXXBaseSpecifier *,
1817 FPOptionsOverride> {
1828 LParenLoc(lParenLoc), RParenLoc(rParenLoc) {
1838 unsigned numTrailingObjects(OverloadToken<CXXBaseSpecifier *>)
const {
1866 return T->getStmtClass() == CXXFunctionalCastExprClass;
1897 bool HadMultipleCandidates,
bool ListInitialization,
1898 bool StdInitListInitialization,
1899 bool ZeroInitialization);
1907 SourceRange ParenOrBraceRange,
bool HadMultipleCandidates,
1908 bool ListInitialization,
bool StdInitListInitialization,
1909 bool ZeroInitialization);
1920 return T->getStmtClass() == CXXTemporaryObjectExprClass;
1924 Stmt **CXXConstructExpr::getTrailingArgs() {
1925 if (
auto *
E = dyn_cast<CXXTemporaryObjectExpr>(
this))
1926 return reinterpret_cast<Stmt **
>(
E + 1);
1928 "Unexpected class deriving from CXXConstructExpr!");
1929 return reinterpret_cast<Stmt **
>(
this + 1);
1954 private llvm::TrailingObjects<LambdaExpr, Stmt *> {
1978 SourceLocation ClosingBrace,
bool ContainsUnexpandedParameterPack);
1983 Stmt **getStoredStmts() {
return getTrailingObjects<Stmt *>(); }
1984 Stmt *
const *getStoredStmts()
const {
return getTrailingObjects<Stmt *>(); }
1986 void initBodyIfNeeded()
const;
1997 bool ExplicitParams,
bool ExplicitResultType,
1999 bool ContainsUnexpandedParameterPack);
2004 unsigned NumCaptures);
2081 return reinterpret_cast<Expr **
>(getStoredStmts());
2087 return reinterpret_cast<Expr *
const *
>(getStoredStmts());
2147 const auto *ConstThis =
this;
2148 return const_cast<CompoundStmt *
>(ConstThis->getCompoundStmtBody());
2165 return T->getStmtClass() == LambdaExprClass;
2169 return IntroducerRange.getBegin();
2198 :
Expr(CXXScalarValueInitExprClass, Shell) {}
2212 return T->getStmtClass() == CXXScalarValueInitExprClass;
2240 private llvm::TrailingObjects<CXXNewExpr, Stmt *, SourceRange> {
2243 friend TrailingObjects;
2275 unsigned arraySizeOffset()
const {
return 0; }
2276 unsigned initExprOffset()
const {
return arraySizeOffset() +
isArray(); }
2277 unsigned placementNewArgsOffset()
const {
2281 unsigned numTrailingObjects(OverloadToken<Stmt *>)
const {
2285 unsigned numTrailingObjects(OverloadToken<SourceRange>)
const {
2290 CXXNewExpr(
bool IsGlobalNew, FunctionDecl *OperatorNew,
2291 FunctionDecl *OperatorDelete,
bool ShouldPassAlignment,
2292 bool UsualArrayDeleteWantsSize, ArrayRef<Expr *> PlacementArgs,
2293 SourceRange TypeIdParens, std::optional<Expr *> ArraySize,
2295 QualType Ty, TypeSourceInfo *AllocatedTypeInfo, SourceRange
Range,
2296 SourceRange DirectInitRange);
2299 CXXNewExpr(EmptyShell Empty,
bool IsArray,
unsigned NumPlacementArgs,
2300 bool IsParenTypeId);
2305 Create(
const ASTContext &Ctx,
bool IsGlobalNew, FunctionDecl *OperatorNew,
2306 FunctionDecl *OperatorDelete,
bool ShouldPassAlignment,
2307 bool UsualArrayDeleteWantsSize, ArrayRef<Expr *> PlacementArgs,
2308 SourceRange TypeIdParens, std::optional<Expr *> ArraySize,
2310 QualType Ty, TypeSourceInfo *AllocatedTypeInfo, SourceRange
Range,
2311 SourceRange DirectInitRange);
2314 static CXXNewExpr *
CreateEmpty(
const ASTContext &Ctx,
bool IsArray,
2315 bool HasInit,
unsigned NumPlacementArgs,
2316 bool IsParenTypeId);
2323 return AllocatedTypeInfo;
2355 return std::nullopt;
2358 cast_or_null<Expr>(getTrailingObjects<Stmt *>()[arraySizeOffset()]))
2361 return std::nullopt;
2369 return std::nullopt;
2372 cast_or_null<Expr>(getTrailingObjects<Stmt *>()[arraySizeOffset()]))
2375 return std::nullopt;
2383 return reinterpret_cast<Expr **
>(getTrailingObjects<Stmt *>() +
2384 placementNewArgsOffset());
2397 return isParenTypeId() ? getTrailingObjects<SourceRange>()[0]
2415 ? cast<Expr>(getTrailingObjects<Stmt *>()[initExprOffset()])
2420 ? cast<Expr>(getTrailingObjects<Stmt *>()[initExprOffset()])
2452 return getTrailingObjects<Stmt *>() + placementNewArgsOffset();
2458 return getTrailingObjects<Stmt *>() + placementNewArgsOffset();
2468 return raw_arg_begin() + numTrailingObjects(OverloadToken<Stmt *>());
2471 return getTrailingObjects<Stmt *>();
2474 return raw_arg_begin() + numTrailingObjects(OverloadToken<Stmt *>());
2484 return T->getStmtClass() == CXXNewExprClass;
2504 Stmt *Argument =
nullptr;
2508 bool ArrayFormAsWritten,
bool UsualArrayDeleteWantsSize,
2511 OperatorDelete(OperatorDelete), Argument(Arg) {
2553 return T->getStmtClass() == CXXDeleteExprClass;
2568 llvm::PointerUnion<TypeSourceInfo *, const IdentifierInfo *>
Type;
2624 LLVM_PREFERRED_TYPE(
bool)
2658 :
Expr(CXXPseudoDestructorExprClass, Shell), IsArrow(
false) {}
2741 return Base->getBeginLoc();
2746 return T->getStmtClass() == CXXPseudoDestructorExprClass;
2767 private llvm::TrailingObjects<TypeTraitExpr, TypeSourceInfo *> {
2784 size_t numTrailingObjects(OverloadToken<TypeSourceInfo *>)
const {
2818 assert(I <
getNumArgs() &&
"Argument out-of-range");
2831 return T->getStmtClass() == TypeTraitExprClass;
2879 Value(value), Dimension(dimension),
Loc(loc), RParen(rparen),
2880 QueriedType(queried) {
2881 assert(att <=
ATT_Last &&
"invalid enum value!");
2882 assert(
static_cast<unsigned>(att) == ATT &&
"ATT overflow!");
2887 :
Expr(ArrayTypeTraitExprClass,
Empty), ATT(0) {}
2903 return T->getStmtClass() == ArrayTypeTraitExprClass;
2929 LLVM_PREFERRED_TYPE(
bool)
2939 Expr* QueriedExpression =
nullptr;
2947 ET(et),
Value(value),
Loc(loc), RParen(rparen),
2948 QueriedExpression(queried) {
2949 assert(et <=
ET_Last &&
"invalid enum value!");
2950 assert(
static_cast<unsigned>(et) == ET &&
"ET overflow!");
2967 return T->getStmtClass() == ExpressionTraitExprClass;
2999 bool KnownDependent,
bool KnownInstantiationDependent,
3000 bool KnownContainsUnexpandedParameterPack);
3003 bool HasTemplateKWAndArgsInfo);
3044 assert(
E->getType()->isSpecificBuiltinType(BuiltinType::Overload));
3047 bool HasParen = isa<ParenExpr>(
E);
3049 E =
E->IgnoreParens();
3050 if (isa<UnaryOperator>(
E)) {
3051 assert(cast<UnaryOperator>(
E)->getOpcode() == UO_AddrOf);
3052 E = cast<UnaryOperator>(
E)->getSubExpr();
3053 auto *Ovl = cast<OverloadExpr>(
E->IgnoreParens());
3055 Result.HasFormOfMemberPointer = (
E == Ovl && Ovl->getQualifier());
3056 Result.IsAddressOfOperand =
true;
3057 Result.IsAddressOfOperandWithParen = HasParen;
3058 Result.Expression = Ovl;
3060 Result.Expression = cast<OverloadExpr>(
E);
3081 llvm::iterator_range<decls_iterator>
decls()
const {
3160 return T->getStmtClass() == UnresolvedLookupExprClass ||
3161 T->getStmtClass() == UnresolvedMemberExprClass;
3200 private llvm::TrailingObjects<UnresolvedLookupExpr, DeclAccessPair,
3201 ASTTemplateKWAndArgsInfo,
3202 TemplateArgumentLoc> {
3205 friend TrailingObjects;
3232 bool KnownDependent,
bool KnownInstantiationDependent);
3235 bool HasTemplateKWAndArgsInfo);
3237 unsigned numTrailingObjects(OverloadToken<DeclAccessPair>)
const {
3241 unsigned numTrailingObjects(OverloadToken<ASTTemplateKWAndArgsInfo>)
const {
3246 static UnresolvedLookupExpr *
3247 Create(
const ASTContext &Context, CXXRecordDecl *NamingClass,
3248 NestedNameSpecifierLoc QualifierLoc,
3249 const DeclarationNameInfo &NameInfo,
bool RequiresADL,
3250 UnresolvedSetIterator
Begin, UnresolvedSetIterator
End,
3251 bool KnownDependent,
bool KnownInstantiationDependent);
3256 static UnresolvedLookupExpr *
3257 Create(
const ASTContext &Context, CXXRecordDecl *NamingClass,
3258 NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc,
3259 const DeclarationNameInfo &NameInfo,
bool RequiresADL,
3260 const TemplateArgumentListInfo *Args, UnresolvedSetIterator
Begin,
3261 UnresolvedSetIterator
End,
bool KnownDependent,
3262 bool KnownInstantiationDependent);
3264 static UnresolvedLookupExpr *
CreateEmpty(
const ASTContext &Context,
3265 unsigned NumResults,
3266 bool HasTemplateKWAndArgsInfo,
3267 unsigned NumTemplateArgs);
3281 return l.getBeginLoc();
3300 return T->getStmtClass() == UnresolvedLookupExprClass;
3320 private llvm::TrailingObjects<DependentScopeDeclRefExpr,
3321 ASTTemplateKWAndArgsInfo,
3322 TemplateArgumentLoc> {
3325 friend TrailingObjects;
3339 size_t numTrailingObjects(OverloadToken<ASTTemplateKWAndArgsInfo>)
const {
3340 return hasTemplateKWAndArgsInfo();
3343 bool hasTemplateKWAndArgsInfo()
const {
3348 static DependentScopeDeclRefExpr *
3349 Create(
const ASTContext &Context, NestedNameSpecifierLoc QualifierLoc,
3350 SourceLocation TemplateKWLoc,
const DeclarationNameInfo &NameInfo,
3351 const TemplateArgumentListInfo *TemplateArgs);
3353 static DependentScopeDeclRefExpr *
CreateEmpty(
const ASTContext &Context,
3354 bool HasTemplateKWAndArgsInfo,
3355 unsigned NumTemplateArgs);
3381 if (!hasTemplateKWAndArgsInfo())
3383 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->TemplateKWLoc;
3389 if (!hasTemplateKWAndArgsInfo())
3391 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->LAngleLoc;
3397 if (!hasTemplateKWAndArgsInfo())
3399 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->RAngleLoc;
3412 getTrailingObjects<ASTTemplateKWAndArgsInfo>()->copyInto(
3413 getTrailingObjects<TemplateArgumentLoc>(), List);
3420 return getTrailingObjects<TemplateArgumentLoc>();
3427 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->NumTemplateArgs;
3447 return T->getStmtClass() == DependentScopeDeclRefExprClass;
3471 private llvm::TrailingObjects<
3473 llvm::PointerUnion<BlockDecl *, CompoundLiteralExpr *>> {
3483 friend TrailingObjects;
3491 unsigned numObjects);
3494 bool CleanupsHaveSideEffects,
3522 return T->getStmtClass() == ExprWithCleanupsClass;
3556 private llvm::TrailingObjects<CXXUnresolvedConstructExpr, Expr *> {
3558 friend TrailingObjects;
3562 llvm::PointerIntPair<TypeSourceInfo *, 1> TypeAndInitForm;
3575 :
Expr(CXXUnresolvedConstructExprClass,
Empty) {
3595 return TypeAndInitForm.getPointer();
3633 assert(I <
getNumArgs() &&
"Argument index out-of-range");
3638 assert(I <
getNumArgs() &&
"Argument index out-of-range");
3643 assert(I <
getNumArgs() &&
"Argument index out-of-range");
3655 return T->getStmtClass() == CXXUnresolvedConstructExprClass;
3665 auto **begin =
reinterpret_cast<Stmt **
>(
3680 private llvm::TrailingObjects<CXXDependentScopeMemberExpr,
3681 ASTTemplateKWAndArgsInfo,
3682 TemplateArgumentLoc, NamedDecl *> {
3685 friend TrailingObjects;
3721 bool hasTemplateKWAndArgsInfo()
const {
3725 bool hasFirstQualifierFoundInScope()
const {
3729 unsigned numTrailingObjects(OverloadToken<ASTTemplateKWAndArgsInfo>)
const {
3730 return hasTemplateKWAndArgsInfo();
3733 unsigned numTrailingObjects(OverloadToken<TemplateArgumentLoc>)
const {
3737 unsigned numTrailingObjects(OverloadToken<NamedDecl *>)
const {
3738 return hasFirstQualifierFoundInScope();
3741 CXXDependentScopeMemberExpr(
const ASTContext &Ctx,
Expr *
Base,
3742 QualType BaseType,
bool IsArrow,
3743 SourceLocation OperatorLoc,
3744 NestedNameSpecifierLoc QualifierLoc,
3745 SourceLocation TemplateKWLoc,
3746 NamedDecl *FirstQualifierFoundInScope,
3747 DeclarationNameInfo MemberNameInfo,
3748 const TemplateArgumentListInfo *TemplateArgs);
3750 CXXDependentScopeMemberExpr(EmptyShell Empty,
bool HasTemplateKWAndArgsInfo,
3751 bool HasFirstQualifierFoundInScope);
3754 static CXXDependentScopeMemberExpr *
3755 Create(
const ASTContext &Ctx,
Expr *
Base, QualType BaseType,
bool IsArrow,
3756 SourceLocation OperatorLoc, NestedNameSpecifierLoc QualifierLoc,
3757 SourceLocation TemplateKWLoc, NamedDecl *FirstQualifierFoundInScope,
3758 DeclarationNameInfo MemberNameInfo,
3759 const TemplateArgumentListInfo *TemplateArgs);
3761 static CXXDependentScopeMemberExpr *
3762 CreateEmpty(
const ASTContext &Ctx,
bool HasTemplateKWAndArgsInfo,
3763 unsigned NumTemplateArgs,
bool HasFirstQualifierFoundInScope);
3771 return cast<Expr>(
Base)->isImplicitCXXThis();
3778 return cast<Expr>(
Base);
3813 if (!hasFirstQualifierFoundInScope())
3815 return *getTrailingObjects<NamedDecl *>();
3820 return MemberNameInfo;
3833 if (!hasTemplateKWAndArgsInfo())
3835 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->TemplateKWLoc;
3841 if (!hasTemplateKWAndArgsInfo())
3843 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->LAngleLoc;
3849 if (!hasTemplateKWAndArgsInfo())
3851 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->RAngleLoc;
3865 getTrailingObjects<ASTTemplateKWAndArgsInfo>()->copyInto(
3866 getTrailingObjects<TemplateArgumentLoc>(), List);
3875 return getTrailingObjects<TemplateArgumentLoc>();
3884 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->NumTemplateArgs;
3893 return Base->getBeginLoc();
3906 return T->getStmtClass() == CXXDependentScopeMemberExprClass;
3940 private llvm::TrailingObjects<UnresolvedMemberExpr, DeclAccessPair,
3941 ASTTemplateKWAndArgsInfo,
3942 TemplateArgumentLoc> {
3945 friend TrailingObjects;
3983 bool HasTemplateKWAndArgsInfo);
3985 unsigned numTrailingObjects(OverloadToken<DeclAccessPair>)
const {
3989 unsigned numTrailingObjects(OverloadToken<ASTTemplateKWAndArgsInfo>)
const {
3994 static UnresolvedMemberExpr *
3995 Create(
const ASTContext &Context,
bool HasUnresolvedUsing,
Expr *
Base,
3996 QualType BaseType,
bool IsArrow, SourceLocation OperatorLoc,
3997 NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc,
3998 const DeclarationNameInfo &MemberNameInfo,
3999 const TemplateArgumentListInfo *TemplateArgs,
4000 UnresolvedSetIterator
Begin, UnresolvedSetIterator
End);
4002 static UnresolvedMemberExpr *
CreateEmpty(
const ASTContext &Context,
4003 unsigned NumResults,
4004 bool HasTemplateKWAndArgsInfo,
4005 unsigned NumTemplateArgs);
4017 return cast<Expr>(
Base);
4021 return cast<Expr>(
Base);
4062 return Base->getBeginLoc();
4064 return l.getBeginLoc();
4075 return T->getStmtClass() == UnresolvedMemberExprClass;
4093 if (
auto *ULE = dyn_cast<UnresolvedLookupExpr>(
this))
4095 return cast<UnresolvedMemberExpr>(
this)->getTrailingObjects<
DeclAccessPair>();
4102 if (
auto *ULE = dyn_cast<UnresolvedLookupExpr>(
this))
4104 return cast<UnresolvedMemberExpr>(
this)
4109 if (
auto *ULE = dyn_cast<UnresolvedLookupExpr>(
this))
4111 return cast<UnresolvedMemberExpr>(
this)
4116 if (
auto *ULE = dyn_cast<UnresolvedLookupExpr>(
this))
4117 return ULE->getNamingClass();
4118 return cast<UnresolvedMemberExpr>(
this)->getNamingClass();
4135 Operand(Operand),
Range(Keyword, RParen) {
4151 return T->getStmtClass() == CXXNoexceptExprClass;
4190 unsigned NumExpansions;
4196 std::optional<unsigned> NumExpansions)
4199 EllipsisLoc(EllipsisLoc),
4200 NumExpansions(NumExpansions ? *NumExpansions + 1 : 0),
4221 return NumExpansions - 1;
4223 return std::nullopt;
4233 return T->getStmtClass() == PackExpansionExprClass;
4257 private llvm::TrailingObjects<SizeOfPackExpr, TemplateArgument> {
4260 friend TrailingObjects;
4290 std::optional<unsigned> Length,
4293 OperatorLoc(OperatorLoc), PackLoc(PackLoc), RParenLoc(RParenLoc),
4294 Length(Length ? *Length : PartialArgs.size()), Pack(Pack) {
4295 assert((!Length || PartialArgs.empty()) &&
4296 "have partial args for non-dependent sizeof... expression");
4297 auto *Args = getTrailingObjects<TemplateArgument>();
4298 std::uninitialized_copy(PartialArgs.begin(), PartialArgs.end(), Args);
4300 : ExprDependence::ValueInstantiation);
4305 :
Expr(SizeOfPackExprClass,
Empty), Length(NumPartialArgs) {}
4308 static SizeOfPackExpr *
4309 Create(ASTContext &Context, SourceLocation OperatorLoc, NamedDecl *Pack,
4310 SourceLocation PackLoc, SourceLocation RParenLoc,
4311 std::optional<unsigned> Length = std::nullopt,
4312 ArrayRef<TemplateArgument> PartialArgs = std::nullopt);
4314 unsigned NumPartialArgs);
4334 "Cannot get the length of a value-dependent pack size expression");
4350 const auto *Args = getTrailingObjects<TemplateArgument>();
4358 return T->getStmtClass() == SizeOfPackExprClass;
4373 private llvm::TrailingObjects<PackIndexingExpr, Expr *> {
4376 friend TrailingObjects;
4387 unsigned TransformedExpressions : 31;
4389 LLVM_PREFERRED_TYPE(
bool)
4390 unsigned ExpandedToEmptyPack : 1;
4395 bool ExpandedToEmptyPack =
false)
4397 EllipsisLoc(EllipsisLoc), RSquareLoc(RSquareLoc),
4398 SubExprs{PackIdExpr, IndexExpr},
4399 TransformedExpressions(SubstitutedExprs.size()),
4400 ExpandedToEmptyPack(ExpandedToEmptyPack) {
4402 auto *Exprs = getTrailingObjects<Expr *>();
4403 std::uninitialized_copy(SubstitutedExprs.begin(), SubstitutedExprs.end(),
4412 PackIndexingExpr(EmptyShell Empty) :
Expr(PackIndexingExprClass,
Empty) {}
4414 unsigned numTrailingObjects(OverloadToken<Expr *>)
const {
4415 return TransformedExpressions;
4419 static PackIndexingExpr *
Create(ASTContext &Context,
4420 SourceLocation EllipsisLoc,
4421 SourceLocation RSquareLoc,
Expr *PackIdExpr,
4422 Expr *IndexExpr, std::optional<int64_t> Index,
4423 ArrayRef<Expr *> SubstitutedExprs = {},
4424 bool ExpandedToEmptyPack =
false);
4426 unsigned NumTransformedExprs);
4451 return std::nullopt;
4454 assert(Index.isNonNegative() &&
"Invalid index");
4455 return static_cast<unsigned>(Index.getExtValue());
4460 assert(Index &&
"extracting the indexed expression of a dependant pack");
4461 return getTrailingObjects<Expr *>()[*Index];
4466 return {getTrailingObjects<Expr *>(), TransformedExpressions};
4470 return T->getStmtClass() == PackIndexingExprClass;
4493 llvm::PointerIntPair<Decl *, 1, bool> AssociatedDeclAndRef;
4495 unsigned Index : 15;
4496 unsigned PackIndex : 16;
4499 :
Expr(SubstNonTypeTemplateParmExprClass,
Empty) {}
4504 Decl *AssociatedDecl,
unsigned Index,
4505 std::optional<unsigned> PackIndex,
bool RefParam)
4506 :
Expr(SubstNonTypeTemplateParmExprClass, Ty, ValueKind,
OK_Ordinary),
4507 Replacement(Replacement),
4508 AssociatedDeclAndRef(AssociatedDecl, RefParam), Index(Index),
4509 PackIndex(PackIndex ? *PackIndex + 1 : 0) {
4510 assert(AssociatedDecl !=
nullptr);
4533 return std::nullopt;
4534 return PackIndex - 1;
4545 return s->getStmtClass() == SubstNonTypeTemplateParmExprClass;
4573 Decl *AssociatedDecl;
4580 unsigned NumArguments : 16;
4582 unsigned Index : 16;
4588 :
Expr(SubstNonTypeTemplateParmPackExprClass,
Empty) {}
4594 Decl *AssociatedDecl,
unsigned Index);
4618 return T->getStmtClass() == SubstNonTypeTemplateParmPackExprClass;
4647 private llvm::TrailingObjects<FunctionParmPackExpr, VarDecl *> {
4650 friend TrailingObjects;
4659 unsigned NumParameters;
4671 unsigned NumParams);
4695 return T->getStmtClass() == FunctionParmPackExprClass;
4732 llvm::PointerUnion<Stmt *, LifetimeExtendedTemporaryDecl *>
State;
4736 bool BoundToLvalueReference,
4740 :
Expr(MaterializeTemporaryExprClass,
Empty) {}
4762 "the temporary has not been lifetime extended");
4811 return T->getStmtClass() == MaterializeTemporaryExprClass;
4824 State.getAddrOfPtr1() + 1)
4843 enum SubExpr { Callee, LHS, RHS, Count };
4850 unsigned NumExpansions;
4851 Stmt *SubExprs[SubExpr::Count];
4858 std::optional<unsigned> NumExpansions);
4889 return NumExpansions - 1;
4890 return std::nullopt;
4910 return T->getStmtClass() == CXXFoldExprClass;
4915 return child_range(SubExprs, SubExprs + SubExpr::Count);
4953 private llvm::TrailingObjects<CXXParenListInitExpr, Expr *> {
4959 unsigned NumUserSpecifiedExprs;
4961 llvm::PointerUnion<Expr *, FieldDecl *> ArrayFillerOrUnionFieldInit;
4967 NumExprs(Args.size()), NumUserSpecifiedExprs(NumUserSpecifiedExprs),
4968 InitLoc(InitLoc), LParenLoc(LParenLoc), RParenLoc(RParenLoc) {
4969 std::copy(Args.begin(), Args.end(), getTrailingObjects<Expr *>());
4970 assert(NumExprs >= NumUserSpecifiedExprs &&
4971 "number of user specified inits is greater than the number of "
4976 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
return NumExprs; }
4979 static CXXParenListInitExpr *
4980 Create(ASTContext &
C, ArrayRef<Expr *> Args, QualType
T,
4981 unsigned NumUserSpecifiedExprs, SourceLocation InitLoc,
4982 SourceLocation LParenLoc, SourceLocation RParenLoc);
4984 static CXXParenListInitExpr *
CreateEmpty(ASTContext &
C,
unsigned numExprs,
4988 :
Expr(CXXParenListInitExprClass,
Empty), NumExprs(NumExprs),
4989 NumUserSpecifiedExprs(0) {}
4994 return ArrayRef(getTrailingObjects<Expr *>(), NumExprs);
4998 return ArrayRef(getTrailingObjects<Expr *>(), NumExprs);
5002 return ArrayRef(getTrailingObjects<Expr *>(), NumUserSpecifiedExprs);
5006 return ArrayRef(getTrailingObjects<Expr *>(), NumUserSpecifiedExprs);
5022 return ArrayFillerOrUnionFieldInit.dyn_cast<
Expr *>();
5026 return ArrayFillerOrUnionFieldInit.dyn_cast<
Expr *>();
5030 ArrayFillerOrUnionFieldInit = FD;
5034 return ArrayFillerOrUnionFieldInit.dyn_cast<
FieldDecl *>();
5038 return ArrayFillerOrUnionFieldInit.dyn_cast<
FieldDecl *>();
5042 Stmt **
Begin =
reinterpret_cast<Stmt **
>(getTrailingObjects<Expr *>());
5048 reinterpret_cast<Stmt *
const *
>(getTrailingObjects<Expr *>());
5053 return T->getStmtClass() == CXXParenListInitExprClass;
5075 enum SubExpr { Operand, Common, Ready, Suspend, Resume, Count };
5077 Stmt *SubExprs[SubExpr::Count];
5089 KeywordLoc(KeywordLoc), OpaqueValue(OpaqueValue) {
5090 SubExprs[SubExpr::Operand] = Operand;
5091 SubExprs[SubExpr::Common] = Common;
5092 SubExprs[SubExpr::Ready] = Ready;
5093 SubExprs[SubExpr::Suspend] = Suspend;
5094 SubExprs[SubExpr::Resume] = Resume;
5102 "wrong constructor for non-dependent co_await/co_yield expression");
5103 SubExprs[SubExpr::Operand] = Operand;
5104 SubExprs[SubExpr::Common] = Common;
5105 SubExprs[SubExpr::Ready] =
nullptr;
5106 SubExprs[SubExpr::Suspend] =
nullptr;
5107 SubExprs[SubExpr::Resume] =
nullptr;
5112 SubExprs[SubExpr::Operand] =
nullptr;
5113 SubExprs[SubExpr::Common] =
nullptr;
5114 SubExprs[SubExpr::Ready] =
nullptr;
5115 SubExprs[SubExpr::Suspend] =
nullptr;
5116 SubExprs[SubExpr::Resume] =
nullptr;
5120 return static_cast<Expr*
>(SubExprs[SubExpr::Common]);
5127 return static_cast<Expr*
>(SubExprs[SubExpr::Ready]);
5131 return static_cast<Expr*
>(SubExprs[SubExpr::Suspend]);
5135 return static_cast<Expr*
>(SubExprs[SubExpr::Resume]);
5140 return static_cast<Expr *
>(SubExprs[SubExpr::Operand]);
5145 assert(SuspendExpr);
5147 auto SuspendType = SuspendExpr->getType();
5149 if (SuspendType->isVoidType())
5151 if (SuspendType->isBooleanType())
5157 assert(SuspendType->isVoidPointerType());
5170 return child_range(SubExprs, SubExprs + SubExpr::Count);
5178 return T->getStmtClass() == CoawaitExprClass ||
5179 T->getStmtClass() == CoyieldExprClass;
5192 Ready, Suspend, Resume, OpaqueValue) {
5197 Expr *Common,
bool IsImplicit =
false)
5210 return T->getStmtClass() == CoawaitExprClass;
5226 KeywordLoc(KeywordLoc) {
5230 "wrong constructor for non-dependent co_await/co_yield expression");
5232 SubExprs[1] = OpCoawait;
5237 :
Expr(DependentCoawaitExprClass,
Empty) {}
5242 return cast<UnresolvedLookupExpr>(SubExprs[1]);
5260 return T->getStmtClass() == DependentCoawaitExprClass;
5273 Ready, Suspend, Resume, OpaqueValue) {}
5282 return T->getStmtClass() == CoyieldExprClass;
5291 private llvm::TrailingObjects<BuiltinBitCastExpr, CXXBaseSpecifier *> {
5294 friend TrailingObjects;
5305 KWLoc(KWLoc), RParenLoc(RParenLoc) {}
5313 return T->getStmtClass() == BuiltinBitCastExprClass;
5328 Loc(
Loc), SourceTy(SourceTy) {
5333 :
Expr(SYCLBuiltinNumFieldsExprClass,
Empty) {}
5341 return static_cast<unsigned>(
5360 return T->getStmtClass() == SYCLBuiltinNumFieldsExprClass;
5375 Stmt *Index =
nullptr;
5380 :
Expr(SYCLBuiltinFieldTypeExprClass, FieldTy, ValueKind,
OK_Ordinary),
5381 Loc(
Loc), SourceTy(SourceTy), Index(Index) {
5386 :
Expr(SYCLBuiltinFieldTypeExprClass,
Empty) {}
5400 return T->getStmtClass() == SYCLBuiltinFieldTypeExprClass;
5420 Loc(
Loc), SourceTy(SourceTy) {
5425 :
Expr(SYCLBuiltinNumBasesExprClass,
Empty) {}
5433 return RD->getNumBases();
5451 return T->getStmtClass() == SYCLBuiltinNumBasesExprClass;
5462 Stmt *Index =
nullptr;
5468 Loc(
Loc), SourceTy(SourceTy), Index(Index) {
5473 :
Expr(SYCLBuiltinBaseTypeExprClass,
Empty) {}
5487 return T->getStmtClass() == SYCLBuiltinBaseTypeExprClass;
This file provides AST data structures related to concepts.
enum clang::sema::@1659::IndirectLocalPathEntry::EntryKind Kind
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....
Defines the C++ template declaration subclasses.
Defines the ExceptionSpecificationType enumeration and various utility functions.
Defines enumerations for expression traits intrinsics.
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
Defines several types used to describe C++ lambda expressions that are shared between the parser and ...
Defines the clang::LangOptions interface.
Defines an enumeration for C++ overloaded operators.
Defines the clang::SourceLocation class and associated facilities.
Defines various enumerations that describe declaration and type specifiers.
static QualType getPointeeType(const MemRegion *R)
Defines enumerations for the type traits support.
C Language Family Type Representation.
__device__ __2f16 float __ockl_bool s
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat],...
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Reads an AST files chain containing the contents of a translation unit.
An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent.
ArrayTypeTraitExpr(SourceLocation loc, ArrayTypeTrait att, TypeSourceInfo *queried, uint64_t value, Expr *dimension, SourceLocation rparen, QualType ty)
uint64_t getValue() const
TypeSourceInfo * getQueriedTypeSourceInfo() const
SourceLocation getEndLoc() const LLVM_READONLY
ArrayTypeTrait getTrait() const
QualType getQueriedType() const
ArrayTypeTraitExpr(EmptyShell Empty)
Expr * getDimensionExpression() const
const_child_range children() const
static bool classof(const Stmt *T)
SourceLocation getBeginLoc() const LLVM_READONLY
StringRef getOpcodeStr() const
Represents a C++2a __builtin_bit_cast(T, v) expression.
static bool classof(const Stmt *T)
SourceLocation getEndLoc() const LLVM_READONLY
BuiltinBitCastExpr(EmptyShell Empty)
BuiltinBitCastExpr(QualType T, ExprValueKind VK, CastKind CK, Expr *SrcExpr, TypeSourceInfo *DstType, SourceLocation KWLoc, SourceLocation RParenLoc)
SourceLocation getBeginLoc() const LLVM_READONLY
Represents a call to a CUDA kernel function.
static CUDAKernelCallExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, bool HasFPFeatures, EmptyShell Empty)
static CUDAKernelCallExpr * Create(const ASTContext &Ctx, Expr *Fn, CallExpr *Config, ArrayRef< Expr * > Args, QualType Ty, ExprValueKind VK, SourceLocation RP, FPOptionsOverride FPFeatures, unsigned MinNumArgs=0)
static bool classof(const Stmt *T)
const CallExpr * getConfig() const
A C++ addrspace_cast expression (currently only enabled for OpenCL).
static bool classof(const Stmt *T)
static CXXAddrspaceCastExpr * CreateEmpty(const ASTContext &Context)
static CXXAddrspaceCastExpr * Create(const ASTContext &Context, QualType T, ExprValueKind VK, CastKind Kind, Expr *Op, TypeSourceInfo *WrittenTy, SourceLocation L, SourceLocation RParenLoc, SourceRange AngleBrackets)
Represents binding an expression to a temporary.
CXXBindTemporaryExpr(EmptyShell Empty)
static bool classof(const Stmt *T)
void setTemporary(CXXTemporary *T)
const_child_range children() const
const Expr * getSubExpr() const
static CXXBindTemporaryExpr * Create(const ASTContext &C, CXXTemporary *Temp, Expr *SubExpr)
SourceLocation getEndLoc() const LLVM_READONLY
CXXTemporary * getTemporary()
const CXXTemporary * getTemporary() const
SourceLocation getBeginLoc() const LLVM_READONLY
A boolean literal, per ([C++ lex.bool] Boolean literals).
const_child_range children() const
CXXBoolLiteralExpr(bool Val, QualType Ty, SourceLocation Loc)
SourceLocation getEndLoc() const
static bool classof(const Stmt *T)
CXXBoolLiteralExpr(EmptyShell Empty)
SourceLocation getBeginLoc() const
static CXXBoolLiteralExpr * Create(const ASTContext &C, bool Val, QualType Ty, SourceLocation Loc)
SourceLocation getLocation() const
void setLocation(SourceLocation L)
A C++ const_cast expression (C++ [expr.const.cast]).
static bool classof(const Stmt *T)
static CXXConstCastExpr * Create(const ASTContext &Context, QualType T, ExprValueKind VK, Expr *Op, TypeSourceInfo *WrittenTy, SourceLocation L, SourceLocation RParenLoc, SourceRange AngleBrackets)
static CXXConstCastExpr * CreateEmpty(const ASTContext &Context)
Represents a call to a C++ constructor.
SourceRange getParenOrBraceRange() const
const_arg_iterator arg_end() const
void setStdInitListInitialization(bool V)
void setConstructionKind(CXXConstructionKind CK)
void setIsImmediateEscalating(bool Set)
llvm::iterator_range< arg_iterator > arg_range
bool isElidable() const
Whether this construction is elidable.
const Expr *const * getArgs() const
bool hadMultipleCandidates() const
Whether the referred constructor was resolved from an overloaded set having size greater than 1.
static CXXConstructExpr * Create(const ASTContext &Ctx, QualType Ty, SourceLocation Loc, CXXConstructorDecl *Ctor, bool Elidable, ArrayRef< Expr * > Args, bool HadMultipleCandidates, bool ListInitialization, bool StdInitListInitialization, bool ZeroInitialization, CXXConstructionKind ConstructKind, SourceRange ParenOrBraceRange)
Create a C++ construction expression.
const Expr * getArg(unsigned Arg) const
CXXConstructExpr(StmtClass SC, QualType Ty, SourceLocation Loc, CXXConstructorDecl *Ctor, bool Elidable, ArrayRef< Expr * > Args, bool HadMultipleCandidates, bool ListInitialization, bool StdInitListInitialization, bool ZeroInitialization, CXXConstructionKind ConstructKind, SourceRange ParenOrBraceRange)
Build a C++ construction expression.
bool isStdInitListInitialization() const
Whether this constructor call was written as list-initialization, but was interpreted as forming a st...
void setListInitialization(bool V)
bool isImmediateEscalating() const
bool requiresZeroInitialization() const
Whether this construction first requires zero-initialization before the initializer is called.
void setRequiresZeroInitialization(bool ZeroInit)
SourceLocation getLocation() const
const_arg_range arguments() const
Expr * getArg(unsigned Arg)
Return the specified argument.
static unsigned sizeOfTrailingObjects(unsigned NumArgs)
Return the size in bytes of the trailing objects.
void setArg(unsigned Arg, Expr *ArgExpr)
Set the specified argument.
SourceLocation getEndLoc() const LLVM_READONLY
llvm::iterator_range< const_arg_iterator > const_arg_range
SourceLocation getBeginLoc() const LLVM_READONLY
void setParenOrBraceRange(SourceRange Range)
const_arg_iterator arg_begin() const
const_child_range children() const
bool isListInitialization() const
Whether this constructor call was written as list-initialization.
unsigned getNumArgs() const
Return the number of arguments to the constructor call.
CXXConstructionKind getConstructionKind() const
Determine whether this constructor is actually constructing a base class (rather than a complete obje...
void setHadMultipleCandidates(bool V)
void setLocation(SourceLocation Loc)
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will (ultimately) call.
static bool classof(const Stmt *T)
static CXXConstructExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs)
Create an empty C++ construction expression.
Represents a C++ constructor within a class.
A default argument (C++ [dcl.fct.default]).
SourceLocation getEndLoc() const
const_child_range children() const
SourceLocation getBeginLoc() const
Default argument expressions have no representation in the source, so they have an empty source range...
DeclContext * getUsedContext()
const ParmVarDecl * getParam() const
SourceLocation getUsedLocation() const
Retrieve the location where this default argument was actually used.
const Expr * getExpr() const
const Expr * getAdjustedRewrittenExpr() const
Expr * getAdjustedRewrittenExpr()
SourceLocation getExprLoc() const
static CXXDefaultArgExpr * Create(const ASTContext &C, SourceLocation Loc, ParmVarDecl *Param, Expr *RewrittenExpr, DeclContext *UsedContext)
static bool classof(const Stmt *T)
Expr * getRewrittenExpr()
static CXXDefaultArgExpr * CreateEmpty(const ASTContext &C, bool HasRewrittenInit)
const Expr * getRewrittenExpr() const
const DeclContext * getUsedContext() const
bool hasRewrittenInit() const
A use of a default initializer in a constructor or in aggregate initialization.
static CXXDefaultInitExpr * Create(const ASTContext &Ctx, SourceLocation Loc, FieldDecl *Field, DeclContext *UsedContext, Expr *RewrittenInitExpr)
Field is the non-static data member whose default initializer is used by this expression.
static bool classof(const Stmt *T)
bool hasRewrittenInit() const
Expr * getExpr()
Get the initialization expression that will be used.
static CXXDefaultInitExpr * CreateEmpty(const ASTContext &C, bool HasRewrittenInit)
Expr * getRewrittenExpr()
Retrieve the initializing expression with evaluated immediate calls, if any.
const FieldDecl * getField() const
SourceLocation getBeginLoc() const
const Expr * getRewrittenExpr() const
Retrieve the initializing expression with evaluated immediate calls, if any.
const Expr * getExpr() const
SourceLocation getEndLoc() const
const_child_range children() const
const DeclContext * getUsedContext() const
SourceLocation getUsedLocation() const
Retrieve the location where this default initializer expression was actually used.
DeclContext * getUsedContext()
FieldDecl * getField()
Get the field whose initializer will be used.
Represents a delete expression for memory deallocation and destructor calls, e.g.
static bool classof(const Stmt *T)
const Expr * getArgument() const
SourceLocation getEndLoc() const LLVM_READONLY
CXXDeleteExpr(EmptyShell Shell)
const_child_range children() const
SourceLocation getBeginLoc() const
FunctionDecl * getOperatorDelete() const
bool isGlobalDelete() const
bool doesUsualArrayDeleteWantSize() const
Answers whether the usual array deallocation function for the allocated type expects the size of the ...
QualType getDestroyedType() const
Retrieve the type being destroyed.
bool isArrayFormAsWritten() const
CXXDeleteExpr(QualType Ty, bool GlobalDelete, bool ArrayForm, bool ArrayFormAsWritten, bool UsualArrayDeleteWantsSize, FunctionDecl *OperatorDelete, Expr *Arg, SourceLocation Loc)
Represents a C++ member access expression where the actual member referenced could not be resolved be...
bool isArrow() const
Determine whether this member expression used the '->' operator; otherwise, it used the '.
SourceLocation getOperatorLoc() const
Retrieve the location of the '->' or '.' operator.
static CXXDependentScopeMemberExpr * Create(const ASTContext &Ctx, Expr *Base, QualType BaseType, bool IsArrow, SourceLocation OperatorLoc, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, NamedDecl *FirstQualifierFoundInScope, DeclarationNameInfo MemberNameInfo, const TemplateArgumentListInfo *TemplateArgs)
const DeclarationNameInfo & getMemberNameInfo() const
Retrieve the name of the member that this expression refers to.
SourceLocation getLAngleLoc() const
Retrieve the location of the left angle bracket starting the explicit template argument list followin...
SourceLocation getTemplateKeywordLoc() const
Retrieve the location of the template keyword preceding the member name, if any.
Expr * getBase() const
Retrieve the base object of this member expressions, e.g., the x in x.m.
SourceLocation getBeginLoc() const LLVM_READONLY
void copyTemplateArgumentsInto(TemplateArgumentListInfo &List) const
Copies the template arguments (if present) into the given structure.
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
ArrayRef< TemplateArgumentLoc > template_arguments() const
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the member name.
bool hasExplicitTemplateArgs() const
Determines whether this member expression actually had a C++ template argument list explicitly specif...
static CXXDependentScopeMemberExpr * CreateEmpty(const ASTContext &Ctx, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs, bool HasFirstQualifierFoundInScope)
SourceLocation getMemberLoc() const
static bool classof(const Stmt *T)
SourceLocation getRAngleLoc() const
Retrieve the location of the right angle bracket ending the explicit template argument list following...
QualType getBaseType() const
DeclarationName getMember() const
Retrieve the name of the member that this expression refers to.
SourceLocation getEndLoc() const LLVM_READONLY
const TemplateArgumentLoc * getTemplateArgs() const
Retrieve the template arguments provided as part of this template-id.
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the member name, with source location information.
const_child_range children() const
bool hasTemplateKeyword() const
Determines whether the member name was preceded by the template keyword.
bool isImplicitAccess() const
True if this is an implicit access, i.e.
NamedDecl * getFirstQualifierFoundInScope() const
Retrieve the first part of the nested-name-specifier that was found in the scope of the member access...
Represents a C++ destructor within a class.
A C++ dynamic_cast expression (C++ [expr.dynamic.cast]).
static bool classof(const Stmt *T)
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)
static CXXDynamicCastExpr * CreateEmpty(const ASTContext &Context, unsigned pathSize)
bool isAlwaysNull() const
isAlwaysNull - Return whether the result of the dynamic_cast is proven to always be null.
Represents a folding of a pack over an operator.
static bool classof(const Stmt *T)
SourceLocation getBeginLoc() const LLVM_READONLY
CXXFoldExpr(EmptyShell Empty)
UnresolvedLookupExpr * getCallee() const
Expr * getInit() const
Get the operand that doesn't contain a pack, for a binary fold.
SourceLocation getEndLoc() const LLVM_READONLY
const_child_range children() const
SourceLocation getLParenLoc() const
SourceLocation getEllipsisLoc() const
bool isLeftFold() const
Does this produce a left-associated sequence of operators?
CXXFoldExpr(QualType T, UnresolvedLookupExpr *Callee, SourceLocation LParenLoc, Expr *LHS, BinaryOperatorKind Opcode, SourceLocation EllipsisLoc, Expr *RHS, SourceLocation RParenLoc, std::optional< unsigned > NumExpansions)
std::optional< unsigned > getNumExpansions() const
bool isRightFold() const
Does this produce a right-associated sequence of operators?
Expr * getPattern() const
Get the pattern, that is, the operand that contains an unexpanded pack.
SourceLocation getRParenLoc() const
BinaryOperatorKind getOperator() const
Represents an explicit C++ type conversion that uses "functional" notation (C++ [expr....
void setLParenLoc(SourceLocation L)
SourceLocation getLParenLoc() const
static CXXFunctionalCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize, bool HasFPFeatures)
SourceLocation getRParenLoc() const
SourceLocation getBeginLoc() const LLVM_READONLY
void setRParenLoc(SourceLocation L)
static bool classof(const Stmt *T)
bool isListInitialization() const
Determine whether this expression models list-initialization.
SourceLocation getEndLoc() const LLVM_READONLY
static CXXFunctionalCastExpr * Create(const ASTContext &Context, QualType T, ExprValueKind VK, TypeSourceInfo *Written, CastKind Kind, Expr *Op, const CXXCastPath *Path, FPOptionsOverride FPO, SourceLocation LPLoc, SourceLocation RPLoc)
Represents a call to an inherited base class constructor from an inheriting constructor.
CXXInheritedCtorInitExpr(EmptyShell Empty)
Construct an empty C++ inheriting construction expression.
const_child_range children() const
CXXConstructionKind getConstructionKind() const
SourceLocation getBeginLoc() const LLVM_READONLY
static bool classof(const Stmt *T)
bool constructsVBase() const
Determine whether this constructor is actually constructing a base class (rather than a complete obje...
CXXInheritedCtorInitExpr(SourceLocation Loc, QualType T, CXXConstructorDecl *Ctor, bool ConstructsVirtualBase, bool InheritedFromVirtualBase)
Construct a C++ inheriting construction expression.
SourceLocation getLocation() const LLVM_READONLY
SourceLocation getEndLoc() const LLVM_READONLY
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will call.
bool inheritedFromVBase() const
Determine whether the inherited constructor is inherited from a virtual base of the object we constru...
Represents a call to a member function that may be written either with member call syntax (e....
CXXMethodDecl * getMethodDecl() const
Retrieve the declaration of the called method.
Expr * getImplicitObjectArgument() const
Retrieve the implicit object argument for the member call.
static CXXMemberCallExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, bool HasFPFeatures, EmptyShell Empty)
static CXXMemberCallExpr * Create(const ASTContext &Ctx, Expr *Fn, ArrayRef< Expr * > Args, QualType Ty, ExprValueKind VK, SourceLocation RP, FPOptionsOverride FPFeatures, unsigned MinNumArgs=0)
QualType getObjectType() const
Retrieve the type of the object argument.
SourceLocation getExprLoc() const LLVM_READONLY
static bool classof(const Stmt *T)
CXXRecordDecl * getRecordDecl() const
Retrieve the CXXRecordDecl for the underlying type of the implicit object argument.
Represents a static or instance method of a struct/union/class.
Abstract class common to all of the C++ "named"/"keyword" casts.
SourceLocation getBeginLoc() const LLVM_READONLY
SourceLocation getOperatorLoc() const
Retrieve the location of the cast operator keyword, e.g., static_cast.
const char * getCastName() const
getCastName - Get the name of the C++ cast being used, e.g., "static_cast", "dynamic_cast",...
CXXNamedCastExpr(StmtClass SC, QualType ty, ExprValueKind VK, CastKind kind, Expr *op, unsigned PathSize, bool HasFPFeatures, TypeSourceInfo *writtenTy, SourceLocation l, SourceLocation RParenLoc, SourceRange AngleBrackets)
static bool classof(const Stmt *T)
CXXNamedCastExpr(StmtClass SC, EmptyShell Shell, unsigned PathSize, bool HasFPFeatures)
SourceRange getAngleBrackets() const LLVM_READONLY
SourceLocation getEndLoc() const LLVM_READONLY
SourceLocation getRParenLoc() const
Retrieve the location of the closing parenthesis.
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)".
llvm::iterator_range< const_arg_iterator > placement_arguments() const
static CXXNewExpr * CreateEmpty(const ASTContext &Ctx, bool IsArray, bool HasInit, unsigned NumPlacementArgs, bool IsParenTypeId)
Create an empty c++ new expression.
Expr * getPlacementArg(unsigned I)
const CXXConstructExpr * getConstructExpr() const
Returns the CXXConstructExpr from this new-expression, or null.
SourceRange getDirectInitRange() const
QualType getAllocatedType() const
Expr ** getPlacementArgs()
arg_iterator placement_arg_end()
const_arg_iterator placement_arg_begin() const
SourceLocation getEndLoc() const
CXXNewInitializationStyle getInitializationStyle() const
The kind of initializer this new-expression has.
bool hasInitializer() const
Whether this new-expression has any initializer at all.
bool shouldNullCheckAllocation() const
True if the allocation result needs to be null-checked.
static bool classof(const Stmt *T)
SourceLocation getBeginLoc() const
void setOperatorDelete(FunctionDecl *D)
bool passAlignment() const
Indicates whether the required alignment should be implicitly passed to the allocation function.
unsigned getNumPlacementArgs() const
Expr * getInitializer()
The initializer of this new-expression.
const_arg_iterator placement_arg_end() const
TypeSourceInfo * getAllocatedTypeSourceInfo() const
SourceRange getSourceRange() const
SourceRange getTypeIdParens() const
bool isParenTypeId() const
llvm::iterator_range< arg_iterator > placement_arguments()
FunctionDecl * getOperatorDelete() const
raw_arg_iterator raw_arg_end()
bool doesUsualArrayDeleteWantSize() const
Answers whether the usual array deallocation function for the allocated type expects the size of the ...
std::optional< const Expr * > getArraySize() const
This might return std::nullopt even if isArray() returns true, since there might not be an array size...
const_arg_iterator raw_arg_end() const
const_child_range children() const
arg_iterator placement_arg_begin()
raw_arg_iterator raw_arg_begin()
const Expr * getInitializer() const
void setOperatorNew(FunctionDecl *D)
const_arg_iterator raw_arg_begin() const
const Expr * getPlacementArg(unsigned I) const
FunctionDecl * getOperatorNew() const
std::optional< Expr * > getArraySize()
This might return std::nullopt even if isArray() returns true, since there might not be an array size...
static CXXNewExpr * Create(const ASTContext &Ctx, bool IsGlobalNew, FunctionDecl *OperatorNew, FunctionDecl *OperatorDelete, bool ShouldPassAlignment, bool UsualArrayDeleteWantsSize, ArrayRef< Expr * > PlacementArgs, SourceRange TypeIdParens, std::optional< Expr * > ArraySize, CXXNewInitializationStyle InitializationStyle, Expr *Initializer, QualType Ty, TypeSourceInfo *AllocatedTypeInfo, SourceRange Range, SourceRange DirectInitRange)
Create a c++ new expression.
Represents a C++11 noexcept expression (C++ [expr.unary.noexcept]).
static bool classof(const Stmt *T)
Expr * getOperand() const
const_child_range children() const
SourceLocation getEndLoc() const
SourceLocation getBeginLoc() const
SourceRange getSourceRange() const
CXXNoexceptExpr(EmptyShell Empty)
CXXNoexceptExpr(QualType Ty, Expr *Operand, CanThrowResult Val, SourceLocation Keyword, SourceLocation RParen)
The null pointer literal (C++11 [lex.nullptr])
const_child_range children() const
CXXNullPtrLiteralExpr(EmptyShell Empty)
void setLocation(SourceLocation L)
SourceLocation getEndLoc() const
static bool classof(const Stmt *T)
CXXNullPtrLiteralExpr(QualType Ty, SourceLocation Loc)
SourceLocation getLocation() const
SourceLocation getBeginLoc() const
A call to an overloaded operator written using operator syntax.
bool isInfixBinaryOp() const
Is this written as an infix binary operator?
bool isAssignmentOp() const
static bool classof(const Stmt *T)
SourceLocation getOperatorLoc() const
Returns the location of the operator symbol in the expression.
SourceLocation getEndLoc() const
SourceLocation getExprLoc() const LLVM_READONLY
OverloadedOperatorKind getOperator() const
Returns the kind of overloaded operator that this expression refers to.
static CXXOperatorCallExpr * Create(const ASTContext &Ctx, OverloadedOperatorKind OpKind, Expr *Fn, ArrayRef< Expr * > Args, QualType Ty, ExprValueKind VK, SourceLocation OperatorLoc, FPOptionsOverride FPFeatures, ADLCallKind UsesADL=NotADL)
static CXXOperatorCallExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, bool HasFPFeatures, EmptyShell Empty)
SourceLocation getBeginLoc() const
static bool isComparisonOp(OverloadedOperatorKind Opc)
static bool isAssignmentOp(OverloadedOperatorKind Opc)
bool isComparisonOp() const
SourceRange getSourceRange() const
Represents a list-initialization with parenthesis.
FieldDecl * getInitializedFieldInUnion()
const ArrayRef< Expr * > getInitExprs() const
SourceRange getSourceRange() const LLVM_READONLY
ArrayRef< Expr * > getUserSpecifiedInitExprs()
static CXXParenListInitExpr * Create(ASTContext &C, ArrayRef< Expr * > Args, QualType T, unsigned NumUserSpecifiedExprs, SourceLocation InitLoc, SourceLocation LParenLoc, SourceLocation RParenLoc)
const_child_range children() const
ArrayRef< Expr * > getInitExprs()
void setInitializedFieldInUnion(FieldDecl *FD)
SourceLocation getEndLoc() const LLVM_READONLY
SourceLocation getInitLoc() const LLVM_READONLY
const FieldDecl * getInitializedFieldInUnion() const
CXXParenListInitExpr(EmptyShell Empty, unsigned NumExprs)
friend class TrailingObjects
static CXXParenListInitExpr * CreateEmpty(ASTContext &C, unsigned numExprs, EmptyShell Empty)
SourceLocation getBeginLoc() const LLVM_READONLY
static bool classof(const Stmt *T)
const ArrayRef< Expr * > getUserSpecifiedInitExprs() const
const Expr * getArrayFiller() const
void setArrayFiller(Expr *E)
Represents a C++ pseudo-destructor (C++ [expr.pseudo]).
SourceLocation getBeginLoc() const LLVM_READONLY
bool isArrow() const
Determine whether this pseudo-destructor expression was written using an '->' (otherwise,...
CXXPseudoDestructorExpr(const ASTContext &Context, Expr *Base, bool isArrow, SourceLocation OperatorLoc, NestedNameSpecifierLoc QualifierLoc, TypeSourceInfo *ScopeType, SourceLocation ColonColonLoc, SourceLocation TildeLoc, PseudoDestructorTypeStorage DestroyedType)
static bool classof(const Stmt *T)
SourceLocation getTildeLoc() const
Retrieve the location of the '~'.
TypeSourceInfo * getScopeTypeInfo() const
Retrieve the scope type in a qualified pseudo-destructor expression.
NestedNameSpecifierLoc getQualifierLoc() const
Retrieves the nested-name-specifier that qualifies the type name, with source-location information.
SourceLocation getEndLoc() const LLVM_READONLY
SourceLocation getDestroyedTypeLoc() const
Retrieve the starting location of the type being destroyed.
const IdentifierInfo * getDestroyedTypeIdentifier() const
In a dependent pseudo-destructor expression for which we do not have full type information on the des...
SourceLocation getColonColonLoc() const
Retrieve the location of the '::' in a qualified pseudo-destructor expression.
const_child_range children() const
QualType getDestroyedType() const
Retrieve the type being destroyed.
SourceLocation getOperatorLoc() const
Retrieve the location of the '.' or '->' operator.
NestedNameSpecifier * getQualifier() const
If the member name was qualified, retrieves the nested-name-specifier that precedes the member name.
void setDestroyedType(IdentifierInfo *II, SourceLocation Loc)
Set the name of destroyed type for a dependent pseudo-destructor expression.
TypeSourceInfo * getDestroyedTypeInfo() const
Retrieve the source location information for the type being destroyed.
void setDestroyedType(TypeSourceInfo *Info)
Set the destroyed type.
bool hasQualifier() const
Determines whether this member expression actually had a C++ nested-name-specifier prior to the name ...
CXXPseudoDestructorExpr(EmptyShell Shell)
Represents a C++ struct/union/class.
A C++ reinterpret_cast expression (C++ [expr.reinterpret.cast]).
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)
static bool classof(const Stmt *T)
static CXXReinterpretCastExpr * CreateEmpty(const ASTContext &Context, unsigned pathSize)
A rewritten comparison expression that was originally written using operator syntax.
SourceLocation getOperatorLoc() const LLVM_READONLY
BinaryOperatorKind getOperator() const
bool isComparisonOp() const
SourceLocation getEndLoc() const LLVM_READONLY
SourceRange getSourceRange() const LLVM_READONLY
bool isReversed() const
Determine whether this expression was rewritten in reverse form.
CXXRewrittenBinaryOperator(Expr *SemanticForm, bool IsReversed)
StringRef getOpcodeStr() const
CXXRewrittenBinaryOperator(EmptyShell Empty)
SourceLocation getBeginLoc() const LLVM_READONLY
Compute the begin and end locations from the decomposed form.
SourceLocation getExprLoc() const LLVM_READONLY
const Expr * getRHS() const
static bool classof(const Stmt *T)
Expr * getSemanticForm()
Get an equivalent semantic form for this expression.
const Expr * getSemanticForm() const
BinaryOperatorKind getOpcode() const
const Expr * getLHS() const
bool isAssignmentOp() const
static StringRef getOpcodeStr(BinaryOperatorKind Op)
DecomposedForm getDecomposedForm() const LLVM_READONLY
Decompose this operator into its syntactic form.
An expression "T()" which creates a value-initialized rvalue of type T, which is a non-class type.
CXXScalarValueInitExpr(EmptyShell Shell)
const_child_range children() const
SourceLocation getBeginLoc() const LLVM_READONLY
TypeSourceInfo * getTypeSourceInfo() const
static bool classof(const Stmt *T)
SourceLocation getEndLoc() const
SourceLocation getRParenLoc() const
CXXScalarValueInitExpr(QualType Type, TypeSourceInfo *TypeInfo, SourceLocation RParenLoc)
Create an explicitly-written scalar-value initialization expression.
A C++ static_cast expression (C++ [expr.static.cast]).
static CXXStaticCastExpr * Create(const ASTContext &Context, QualType T, ExprValueKind VK, CastKind K, Expr *Op, const CXXCastPath *Path, TypeSourceInfo *Written, FPOptionsOverride FPO, SourceLocation L, SourceLocation RParenLoc, SourceRange AngleBrackets)
static CXXStaticCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize, bool hasFPFeatures)
static bool classof(const Stmt *T)
Implicit construction of a std::initializer_list<T> object from an array temporary within list-initia...
SourceRange getSourceRange() const LLVM_READONLY
Retrieve the source range of the expression.
const_child_range children() const
CXXStdInitializerListExpr(QualType Ty, Expr *SubExpr)
SourceLocation getEndLoc() const LLVM_READONLY
SourceLocation getBeginLoc() const LLVM_READONLY
const Expr * getSubExpr() const
static bool classof(const Stmt *S)
Represents a C++ functional cast expression that builds a temporary object.
static CXXTemporaryObjectExpr * Create(const ASTContext &Ctx, CXXConstructorDecl *Cons, QualType Ty, TypeSourceInfo *TSI, ArrayRef< Expr * > Args, SourceRange ParenOrBraceRange, bool HadMultipleCandidates, bool ListInitialization, bool StdInitListInitialization, bool ZeroInitialization)
TypeSourceInfo * getTypeSourceInfo() const
SourceLocation getEndLoc() const LLVM_READONLY
static CXXTemporaryObjectExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs)
static bool classof(const Stmt *T)
SourceLocation getBeginLoc() const LLVM_READONLY
Represents a C++ temporary.
const CXXDestructorDecl * getDestructor() const
void setDestructor(const CXXDestructorDecl *Dtor)
static CXXTemporary * Create(const ASTContext &C, const CXXDestructorDecl *Destructor)
Represents the this expression in C++.
void setCapturedByCopyInLambdaWithExplicitObjectParameter(bool Set)
SourceLocation getBeginLoc() const
void setLocation(SourceLocation L)
SourceLocation getEndLoc() const
bool isCapturedByCopyInLambdaWithExplicitObjectParameter() const
static CXXThisExpr * CreateEmpty(const ASTContext &Ctx)
static bool classof(const Stmt *T)
const_child_range children() const
static CXXThisExpr * Create(const ASTContext &Ctx, SourceLocation L, QualType Ty, bool IsImplicit)
SourceLocation getLocation() const
A C++ throw-expression (C++ [except.throw]).
CXXThrowExpr(EmptyShell Empty)
const Expr * getSubExpr() const
const_child_range children() const
SourceLocation getEndLoc() const LLVM_READONLY
CXXThrowExpr(Expr *Operand, QualType Ty, SourceLocation Loc, bool IsThrownVariableInScope)
SourceLocation getThrowLoc() const
SourceLocation getBeginLoc() const
bool isThrownVariableInScope() const
Determines whether the variable thrown by this expression (if any!) is within the innermost try block...
static bool classof(const Stmt *T)
A C++ typeid expression (C++ [expr.typeid]), which gets the type_info that corresponds to the supplie...
CXXTypeidExpr(QualType Ty, Expr *Operand, SourceRange R)
static bool classof(const Stmt *T)
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
QualType getTypeOperand(ASTContext &Context) const
Retrieves the type operand of this typeid() expression after various required adjustments (removing r...
CXXTypeidExpr(QualType Ty, TypeSourceInfo *Operand, SourceRange R)
bool isTypeOperand() const
SourceLocation getBeginLoc() const LLVM_READONLY
bool isMostDerived(ASTContext &Context) const
Best-effort check if the expression operand refers to a most derived object.
SourceRange getSourceRange() const LLVM_READONLY
void setSourceRange(SourceRange R)
const_child_range children() const
Expr * getExprOperand() const
SourceLocation getEndLoc() const LLVM_READONLY
bool isPotentiallyEvaluated() const
Determine whether this typeid has a type operand which is potentially evaluated, per C++11 [expr....
CXXTypeidExpr(EmptyShell Empty, bool isExpr)
bool hasNullCheck() const
Whether this is of a form like "typeid(*ptr)" that can throw a std::bad_typeid if a pointer is a null...
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
const_child_range children() const
const Expr *const * const_arg_iterator
void setRParenLoc(SourceLocation L)
void setArg(unsigned I, Expr *E)
SourceLocation getLParenLoc() const
Retrieve the location of the left parentheses ('(') that precedes the argument list.
bool isListInitialization() const
Determine whether this expression models list-initialization.
static CXXUnresolvedConstructExpr * Create(const ASTContext &Context, QualType T, TypeSourceInfo *TSI, SourceLocation LParenLoc, ArrayRef< Expr * > Args, SourceLocation RParenLoc, bool IsListInit)
const_arg_range arguments() const
const Expr * getArg(unsigned I) const
QualType getTypeAsWritten() const
Retrieve the type that is being constructed, as specified in the source code.
const_arg_iterator arg_end() const
TypeSourceInfo * getTypeSourceInfo() const
Retrieve the type source information for the type being constructed.
SourceLocation getEndLoc() const LLVM_READONLY
llvm::iterator_range< const_arg_iterator > const_arg_range
void setLParenLoc(SourceLocation L)
SourceLocation getRParenLoc() const
Retrieve the location of the right parentheses (')') that follows the argument list.
Expr * getArg(unsigned I)
SourceLocation getBeginLoc() const LLVM_READONLY
unsigned getNumArgs() const
Retrieve the number of arguments.
static bool classof(const Stmt *T)
static CXXUnresolvedConstructExpr * CreateEmpty(const ASTContext &Context, unsigned NumArgs)
llvm::iterator_range< arg_iterator > arg_range
const_arg_iterator arg_begin() const
A Microsoft C++ __uuidof expression, which gets the _GUID that corresponds to the supplied type or ex...
Expr * getExprOperand() const
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
SourceLocation getBeginLoc() const LLVM_READONLY
static bool classof(const Stmt *T)
const_child_range children() const
MSGuidDecl * getGuidDecl() const
CXXUuidofExpr(QualType Ty, TypeSourceInfo *Operand, MSGuidDecl *Guid, SourceRange R)
QualType getTypeOperand(ASTContext &Context) const
Retrieves the type operand of this __uuidof() expression after various required adjustments (removing...
bool isTypeOperand() const
CXXUuidofExpr(QualType Ty, Expr *Operand, MSGuidDecl *Guid, SourceRange R)
void setSourceRange(SourceRange R)
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation getEndLoc() const LLVM_READONLY
CXXUuidofExpr(EmptyShell Empty, bool isExpr)
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
static constexpr ADLCallKind NotADL
Stmt * getPreArg(unsigned I)
SourceLocation getBeginLoc() const LLVM_READONLY
Expr * getArg(unsigned Arg)
getArg - Return the specified argument.
SourceLocation getRParenLoc() const
static constexpr ADLCallKind UsesADL
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
FPOptionsOverride * getTrailingFPFeatures()
Return a pointer to the trailing FPOptions.
unsigned path_size() const
bool hasStoredFPFeatures() const
Represents a 'co_await' expression.
void setIsImplicit(bool value=true)
static bool classof(const Stmt *T)
CoawaitExpr(EmptyShell Empty)
CoawaitExpr(SourceLocation CoawaitLoc, QualType Ty, Expr *Operand, Expr *Common, bool IsImplicit=false)
CoawaitExpr(SourceLocation CoawaitLoc, Expr *Operand, Expr *Common, Expr *Ready, Expr *Suspend, Expr *Resume, OpaqueValueExpr *OpaqueValue, bool IsImplicit=false)
CompoundStmt - This represents a group of statements like { stmt stmt }.
ConstantExpr - An expression that occurs in a constant context and optionally the result of evaluatin...
llvm::APSInt getResultAsAPSInt() const
Represents an expression that might suspend coroutine execution; either a co_await or co_yield expres...
Expr * getSuspendExpr() const
SuspendReturnType getSuspendReturnType() const
CoroutineSuspendExpr(StmtClass SC, SourceLocation KeywordLoc, Expr *Operand, Expr *Common, Expr *Ready, Expr *Suspend, Expr *Resume, OpaqueValueExpr *OpaqueValue)
SourceLocation getKeywordLoc() const
SourceLocation getBeginLoc() const LLVM_READONLY
CoroutineSuspendExpr(StmtClass SC, SourceLocation KeywordLoc, QualType Ty, Expr *Operand, Expr *Common)
static bool classof(const Stmt *T)
Expr * getCommonExpr() const
const_child_range children() const
Expr * getOperand() const
Expr * getReadyExpr() const
CoroutineSuspendExpr(StmtClass SC, EmptyShell Empty)
Expr * getResumeExpr() const
OpaqueValueExpr * getOpaqueValue() const
getOpaqueValue - Return the opaque value placeholder.
SourceLocation getEndLoc() const LLVM_READONLY
Represents a 'co_yield' expression.
CoyieldExpr(EmptyShell Empty)
CoyieldExpr(SourceLocation CoyieldLoc, Expr *Operand, Expr *Common, Expr *Ready, Expr *Suspend, Expr *Resume, OpaqueValueExpr *OpaqueValue)
static bool classof(const Stmt *T)
CoyieldExpr(SourceLocation CoyieldLoc, QualType Ty, Expr *Operand, Expr *Common)
A POD class for pairing a NamedDecl* with an access specifier.
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
Decl - This represents one declaration (or definition), e.g.
The name of a declaration.
Represents a 'co_await' expression while the type of the promise is dependent.
static bool classof(const Stmt *T)
DependentCoawaitExpr(EmptyShell Empty)
SourceLocation getEndLoc() const LLVM_READONLY
const_child_range children() const
Expr * getOperand() const
UnresolvedLookupExpr * getOperatorCoawaitLookup() const
SourceLocation getBeginLoc() const LLVM_READONLY
DependentCoawaitExpr(SourceLocation KeywordLoc, QualType Ty, Expr *Op, UnresolvedLookupExpr *OpCoawait)
SourceLocation getKeywordLoc() const
A qualified reference to a name whose declaration cannot yet be resolved.
static DependentScopeDeclRefExpr * Create(const ASTContext &Context, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, const DeclarationNameInfo &NameInfo, const TemplateArgumentListInfo *TemplateArgs)
const DeclarationNameInfo & getNameInfo() const
Retrieve the name that this expression refers to.
SourceLocation getRAngleLoc() const
Retrieve the location of the right angle bracket ending the explicit template argument list following...
static DependentScopeDeclRefExpr * CreateEmpty(const ASTContext &Context, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name, with source location information.
SourceLocation getLocation() const
Retrieve the location of the name within the expression.
SourceLocation getLAngleLoc() const
Retrieve the location of the left angle bracket starting the explicit template argument list followin...
const_child_range children() const
static bool classof(const Stmt *T)
bool hasExplicitTemplateArgs() const
Determines whether this lookup had explicit template arguments.
SourceLocation getEndLoc() const LLVM_READONLY
SourceLocation getBeginLoc() const LLVM_READONLY
Note: getBeginLoc() is the start of the whole DependentScopeDeclRefExpr, and differs from getLocation...
SourceLocation getTemplateKeywordLoc() const
Retrieve the location of the template keyword preceding this name, if any.
bool hasTemplateKeyword() const
Determines whether the name was preceded by the template keyword.
TemplateArgumentLoc const * getTemplateArgs() const
unsigned getNumTemplateArgs() const
DeclarationName getDeclName() const
Retrieve the name that this expression refers to.
void copyTemplateArgumentsInto(TemplateArgumentListInfo &List) const
Copies the template arguments (if present) into the given structure.
ArrayRef< TemplateArgumentLoc > template_arguments() const
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies this declaration.
ExplicitCastExpr - An explicit cast written in the source code.
ExplicitCastExpr(StmtClass SC, QualType exprTy, ExprValueKind VK, CastKind kind, Expr *op, unsigned PathSize, bool HasFPFeatures, TypeSourceInfo *writtenTy)
Represents an expression – generally a full-expression – that introduces cleanups to be run at the en...
bool cleanupsHaveSideEffects() const
static bool classof(const Stmt *T)
CleanupObject getObject(unsigned i) const
unsigned getNumObjects() const
ArrayRef< CleanupObject > getObjects() const
SourceLocation getEndLoc() const LLVM_READONLY
const_child_range children() const
llvm::PointerUnion< BlockDecl *, CompoundLiteralExpr * > CleanupObject
The type of objects that are kept in the cleanup.
SourceLocation getBeginLoc() const LLVM_READONLY
static ExprWithCleanups * Create(const ASTContext &C, EmptyShell empty, unsigned numObjects)
This represents one expression.
bool isImplicitCXXThis() const
Whether this expression is an implicit reference to 'this' in C++.
bool isValueDependent() const
Determines whether the value of this expression depends on.
ExprValueKind getValueKind() const
getValueKind - The value kind that this expression produces.
bool isTypeDependent() const
Determines whether the type of this expression depends on.
bool containsUnexpandedParameterPack() const
Whether this expression contains an unexpanded parameter pack (for C++11 variadic templates).
bool isLValue() const
isLValue - True if this expression is an "l-value" according to the rules of the current language.
ExprObjectKind getObjectKind() const
getObjectKind - The object kind that this expression produces.
bool isInstantiationDependent() const
Whether this expression is instantiation-dependent, meaning that it depends in some way on.
void setValueKind(ExprValueKind Cat)
setValueKind - Set the value kind produced by this expression.
SourceLocation getExprLoc() const LLVM_READONLY
getExprLoc - Return the preferred location for the arrow when diagnosing a problem with a generic exp...
static ExprValueKind getValueKindForType(QualType T)
getValueKindForType - Given a formal return or parameter type, give its value kind.
void setDependence(ExprDependence Deps)
Each concrete expr subclass is expected to compute its dependence and call this in the constructor.
An expression trait intrinsic.
ExpressionTraitExpr(SourceLocation loc, ExpressionTrait et, Expr *queried, bool value, SourceLocation rparen, QualType resultType)
static bool classof(const Stmt *T)
Expr * getQueriedExpression() const
ExpressionTraitExpr(EmptyShell Empty)
SourceLocation getBeginLoc() const LLVM_READONLY
ExpressionTrait getTrait() const
SourceLocation getEndLoc() const LLVM_READONLY
const_child_range children() const
Represents difference between two FPOptions values.
bool requiresTrailingStorage() const
Represents a member of a struct/union/class.
FullExpr - Represents a "full-expression" node.
Represents a function declaration or definition.
Represents a reference to a function parameter pack or init-capture pack that has been substituted bu...
const_child_range children() const
SourceLocation getEndLoc() const LLVM_READONLY
VarDecl * getParameterPack() const
Get the parameter pack which this expression refers to.
SourceLocation getBeginLoc() const LLVM_READONLY
VarDecl *const * iterator
Iterators over the parameters which the parameter pack expanded into.
unsigned getNumExpansions() const
Get the number of parameters in this parameter pack.
static bool classof(const Stmt *T)
SourceLocation getParameterPackLocation() const
Get the location of the parameter pack.
static FunctionParmPackExpr * Create(const ASTContext &Context, QualType T, VarDecl *ParamPack, SourceLocation NameLoc, ArrayRef< VarDecl * > Params)
VarDecl * getExpansion(unsigned I) const
Get an expansion of the parameter pack by index.
static FunctionParmPackExpr * CreateEmpty(const ASTContext &Context, unsigned NumParams)
Declaration of a template function.
One of these records is kept for each identifier that is lexed.
Describes the capture of a variable or of this, or of a C++1y init-capture.
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
capture_iterator capture_begin() const
Retrieve an iterator pointing to the first lambda capture.
static LambdaExpr * CreateDeserialized(const ASTContext &C, unsigned NumCaptures)
Construct a new lambda expression that will be deserialized from an external source.
static LambdaExpr * Create(const ASTContext &C, CXXRecordDecl *Class, SourceRange IntroducerRange, LambdaCaptureDefault CaptureDefault, SourceLocation CaptureDefaultLoc, bool ExplicitParams, bool ExplicitResultType, ArrayRef< Expr * > CaptureInits, SourceLocation ClosingBrace, bool ContainsUnexpandedParameterPack)
Construct a new lambda expression.
llvm::iterator_range< capture_init_iterator > capture_inits()
Retrieve the initialization expressions for this lambda's captures.
SourceLocation getEndLoc() const LLVM_READONLY
Stmt * getBody() const
Retrieve the body of the lambda.
bool hasExplicitParameters() const
Determine whether this lambda has an explicit parameter list vs.
const_capture_init_iterator capture_init_begin() const
Retrieve the first initialization argument for this lambda expression (which initializes the first ca...
bool isGenericLambda() const
Whether this is a generic lambda.
SourceRange getIntroducerRange() const
Retrieve the source range covering the lambda introducer, which contains the explicit capture list su...
bool isMutable() const
Determine whether the lambda is mutable, meaning that any captures values can be modified.
capture_iterator implicit_capture_end() const
Retrieve an iterator pointing past the end of the sequence of implicit lambda captures.
llvm::iterator_range< const_capture_init_iterator > capture_inits() const
Retrieve the initialization expressions for this lambda's captures.
unsigned capture_size() const
Determine the number of captures in this lambda.
capture_range explicit_captures() const
Retrieve this lambda's explicit captures.
bool isInitCapture(const LambdaCapture *Capture) const
Determine whether one of this lambda's captures is an init-capture.
const_capture_init_iterator capture_init_end() const
Retrieve the iterator pointing one past the last initialization argument for this lambda expression.
CXXMethodDecl * getCallOperator() const
Retrieve the function call operator associated with this lambda expression.
const CompoundStmt * getCompoundStmtBody() const
Retrieve the CompoundStmt representing the body of the lambda.
bool hasExplicitResultType() const
Whether this lambda had its result type explicitly specified.
capture_range implicit_captures() const
Retrieve this lambda's implicit captures.
TemplateParameterList * getTemplateParameterList() const
If this is a generic lambda expression, retrieve the template parameter list associated with it,...
ArrayRef< NamedDecl * > getExplicitTemplateParameters() const
Get the template parameters were explicitly specified (as opposed to being invented by use of an auto...
capture_iterator implicit_capture_begin() const
Retrieve an iterator pointing to the first implicit lambda capture.
capture_iterator explicit_capture_end() const
Retrieve an iterator pointing past the end of the sequence of explicit lambda captures.
capture_iterator capture_end() const
Retrieve an iterator pointing past the end of the sequence of lambda captures.
llvm::iterator_range< capture_iterator > capture_range
An iterator over a range of lambda captures.
SourceLocation getCaptureDefaultLoc() const
Retrieve the location of this lambda's capture-default, if any.
capture_init_iterator capture_init_end()
Retrieve the iterator pointing one past the last initialization argument for this lambda expression.
const LambdaCapture * capture_iterator
An iterator that walks over the captures of the lambda, both implicit and explicit.
Expr *const * const_capture_init_iterator
Const iterator that walks over the capture initialization arguments.
Expr * getTrailingRequiresClause() const
Get the trailing requires clause, if any.
capture_iterator explicit_capture_begin() const
Retrieve an iterator pointing to the first explicit lambda capture.
child_range children()
Includes the captures and the body of the lambda.
FunctionTemplateDecl * getDependentCallOperator() const
Retrieve the function template call operator associated with this lambda expression.
SourceLocation getBeginLoc() const LLVM_READONLY
static bool classof(const Stmt *T)
capture_range captures() const
Retrieve this lambda's captures.
capture_init_iterator capture_init_begin()
Retrieve the first initialization argument for this lambda expression (which initializes the first ca...
CompoundStmt * getCompoundStmtBody()
LambdaCaptureDefault getCaptureDefault() const
Determine the default capture kind for this lambda.
CXXRecordDecl * getLambdaClass() const
Retrieve the class that corresponds to the lambda.
Implicit declaration of a temporary that was materialized by a MaterializeTemporaryExpr and lifetime-...
unsigned getManglingNumber() const
ValueDecl * getExtendingDecl()
Stmt::child_range childrenExpr()
Expr * getTemporaryExpr()
Retrieve the expression to which the temporary materialization conversion was applied.
StorageDuration getStorageDuration() const
Retrieve the storage duration for the materialized temporary.
An instance of this class represents the declaration of a property member.
A member reference to an MSPropertyDecl.
const_child_range children() const
NestedNameSpecifierLoc getQualifierLoc() const
MSPropertyDecl * getPropertyDecl() const
MSPropertyRefExpr(EmptyShell Empty)
bool isImplicitAccess() const
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation getEndLoc() const
MSPropertyRefExpr(Expr *baseExpr, MSPropertyDecl *decl, bool isArrow, QualType ty, ExprValueKind VK, NestedNameSpecifierLoc qualifierLoc, SourceLocation nameLoc)
static bool classof(const Stmt *T)
Expr * getBaseExpr() const
SourceLocation getBeginLoc() const
SourceLocation getMemberLoc() const
MS property subscript expression.
static bool classof(const Stmt *T)
const Expr * getBase() const
void setRBracketLoc(SourceLocation L)
SourceLocation getEndLoc() const LLVM_READONLY
MSPropertySubscriptExpr(Expr *Base, Expr *Idx, QualType Ty, ExprValueKind VK, ExprObjectKind OK, SourceLocation RBracketLoc)
SourceLocation getExprLoc() const LLVM_READONLY
const_child_range children() const
MSPropertySubscriptExpr(EmptyShell Shell)
Create an empty array subscript expression.
SourceLocation getBeginLoc() const LLVM_READONLY
const Expr * getIdx() const
SourceLocation getRBracketLoc() const
Represents a prvalue temporary that is written into memory so that a reference can bind to it.
const ValueDecl * getExtendingDecl() const
MaterializeTemporaryExpr(QualType T, Expr *Temporary, bool BoundToLvalueReference, LifetimeExtendedTemporaryDecl *MTD=nullptr)
StorageDuration getStorageDuration() const
Retrieve the storage duration for the materialized temporary.
LifetimeExtendedTemporaryDecl * getLifetimeExtendedTemporaryDecl()
bool isBoundToLvalueReference() const
Determine whether this materialized temporary is bound to an lvalue reference; otherwise,...
ValueDecl * getExtendingDecl()
Get the declaration which triggered the lifetime-extension of this temporary, if any.
Expr * getSubExpr() const
Retrieve the temporary-generating subexpression whose value will be materialized into a glvalue.
bool isUsableInConstantExpressions(const ASTContext &Context) const
Determine whether this temporary object is usable in constant expressions, as specified in C++20 [exp...
MaterializeTemporaryExpr(EmptyShell Empty)
const LifetimeExtendedTemporaryDecl * getLifetimeExtendedTemporaryDecl() const
void setExtendingDecl(ValueDecl *ExtendedBy, unsigned ManglingNumber)
SourceLocation getEndLoc() const LLVM_READONLY
APValue * getOrCreateValue(bool MayCreate) const
Get the storage for the constant value of a materialized temporary of static storage duration.
static bool classof(const Stmt *T)
SourceLocation getBeginLoc() const LLVM_READONLY
unsigned getManglingNumber() const
const_child_range children() const
This represents a decl that may have a name.
A C++ nested-name-specifier augmented with source location information.
SourceLocation getBeginLoc() const
Retrieve the location of the beginning of this nested-name-specifier.
NestedNameSpecifier * getNestedNameSpecifier() const
Retrieve the nested-name-specifier to which this instance refers.
bool hasQualifier() const
Evaluates true when this nested-name-specifier location is non-empty.
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
NonTypeTemplateParmDecl - Declares a non-type template parameter, e.g., "Size" in.
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class.
A reference to an overloaded function set, either an UnresolvedLookupExpr or an UnresolvedMemberExpr.
llvm::iterator_range< decls_iterator > decls() const
static bool classof(const Stmt *T)
ASTTemplateKWAndArgsInfo * getTrailingASTTemplateKWAndArgsInfo()
Return the optional template keyword and arguments info.
bool hasExplicitTemplateArgs() const
Determines whether this expression had explicit template arguments.
static FindResult find(Expr *E)
Finds the overloaded expression in the given expression E of OverloadTy.
SourceLocation getLAngleLoc() const
Retrieve the location of the left angle bracket starting the explicit template argument list followin...
SourceLocation getNameLoc() const
Gets the location of the name.
decls_iterator decls_begin() const
CXXRecordDecl * getNamingClass()
Gets the naming class of this lookup, if any.
const CXXRecordDecl * getNamingClass() const
unsigned getNumDecls() const
Gets the number of declarations in the unresolved set.
TemplateArgumentLoc const * getTemplateArgs() const
NestedNameSpecifier * getQualifier() const
Fetches the nested-name qualifier, if one was given.
const DeclarationNameInfo & getNameInfo() const
Gets the full name info.
const TemplateArgumentLoc * getTrailingTemplateArgumentLoc() const
SourceLocation getTemplateKeywordLoc() const
Retrieve the location of the template keyword preceding this name, if any.
NestedNameSpecifierLoc getQualifierLoc() const
Fetches the nested-name qualifier with source-location information, if one was given.
const ASTTemplateKWAndArgsInfo * getTrailingASTTemplateKWAndArgsInfo() const
const DeclAccessPair * getTrailingResults() const
void copyTemplateArgumentsInto(TemplateArgumentListInfo &List) const
Copies the template arguments into the given structure.
TemplateArgumentLoc * getTrailingTemplateArgumentLoc()
Return the optional template arguments.
DeclAccessPair * getTrailingResults()
Return the results. Defined after UnresolvedMemberExpr.
OverloadExpr(StmtClass SC, const ASTContext &Context, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, const DeclarationNameInfo &NameInfo, const TemplateArgumentListInfo *TemplateArgs, UnresolvedSetIterator Begin, UnresolvedSetIterator End, bool KnownDependent, bool KnownInstantiationDependent, bool KnownContainsUnexpandedParameterPack)
bool hasTemplateKWAndArgsInfo() const
decls_iterator decls_end() const
unsigned getNumTemplateArgs() const
DeclarationName getName() const
Gets the name looked up.
SourceLocation getRAngleLoc() const
Retrieve the location of the right angle bracket ending the explicit template argument list following...
bool hasTemplateKeyword() const
Determines whether the name was preceded by the template keyword.
ArrayRef< TemplateArgumentLoc > template_arguments() const
Represents a C++11 pack expansion that produces a sequence of expressions.
const Expr * getPattern() const
Retrieve the pattern of the pack expansion.
PackExpansionExpr(QualType T, Expr *Pattern, SourceLocation EllipsisLoc, std::optional< unsigned > NumExpansions)
SourceLocation getBeginLoc() const LLVM_READONLY
SourceLocation getEndLoc() const LLVM_READONLY
std::optional< unsigned > getNumExpansions() const
Determine the number of expansions that will be produced when this pack expansion is instantiated,...
const_child_range children() const
SourceLocation getEllipsisLoc() const
Retrieve the location of the ellipsis that describes this pack expansion.
PackExpansionExpr(EmptyShell Empty)
Expr * getPattern()
Retrieve the pattern of the pack expansion.
static bool classof(const Stmt *T)
std::optional< unsigned > getSelectedIndex() const
NamedDecl * getPackDecl() const
static PackIndexingExpr * CreateDeserialized(ASTContext &Context, unsigned NumTransformedExprs)
SourceLocation getEllipsisLoc() const
Determine the location of the 'sizeof' keyword.
Expr * getSelectedExpr() const
Expr * getPackIdExpression() const
SourceLocation getEndLoc() const LLVM_READONLY
SourceLocation getPackLoc() const
Determine the location of the parameter pack.
SourceLocation getRSquareLoc() const
Determine the location of the right parenthesis.
ArrayRef< Expr * > getExpressions() const
Return the trailing expressions, regardless of the expansion.
bool expandsToEmptyPack() const
Determine if the expression was expanded to empty.
static PackIndexingExpr * Create(ASTContext &Context, SourceLocation EllipsisLoc, SourceLocation RSquareLoc, Expr *PackIdExpr, Expr *IndexExpr, std::optional< int64_t > Index, ArrayRef< Expr * > SubstitutedExprs={}, bool ExpandedToEmptyPack=false)
static bool classof(const Stmt *T)
Expr * getIndexExpr() const
const_child_range children() const
SourceLocation getBeginLoc() const LLVM_READONLY
Represents a parameter to a function.
PointerType - C99 6.7.5.1 - Pointer Declarators.
Stores the type being destroyed by a pseudo-destructor expression.
TypeSourceInfo * getTypeSourceInfo() const
PseudoDestructorTypeStorage(const IdentifierInfo *II, SourceLocation Loc)
const IdentifierInfo * getIdentifier() const
PseudoDestructorTypeStorage()=default
SourceLocation getLocation() const
A (possibly-)qualified type.
Represents a __builtin_base_type expression.
QualType getSourceType() const
static bool classof(const Stmt *T)
const_child_range children() const
SYCLBuiltinBaseTypeExpr(SourceLocation Loc, QualType SourceTy, Expr *Index, QualType BaseTy)
void setLocation(SourceLocation L)
const Expr * getIndex() const
SYCLBuiltinBaseTypeExpr(EmptyShell Empty)
SourceLocation getLocation() const
SourceLocation getBeginLoc() const
SourceLocation getEndLoc() const
Represents a __builtin_field_type expression.
const_child_range children() const
void setLocation(SourceLocation L)
SourceLocation getBeginLoc() const
SourceLocation getEndLoc() const
SYCLBuiltinFieldTypeExpr(EmptyShell Empty)
QualType getSourceType() const
SYCLBuiltinFieldTypeExpr(SourceLocation Loc, QualType SourceTy, Expr *Index, QualType FieldTy, ExprValueKind ValueKind)
static bool classof(const Stmt *T)
SourceLocation getLocation() const
const Expr * getIndex() const
Represents a __builtin_num_bases expression.
SourceLocation getLocation() const
QualType getSourceType() const
void setLocation(SourceLocation L)
SYCLBuiltinNumBasesExpr(EmptyShell Empty)
static bool classof(const Stmt *T)
SourceLocation getEndLoc() const
const_child_range children() const
unsigned getNumBases() const
SYCLBuiltinNumBasesExpr(SourceLocation Loc, QualType SourceTy, QualType RetTy)
SourceLocation getBeginLoc() const
Represents a __builtin_num_fields expression.
SourceLocation getBeginLoc() const
unsigned getNumFields() const
void setLocation(SourceLocation L)
SYCLBuiltinNumFieldsExpr(SourceLocation Loc, QualType SourceTy, QualType RetTy)
static bool classof(const Stmt *T)
SourceLocation getEndLoc() const
SYCLBuiltinNumFieldsExpr(EmptyShell Empty)
QualType getSourceType() const
const_child_range children() const
SourceLocation getLocation() const
Represents an expression that computes the length of a parameter pack.
SourceLocation getPackLoc() const
Determine the location of the parameter pack.
static bool classof(const Stmt *T)
SourceLocation getEndLoc() const LLVM_READONLY
static SizeOfPackExpr * CreateDeserialized(ASTContext &Context, unsigned NumPartialArgs)
ArrayRef< TemplateArgument > getPartialArguments() const
Get.
bool isPartiallySubstituted() const
Determine whether this represents a partially-substituted sizeof...
const_child_range children() const
SourceLocation getBeginLoc() const LLVM_READONLY
NamedDecl * getPack() const
Retrieve the parameter pack.
static SizeOfPackExpr * Create(ASTContext &Context, SourceLocation OperatorLoc, NamedDecl *Pack, SourceLocation PackLoc, SourceLocation RParenLoc, std::optional< unsigned > Length=std::nullopt, ArrayRef< TemplateArgument > PartialArgs=std::nullopt)
SourceLocation getOperatorLoc() const
Determine the location of the 'sizeof' keyword.
SourceLocation getRParenLoc() const
Determine the location of the right parenthesis.
unsigned getPackLength() const
Retrieve the length of the parameter pack.
Encodes a location in the source.
bool isValid() const
Return true if this is a valid SourceLocation object.
A trivial tuple used to represent a source range.
Stmt - This represents one statement.
SourceLocation getEndLoc() const LLVM_READONLY
CXXUnresolvedConstructExprBitfields CXXUnresolvedConstructExprBits
LambdaExprBitfields LambdaExprBits
UnresolvedLookupExprBitfields UnresolvedLookupExprBits
SubstNonTypeTemplateParmExprBitfields SubstNonTypeTemplateParmExprBits
CXXNoexceptExprBitfields CXXNoexceptExprBits
StmtIterator child_iterator
Child Iterators: All subclasses must implement 'children' to permit easy iteration over the substatem...
CXXRewrittenBinaryOperatorBitfields CXXRewrittenBinaryOperatorBits
ExprWithCleanupsBitfields ExprWithCleanupsBits
StmtClass getStmtClass() const
CXXScalarValueInitExprBitfields CXXScalarValueInitExprBits
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation tokens are not useful in isolation - they are low level value objects created/interpre...
OverloadExprBitfields OverloadExprBits
CXXConstructExprBitfields CXXConstructExprBits
CXXDependentScopeMemberExprBitfields CXXDependentScopeMemberExprBits
ConstCastIterator< Expr > ConstExprIterator
TypeTraitExprBitfields TypeTraitExprBits
CXXNewExprBitfields CXXNewExprBits
CXXNullPtrLiteralExprBitfields CXXNullPtrLiteralExprBits
CoawaitExprBitfields CoawaitBits
llvm::iterator_range< child_iterator > child_range
CXXThrowExprBitfields CXXThrowExprBits
ConstStmtIterator const_child_iterator
CXXBoolLiteralExprBitfields CXXBoolLiteralExprBits
CXXOperatorCallExprBitfields CXXOperatorCallExprBits
CXXDefaultInitExprBitfields CXXDefaultInitExprBits
DependentScopeDeclRefExprBitfields DependentScopeDeclRefExprBits
SourceLocation getBeginLoc() const LLVM_READONLY
UnresolvedMemberExprBitfields UnresolvedMemberExprBits
llvm::iterator_range< const_child_iterator > const_child_range
CXXDeleteExprBitfields CXXDeleteExprBits
CXXDefaultArgExprBitfields CXXDefaultArgExprBits
CXXThisExprBitfields CXXThisExprBits
CastIterator< Expr > ExprIterator
Represents a reference to a non-type template parameter that has been substituted with a template arg...
SourceLocation getEndLoc() const
QualType getParameterType(const ASTContext &Ctx) const
Determine the substituted type of the template parameter.
const_child_range children() const
std::optional< unsigned > getPackIndex() const
bool isReferenceParameter() const
unsigned getIndex() const
Returns the index of the replaced parameter in the associated declaration.
Decl * getAssociatedDecl() const
A template-like entity which owns the whole pattern being substituted.
SourceLocation getNameLoc() const
NonTypeTemplateParmDecl * getParameter() const
SourceLocation getBeginLoc() const
SubstNonTypeTemplateParmExpr(QualType Ty, ExprValueKind ValueKind, SourceLocation Loc, Expr *Replacement, Decl *AssociatedDecl, unsigned Index, std::optional< unsigned > PackIndex, bool RefParam)
static bool classof(const Stmt *s)
Expr * getReplacement() const
Represents a reference to a non-type template parameter pack that has been substituted with a non-tem...
SourceLocation getBeginLoc() const LLVM_READONLY
Decl * getAssociatedDecl() const
A template-like entity which owns the whole pattern being substituted.
TemplateArgument getArgumentPack() const
Retrieve the template argument pack containing the substituted template arguments.
SourceLocation getParameterPackLocation() const
Retrieve the location of the parameter pack name.
const_child_range children() const
NonTypeTemplateParmDecl * getParameterPack() const
Retrieve the non-type template parameter pack being substituted.
static bool classof(const Stmt *T)
unsigned getIndex() const
Returns the index of the replaced parameter in the associated declaration.
SourceLocation getEndLoc() const LLVM_READONLY
A convenient class for passing around template argument information.
Location wrapper for a TemplateArgument.
Represents a template argument.
Stores a list of template parameters for a TemplateDecl and its derived classes.
A container of type source information.
QualType getType() const
Return the type wrapped by this type source info.
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
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)
ArrayRef< TypeSourceInfo * > getArgs() const
Retrieve the argument types.
SourceLocation getEndLoc() const LLVM_READONLY
const_child_range children() const
unsigned getNumArgs() const
Determine the number of arguments to this type trait.
TypeSourceInfo * getArg(unsigned I) const
Retrieve the Ith argument.
TypeTrait getTrait() const
Determine which type trait this expression uses.
SourceLocation getBeginLoc() const LLVM_READONLY
static bool classof(const Stmt *T)
The base class of the type hierarchy.
CXXRecordDecl * getAsCXXRecordDecl() const
Retrieves the CXXRecordDecl that this type refers to, either because the type is a RecordType or beca...
const T * castAs() const
Member-template castAs<specific type>.
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
bool isRecordType() const
RecordDecl * getAsRecordDecl() const
Retrieves the RecordDecl this type refers to.
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
SourceLocation getBeginLoc() const LLVM_READONLY
SourceLocation getEndLoc() const LLVM_READONLY
const CXXRecordDecl * getNamingClass() const
static UnresolvedLookupExpr * CreateEmpty(const ASTContext &Context, unsigned NumResults, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
static bool classof(const Stmt *T)
bool requiresADL() const
True if this declaration should be extended by argument-dependent lookup.
const_child_range children() const
static UnresolvedLookupExpr * Create(const ASTContext &Context, CXXRecordDecl *NamingClass, NestedNameSpecifierLoc QualifierLoc, const DeclarationNameInfo &NameInfo, bool RequiresADL, UnresolvedSetIterator Begin, UnresolvedSetIterator End, bool KnownDependent, bool KnownInstantiationDependent)
CXXRecordDecl * getNamingClass()
Gets the 'naming class' (in the sense of C++0x [class.access.base]p5) of the lookup.
Represents a C++ member access expression for which lookup produced a set of overloaded functions.
SourceLocation getEndLoc() const LLVM_READONLY
DeclarationName getMemberName() const
Retrieve the name of the member that this expression refers to.
const Expr * getBase() const
QualType getBaseType() const
const CXXRecordDecl * getNamingClass() const
bool isArrow() const
Determine whether this member expression used the '->' operator; otherwise, it used the '.
SourceLocation getOperatorLoc() const
Retrieve the location of the '->' or '.' operator.
bool hasUnresolvedUsing() const
Determine whether the lookup results contain an unresolved using declaration.
SourceLocation getExprLoc() const LLVM_READONLY
Return the preferred location (the member name) for the arrow when diagnosing a problem with this exp...
Expr * getBase()
Retrieve the base object of this member expressions, e.g., the x in x.m.
const DeclarationNameInfo & getMemberNameInfo() const
Retrieve the full name info for the member that this expression refers to.
static UnresolvedMemberExpr * Create(const ASTContext &Context, 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 bool classof(const Stmt *T)
CXXRecordDecl * getNamingClass()
Retrieve the naming class of this lookup.
bool isImplicitAccess() const
True if this is an implicit access, i.e., one in which the member being accessed was not written in t...
SourceLocation getBeginLoc() const LLVM_READONLY
static UnresolvedMemberExpr * CreateEmpty(const ASTContext &Context, unsigned NumResults, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
const_child_range children() const
SourceLocation getMemberLoc() const
Retrieve the location of the name of the member that this expression refers to.
UnresolvedSetIterator iterator
The iterator over UnresolvedSets.
A call to a literal operator (C++11 [over.literal]) written as a user-defined literal (C++11 [lit....
LiteralOperatorKind getLiteralOperatorKind() const
Returns the kind of literal operator invocation which this expression represents.
const IdentifierInfo * getUDSuffix() const
Returns the ud-suffix specified for this literal.
static UserDefinedLiteral * Create(const ASTContext &Ctx, Expr *Fn, ArrayRef< Expr * > Args, QualType Ty, ExprValueKind VK, SourceLocation LitEndLoc, SourceLocation SuffixLoc, FPOptionsOverride FPFeatures)
static UserDefinedLiteral * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, bool HasFPOptions, EmptyShell Empty)
const Expr * getCookedLiteral() const
SourceLocation getEndLoc() const
Expr * getCookedLiteral()
If this is not a raw user-defined literal, get the underlying cooked literal (representing the litera...
SourceLocation getBeginLoc() const
SourceLocation getUDSuffixLoc() const
Returns the location of a ud-suffix in the expression.
LiteralOperatorKind
The kind of literal operator which is invoked.
@ LOK_String
operator "" X (const CharT *, size_t)
@ LOK_Raw
Raw form: operator "" X (const char *)
@ LOK_Floating
operator "" X (long double)
@ LOK_Integer
operator "" X (unsigned long long)
@ LOK_Template
Raw form: operator "" X<cs...> ()
@ LOK_Character
operator "" X (CharT)
static bool classof(const Stmt *S)
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Stmt(StmtClass SC, EmptyShell)
Construct an empty statement.
Represents a variable declaration or definition.
constexpr XRayInstrMask None
const internal::VariadicAllOfMatcher< Decl > decl
Matches declarations.
const internal::VariadicDynCastAllOfMatcher< Stmt, CastExpr > castExpr
Matches any cast nodes of Clang's AST.
unsigned kind
All of the diagnostics that can be emitted by the frontend.
The JSON file list parser is used to communicate input to InstallAPI.
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
ArrayTypeTrait
Names for the array type traits.
CanThrowResult
Possible results from evaluation of a noexcept expression.
ExprObjectKind
A further classification of the kind of object referenced by an l-value or x-value.
@ OK_Ordinary
An ordinary object is located at an address in memory.
ExprDependence computeDependence(FullExpr *E)
StorageDuration
The storage duration for an object (per C++ [basic.stc]).
@ SD_FullExpression
Full-expression storage duration (for temporaries).
CastKind
CastKind - The kind of operation required for a conversion.
LambdaCaptureDefault
The default, if any, capture method for a lambda expression.
ExprValueKind
The categorization of expression values, currently following the C++11 scheme.
@ VK_PRValue
A pr-value expression (in the C++11 taxonomy) produces a temporary value.
@ VK_LValue
An l-value expression is a reference to an object with independent storage.
const FunctionProtoType * T
TypeTrait
Names for traits that operate specifically on types.
CXXNewInitializationStyle
@ Parens
New-expression has a C++98 paren-delimited initializer.
@ None
New-expression has no initializer as written.
@ Braces
New-expression has a C++11 list-initializer.
float __ovld __cnfn distance(float, float)
Returns the distance between p0 and p1.
Represents an explicit template argument list in C++, e.g., the "<int>" in "sort<int>".
SourceLocation LAngleLoc
The source location of the left angle bracket ('<').
void copyInto(const TemplateArgumentLoc *ArgArray, TemplateArgumentListInfo &List) const
unsigned NumTemplateArgs
The number of template arguments in TemplateArgs.
SourceLocation RAngleLoc
The source location of the right angle bracket ('>').
SourceLocation TemplateKWLoc
The source location of the template keyword; this is used as part of the representation of qualified ...
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspon...
SourceLocation getLoc() const
getLoc - Returns the main location of the declaration name.
DeclarationName getName() const
getName - Returns the embedded declaration name.
SourceLocation getBeginLoc() const
getBeginLoc - Retrieve the location of the first token.
SourceLocation getEndLoc() const LLVM_READONLY
bool IsAddressOfOperandWithParen
bool HasFormOfMemberPointer
Iterator for iterating over Stmt * arrays that contain only T *.
A placeholder type used to construct an empty shell of a type, that will be filled in later (e....