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/STLExtras.h"
45#include "llvm/ADT/StringRef.h"
46#include "llvm/ADT/TypeSwitch.h"
47#include "llvm/ADT/iterator_range.h"
48#include "llvm/Support/Casting.h"
49#include "llvm/Support/Compiler.h"
50#include "llvm/Support/TrailingObjects.h"
84class CXXOperatorCallExpr final :
public CallExpr {
93 SourceRange getSourceRangeImpl() const LLVM_READONLY;
100 CXXOperatorCallExpr(
unsigned NumArgs,
bool HasFPFeatures,
EmptyShell Empty);
103 static CXXOperatorCallExpr *
110 unsigned NumArgs,
bool HasFPFeatures,
120 return Opc == OO_Equal || Opc == OO_StarEqual || Opc == OO_SlashEqual ||
121 Opc == OO_PercentEqual || Opc == OO_PlusEqual ||
122 Opc == OO_MinusEqual || Opc == OO_LessLessEqual ||
123 Opc == OO_GreaterGreaterEqual || Opc == OO_AmpEqual ||
124 Opc == OO_CaretEqual || Opc == OO_PipeEqual;
131 case OO_ExclaimEqual:
133 case OO_GreaterEqual:
159 return (Operator < OO_Plus || Operator >= OO_Arrow ||
160 Operator == OO_PlusPlus || Operator == OO_MinusMinus)
170 return T->getStmtClass() == CXXOperatorCallExprClass;
190 CXXMemberCallExpr(
unsigned NumArgs,
bool HasFPFeatures,
EmptyShell Empty);
197 unsigned MinNumArgs = 0);
232 return T->getStmtClass() == CXXMemberCallExprClass;
240 enum { CONFIG, END_PREARG };
257 unsigned MinNumArgs = 0);
260 unsigned NumArgs,
bool HasFPFeatures,
264 return cast_or_null<CallExpr>(
getPreArg(CONFIG));
269 return T->getStmtClass() == CUDAKernelCallExprClass;
297 :
Expr(CXXRewrittenBinaryOperatorClass, SemanticForm->
getType(),
299 SemanticForm(SemanticForm) {
304 :
Expr(CXXRewrittenBinaryOperatorClass,
Empty), SemanticForm() {}
363 return child_range(&SemanticForm, &SemanticForm + 1);
367 return T->getStmtClass() == CXXRewrittenBinaryOperatorClass;
393 Expr *op,
unsigned PathSize,
bool HasFPFeatures,
398 Loc(l), RParenLoc(RParenLoc), AngleBrackets(AngleBrackets) {}
419 switch (
T->getStmtClass()) {
420 case CXXStaticCastExprClass:
421 case CXXDynamicCastExprClass:
422 case CXXReinterpretCastExprClass:
423 case CXXConstCastExprClass:
424 case CXXAddrspaceCastExprClass:
436class CXXStaticCastExpr final
438 private llvm::TrailingObjects<CXXStaticCastExpr, CXXBaseSpecifier *,
456 unsigned numTrailingObjects(OverloadToken<CXXBaseSpecifier *>)
const {
464 static CXXStaticCastExpr *
470 unsigned PathSize,
bool hasFPFeatures);
473 return T->getStmtClass() == CXXStaticCastExprClass;
482class CXXDynamicCastExpr final
484 private llvm::TrailingObjects<CXXDynamicCastExpr, CXXBaseSpecifier *> {
490 false, writtenTy, l, RParenLoc,
514 return T->getStmtClass() == CXXDynamicCastExprClass;
526class CXXReinterpretCastExpr final
528 private llvm::TrailingObjects<CXXReinterpretCastExpr,
529 CXXBaseSpecifier *> {
535 pathSize,
false, writtenTy, l,
536 RParenLoc, AngleBrackets) {}
556 return T->getStmtClass() == CXXReinterpretCastExprClass;
567class CXXConstCastExpr final
569 private llvm::TrailingObjects<CXXConstCastExpr, CXXBaseSpecifier *> {
574 false, writtenTy, l, RParenLoc,
593 return T->getStmtClass() == CXXConstCastExprClass;
605class CXXAddrspaceCastExpr final
607 private llvm::TrailingObjects<CXXAddrspaceCastExpr, CXXBaseSpecifier *> {
612 false, writtenTy, l, RParenLoc,
623 static CXXAddrspaceCastExpr *
630 return T->getStmtClass() == CXXAddrspaceCastExprClass;
657 UserDefinedLiteral(
unsigned NumArgs,
bool HasFPFeatures,
EmptyShell Empty);
667 unsigned NumArgs,
bool HasFPOptions,
736 :
Expr(CXXBoolLiteralExprClass,
Empty) {}
753 return T->getStmtClass() == CXXBoolLiteralExprClass;
780 :
Expr(CXXNullPtrLiteralExprClass,
Empty) {}
789 return T->getStmtClass() == CXXNullPtrLiteralExprClass;
803class CXXStdInitializerListExpr :
public Expr {
804 Stmt *SubExpr =
nullptr;
807 :
Expr(CXXStdInitializerListExprClass,
Empty) {}
823 return SubExpr->getBeginLoc();
827 return SubExpr->getEndLoc();
832 return SubExpr->getSourceRange();
836 return S->
getStmtClass() == CXXStdInitializerListExprClass;
855 llvm::PointerUnion<Stmt *, TypeSourceInfo *> Operand;
874 Operand = (
Expr*)
nullptr;
895 assert(
isTypeOperand() &&
"Cannot call getTypeOperand for typeid(expr)");
899 assert(!
isTypeOperand() &&
"Cannot call getExprOperand for typeid(type)");
909 return T->getStmtClass() == CXXTypeidExprClass;
916 auto **begin =
reinterpret_cast<Stmt **
>(&Operand);
953 TheDecl(
decl), MemberLoc(nameLoc), IsArrow(
isArrow),
954 QualifierLoc(qualifierLoc) {
970 return BaseExpr->getBeginLoc();
971 else if (QualifierLoc)
972 return QualifierLoc.getBeginLoc();
988 return T->getStmtClass() == MSPropertyRefExprClass;
1012 enum { BASE_EXPR, IDX_EXPR, NUM_SUBEXPRS = 2 };
1014 Stmt *SubExprs[NUM_SUBEXPRS];
1017 void setBase(
Expr *
Base) { SubExprs[BASE_EXPR] =
Base; }
1018 void setIdx(
Expr *Idx) { SubExprs[IDX_EXPR] = Idx; }
1023 :
Expr(MSPropertySubscriptExprClass, Ty,
VK, OK),
1024 RBracketLoc(RBracketLoc) {
1025 SubExprs[BASE_EXPR] =
Base;
1026 SubExprs[IDX_EXPR] = Idx;
1032 :
Expr(MSPropertySubscriptExprClass, Shell) {}
1054 return T->getStmtClass() == MSPropertySubscriptExprClass;
1059 return child_range(&SubExprs[0], &SubExprs[0] + NUM_SUBEXPRS);
1075 llvm::PointerUnion<Stmt *, TypeSourceInfo *> Operand;
1083 Guid(Guid), Range(R) {
1089 Guid(Guid), Range(R) {
1096 Operand = (
Expr*)
nullptr;
1109 assert(
isTypeOperand() &&
"Cannot call getTypeOperand for __uuidof(expr)");
1113 assert(!
isTypeOperand() &&
"Cannot call getExprOperand for __uuidof(type)");
1125 return T->getStmtClass() == CXXUuidofExprClass;
1132 auto **begin =
reinterpret_cast<Stmt **
>(&Operand);
1161 CXXThisExprBits.CapturedByCopyInLambdaWithExplicitObjectParameter =
false;
1184 return CXXThisExprBits.CapturedByCopyInLambdaWithExplicitObjectParameter;
1193 return T->getStmtClass() == CXXThisExprClass;
1223 bool IsThrownVariableInScope)
1253 return T->getStmtClass() == CXXThrowExprClass;
1258 return child_range(&Operand, Operand ? &Operand + 1 : &Operand);
1271class CXXDefaultArgExpr final
1273 private llvm::TrailingObjects<CXXDefaultArgExpr, Expr *> {
1276 friend TrailingObjects;
1287 Param->hasUnparsedDefaultArg()
1288 ? Param->
getType().getNonReferenceType()
1289 : Param->getDefaultArg()->
getType(),
1292 Param(Param), UsedContext(UsedContext) {
1296 *getTrailingObjects() = RewrittenExpr;
1307 bool HasRewrittenInit);
1312 ParmVarDecl *Param,
Expr *RewrittenExpr,
1313 DeclContext *UsedContext);
1325 return const_cast<CXXDefaultArgExpr *
>(
this)->
getExpr();
1357 return T->getStmtClass() == CXXDefaultArgExprClass;
1378class CXXDefaultInitExpr final
1380 private llvm::TrailingObjects<CXXDefaultInitExpr, Expr *> {
1384 friend TrailingObjects;
1393 Expr *RewrittenInitExpr);
1396 :
Expr(CXXDefaultInitExprClass,
Empty) {
1402 bool HasRewrittenInit);
1407 Expr *RewrittenInitExpr);
1420 return const_cast<CXXDefaultInitExpr *
>(
this)->
getExpr();
1427 return *getTrailingObjects();
1434 return *getTrailingObjects();
1448 return T->getStmtClass() == CXXDefaultInitExprClass;
1496class CXXBindTemporaryExpr :
public Expr {
1498 Stmt *SubExpr =
nullptr;
1501 :
Expr(CXXBindTemporaryExprClass, SubExpr->getType(),
VK_PRValue,
1503 Temp(temp), SubExpr(SubExpr) {
1509 :
Expr(CXXBindTemporaryExprClass,
Empty) {}
1523 return SubExpr->getBeginLoc();
1527 return SubExpr->getEndLoc();
1532 return T->getStmtClass() == CXXBindTemporaryExprClass;
1578 inline Stmt **getTrailingArgs();
1579 const Stmt *
const *getTrailingArgs()
const {
1588 bool ListInitialization,
bool StdInitListInitialization,
1598 return NumArgs *
sizeof(
Stmt *);
1606 bool HadMultipleCandidates,
bool ListInitialization,
1607 bool StdInitListInitialization,
bool ZeroInitialization,
1687 return reinterpret_cast<const Expr *
const *
>(getTrailingArgs());
1695 assert(Arg <
getNumArgs() &&
"Arg access out of range!");
1699 assert(Arg <
getNumArgs() &&
"Arg access out of range!");
1705 assert(Arg <
getNumArgs() &&
"Arg access out of range!");
1720 std::pair<const NamedDecl *, const WarnUnusedResultAttr *>
1736 return T->getStmtClass() == CXXConstructExprClass ||
1737 T->getStmtClass() == CXXTemporaryObjectExprClass;
1762 LLVM_PREFERRED_TYPE(
bool)
1763 unsigned ConstructsVirtualBase : 1;
1767 LLVM_PREFERRED_TYPE(
bool)
1768 unsigned InheritedFromVirtualBase : 1;
1776 bool InheritedFromVirtualBase)
1778 Constructor(Ctor), Loc(Loc),
1779 ConstructsVirtualBase(ConstructsVirtualBase),
1780 InheritedFromVirtualBase(InheritedFromVirtualBase) {
1781 assert(!
T->isDependentType());
1787 :
Expr(CXXInheritedCtorInitExprClass,
Empty),
1788 ConstructsVirtualBase(
false), InheritedFromVirtualBase(
false) {}
1812 return T->getStmtClass() == CXXInheritedCtorInitExprClass;
1831class CXXFunctionalCastExpr final
1833 private llvm::TrailingObjects<CXXFunctionalCastExpr, CXXBaseSpecifier *,
1834 FPOptionsOverride> {
1845 LParenLoc(lParenLoc), RParenLoc(rParenLoc) {
1850 explicit CXXFunctionalCastExpr(
EmptyShell Shell,
unsigned PathSize,
1855 unsigned numTrailingObjects(OverloadToken<CXXBaseSpecifier *>)
const {
1863 static CXXFunctionalCastExpr *
1868 static CXXFunctionalCastExpr *
1883 return T->getStmtClass() == CXXFunctionalCastExprClass;
1914 bool HadMultipleCandidates,
bool ListInitialization,
1915 bool StdInitListInitialization,
1916 bool ZeroInitialization);
1921 static CXXTemporaryObjectExpr *
1924 SourceRange ParenOrBraceRange,
bool HadMultipleCandidates,
1925 bool ListInitialization,
bool StdInitListInitialization,
1926 bool ZeroInitialization);
1937 return T->getStmtClass() == CXXTemporaryObjectExprClass;
1941Stmt **CXXConstructExpr::getTrailingArgs() {
1942 if (
auto *E = dyn_cast<CXXTemporaryObjectExpr>(
this))
1943 return reinterpret_cast<Stmt **
>(E + 1);
1945 "Unexpected class deriving from CXXConstructExpr!");
1946 return reinterpret_cast<Stmt **
>(
this + 1);
1970class LambdaExpr final :
public Expr,
1971 private llvm::TrailingObjects<LambdaExpr, Stmt *> {
1995 SourceLocation ClosingBrace,
bool ContainsUnexpandedParameterPack);
2000 Stmt **getStoredStmts() {
return getTrailingObjects(); }
2001 Stmt *
const *getStoredStmts()
const {
return getTrailingObjects(); }
2003 void initBodyIfNeeded()
const;
2014 bool ExplicitParams,
bool ExplicitResultType,
2016 bool ContainsUnexpandedParameterPack);
2021 unsigned NumCaptures);
2098 return reinterpret_cast<Expr **
>(getStoredStmts());
2104 return reinterpret_cast<Expr *
const *
>(getStoredStmts());
2164 const auto *ConstThis =
this;
2165 return const_cast<CompoundStmt *
>(ConstThis->getCompoundStmtBody());
2182 return T->getStmtClass() == LambdaExprClass;
2186 return IntroducerRange.getBegin();
2210 TypeInfo(TypeInfo) {
2216 :
Expr(CXXScalarValueInitExprClass, Shell) {}
2230 return T->getStmtClass() == CXXScalarValueInitExprClass;
2260inline TypeAwareAllocationMode
2356class CXXNewExpr final
2358 private llvm::TrailingObjects<CXXNewExpr, Stmt *, SourceRange> {
2361 friend TrailingObjects;
2393 unsigned arraySizeOffset()
const {
return 0; }
2394 unsigned initExprOffset()
const {
return arraySizeOffset() +
isArray(); }
2395 unsigned placementNewArgsOffset()
const {
2399 unsigned numTrailingObjects(OverloadToken<Stmt *>)
const {
2403 unsigned numTrailingObjects(OverloadToken<SourceRange>)
const {
2408 CXXNewExpr(
bool IsGlobalNew, FunctionDecl *OperatorNew,
2409 FunctionDecl *OperatorDelete,
2410 const ImplicitAllocationParameters &IAP,
2411 bool UsualArrayDeleteWantsSize, ArrayRef<Expr *> PlacementArgs,
2412 SourceRange TypeIdParens, std::optional<Expr *> ArraySize,
2414 QualType Ty, TypeSourceInfo *AllocatedTypeInfo, SourceRange Range,
2415 SourceRange DirectInitRange);
2419 bool IsParenTypeId);
2424 Create(
const ASTContext &Ctx,
bool IsGlobalNew, FunctionDecl *OperatorNew,
2425 FunctionDecl *OperatorDelete,
const ImplicitAllocationParameters &IAP,
2426 bool UsualArrayDeleteWantsSize, ArrayRef<Expr *> PlacementArgs,
2427 SourceRange TypeIdParens, std::optional<Expr *> ArraySize,
2429 QualType Ty, TypeSourceInfo *AllocatedTypeInfo, SourceRange Range,
2430 SourceRange DirectInitRange);
2433 static CXXNewExpr *
CreateEmpty(
const ASTContext &Ctx,
bool IsArray,
2434 bool HasInit,
unsigned NumPlacementArgs,
2435 bool IsParenTypeId);
2442 return AllocatedTypeInfo;
2474 return std::nullopt;
2477 cast_or_null<Expr>(getTrailingObjects<Stmt *>()[arraySizeOffset()]))
2480 return std::nullopt;
2488 return std::nullopt;
2491 cast_or_null<Expr>(getTrailingObjects<Stmt *>()[arraySizeOffset()]))
2494 return std::nullopt;
2502 return reinterpret_cast<Expr **
>(getTrailingObjects<Stmt *>() +
2503 placementNewArgsOffset());
2520 return isParenTypeId() ? getTrailingObjects<SourceRange>()[0]
2538 ?
cast<Expr>(getTrailingObjects<Stmt *>()[initExprOffset()])
2543 ?
cast<Expr>(getTrailingObjects<Stmt *>()[initExprOffset()])
2584 return getTrailingObjects<Stmt *>() + placementNewArgsOffset();
2590 return getTrailingObjects<Stmt *>() + placementNewArgsOffset();
2600 return raw_arg_begin() + numTrailingObjects(OverloadToken<Stmt *>());
2603 return getTrailingObjects<Stmt *>();
2606 return raw_arg_begin() + numTrailingObjects(OverloadToken<Stmt *>());
2616 return T->getStmtClass() == CXXNewExprClass;
2636 Stmt *Argument =
nullptr;
2640 bool ArrayFormAsWritten,
bool UsualArrayDeleteWantsSize,
2643 OperatorDelete(OperatorDelete), Argument(Arg) {
2681 return Argument->getEndLoc();
2685 return T->getStmtClass() == CXXDeleteExprClass;
2700 llvm::PointerUnion<TypeSourceInfo *, const IdentifierInfo *> Type;
2709 : Type(II), Location(Loc) {}
2752 Stmt *Base =
nullptr;
2756 LLVM_PREFERRED_TYPE(
bool)
2790 :
Expr(CXXPseudoDestructorExprClass, Shell), IsArrow(
false) {}
2807 return QualifierLoc.getNestedNameSpecifier();
2843 return DestroyedType.getTypeSourceInfo();
2850 return DestroyedType.getIdentifier();
2858 return DestroyedType.getLocation();
2873 return Base->getBeginLoc();
2878 return T->getStmtClass() == CXXPseudoDestructorExprClass;
2897class TypeTraitExpr final
2899 private llvm::TrailingObjects<TypeTraitExpr, APValue, TypeSourceInfo *> {
2908 std::variant<bool, APValue>
Value);
2912 size_t numTrailingObjects(OverloadToken<TypeSourceInfo *>)
const {
2916 size_t numTrailingObjects(OverloadToken<APValue>)
const {
2938 bool IsStoredAsBool,
2957 return *getTrailingObjects<APValue>();
2965 assert(I <
getNumArgs() &&
"Argument out-of-range");
2971 return getTrailingObjects<TypeSourceInfo *>(
getNumArgs());
2978 return T->getStmtClass() == TypeTraitExprClass;
3022 Value(value), Dimension(dimension), Loc(loc), RParen(rparen),
3023 QueriedType(queried) {
3024 assert(att <= ATT_Last &&
"invalid enum value!");
3032 :
Expr(ArrayTypeTraitExprClass,
Empty) {
3052 return T->getStmtClass() == ArrayTypeTraitExprClass;
3080 Expr* QueriedExpression =
nullptr;
3088 Loc(loc), RParen(rparen), QueriedExpression(queried) {
3092 assert(et <= ET_Last &&
"invalid enum value!");
3099 :
Expr(ExpressionTraitExprClass,
Empty) {
3116 return T->getStmtClass() == ExpressionTraitExprClass;
3148 bool KnownDependent,
bool KnownInstantiationDependent,
3149 bool KnownContainsUnexpandedParameterPack);
3152 bool HasTemplateKWAndArgsInfo);
3204 Result.HasFormOfMemberPointer = (E == Ovl && Ovl->getQualifier());
3205 Result.IsAddressOfOperand =
true;
3206 Result.IsAddressOfOperandWithParen = HasParen;
3230 llvm::iterator_range<decls_iterator>
decls()
const {
3248 return QualifierLoc.getNestedNameSpecifier();
3292 if (
auto *TTP = dyn_cast_or_null<TemplateTemplateParmDecl>(
3303 if (
auto *TTP = dyn_cast_or_null<TemplateTemplateParmDecl>(
3319 return dyn_cast_or_null<TemplateTemplateParmDecl>(
3347 return T->getStmtClass() == UnresolvedLookupExprClass ||
3348 T->getStmtClass() == UnresolvedMemberExprClass;
3385class UnresolvedLookupExpr final
3387 private llvm::TrailingObjects<UnresolvedLookupExpr, DeclAccessPair,
3388 ASTTemplateKWAndArgsInfo,
3389 TemplateArgumentLoc> {
3392 friend TrailingObjects;
3419 bool KnownDependent,
bool KnownInstantiationDependent);
3422 bool HasTemplateKWAndArgsInfo);
3424 unsigned numTrailingObjects(OverloadToken<DeclAccessPair>)
const {
3428 unsigned numTrailingObjects(OverloadToken<ASTTemplateKWAndArgsInfo>)
const {
3433 static UnresolvedLookupExpr *
3435 NestedNameSpecifierLoc QualifierLoc,
3436 const DeclarationNameInfo &NameInfo,
bool RequiresADL,
3437 UnresolvedSetIterator Begin, UnresolvedSetIterator End,
3438 bool KnownDependent,
bool KnownInstantiationDependent);
3443 static UnresolvedLookupExpr *
3445 NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc,
3446 const DeclarationNameInfo &NameInfo,
bool RequiresADL,
3447 const TemplateArgumentListInfo *Args, UnresolvedSetIterator Begin,
3448 UnresolvedSetIterator End,
bool KnownDependent,
3449 bool KnownInstantiationDependent);
3452 unsigned NumResults,
3453 bool HasTemplateKWAndArgsInfo,
3454 unsigned NumTemplateArgs);
3468 return l.getBeginLoc();
3487 return T->getStmtClass() == UnresolvedLookupExprClass;
3505class DependentScopeDeclRefExpr final
3507 private llvm::TrailingObjects<DependentScopeDeclRefExpr,
3508 ASTTemplateKWAndArgsInfo,
3509 TemplateArgumentLoc> {
3512 friend TrailingObjects;
3526 size_t numTrailingObjects(OverloadToken<ASTTemplateKWAndArgsInfo>)
const {
3527 return hasTemplateKWAndArgsInfo();
3530 bool hasTemplateKWAndArgsInfo()
const {
3535 static DependentScopeDeclRefExpr *
3537 SourceLocation TemplateKWLoc,
const DeclarationNameInfo &NameInfo,
3538 const TemplateArgumentListInfo *TemplateArgs);
3541 bool HasTemplateKWAndArgsInfo,
3542 unsigned NumTemplateArgs);
3562 return QualifierLoc.getNestedNameSpecifier();
3568 if (!hasTemplateKWAndArgsInfo())
3570 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->TemplateKWLoc;
3576 if (!hasTemplateKWAndArgsInfo())
3578 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->LAngleLoc;
3584 if (!hasTemplateKWAndArgsInfo())
3586 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->RAngleLoc;
3599 getTrailingObjects<ASTTemplateKWAndArgsInfo>()->copyInto(
3600 getTrailingObjects<TemplateArgumentLoc>(), List);
3607 return getTrailingObjects<TemplateArgumentLoc>();
3614 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->NumTemplateArgs;
3624 return QualifierLoc.getBeginLoc();
3634 return T->getStmtClass() == DependentScopeDeclRefExprClass;
3656class ExprWithCleanups final
3658 private llvm::TrailingObjects<
3660 llvm::PointerUnion<BlockDecl *, CompoundLiteralExpr *>> {
3670 friend TrailingObjects;
3672 ExprWithCleanups(
EmptyShell,
unsigned NumObjects);
3673 ExprWithCleanups(
Expr *
SubExpr,
bool CleanupsHaveSideEffects,
3678 unsigned numObjects);
3681 bool CleanupsHaveSideEffects,
3700 return SubExpr->getBeginLoc();
3709 return T->getStmtClass() == ExprWithCleanupsClass;
3741class CXXUnresolvedConstructExpr final
3743 private llvm::TrailingObjects<CXXUnresolvedConstructExpr, Expr *> {
3745 friend TrailingObjects;
3749 llvm::PointerIntPair<TypeSourceInfo *, 1> TypeAndInitForm;
3762 :
Expr(CXXUnresolvedConstructExprClass,
Empty) {
3782 return TypeAndInitForm.getPointer();
3820 assert(I <
getNumArgs() &&
"Argument index out-of-range");
3825 assert(I <
getNumArgs() &&
"Argument index out-of-range");
3830 assert(I <
getNumArgs() &&
"Argument index out-of-range");
3836 if (!RParenLoc.isValid() &&
getNumArgs() > 0)
3842 return T->getStmtClass() == CXXUnresolvedConstructExprClass;
3852 auto **begin =
reinterpret_cast<Stmt **
>(
3853 const_cast<CXXUnresolvedConstructExpr *
>(
this)->arg_begin());
3865class CXXDependentScopeMemberExpr final
3867 private llvm::TrailingObjects<CXXDependentScopeMemberExpr,
3868 ASTTemplateKWAndArgsInfo,
3869 TemplateArgumentLoc, NamedDecl *> {
3872 friend TrailingObjects;
3908 bool hasTemplateKWAndArgsInfo()
const {
3912 bool hasFirstQualifierFoundInScope()
const {
3916 unsigned numTrailingObjects(OverloadToken<ASTTemplateKWAndArgsInfo>)
const {
3917 return hasTemplateKWAndArgsInfo();
3920 unsigned numTrailingObjects(OverloadToken<TemplateArgumentLoc>)
const {
3924 CXXDependentScopeMemberExpr(
const ASTContext &Ctx,
Expr *Base,
3925 QualType BaseType,
bool IsArrow,
3926 SourceLocation OperatorLoc,
3927 NestedNameSpecifierLoc QualifierLoc,
3928 SourceLocation TemplateKWLoc,
3929 NamedDecl *FirstQualifierFoundInScope,
3930 DeclarationNameInfo MemberNameInfo,
3931 const TemplateArgumentListInfo *TemplateArgs);
3933 CXXDependentScopeMemberExpr(
EmptyShell Empty,
bool HasTemplateKWAndArgsInfo,
3934 bool HasFirstQualifierFoundInScope);
3937 static CXXDependentScopeMemberExpr *
3938 Create(
const ASTContext &Ctx,
Expr *Base, QualType BaseType,
bool IsArrow,
3939 SourceLocation OperatorLoc, NestedNameSpecifierLoc QualifierLoc,
3940 SourceLocation TemplateKWLoc, NamedDecl *FirstQualifierFoundInScope,
3941 DeclarationNameInfo MemberNameInfo,
3942 const TemplateArgumentListInfo *TemplateArgs);
3944 static CXXDependentScopeMemberExpr *
3945 CreateEmpty(
const ASTContext &Ctx,
bool HasTemplateKWAndArgsInfo,
3946 unsigned NumTemplateArgs,
bool HasFirstQualifierFoundInScope);
3954 return cast<Expr>(Base)->isImplicitCXXThis();
3977 return QualifierLoc.getNestedNameSpecifier();
3996 if (!hasFirstQualifierFoundInScope())
3998 return *getTrailingObjects<NamedDecl *>();
4003 return MemberNameInfo;
4016 if (!hasTemplateKWAndArgsInfo())
4018 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->TemplateKWLoc;
4024 if (!hasTemplateKWAndArgsInfo())
4026 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->LAngleLoc;
4032 if (!hasTemplateKWAndArgsInfo())
4034 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->RAngleLoc;
4048 getTrailingObjects<ASTTemplateKWAndArgsInfo>()->copyInto(
4049 getTrailingObjects<TemplateArgumentLoc>(), List);
4058 return getTrailingObjects<TemplateArgumentLoc>();
4067 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->NumTemplateArgs;
4076 return Base->getBeginLoc();
4079 return MemberNameInfo.getBeginLoc();
4085 return MemberNameInfo.getEndLoc();
4089 return T->getStmtClass() == CXXDependentScopeMemberExprClass;
4121class UnresolvedMemberExpr final
4123 private llvm::TrailingObjects<UnresolvedMemberExpr, DeclAccessPair,
4124 ASTTemplateKWAndArgsInfo,
4125 TemplateArgumentLoc> {
4128 friend TrailingObjects;
4156 UnresolvedMemberExpr(
const ASTContext &Context,
bool HasUnresolvedUsing,
4166 bool HasTemplateKWAndArgsInfo);
4168 unsigned numTrailingObjects(OverloadToken<DeclAccessPair>)
const {
4172 unsigned numTrailingObjects(OverloadToken<ASTTemplateKWAndArgsInfo>)
const {
4177 static UnresolvedMemberExpr *
4179 QualType BaseType,
bool IsArrow, SourceLocation OperatorLoc,
4180 NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc,
4181 const DeclarationNameInfo &MemberNameInfo,
4182 const TemplateArgumentListInfo *TemplateArgs,
4183 UnresolvedSetIterator Begin, UnresolvedSetIterator End);
4186 unsigned NumResults,
4187 bool HasTemplateKWAndArgsInfo,
4188 unsigned NumTemplateArgs);
4225 return const_cast<UnresolvedMemberExpr *
>(
this)->
getNamingClass();
4245 return Base->getBeginLoc();
4247 return l.getBeginLoc();
4258 return T->getStmtClass() == UnresolvedMemberExprClass;
4276 if (
auto *ULE = dyn_cast<UnresolvedLookupExpr>(
this))
4285 if (
auto *ULE = dyn_cast<UnresolvedLookupExpr>(
this))
4292 if (
auto *ULE = dyn_cast<UnresolvedLookupExpr>(
this))
4299 if (
auto *ULE = dyn_cast<UnresolvedLookupExpr>(
this))
4300 return ULE->getNamingClass();
4318 Operand(Operand), Range(
Keyword, RParen) {
4334 return T->getStmtClass() == CXXNoexceptExprClass;
4373 unsigned NumExpansions;
4380 :
Expr(PackExpansionExprClass, Pattern->
getType(),
4382 EllipsisLoc(EllipsisLoc),
4383 NumExpansions(NumExpansions ? *NumExpansions + 1 : 0),
4404 return NumExpansions - 1;
4406 return std::nullopt;
4410 return Pattern->getBeginLoc();
4416 return T->getStmtClass() == PackExpansionExprClass;
4438class SizeOfPackExpr final
4440 private llvm::TrailingObjects<SizeOfPackExpr, TemplateArgument> {
4443 friend TrailingObjects;
4475 OperatorLoc(OperatorLoc), PackLoc(PackLoc), RParenLoc(RParenLoc),
4476 Length(Length ? *Length : PartialArgs.size()), Pack(Pack) {
4477 assert((!Length || PartialArgs.empty()) &&
4478 "have partial args for non-dependent sizeof... expression");
4479 auto *Args = getTrailingObjects();
4480 llvm::uninitialized_copy(PartialArgs, Args);
4482 : ExprDependence::ValueInstantiation);
4487 :
Expr(SizeOfPackExprClass,
Empty), Length(NumPartialArgs) {}
4490 static SizeOfPackExpr *
Create(
ASTContext &Context, SourceLocation OperatorLoc,
4491 NamedDecl *Pack, SourceLocation PackLoc,
4492 SourceLocation RParenLoc,
4496 unsigned NumPartialArgs);
4516 "Cannot get the length of a value-dependent pack size expression");
4532 return getTrailingObjects(Length);
4539 return T->getStmtClass() == SizeOfPackExprClass;
4552class PackIndexingExpr final
4554 private llvm::TrailingObjects<PackIndexingExpr, Expr *> {
4557 friend TrailingObjects;
4570 bool FullySubstituted =
false)
4572 EllipsisLoc(EllipsisLoc), RSquareLoc(RSquareLoc),
4573 SubExprs{PackIdExpr, IndexExpr} {
4576 llvm::uninitialized_copy(SubstitutedExprs, getTrailingObjects());
4584 PackIndexingExpr(EmptyShell
Empty) :
Expr(PackIndexingExprClass,
Empty) {}
4586 unsigned numTrailingObjects(OverloadToken<Expr *>)
const {
4591 static PackIndexingExpr *
Create(ASTContext &Context,
4592 SourceLocation EllipsisLoc,
4593 SourceLocation RSquareLoc,
Expr *PackIdExpr,
4594 Expr *IndexExpr, std::optional<int64_t> Index,
4595 ArrayRef<Expr *> SubstitutedExprs = {},
4596 bool FullySubstituted =
false);
4598 unsigned NumTransformedExprs);
4631 return std::nullopt;
4634 assert(Index.isNonNegative() &&
"Invalid index");
4635 return static_cast<unsigned>(Index.getExtValue());
4640 assert(Index &&
"extracting the indexed expression of a dependant pack");
4641 return getTrailingObjects()[*Index];
4650 return T->getStmtClass() == PackIndexingExprClass;
4663class SubstNonTypeTemplateParmExpr :
public Expr {
4673 llvm::PointerIntPair<Decl *, 1, bool> AssociatedDeclAndFinal;
4677 unsigned Index : 15;
4678 unsigned PackIndex : 15;
4681 :
Expr(SubstNonTypeTemplateParmExprClass,
Empty) {}
4689 :
Expr(SubstNonTypeTemplateParmExprClass, Ty, ValueKind,
OK_Ordinary),
4690 Replacement(Replacement), AssociatedDeclAndFinal(AssociatedDecl, Final),
4691 ParamType(ParamType), Index(Index),
4692 PackIndex(PackIndex.toInternalRepresentation()) {
4693 assert(AssociatedDecl !=
nullptr);
4709 return AssociatedDeclAndFinal.getPointer();
4722 bool getFinal()
const {
return AssociatedDeclAndFinal.getInt(); }
4730 return s->
getStmtClass() == SubstNonTypeTemplateParmExprClass;
4753class SubstNonTypeTemplateParmPackExpr :
public Expr {
4758 Decl *AssociatedDecl;
4765 unsigned NumArguments : 15;
4767 LLVM_PREFERRED_TYPE(
bool)
4770 unsigned Index : 16;
4776 :
Expr(SubstNonTypeTemplateParmPackExprClass,
Empty) {}
4782 Decl *AssociatedDecl,
unsigned Index,
4811 return T->getStmtClass() == SubstNonTypeTemplateParmPackExprClass;
4838class FunctionParmPackExpr final
4840 private llvm::TrailingObjects<FunctionParmPackExpr, ValueDecl *> {
4843 friend TrailingObjects;
4852 unsigned NumParameters;
4855 unsigned NumParams,
ValueDecl *
const *Params);
4863 unsigned NumParams);
4887 return T->getStmtClass() == FunctionParmPackExprClass;
4924 llvm::PointerUnion<Stmt *, LifetimeExtendedTemporaryDecl *> State;
4928 bool BoundToLvalueReference,
4932 :
Expr(MaterializeTemporaryExprClass,
Empty) {}
4947 ->getStorageDuration();
4954 "the temporary has not been lifetime extended");
4972 ->getExtendingDecl();
4983 ->getManglingNumber();
5003 return T->getStmtClass() == MaterializeTemporaryExprClass;
5009 ?
child_range(State.getAddrOfPtr1(), State.getAddrOfPtr1() + 1)
5016 State.getAddrOfPtr1() + 1)
5035 enum SubExpr { Callee, LHS, RHS, Count };
5043 Stmt *SubExprs[SubExpr::Count];
5081 if (LParenLoc.isValid())
5089 if (RParenLoc.isValid())
5097 return T->getStmtClass() == CXXFoldExprClass;
5102 return child_range(SubExprs, SubExprs + SubExpr::Count);
5138class CXXParenListInitExpr final
5140 private llvm::TrailingObjects<CXXParenListInitExpr, Expr *> {
5146 unsigned NumUserSpecifiedExprs;
5148 llvm::PointerUnion<Expr *, FieldDecl *> ArrayFillerOrUnionFieldInit;
5154 NumExprs(Args.size()), NumUserSpecifiedExprs(NumUserSpecifiedExprs),
5155 InitLoc(InitLoc), LParenLoc(LParenLoc), RParenLoc(RParenLoc) {
5156 llvm::copy(Args, getTrailingObjects());
5157 assert(NumExprs >= NumUserSpecifiedExprs &&
5158 "number of user specified inits is greater than the number of "
5163 size_t numTrailingObjects(OverloadToken<Expr *>)
const {
return NumExprs; }
5166 static CXXParenListInitExpr *
5168 unsigned NumUserSpecifiedExprs, SourceLocation InitLoc,
5169 SourceLocation LParenLoc, SourceLocation RParenLoc);
5175 :
Expr(CXXParenListInitExprClass,
Empty), NumExprs(NumExprs),
5176 NumUserSpecifiedExprs(0) {}
5181 return getTrailingObjects(NumExprs);
5187 return getTrailingObjects(NumUserSpecifiedExprs);
5191 return getTrailingObjects(NumUserSpecifiedExprs);
5207 return dyn_cast_if_present<Expr *>(ArrayFillerOrUnionFieldInit);
5211 return dyn_cast_if_present<Expr *>(ArrayFillerOrUnionFieldInit);
5215 ArrayFillerOrUnionFieldInit = FD;
5219 return dyn_cast_if_present<FieldDecl *>(ArrayFillerOrUnionFieldInit);
5223 return dyn_cast_if_present<FieldDecl *>(ArrayFillerOrUnionFieldInit);
5227 Stmt **Begin =
reinterpret_cast<Stmt **
>(getTrailingObjects());
5232 Stmt *
const *Begin =
reinterpret_cast<Stmt *
const *
>(getTrailingObjects());
5237 return T->getStmtClass() == CXXParenListInitExprClass;
5259 enum SubExpr { Operand, Common, Ready, Suspend, Resume, Count };
5261 Stmt *SubExprs[SubExpr::Count];
5273 KeywordLoc(KeywordLoc), OpaqueValue(OpaqueValue) {
5274 SubExprs[SubExpr::Operand] = Operand;
5275 SubExprs[SubExpr::Common] = Common;
5276 SubExprs[SubExpr::Ready] = Ready;
5277 SubExprs[SubExpr::Suspend] = Suspend;
5278 SubExprs[SubExpr::Resume] = Resume;
5286 "wrong constructor for non-dependent co_await/co_yield expression");
5287 SubExprs[SubExpr::Operand] = Operand;
5288 SubExprs[SubExpr::Common] = Common;
5289 SubExprs[SubExpr::Ready] =
nullptr;
5290 SubExprs[SubExpr::Suspend] =
nullptr;
5291 SubExprs[SubExpr::Resume] =
nullptr;
5296 SubExprs[SubExpr::Operand] =
nullptr;
5297 SubExprs[SubExpr::Common] =
nullptr;
5298 SubExprs[SubExpr::Ready] =
nullptr;
5299 SubExprs[SubExpr::Suspend] =
nullptr;
5300 SubExprs[SubExpr::Resume] =
nullptr;
5304 return static_cast<Expr*
>(SubExprs[SubExpr::Common]);
5311 return static_cast<Expr*
>(SubExprs[SubExpr::Ready]);
5315 return static_cast<Expr*
>(SubExprs[SubExpr::Suspend]);
5319 return static_cast<Expr*
>(SubExprs[SubExpr::Resume]);
5324 return static_cast<Expr *
>(SubExprs[SubExpr::Operand]);
5329 assert(SuspendExpr);
5331 auto SuspendType = SuspendExpr->getType();
5333 if (SuspendType->isVoidType())
5335 if (SuspendType->isBooleanType())
5341 assert(SuspendType->isVoidPointerType());
5354 return child_range(SubExprs, SubExprs + SubExpr::Count);
5362 return T->getStmtClass() == CoawaitExprClass ||
5363 T->getStmtClass() == CoyieldExprClass;
5376 Ready, Suspend, Resume, OpaqueValue) {
5381 Expr *Common,
bool IsImplicit =
false)
5394 return T->getStmtClass() == CoawaitExprClass;
5410 KeywordLoc(KeywordLoc) {
5414 "wrong constructor for non-dependent co_await/co_yield expression");
5416 SubExprs[1] = OpCoawait;
5421 :
Expr(DependentCoawaitExprClass,
Empty) {}
5444 return T->getStmtClass() == DependentCoawaitExprClass;
5457 Ready, Suspend, Resume, OpaqueValue) {}
5466 return T->getStmtClass() == CoyieldExprClass;
5475 private llvm::TrailingObjects<BuiltinBitCastExpr, CXXBaseSpecifier *> {
5478 friend TrailingObjects;
5489 KWLoc(KWLoc), RParenLoc(RParenLoc) {}
5497 return T->getStmtClass() == BuiltinBitCastExprClass;
5507class CXXReflectExpr :
public Expr {
5511 using operand_type = llvm::PointerUnion<const TypeSourceInfo *>;
5514 operand_type Operand;
5526 return llvm::TypeSwitch<operand_type, SourceLocation>(Operand)
5528 [](
auto *Ptr) {
return Ptr->getTypeLoc().getBeginLoc(); });
5532 return llvm::TypeSwitch<operand_type, SourceLocation>(Operand)
5534 [](
auto *Ptr) {
return Ptr->getTypeLoc().getEndLoc(); });
5551 return T->getStmtClass() == CXXReflectExprClass;
5560 enum SubExpr { RANGE, INDEX, COUNT };
5561 Expr *SubExprs[COUNT];
5584 reinterpret_cast<Stmt **
>(SubExprs + COUNT));
5589 reinterpret_cast<Stmt **
>(
const_cast<Expr **
>(SubExprs)),
5590 reinterpret_cast<Stmt **
>(
const_cast<Expr **
>(SubExprs + COUNT)));
5594 return T->getStmtClass() == CXXExpansionSelectExprClass;
This file provides AST data structures related to concepts.
Defines enumerations for traits support.
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.
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.
*collection of selector each with an associated kind and an ordered *collection of selectors A selector has a kind
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 the clang::TemplateNameKind enum.
C Language Family Type Representation.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
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 ...
ArrayTypeTraitExpr(SourceLocation loc, ArrayTypeTrait att, TypeSourceInfo *queried, uint64_t value, Expr *dimension, SourceLocation rparen, QualType ty)
uint64_t getValue() const
SourceLocation getEndLoc() const LLVM_READONLY
ArrayTypeTrait getTrait() const
QualType getQueriedType() const
Expr * getDimensionExpression() const
ArrayTypeTraitExpr(EmptyShell Empty)
const_child_range children() const
static bool classof(const Stmt *T)
TypeSourceInfo * getQueriedTypeSourceInfo() const
friend class ASTStmtReader
SourceLocation getBeginLoc() const LLVM_READONLY
StringRef getOpcodeStr() const
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)
friend class ASTStmtReader
SourceLocation getBeginLoc() const LLVM_READONLY
Represents a call to a CUDA kernel function.
const CallExpr * getConfig() const
static CUDAKernelCallExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, bool HasFPFeatures, EmptyShell Empty)
static bool classof(const Stmt *T)
friend class ASTStmtReader
static bool classof(const Stmt *T)
static CXXAddrspaceCastExpr * CreateEmpty(const ASTContext &Context)
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
CXXTemporary * getTemporary()
const CXXTemporary * getTemporary() const
const Expr * getSubExpr() const
SourceLocation getEndLoc() const LLVM_READONLY
SourceLocation getBeginLoc() const LLVM_READONLY
const_child_range children() const
CXXBoolLiteralExpr(bool Val, QualType Ty, SourceLocation Loc)
SourceLocation getEndLoc() const
static bool classof(const Stmt *T)
static CXXBoolLiteralExpr * Create(const ASTContext &C, bool Val, QualType Ty, SourceLocation Loc)
CXXBoolLiteralExpr(EmptyShell Empty)
SourceLocation getBeginLoc() const
SourceLocation getLocation() const
void setLocation(SourceLocation L)
static bool classof(const Stmt *T)
static CXXConstCastExpr * CreateEmpty(const ASTContext &Context)
Represents a call to a C++ constructor.
bool hasUnusedResultAttr(const ASTContext &Ctx) const
Returns true if this call expression should warn on unused results.
SourceRange getParenOrBraceRange() const
const_arg_iterator arg_end() const
void setStdInitListInitialization(bool V)
void setConstructionKind(CXXConstructionKind CK)
ExprIterator arg_iterator
void setIsImmediateEscalating(bool Set)
llvm::iterator_range< arg_iterator > arg_range
bool isElidable() const
Whether this construction is elidable.
bool hadMultipleCandidates() const
Whether the referred constructor was resolved from an overloaded set having size greater than 1.
ConstExprIterator const_arg_iterator
std::pair< const NamedDecl *, const WarnUnusedResultAttr * > getUnusedResultAttr(const ASTContext &Ctx) const
Returns the WarnUnusedResultAttr that is declared on the callee or its return type declaration,...
Expr * getArg(unsigned Arg)
Return the specified argument.
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
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
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will (ultimately) call.
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)
friend class ASTStmtReader
const Expr * getArg(unsigned Arg) const
const Expr *const * getArgs() const
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...
SourceLocation getUsedLocation() const
Retrieve the location where this default argument was actually used.
const ParmVarDecl * getParam() const
const Expr * getExpr() const
Expr * getRewrittenExpr()
Expr * getAdjustedRewrittenExpr()
const Expr * getAdjustedRewrittenExpr() const
DeclContext * getUsedContext()
SourceLocation getExprLoc() const
const DeclContext * getUsedContext() const
const Expr * getRewrittenExpr() const
static bool classof(const Stmt *T)
static CXXDefaultArgExpr * CreateEmpty(const ASTContext &C, bool HasRewrittenInit)
friend class ASTStmtReader
bool hasRewrittenInit() const
A use of a default initializer in a constructor or in aggregate initialization.
static bool classof(const Stmt *T)
const DeclContext * getUsedContext() const
const FieldDecl * getField() const
const Expr * getRewrittenExpr() const
Retrieve the initializing expression with evaluated immediate calls, if any.
const Expr * getExpr() const
bool hasRewrittenInit() const
Expr * getExpr()
Get the initialization expression that will be used.
FieldDecl * getField()
Get the field whose initializer will be used.
static CXXDefaultInitExpr * CreateEmpty(const ASTContext &C, bool HasRewrittenInit)
Expr * getRewrittenExpr()
Retrieve the initializing expression with evaluated immediate calls, if any.
SourceLocation getBeginLoc() const
SourceLocation getEndLoc() const
const_child_range children() const
DeclContext * getUsedContext()
SourceLocation getUsedLocation() const
Retrieve the location where this default initializer expression was actually used.
friend class ASTStmtReader
static bool classof(const Stmt *T)
FunctionDecl * getOperatorDelete() const
SourceLocation getEndLoc() const LLVM_READONLY
CXXDeleteExpr(EmptyShell Shell)
const_child_range children() const
SourceLocation getBeginLoc() const
const Expr * getArgument() const
bool isGlobalDelete() const
friend class ASTStmtReader
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)
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.
NestedNameSpecifier getQualifier() const
Retrieve the nested-name-specifier that qualifies the member name.
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.
const DeclarationNameInfo & getMemberNameInfo() const
Retrieve the name of the member that this expression refers to.
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.
const TemplateArgumentLoc * getTemplateArgs() const
Retrieve the template arguments provided as part of this template-id.
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
NamedDecl * getFirstQualifierFoundInScope() const
Retrieve the first part of the nested-name-specifier that was found in the scope of the member access...
Expr * getBase() const
Retrieve the base object of this member expressions, e.g., the x in x.m.
friend class ASTStmtWriter
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the member name, with source location information.
const_child_range children() const
friend class ASTStmtReader
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.
ArrayRef< TemplateArgumentLoc > template_arguments() const
Represents a C++ destructor within a class.
static bool classof(const Stmt *T)
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.
SourceLocation getEndLoc() const
InitListExpr * getRangeExpr()
CXXExpansionSelectExpr(EmptyShell Empty)
void setIndexExpr(Expr *E)
const Expr * getIndexExpr() const
void setRangeExpr(InitListExpr *E)
const InitListExpr * getRangeExpr() const
SourceLocation getBeginLoc() const
static bool classof(const Stmt *T)
friend class ASTStmtReader
const_child_range children() const
static bool classof(const Stmt *T)
SourceLocation getBeginLoc() const LLVM_READONLY
UnresolvedLookupExpr * getCallee() const
Expr * getInit() const
Get the operand that doesn't contain a pack, for a binary fold.
CXXFoldExpr(EmptyShell Empty)
CXXFoldExpr(QualType T, UnresolvedLookupExpr *Callee, SourceLocation LParenLoc, Expr *LHS, BinaryOperatorKind Opcode, SourceLocation EllipsisLoc, Expr *RHS, SourceLocation RParenLoc, UnsignedOrNone NumExpansions)
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?
UnsignedOrNone getNumExpansions() const
bool isRightFold() const
Does this produce a right-associated sequence of operators?
friend class ASTStmtWriter
Expr * getPattern() const
Get the pattern, that is, the operand that contains an unexpanded pack.
friend class ASTStmtReader
SourceLocation getRParenLoc() const
BinaryOperatorKind getOperator() const
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
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...
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will call.
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
friend class ASTStmtReader
bool inheritedFromVBase() const
Determine whether the inherited constructor is inherited from a virtual base of the object we constru...
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)
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.
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
friend class ASTStmtReader
SourceLocation getEndLoc() const LLVM_READONLY
SourceLocation getRParenLoc() const
Retrieve the location of the closing parenthesis.
static CXXNewExpr * CreateEmpty(const ASTContext &Ctx, bool IsArray, bool HasInit, unsigned NumPlacementArgs, bool IsParenTypeId)
Create an empty c++ new expression.
SourceRange getDirectInitRange() const
llvm::iterator_range< arg_iterator > placement_arguments()
ExprIterator arg_iterator
QualType getAllocatedType() const
unsigned getNumImplicitArgs() const
arg_iterator placement_arg_end()
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 placement_arg_begin() const
std::optional< Expr * > getArraySize()
This might return std::nullopt even if isArray() returns true, since there might not be an array size...
SourceLocation getEndLoc() const
CXXNewInitializationStyle getInitializationStyle() const
The kind of initializer this new-expression has.
ImplicitAllocationParameters implicitAllocationParameters() const
Provides the full set of information about expected implicit parameters in this call.
Expr * getPlacementArg(unsigned I)
bool hasInitializer() const
Whether this new-expression has any initializer at all.
const Expr * getInitializer() const
bool shouldNullCheckAllocation() const
True if the allocation result needs to be null-checked.
const Expr * getPlacementArg(unsigned I) const
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.
FunctionDecl * getOperatorDelete() const
unsigned getNumPlacementArgs() const
const CXXConstructExpr * getConstructExpr() const
Returns the CXXConstructExpr from this new-expression, or null.
llvm::iterator_range< const_arg_iterator > placement_arguments() const
const_arg_iterator placement_arg_end() const
TypeSourceInfo * getAllocatedTypeSourceInfo() const
SourceRange getSourceRange() const
SourceRange getTypeIdParens() const
Expr ** getPlacementArgs()
bool isParenTypeId() 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 ...
const_arg_iterator raw_arg_end() const
const_child_range children() const
friend class ASTStmtWriter
arg_iterator placement_arg_begin()
raw_arg_iterator raw_arg_begin()
void setOperatorNew(FunctionDecl *D)
friend class ASTStmtReader
FunctionDecl * getOperatorNew() const
const_arg_iterator raw_arg_begin() const
ConstExprIterator const_arg_iterator
Expr * getInitializer()
The initializer of this new-expression.
static bool classof(const Stmt *T)
const_child_range children() const
SourceLocation getEndLoc() const
Expr * getOperand() const
SourceLocation getBeginLoc() const
SourceRange getSourceRange() const
CXXNoexceptExpr(EmptyShell Empty)
CXXNoexceptExpr(QualType Ty, Expr *Operand, CanThrowResult Val, SourceLocation Keyword, SourceLocation RParen)
friend class ASTStmtReader
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
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.
static CXXOperatorCallExpr * Create(const ASTContext &Ctx, OverloadedOperatorKind OpKind, Expr *Fn, ArrayRef< Expr * > Args, QualType Ty, ExprValueKind VK, SourceLocation OperatorLoc, FPOptionsOverride FPFeatures, ADLCallKind UsesADL=NotADL, bool IsReversed=false)
SourceLocation getEndLoc() const
SourceLocation getExprLoc() const LLVM_READONLY
bool isReversed() const
Whether this is a C++20 rewritten reversed operator.
OverloadedOperatorKind getOperator() const
Returns the kind of overloaded operator that this expression refers to.
friend class ASTStmtWriter
static CXXOperatorCallExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, bool HasFPFeatures, EmptyShell Empty)
friend class ASTStmtReader
SourceLocation getBeginLoc() const
static bool isComparisonOp(OverloadedOperatorKind Opc)
static bool isAssignmentOp(OverloadedOperatorKind Opc)
bool isComparisonOp() const
SourceRange getSourceRange() const
ArrayRef< Expr * > getInitExprs() const
SourceRange getSourceRange() const LLVM_READONLY
const_child_range children() const
void setInitializedFieldInUnion(FieldDecl *FD)
SourceLocation getEndLoc() const LLVM_READONLY
SourceLocation getInitLoc() const LLVM_READONLY
MutableArrayRef< Expr * > getInitExprs()
ArrayRef< Expr * > getUserSpecifiedInitExprs() const
CXXParenListInitExpr(EmptyShell Empty, unsigned NumExprs)
friend class TrailingObjects
static CXXParenListInitExpr * CreateEmpty(ASTContext &C, unsigned numExprs, EmptyShell Empty)
const FieldDecl * getInitializedFieldInUnion() const
SourceLocation getBeginLoc() const LLVM_READONLY
MutableArrayRef< Expr * > getUserSpecifiedInitExprs()
static bool classof(const Stmt *T)
friend class ASTStmtWriter
friend class ASTStmtReader
FieldDecl * getInitializedFieldInUnion()
const Expr * getArrayFiller() const
void setArrayFiller(Expr *E)
TypeSourceInfo * getDestroyedTypeInfo() const
Retrieve the source location information for the type being destroyed.
SourceLocation getBeginLoc() const LLVM_READONLY
bool isArrow() const
Determine whether this pseudo-destructor expression was written using an '->' (otherwise,...
TypeSourceInfo * getScopeTypeInfo() const
Retrieve the scope type in a qualified pseudo-destructor expression.
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 '~'.
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.
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.
const IdentifierInfo * getDestroyedTypeIdentifier() const
In a dependent pseudo-destructor expression for which we do not have full type information on the des...
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 ...
friend class ASTStmtReader
CXXPseudoDestructorExpr(EmptyShell Shell)
Represents a C++ struct/union/class.
SourceLocation getBeginLoc() const LLVM_READONLY
SourceLocation getOperatorLoc() const
Returns location of the '^^'-operator.
const_child_range children() const
SourceLocation getEndLoc() const LLVM_READONLY
static bool classof(const Stmt *T)
static CXXReflectExpr * CreateEmpty(ASTContext &C)
static bool classof(const Stmt *T)
static CXXReinterpretCastExpr * CreateEmpty(const ASTContext &Context, unsigned pathSize)
Expr * getSemanticForm()
Get an equivalent semantic form for this expression.
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)
const Expr * getLHS() const
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)
BinaryOperatorKind getOpcode() const
friend class ASTStmtReader
bool isAssignmentOp() const
static StringRef getOpcodeStr(BinaryOperatorKind Op)
DecomposedForm getDecomposedForm() const LLVM_READONLY
Decompose this operator into its syntactic form.
const Expr * getSemanticForm() const
CXXScalarValueInitExpr(EmptyShell Shell)
const_child_range children() const
TypeSourceInfo * getTypeSourceInfo() const
SourceLocation getBeginLoc() const LLVM_READONLY
static bool classof(const Stmt *T)
friend class ASTStmtReader
SourceLocation getEndLoc() const
SourceLocation getRParenLoc() const
CXXScalarValueInitExpr(QualType Type, TypeSourceInfo *TypeInfo, SourceLocation RParenLoc)
Create an explicitly-written scalar-value initialization expression.
static CXXStaticCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize, bool hasFPFeatures)
static bool classof(const Stmt *T)
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
friend class ASTStmtReader
static bool classof(const Stmt *S)
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
friend class ASTStmtReader
Represents a C++ temporary.
const CXXDestructorDecl * getDestructor() const
void setDestructor(const CXXDestructorDecl *Dtor)
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
SourceLocation getLocation() const
CXXThrowExpr(EmptyShell Empty)
const_child_range children() const
SourceLocation getEndLoc() const LLVM_READONLY
const Expr * getSubExpr() const
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)
friend class ASTStmtReader
CXXTypeidExpr(QualType Ty, Expr *Operand, SourceRange R)
static bool classof(const Stmt *T)
CXXTypeidExpr(QualType Ty, TypeSourceInfo *Operand, SourceRange R)
bool isTypeOperand() const
QualType getTypeOperand(const ASTContext &Context) const
Retrieves the type operand of this typeid() expression after various required adjustments (removing r...
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
SourceLocation getBeginLoc() const LLVM_READONLY
Expr * getExprOperand() const
SourceRange getSourceRange() const LLVM_READONLY
bool isMostDerived(const ASTContext &Context) const
Best-effort check if the expression operand refers to a most derived object.
void setSourceRange(SourceRange R)
const_child_range children() const
SourceLocation getEndLoc() const LLVM_READONLY
friend class ASTStmtReader
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.
TypeSourceInfo * getTypeSourceInfo() const
Retrieve the type source information for the type being constructed.
const_arg_range arguments() const
QualType getTypeAsWritten() const
Retrieve the type that is being constructed, as specified in the source code.
const_arg_iterator arg_end() const
SourceLocation getEndLoc() const LLVM_READONLY
llvm::iterator_range< const_arg_iterator > const_arg_range
void setLParenLoc(SourceLocation L)
const Expr * getArg(unsigned I) const
Expr * getArg(unsigned I)
SourceLocation getRParenLoc() const
Retrieve the location of the right parentheses (')') that follows the argument list.
SourceLocation getBeginLoc() const LLVM_READONLY
friend class ASTStmtReader
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
SourceLocation getBeginLoc() const LLVM_READONLY
static bool classof(const Stmt *T)
const_child_range children() const
Expr * getExprOperand() const
CXXUuidofExpr(QualType Ty, TypeSourceInfo *Operand, MSGuidDecl *Guid, SourceRange R)
MSGuidDecl * getGuidDecl() const
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)
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
void setSourceRange(SourceRange R)
friend class ASTStmtReader
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]).
Expr * getArg(unsigned Arg)
getArg - Return the specified argument.
static constexpr ADLCallKind NotADL
SourceLocation getBeginLoc() const
CallExpr(StmtClass SC, Expr *Fn, ArrayRef< Expr * > PreArgs, ArrayRef< Expr * > Args, QualType Ty, ExprValueKind VK, SourceLocation RParenLoc, FPOptionsOverride FPFeatures, unsigned MinNumArgs, ADLCallKind UsesADL)
Build a call expression, assuming that appropriate storage has been allocated for the trailing object...
SourceLocation getRParenLoc() const
static constexpr ADLCallKind UsesADL
Stmt * getPreArg(unsigned I)
FPOptionsOverride * getTrailingFPFeatures()
Return a pointer to the trailing FPOptions.
unsigned path_size() const
bool hasStoredFPFeatures() const
void setIsImplicit(bool value=true)
static bool classof(const Stmt *T)
CoawaitExpr(EmptyShell Empty)
friend class ASTStmtReader
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
SuspendReturnType getSuspendReturnType() const
CoroutineSuspendExpr(StmtClass SC, SourceLocation KeywordLoc, Expr *Operand, Expr *Common, Expr *Ready, Expr *Suspend, Expr *Resume, OpaqueValueExpr *OpaqueValue)
Expr * getReadyExpr() const
SourceLocation getKeywordLoc() const
Expr * getResumeExpr() const
SourceLocation getBeginLoc() const LLVM_READONLY
Expr * getSuspendExpr() const
CoroutineSuspendExpr(StmtClass SC, SourceLocation KeywordLoc, QualType Ty, Expr *Operand, Expr *Common)
static bool classof(const Stmt *T)
OpaqueValueExpr * getOpaqueValue() const
getOpaqueValue - Return the opaque value placeholder.
Expr * getCommonExpr() const
Expr * getOperand() const
const_child_range children() const
CoroutineSuspendExpr(StmtClass SC, EmptyShell Empty)
friend class ASTStmtReader
SourceLocation getEndLoc() const LLVM_READONLY
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)
friend class ASTStmtReader
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.
static bool classof(const Stmt *T)
DependentCoawaitExpr(EmptyShell Empty)
SourceLocation getEndLoc() const LLVM_READONLY
const_child_range children() const
Expr * getOperand() const
SourceLocation getBeginLoc() const LLVM_READONLY
DependentCoawaitExpr(SourceLocation KeywordLoc, QualType Ty, Expr *Op, UnresolvedLookupExpr *OpCoawait)
friend class ASTStmtReader
SourceLocation getKeywordLoc() const
UnresolvedLookupExpr * getOperatorCoawaitLookup() const
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...
ArrayRef< TemplateArgumentLoc > template_arguments() const
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...
NestedNameSpecifier getQualifier() const
Retrieve the nested-name-specifier that qualifies this declaration.
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.
friend class ASTStmtWriter
unsigned getNumTemplateArgs() const
DeclarationName getDeclName() const
Retrieve the name that this expression refers to.
TemplateArgumentLoc const * getTemplateArgs() const
void copyTemplateArgumentsInto(TemplateArgumentListInfo &List) const
Copies the template arguments (if present) into the given structure.
friend class ASTStmtReader
const DeclarationNameInfo & getNameInfo() const
Retrieve the name that this expression refers to.
ExplicitCastExpr(StmtClass SC, QualType exprTy, ExprValueKind VK, CastKind kind, Expr *op, unsigned PathSize, bool HasFPFeatures, TypeSourceInfo *writtenTy)
bool cleanupsHaveSideEffects() const
static bool classof(const Stmt *T)
CleanupObject getObject(unsigned i) const
ArrayRef< CleanupObject > getObjects() const
unsigned getNumObjects() const
SourceLocation getEndLoc() const LLVM_READONLY
friend class ASTStmtReader
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
This represents one expression.
static std::pair< const NamedDecl *, const WarnUnusedResultAttr * > getUnusedResultAttrImpl(const Decl *Callee, QualType ReturnType)
Returns the WarnUnusedResultAttr that is declared on the callee or its return type declaration,...
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).
Expr * IgnoreParens() LLVM_READONLY
Skip past any parentheses which might surround this expression until reaching a fixed point.
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.
ExpressionTraitExpr(SourceLocation loc, ExpressionTrait et, Expr *queried, bool value, SourceLocation rparen, QualType resultType)
static bool classof(const Stmt *T)
ExpressionTraitExpr(EmptyShell Empty)
SourceLocation getBeginLoc() const LLVM_READONLY
Expr * getQueriedExpression() const
ExpressionTrait getTrait() const
friend class ASTStmtReader
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(StmtClass SC, Expr *subexpr)
Represents a function declaration or definition.
const_child_range children() const
ValueDecl * getExpansion(unsigned I) const
Get an expansion of the parameter pack by index.
SourceLocation getEndLoc() const LLVM_READONLY
ValueDecl *const * iterator
Iterators over the parameters which the parameter pack expanded into.
ValueDecl * getParameterPack() const
Get the parameter pack which this expression refers to.
SourceLocation getBeginLoc() const LLVM_READONLY
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.
friend class ASTStmtReader
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 an C or C++ initializer list.
SourceLocation getBeginLoc() const LLVM_READONLY
SourceLocation getEndLoc() const LLVM_READONLY
Describes the capture of a variable or of this, or of a C++1y init-capture.
llvm::iterator_range< const_capture_init_iterator > capture_inits() const
Retrieve the initialization expressions for this lambda's captures.
Expr ** capture_init_iterator
Iterator that walks over the capture initialization arguments.
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.
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.
CompoundStmt * getCompoundStmtBody()
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.
const AssociatedConstraint & getTrailingRequiresClause() const
Get the trailing requires clause, if any.
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.
friend class ASTStmtWriter
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.
capture_iterator explicit_capture_begin() const
Retrieve an iterator pointing to the first explicit lambda capture.
llvm::iterator_range< capture_init_iterator > capture_inits()
Retrieve the initialization expressions for this lambda's captures.
friend class ASTStmtReader
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...
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-...
An instance of this class represents the declaration of a property member.
const_child_range children() const
NestedNameSpecifierLoc getQualifierLoc() const
MSPropertyRefExpr(EmptyShell Empty)
bool isImplicitAccess() const
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation getEndLoc() const
MSPropertyDecl * getPropertyDecl() const
Expr * getBaseExpr() const
MSPropertyRefExpr(Expr *baseExpr, MSPropertyDecl *decl, bool isArrow, QualType ty, ExprValueKind VK, NestedNameSpecifierLoc qualifierLoc, SourceLocation nameLoc)
static bool classof(const Stmt *T)
SourceLocation getBeginLoc() const
friend class ASTStmtReader
SourceLocation getMemberLoc() const
static bool classof(const Stmt *T)
const Expr * getIdx() 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.
const Expr * getBase() const
SourceLocation getBeginLoc() const LLVM_READONLY
friend class ASTStmtReader
SourceLocation getRBracketLoc() const
MaterializeTemporaryExpr(QualType T, Expr *Temporary, bool BoundToLvalueReference, LifetimeExtendedTemporaryDecl *MTD=nullptr)
const LifetimeExtendedTemporaryDecl * getLifetimeExtendedTemporaryDecl() const
StorageDuration getStorageDuration() const
Retrieve the storage duration for the materialized temporary.
Expr * getSubExpr() const
Retrieve the temporary-generating subexpression whose value will be materialized into a glvalue.
APValue * getOrCreateValue(bool MayCreate) const
Get the storage for the constant value of a materialized temporary of static storage duration.
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.
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)
LifetimeExtendedTemporaryDecl * getLifetimeExtendedTemporaryDecl()
friend class ASTStmtWriter
void setExtendingDecl(ValueDecl *ExtendedBy, unsigned ManglingNumber)
SourceLocation getEndLoc() const LLVM_READONLY
friend class ASTStmtReader
const ValueDecl * getExtendingDecl() const
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.
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.
static bool classof(const Stmt *T)
ASTTemplateKWAndArgsInfo * getTrailingASTTemplateKWAndArgsInfo()
Return the optional template keyword and arguments info.
bool isVarDeclReference() const
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.
NestedNameSpecifier getQualifier() const
Fetches the nested-name qualifier, if one was given.
SourceLocation getLAngleLoc() const
Retrieve the location of the left angle bracket starting the explicit template argument list followin...
const DeclarationNameInfo & getNameInfo() const
Gets the full name info.
const CXXRecordDecl * getNamingClass() const
SourceLocation getNameLoc() const
Gets the location of the name.
UnresolvedSetImpl::iterator decls_iterator
decls_iterator decls_begin() const
CXXRecordDecl * getNamingClass()
Gets the naming class of this lookup, if any.
unsigned getNumDecls() const
Gets the number of declarations in the unresolved set.
TemplateDecl * getTemplateDecl() const
TemplateTemplateParmDecl * getTemplateTemplateDecl() 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
TemplateArgumentLoc const * getTemplateArgs() const
llvm::iterator_range< decls_iterator > decls() const
friend class ASTStmtWriter
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)
const DeclAccessPair * getTrailingResults() const
bool isConceptReference() const
friend class ASTStmtReader
bool hasTemplateKWAndArgsInfo() const
decls_iterator decls_end() const
unsigned getNumTemplateArgs() const
const TemplateArgumentLoc * getTrailingTemplateArgumentLoc() 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
Expr * getPattern()
Retrieve the pattern of the pack expansion.
const Expr * getPattern() const
Retrieve the pattern of the pack expansion.
UnsignedOrNone getNumExpansions() const
Determine the number of expansions that will be produced when this pack expansion is instantiated,...
SourceLocation getBeginLoc() const LLVM_READONLY
SourceLocation getEndLoc() const LLVM_READONLY
friend class ASTStmtWriter
PackExpansionExpr(Expr *Pattern, SourceLocation EllipsisLoc, UnsignedOrNone NumExpansions)
const_child_range children() const
friend class ASTStmtReader
SourceLocation getEllipsisLoc() const
Retrieve the location of the ellipsis that describes this pack expansion.
PackExpansionExpr(EmptyShell Empty)
static bool classof(const Stmt *T)
NamedDecl * getPackDecl() const
static PackIndexingExpr * CreateDeserialized(ASTContext &Context, unsigned NumTransformedExprs)
SourceLocation getEllipsisLoc() const
Determine the location of the 'sizeof' keyword.
Expr * getIndexExpr() const
ArrayRef< Expr * > getExpressions() const
Return the trailing expressions, regardless of the expansion.
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.
bool expandsToEmptyPack() const
Determine if the expression was expanded to empty.
Expr * getPackIdExpression() const
friend class ASTStmtWriter
Expr * getSelectedExpr() const
static bool classof(const Stmt *T)
bool isFullySubstituted() const
UnsignedOrNone getSelectedIndex() const
friend class ASTStmtReader
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.
PseudoDestructorTypeStorage(const IdentifierInfo *II, SourceLocation Loc)
const IdentifierInfo * getIdentifier() const
PseudoDestructorTypeStorage()=default
SourceLocation getLocation() const
TypeSourceInfo * getTypeSourceInfo() const
A (possibly-)qualified type.
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)
bool isPartiallySubstituted() const
Determine whether this represents a partially-substituted sizeof... expression, such as is produced f...
const_child_range children() const
SourceLocation getBeginLoc() const LLVM_READONLY
ArrayRef< TemplateArgument > getPartialArguments() const
Get.
SourceLocation getOperatorLoc() const
Determine the location of the 'sizeof' keyword.
friend class ASTStmtWriter
SourceLocation getRParenLoc() const
Determine the location of the right parenthesis.
NamedDecl * getPack() const
Retrieve the parameter pack.
friend class ASTStmtReader
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.
ExpressionTraitExprBitfields ExpressionTraitExprBits
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
OverloadExprBitfields OverloadExprBits
CXXConstructExprBitfields CXXConstructExprBits
CXXDependentScopeMemberExprBitfields CXXDependentScopeMemberExprBits
ConstCastIterator< Expr > ConstExprIterator
TypeTraitExprBitfields TypeTraitExprBits
CXXNewExprBitfields CXXNewExprBits
CXXNullPtrLiteralExprBitfields CXXNullPtrLiteralExprBits
CoawaitExprBitfields CoawaitBits
llvm::iterator_range< child_iterator > child_range
CXXFoldExprBitfields CXXFoldExprBits
CXXThrowExprBitfields CXXThrowExprBits
PackIndexingExprBitfields PackIndexingExprBits
ConstStmtIterator const_child_iterator
CXXBoolLiteralExprBitfields CXXBoolLiteralExprBits
CXXOperatorCallExprBitfields CXXOperatorCallExprBits
CXXDefaultInitExprBitfields CXXDefaultInitExprBits
DependentScopeDeclRefExprBitfields DependentScopeDeclRefExprBits
ArrayTypeTraitExprBitfields ArrayTypeTraitExprBits
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
Decl * getAssociatedDecl() const
A template-like entity which owns the whole pattern being substituted.
SubstNonTypeTemplateParmExpr(QualType Ty, ExprValueKind ValueKind, SourceLocation Loc, Expr *Replacement, Decl *AssociatedDecl, QualType ParamType, unsigned Index, UnsignedOrNone PackIndex, bool Final)
UnsignedOrNone getPackIndex() const
SourceLocation getEndLoc() const
const_child_range children() const
QualType getParameterType() const
Determine the substituted type of the template parameter.
unsigned getIndex() const
Returns the index of the replaced parameter in the associated declaration.
SourceLocation getNameLoc() const
NonTypeTemplateParmDecl * getParameter() const
SourceLocation getBeginLoc() const
Expr * getReplacement() const
static bool classof(const Stmt *s)
friend class ASTStmtReader
Represents a reference to a non-type template parameter pack that has been substituted with a non-tem...
SourceLocation getBeginLoc() const LLVM_READONLY
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.
Decl * getAssociatedDecl() const
A template-like entity which owns the whole pattern 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
friend class ASTStmtReader
A convenient class for passing around template argument information.
Location wrapper for a TemplateArgument.
Represents a template argument.
The base class of all kinds of template declarations (e.g., class, function, etc.).
Stores a list of template parameters for a TemplateDecl and its derived classes.
TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in.
A container of type source information.
QualType getType() const
Return the type wrapped by this type source info.
bool getBoolValue() const
ArrayRef< TypeSourceInfo * > getArgs() const
Retrieve the argument types.
SourceLocation getEndLoc() const LLVM_READONLY
TypeSourceInfo * getArg(unsigned I) const
Retrieve the Ith argument.
const_child_range children() const
unsigned getNumArgs() const
Determine the number of arguments to this type trait.
static TypeTraitExpr * CreateDeserialized(const ASTContext &C, bool IsStoredAsBool, unsigned NumArgs)
TypeTrait getTrait() const
Determine which type trait this expression uses.
friend class ASTStmtWriter
SourceLocation getBeginLoc() const LLVM_READONLY
const APValue & getAPValue() const
friend class ASTStmtReader
static bool classof(const Stmt *T)
bool isStoredAsBoolean() const
The base class of the type hierarchy.
const T * castAs() const
Member-template castAs<specific type>.
bool isSpecificBuiltinType(unsigned K) const
Test for a particular builtin type.
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
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
const CXXRecordDecl * getNamingClass() const
CXXRecordDecl * getNamingClass()
Gets the 'naming class' (in the sense of C++0x [class.access.base]p5) of the lookup.
SourceLocation getEndLoc() const LLVM_READONLY
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
friend class ASTStmtReader
friend class OverloadExpr
SourceLocation getEndLoc() const LLVM_READONLY
DeclarationName getMemberName() const
Retrieve the name of the member that this expression refers to.
QualType getBaseType() 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.
const Expr * getBase() const
const CXXRecordDecl * getNamingClass() const
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.
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...
const DeclarationNameInfo & getMemberNameInfo() const
Retrieve the full name info for the member that this expression refers to.
friend class ASTStmtReader
friend class OverloadExpr
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.
LiteralOperatorKind getLiteralOperatorKind() const
Returns the kind of literal operator invocation which this expression represents.
const Expr * getCookedLiteral() const
const IdentifierInfo * getUDSuffix() const
Returns the ud-suffix specified for this literal.
static UserDefinedLiteral * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, bool HasFPOptions, EmptyShell Empty)
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
friend class ASTStmtWriter
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)
friend class ASTStmtReader
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 ...
const internal::VariadicAllOfMatcher< Decl > decl
Matches declarations.
const internal::VariadicDynCastAllOfMatcher< Stmt, CastExpr > castExpr
Matches any cast nodes of Clang's AST.
The JSON file list parser is used to communicate input to InstallAPI.
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
bool isa(CodeGen::Address addr)
CanThrowResult
Possible results from evaluation of a noexcept expression.
AlignedAllocationMode alignedAllocationModeFromBool(bool IsAligned)
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)
@ Create
'create' clause, allowed on Compute and Combined constructs, plus 'data', 'enter data',...
nullptr
This class represents a compute construct, representing a 'Kind' of ‘parallel’, 'serial',...
bool isAlignedAllocation(AlignedAllocationMode Mode)
StorageDuration
The storage duration for an object (per C++ [basic.stc]).
@ SD_FullExpression
Full-expression storage duration (for temporaries).
@ Result
The result type of a method or function.
OptionalUnsigned< unsigned > UnsignedOrNone
const FunctionProtoType * T
@ Keyword
The name has been typo-corrected to a keyword.
bool isTypeAwareAllocation(TypeAwareAllocationMode Mode)
CastKind
CastKind - The kind of operation required for a conversion.
SizedDeallocationMode sizedDeallocationModeFromBool(bool IsSized)
@ TNK_Var_template
The name refers to a variable template whose specialization produces a variable.
@ TNK_Concept_template
The name refers to a concept.
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.
SmallVector< CXXBaseSpecifier *, 4 > CXXCastPath
A simple array of base specifiers.
bool isSizedDeallocation(SizedDeallocationMode Mode)
TypeAwareAllocationMode typeAwareAllocationModeFromBool(bool IsTypeAwareAllocation)
U cast(CodeGen::Address addr)
@ None
The alignment was not explicit in code.
@ Class
The "class" keyword introduces the elaborated-type-specifier.
CXXNewInitializationStyle
@ Parens
New-expression has a C++98 paren-delimited initializer.
@ Braces
New-expression has a C++11 list-initializer.
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 getBeginLoc() const
getBeginLoc - Retrieve the location of the first token.
SourceLocation getEndLoc() const LLVM_READONLY
ImplicitAllocationParameters(QualType AllocType, TypeAwareAllocationMode PassTypeIdentity, AlignedAllocationMode PassAlignment)
AlignedAllocationMode PassAlignment
ImplicitAllocationParameters(AlignedAllocationMode PassAlignment)
TypeAwareAllocationMode PassTypeIdentity
unsigned getNumImplicitArgs() const
unsigned getNumImplicitArgs() const
ImplicitDeallocationParameters(AlignedAllocationMode PassAlignment, SizedDeallocationMode PassSize)
TypeAwareAllocationMode PassTypeIdentity
SizedDeallocationMode PassSize
ImplicitDeallocationParameters(QualType DeallocType, TypeAwareAllocationMode PassTypeIdentity, AlignedAllocationMode PassAlignment, SizedDeallocationMode PassSize)
AlignedAllocationMode PassAlignment
static constexpr OptionalUnsigned fromInternalRepresentation(underlying_type Rep)
bool IsAddressOfOperandWithParen
bool HasFormOfMemberPointer
OverloadExpr * Expression
A placeholder type used to construct an empty shell of a type, that will be filled in later (e....
The parameters to pass to a usual operator delete.
TypeAwareAllocationMode TypeAwareDelete
AlignedAllocationMode Alignment