14 #ifndef LLVM_CLANG_AST_EXPRCXX_H 15 #define LLVM_CLANG_AST_EXPRCXX_H 38 #include "llvm/ADT/ArrayRef.h" 39 #include "llvm/ADT/None.h" 40 #include "llvm/ADT/Optional.h" 41 #include "llvm/ADT/PointerUnion.h" 42 #include "llvm/ADT/StringRef.h" 43 #include "llvm/ADT/iterator_range.h" 44 #include "llvm/Support/Casting.h" 45 #include "llvm/Support/Compiler.h" 46 #include "llvm/Support/TrailingObjects.h" 58 class NonTypeTemplateParmDecl;
59 class TemplateParameterList;
87 SourceRange getSourceRangeImpl() const LLVM_READONLY;
113 return Opc == OO_Equal || Opc == OO_StarEqual || Opc == OO_SlashEqual ||
114 Opc == OO_PercentEqual || Opc == OO_PlusEqual ||
115 Opc == OO_MinusEqual || Opc == OO_LessLessEqual ||
116 Opc == OO_GreaterGreaterEqual || Opc == OO_AmpEqual ||
117 Opc == OO_CaretEqual || Opc == OO_PipeEqual;
133 return (Operator < OO_Plus || Operator >= OO_Arrow ||
134 Operator == OO_PlusPlus || Operator == OO_MinusMinus)
178 CXXMemberCallExpr(
unsigned NumArgs,
EmptyShell Empty);
184 unsigned MinNumArgs = 0);
192 Expr *getImplicitObjectArgument()
const;
227 enum { CONFIG, END_PREARG };
234 unsigned MinNumArgs);
248 return cast_or_null<CallExpr>(
getPreArg(CONFIG));
281 :
Expr(CXXRewrittenBinaryOperatorClass, SemanticForm->
getType(),
286 SemanticForm(SemanticForm) {
290 :
Expr(CXXRewrittenBinaryOperatorClass, Empty), SemanticForm() {}
314 const Expr *
getLHS()
const {
return getDecomposedForm().LHS; }
315 const Expr *
getRHS()
const {
return getDecomposedForm().RHS; }
318 return getDecomposedForm().InnerBinOp->getExprLoc();
327 return getDecomposedForm().LHS->getBeginLoc();
330 return getDecomposedForm().RHS->getEndLoc();
339 return child_range(&SemanticForm, &SemanticForm + 1);
343 return T->
getStmtClass() == CXXRewrittenBinaryOperatorClass;
373 RParenLoc(RParenLoc), AngleBrackets(AngleBrackets) {}
379 const char *getCastName()
const;
394 case CXXStaticCastExprClass:
395 case CXXDynamicCastExprClass:
396 case CXXReinterpretCastExprClass:
397 case CXXConstCastExprClass:
417 writtenTy, l, RParenLoc, AngleBrackets) {}
419 explicit CXXStaticCastExpr(
EmptyShell Empty,
unsigned PathSize)
453 writtenTy, l, RParenLoc, AngleBrackets) {}
455 explicit CXXDynamicCastExpr(
EmptyShell Empty,
unsigned pathSize)
472 bool isAlwaysNull()
const;
490 CXXBaseSpecifier *> {
492 Expr *op,
unsigned pathSize,
497 pathSize, writtenTy, l, RParenLoc, AngleBrackets) {}
499 CXXReinterpretCastExpr(
EmptyShell Empty,
unsigned pathSize)
516 return T->
getStmtClass() == CXXReinterpretCastExprClass;
534 0, writtenTy, l, RParenLoc, AngleBrackets) {}
617 Expr *getCookedLiteral();
623 if (getLiteralOperatorKind() == LOK_Template)
655 :
Expr(CXXBoolLiteralExprClass, Empty) {}
692 :
Expr(CXXNullPtrLiteralExprClass, Empty) {}
716 Stmt *SubExpr =
nullptr;
719 :
Expr(CXXStdInitializerListExprClass, Empty) {}
749 return S->
getStmtClass() == CXXStdInitializerListExprClass;
766 llvm::PointerUnion<Stmt *, TypeSourceInfo *> Operand;
776 Operand->
getType()->isDependentType(),
777 Operand->
getType()->isInstantiationDependentType(),
779 Operand(Operand), Range(R) {}
790 Operand(Operand), Range(R) {}
793 :
Expr(CXXTypeidExprClass, Empty) {
795 Operand = (
Expr*)
nullptr;
802 bool isPotentiallyEvaluated()
const;
812 assert(isTypeOperand() &&
"Cannot call getTypeOperand for typeid(expr)");
817 assert(isTypeOperand() &&
"Cannot call getTypeOperand for typeid(expr)");
822 assert(!isTypeOperand() &&
"Cannot call getExprOperand for typeid(type)");
823 return static_cast<Expr*
>(Operand.get<
Stmt *>());
827 assert(!isTypeOperand() &&
"Cannot call getExprOperand for typeid(type)");
844 auto **begin =
reinterpret_cast<Stmt **
>(&Operand);
881 BaseExpr(baseExpr), TheDecl(decl),
882 MemberLoc(nameLoc), IsArrow(isArrow),
883 QualifierLoc(qualifierLoc) {}
892 return getBaseExpr() && getBaseExpr()->isImplicitCXXThis();
896 if (!isImplicitAccess())
898 else if (QualifierLoc)
940 enum { BASE_EXPR, IDX_EXPR, NUM_SUBEXPRS = 2 };
942 Stmt *SubExprs[NUM_SUBEXPRS];
945 void setBase(
Expr *
Base) { SubExprs[BASE_EXPR] = Base; }
946 void setIdx(
Expr *Idx) { SubExprs[IDX_EXPR] = Idx; }
954 RBracketLoc(RBracketLoc) {
955 SubExprs[BASE_EXPR] = Base;
956 SubExprs[IDX_EXPR] = Idx;
961 :
Expr(MSPropertySubscriptExprClass, Shell) {}
964 const Expr *
getBase()
const {
return cast<Expr>(SubExprs[BASE_EXPR]); }
967 const Expr *
getIdx()
const {
return cast<Expr>(SubExprs[IDX_EXPR]); }
970 return getBase()->getBeginLoc();
979 return getBase()->getExprLoc();
983 return T->
getStmtClass() == MSPropertySubscriptExprClass;
988 return child_range(&SubExprs[0], &SubExprs[0] + NUM_SUBEXPRS);
1002 llvm::PointerUnion<Stmt *, TypeSourceInfo *> Operand;
1010 Operand->
getType()->isDependentType(),
1011 Operand->
getType()->isInstantiationDependentType(),
1013 Operand(Operand), UuidStr(UuidStr), Range(R) {}
1019 Operand(Operand), UuidStr(UuidStr), Range(R) {}
1022 :
Expr(CXXUuidofExprClass, Empty) {
1024 Operand = (
Expr*)
nullptr;
1037 assert(isTypeOperand() &&
"Cannot call getTypeOperand for __uuidof(expr)");
1042 assert(isTypeOperand() &&
"Cannot call getTypeOperand for __uuidof(expr)");
1047 assert(!isTypeOperand() &&
"Cannot call getExprOperand for __uuidof(type)");
1048 return static_cast<Expr*
>(Operand.get<
Stmt *>());
1052 assert(!isTypeOperand() &&
"Cannot call getExprOperand for __uuidof(type)");
1070 if (isTypeOperand())
1072 auto **begin =
reinterpret_cast<Stmt **
>(&Operand);
1077 if (isTypeOperand())
1103 Ty->isDependentType(), Ty->isDependentType(),
1104 Ty->isInstantiationDependentType(),
1152 bool IsThrownVariableInScope)
1179 return getThrowLoc();
1180 return getSubExpr()->getEndLoc();
1189 return child_range(&Operand, Operand ? &Operand + 1 : &Operand);
1214 Param->hasUnparsedDefaultArg()
1215 ? Param->
getType().getNonReferenceType()
1216 : Param->getDefaultArg()->
getType(),
1220 Param(Param), UsedContext(UsedContext) {
1346 : Destructor(destructor) {}
1375 Stmt *SubExpr =
nullptr;
1378 :
Expr(CXXBindTemporaryExprClass, SubExpr->
getType(),
1383 Temp(temp), SubExpr(SubExpr) {}
1387 :
Expr(CXXBindTemporaryExprClass, Empty) {}
1458 inline Stmt **getTrailingArgs();
1459 const Stmt *
const *getTrailingArgs()
const {
1468 bool ListInitialization,
bool StdInitListInitialization,
1478 return NumArgs *
sizeof(
Stmt *);
1486 bool HadMultipleCandidates,
bool ListInitialization,
1487 bool StdInitListInitialization,
bool ZeroInitialization,
1566 return reinterpret_cast<const Expr *
const *
>(getTrailingArgs());
1574 assert(Arg <
getNumArgs() &&
"Arg access out of range!");
1578 assert(Arg <
getNumArgs() &&
"Arg access out of range!");
1584 assert(Arg <
getNumArgs() &&
"Arg access out of range!");
1621 unsigned ConstructsVirtualBase : 1;
1625 unsigned InheritedFromVirtualBase : 1;
1633 bool InheritedFromVirtualBase)
1636 Constructor(Ctor), Loc(Loc),
1637 ConstructsVirtualBase(ConstructsVirtualBase),
1638 InheritedFromVirtualBase(InheritedFromVirtualBase) {
1644 :
Expr(CXXInheritedCtorInitExprClass, Empty),
1645 ConstructsVirtualBase(
false), InheritedFromVirtualBase(
false) {}
1669 return T->
getStmtClass() == CXXInheritedCtorInitExprClass;
1699 castExpr, pathSize, writtenTy),
1700 LParenLoc(lParenLoc), RParenLoc(rParenLoc) {}
1731 return T->
getStmtClass() == CXXFunctionalCastExprClass;
1762 bool HadMultipleCandidates,
bool ListInitialization,
1763 bool StdInitListInitialization,
1764 bool ZeroInitialization);
1772 SourceRange ParenOrBraceRange,
bool HadMultipleCandidates,
1773 bool ListInitialization,
bool StdInitListInitialization,
1774 bool ZeroInitialization);
1785 return T->
getStmtClass() == CXXTemporaryObjectExprClass;
1789 Stmt **CXXConstructExpr::getTrailingArgs() {
1790 if (
auto *E = dyn_cast<CXXTemporaryObjectExpr>(
this))
1791 return reinterpret_cast<Stmt **
>(E + 1);
1793 "Unexpected class deriving from CXXConstructExpr!");
1794 return reinterpret_cast<Stmt **
>(
this + 1);
1827 unsigned NumCaptures : 16;
1831 unsigned CaptureDefault : 2;
1835 unsigned ExplicitParams : 1;
1838 unsigned ExplicitResultType : 1;
1854 bool ExplicitParams,
bool ExplicitResultType,
1856 bool ContainsUnexpandedParameterPack);
1860 :
Expr(LambdaExprClass, Empty), NumCaptures(NumCaptures),
1861 CaptureDefault(
LCD_None), ExplicitParams(
false),
1862 ExplicitResultType(
false) {
1863 getStoredStmts()[NumCaptures] =
nullptr;
1866 Stmt **getStoredStmts() {
return getTrailingObjects<Stmt *>(); }
1868 Stmt *
const *getStoredStmts()
const {
return getTrailingObjects<Stmt *>(); }
1881 SourceLocation ClosingBrace,
bool ContainsUnexpandedParameterPack);
1886 unsigned NumCaptures);
1895 return CaptureDefaultLoc;
1953 return llvm::make_range(capture_init_begin(), capture_init_end());
1958 return llvm::make_range(capture_init_begin(), capture_init_end());
1964 return reinterpret_cast<Expr **
>(getStoredStmts());
1970 return reinterpret_cast<Expr *
const *
>(getStoredStmts());
1976 return capture_init_begin() + NumCaptures;
1982 return capture_init_begin() + NumCaptures;
2021 bool isMutable()
const;
2042 return child_range(getStoredStmts(), getStoredStmts() + NumCaptures + 1);
2047 getStoredStmts() + NumCaptures + 1);
2064 false, Type->isInstantiationDependentType(),
2066 TypeInfo(TypeInfo) {
2071 :
Expr(CXXScalarValueInitExprClass, Shell) {}
2085 return T->
getStmtClass() == CXXScalarValueInitExprClass;
2137 unsigned arraySizeOffset()
const {
return 0; }
2138 unsigned initExprOffset()
const {
return arraySizeOffset() + isArray(); }
2139 unsigned placementNewArgsOffset()
const {
2140 return initExprOffset() + hasInitializer();
2143 unsigned numTrailingObjects(OverloadToken<Stmt *>)
const {
2144 return isArray() + hasInitializer() + getNumPlacementArgs();
2147 unsigned numTrailingObjects(OverloadToken<SourceRange>)
const {
2148 return isParenTypeId();
2166 FunctionDecl *OperatorDelete,
bool ShouldPassAlignment,
2175 bool IsParenTypeId);
2181 FunctionDecl *OperatorDelete,
bool ShouldPassAlignment,
2190 bool HasInit,
unsigned NumPlacementArgs,
2191 bool IsParenTypeId);
2198 return AllocatedTypeInfo;
2216 bool shouldNullCheckAllocation()
const;
2228 return cast_or_null<Expr>(getTrailingObjects<Stmt *>()[arraySizeOffset()]);
2233 return cast_or_null<Expr>(getTrailingObjects<Stmt *>()[arraySizeOffset()]);
2241 return reinterpret_cast<Expr **
>(getTrailingObjects<Stmt *>() +
2242 placementNewArgsOffset());
2246 assert((I < getNumPlacementArgs()) &&
"Index out of range!");
2247 return getPlacementArgs()[I];
2250 return const_cast<CXXNewExpr *
>(
this)->getPlacementArg(I);
2255 return isParenTypeId() ? getTrailingObjects<SourceRange>()[0]
2276 return hasInitializer()
2277 ? cast<Expr>(getTrailingObjects<Stmt *>()[initExprOffset()])
2281 return hasInitializer()
2282 ? cast<Expr>(getTrailingObjects<Stmt *>()[initExprOffset()])
2288 return dyn_cast_or_null<CXXConstructExpr>(getInitializer());
2306 return llvm::make_range(placement_arg_begin(), placement_arg_end());
2310 return llvm::make_range(placement_arg_begin(), placement_arg_end());
2314 return getTrailingObjects<Stmt *>() + placementNewArgsOffset();
2317 return placement_arg_begin() + getNumPlacementArgs();
2320 return getTrailingObjects<Stmt *>() + placementNewArgsOffset();
2323 return placement_arg_begin() + getNumPlacementArgs();
2330 return raw_arg_begin() + numTrailingObjects(OverloadToken<Stmt *>());
2333 return getTrailingObjects<Stmt *>();
2336 return raw_arg_begin() + numTrailingObjects(OverloadToken<Stmt *>());
2366 Stmt *Argument =
nullptr;
2370 bool ArrayFormAsWritten,
bool UsualArrayDeleteWantsSize,
2375 OperatorDelete(OperatorDelete), Argument(Arg) {
2431 llvm::PointerUnion<TypeSourceInfo *, IdentifierInfo *>
Type;
2440 : Type(II), Location(Loc) {}
2520 :
Expr(CXXPseudoDestructorExprClass, Shell), IsArrow(
false) {}
2608 return T->
getStmtClass() == CXXPseudoDestructorExprClass;
2646 size_t numTrailingObjects(OverloadToken<TypeSourceInfo *>)
const {
2680 assert(I <
getNumArgs() &&
"Argument out-of-range");
2686 return llvm::makeArrayRef(getTrailingObjects<TypeSourceInfo *>(),
2742 (queried->
getType()->isInstantiationDependentType() ||
2745 ATT(att), Value(value), Dimension(dimension),
2746 Loc(loc), RParen(rparen), QueriedType(queried) {}
2749 :
Expr(ArrayTypeTraitExprClass, Empty), ATT(0) {}
2799 Expr* QueriedExpression =
nullptr;
2805 Expr *queried,
bool value,
2813 ET(et),
Value(value), Loc(loc), RParen(rparen),
2814 QueriedExpression(queried) {}
2861 bool KnownDependent,
bool KnownInstantiationDependent,
2862 bool KnownContainsUnexpandedParameterPack);
2865 bool HasTemplateKWAndArgsInfo);
2870 return const_cast<OverloadExpr *
>(
this)->getTrailingResults();
2878 ->getTrailingASTTemplateKWAndArgsInfo();
2885 return const_cast<OverloadExpr *
>(
this)->getTrailingTemplateArgumentLoc();
2910 if (isa<UnaryOperator>(E)) {
2911 assert(cast<UnaryOperator>(E)->getOpcode() == UO_AddrOf);
2912 E = cast<UnaryOperator>(E)->getSubExpr();
2915 Result.HasFormOfMemberPointer = (E == Ovl && Ovl->getQualifier());
2916 Result.IsAddressOfOperand =
true;
2917 Result.Expression = Ovl;
2919 Result.HasFormOfMemberPointer =
false;
2920 Result.IsAddressOfOperand =
false;
2921 Result.Expression = cast<OverloadExpr>(E);
2931 return const_cast<OverloadExpr *
>(
this)->getNamingClass();
2942 llvm::iterator_range<decls_iterator>
decls()
const {
2943 return llvm::make_range(decls_begin(), decls_end());
2970 if (!hasTemplateKWAndArgsInfo())
2972 return getTrailingASTTemplateKWAndArgsInfo()->
TemplateKWLoc;
2978 if (!hasTemplateKWAndArgsInfo())
2980 return getTrailingASTTemplateKWAndArgsInfo()->
LAngleLoc;
2986 if (!hasTemplateKWAndArgsInfo())
2988 return getTrailingASTTemplateKWAndArgsInfo()->
RAngleLoc;
2998 if (!hasExplicitTemplateArgs())
3000 return const_cast<OverloadExpr *
>(
this)->getTrailingTemplateArgumentLoc();
3004 if (!hasExplicitTemplateArgs())
3011 return {getTemplateArgs(), getNumTemplateArgs()};
3016 if (hasExplicitTemplateArgs())
3017 getTrailingASTTemplateKWAndArgsInfo()->
copyInto(getTemplateArgs(), List);
3021 return T->
getStmtClass() == UnresolvedLookupExprClass ||
3040 ASTTemplateKWAndArgsInfo,
3041 TemplateArgumentLoc> {
3074 bool HasTemplateKWAndArgsInfo);
3076 unsigned numTrailingObjects(OverloadToken<DeclAccessPair>)
const {
3077 return getNumDecls();
3080 unsigned numTrailingObjects(OverloadToken<ASTTemplateKWAndArgsInfo>)
const {
3081 return hasTemplateKWAndArgsInfo();
3099 unsigned NumResults,
3100 bool HasTemplateKWAndArgsInfo,
3101 unsigned NumTemplateArgs);
3118 return l.getBeginLoc();
3119 return getNameInfo().getBeginLoc();
3123 if (hasExplicitTemplateArgs())
3124 return getRAngleLoc();
3125 return getNameInfo().getEndLoc();
3158 ASTTemplateKWAndArgsInfo,
3159 TemplateArgumentLoc> {
3176 size_t numTrailingObjects(OverloadToken<ASTTemplateKWAndArgsInfo>)
const {
3177 return hasTemplateKWAndArgsInfo();
3180 bool hasTemplateKWAndArgsInfo()
const {
3191 bool HasTemplateKWAndArgsInfo,
3192 unsigned NumTemplateArgs);
3218 if (!hasTemplateKWAndArgsInfo())
3220 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->TemplateKWLoc;
3226 if (!hasTemplateKWAndArgsInfo())
3228 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->LAngleLoc;
3234 if (!hasTemplateKWAndArgsInfo())
3236 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->RAngleLoc;
3248 if (hasExplicitTemplateArgs())
3249 getTrailingObjects<ASTTemplateKWAndArgsInfo>()->copyInto(
3250 getTrailingObjects<TemplateArgumentLoc>(), List);
3254 if (!hasExplicitTemplateArgs())
3257 return getTrailingObjects<TemplateArgumentLoc>();
3261 if (!hasExplicitTemplateArgs())
3264 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->NumTemplateArgs;
3268 return {getTemplateArgs(), getNumTemplateArgs()};
3278 if (hasExplicitTemplateArgs())
3279 return getRAngleLoc();
3280 return getLocation();
3284 return T->
getStmtClass() == DependentScopeDeclRefExprClass;
3326 unsigned numObjects);
3329 bool CleanupsHaveSideEffects,
3333 return llvm::makeArrayRef(getTrailingObjects<CleanupObject>(),
3340 assert(i < getNumObjects() &&
"Index out of range");
3341 return getObjects()[i];
3349 return SubExpr->getBeginLoc();
3353 return SubExpr->getEndLoc();
3409 :
Expr(CXXUnresolvedConstructExprClass, Empty) {
3466 assert(I < arg_size() &&
"Argument index out-of-range");
3471 assert(I < arg_size() &&
"Argument index out-of-range");
3476 assert(I < arg_size() &&
"Argument index out-of-range");
3482 if (!RParenLoc.
isValid() && arg_size() > 0)
3488 return T->
getStmtClass() == CXXUnresolvedConstructExprClass;
3498 auto **begin =
reinterpret_cast<Stmt **
>(
3514 ASTTemplateKWAndArgsInfo,
3515 TemplateArgumentLoc, NamedDecl *> {
3554 bool hasTemplateKWAndArgsInfo()
const {
3558 bool hasFirstQualifierFoundInScope()
const {
3562 unsigned numTrailingObjects(OverloadToken<ASTTemplateKWAndArgsInfo>)
const {
3563 return hasTemplateKWAndArgsInfo();
3566 unsigned numTrailingObjects(OverloadToken<TemplateArgumentLoc>)
const {
3567 return getNumTemplateArgs();
3570 unsigned numTrailingObjects(OverloadToken<NamedDecl *>)
const {
3571 return hasFirstQualifierFoundInScope();
3584 bool HasFirstQualifierFoundInScope);
3596 unsigned NumTemplateArgs,
bool HasFirstQualifierFoundInScope);
3610 assert(!isImplicitAccess());
3611 return cast<Expr>(Base);
3646 if (!hasFirstQualifierFoundInScope())
3648 return *getTrailingObjects<NamedDecl *>();
3653 return MemberNameInfo;
3666 if (!hasTemplateKWAndArgsInfo())
3668 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->TemplateKWLoc;
3674 if (!hasTemplateKWAndArgsInfo())
3676 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->LAngleLoc;
3682 if (!hasTemplateKWAndArgsInfo())
3684 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->RAngleLoc;
3697 if (hasExplicitTemplateArgs())
3698 getTrailingObjects<ASTTemplateKWAndArgsInfo>()->copyInto(
3699 getTrailingObjects<TemplateArgumentLoc>(), List);
3705 if (!hasExplicitTemplateArgs())
3708 return getTrailingObjects<TemplateArgumentLoc>();
3714 if (!hasExplicitTemplateArgs())
3717 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->NumTemplateArgs;
3721 return {getTemplateArgs(), getNumTemplateArgs()};
3725 if (!isImplicitAccess())
3728 return getQualifierLoc().getBeginLoc();
3733 if (hasExplicitTemplateArgs())
3734 return getRAngleLoc();
3739 return T->
getStmtClass() == CXXDependentScopeMemberExprClass;
3744 if (isImplicitAccess())
3750 if (isImplicitAccess())
3774 ASTTemplateKWAndArgsInfo,
3775 TemplateArgumentLoc> {
3816 bool HasTemplateKWAndArgsInfo);
3818 unsigned numTrailingObjects(OverloadToken<DeclAccessPair>)
const {
3819 return getNumDecls();
3822 unsigned numTrailingObjects(OverloadToken<ASTTemplateKWAndArgsInfo>)
const {
3823 return hasTemplateKWAndArgsInfo();
3836 unsigned NumResults,
3837 bool HasTemplateKWAndArgsInfo,
3838 unsigned NumTemplateArgs);
3844 bool isImplicitAccess()
const;
3849 assert(!isImplicitAccess());
3850 return cast<Expr>(Base);
3853 assert(!isImplicitAccess());
3854 return cast<Expr>(Base);
3894 if (!isImplicitAccess())
3897 return l.getBeginLoc();
3898 return getMemberNameInfo().getBeginLoc();
3902 if (hasExplicitTemplateArgs())
3903 return getRAngleLoc();
3904 return getMemberNameInfo().getEndLoc();
3913 if (isImplicitAccess())
3919 if (isImplicitAccess())
3926 if (
auto *ULE = dyn_cast<UnresolvedLookupExpr>(
this))
3928 return cast<UnresolvedMemberExpr>(
this)->getTrailingObjects<DeclAccessPair>();
3932 if (!hasTemplateKWAndArgsInfo())
3935 if (
auto *ULE = dyn_cast<UnresolvedLookupExpr>(
this))
3937 return cast<UnresolvedMemberExpr>(
this)
3938 ->getTrailingObjects<ASTTemplateKWAndArgsInfo>();
3942 if (
auto *ULE = dyn_cast<UnresolvedLookupExpr>(
this))
3944 return cast<UnresolvedMemberExpr>(
this)
3945 ->getTrailingObjects<TemplateArgumentLoc>();
3949 if (
auto *ULE = dyn_cast<UnresolvedLookupExpr>(
this))
3950 return ULE->getNamingClass();
3951 return cast<UnresolvedMemberExpr>(
this)->getNamingClass();
3972 Operand(Operand), Range(Keyword, RParen) {
4026 unsigned NumExpansions;
4037 EllipsisLoc(EllipsisLoc),
4038 NumExpansions(NumExpansions ? *NumExpansions + 1 : 0),
4057 return NumExpansions - 1;
4131 OperatorLoc(OperatorLoc), PackLoc(PackLoc), RParenLoc(RParenLoc),
4132 Length(Length ? *Length : PartialArgs.size()), Pack(Pack) {
4133 assert((!Length || PartialArgs.empty()) &&
4134 "have partial args for non-dependent sizeof... expression");
4135 auto *Args = getTrailingObjects<TemplateArgument>();
4136 std::uninitialized_copy(PartialArgs.begin(), PartialArgs.end(), Args);
4141 :
Expr(SizeOfPackExprClass, Empty), Length(NumPartialArgs) {}
4150 unsigned NumPartialArgs);
4170 "Cannot get the length of a value-dependent pack size expression");
4185 assert(isPartiallySubstituted());
4186 const auto *Args = getTrailingObjects<TemplateArgument>();
4187 return llvm::makeArrayRef(Args, Args + Length);
4220 :
Expr(SubstNonTypeTemplateParmExprClass, Empty) {}
4231 Param(Param), Replacement(Replacement) {
4246 return s->
getStmtClass() == SubstNonTypeTemplateParmExprClass;
4281 unsigned NumArguments;
4287 :
Expr(SubstNonTypeTemplateParmPackExprClass, Empty) {}
4310 return T->
getStmtClass() == SubstNonTypeTemplateParmPackExprClass;
4351 unsigned NumParameters;
4363 unsigned NumParams);
4424 llvm::PointerUnion<Stmt *, LifetimeExtendedTemporaryDecl *>
State;
4428 bool BoundToLvalueReference,
4432 :
Expr(MaterializeTemporaryExprClass, Empty) {}
4439 ? State.get<
Stmt *>()
4454 "the temporary has not been lifetime extended");
4470 return State.is<
Stmt *>() ?
nullptr 4478 void setExtendingDecl(
ValueDecl *ExtendedBy,
unsigned ManglingNumber);
4481 return State.is<
Stmt *>() ? 0
4493 return getSubExpr()->getBeginLoc();
4497 return getSubExpr()->getEndLoc();
4501 return T->
getStmtClass() == MaterializeTemporaryExprClass;
4506 return State.is<
Stmt *>()
4507 ?
child_range(State.getAddrOfPtr1(), State.getAddrOfPtr1() + 1)
4512 return State.is<
Stmt *>()
4514 State.getAddrOfPtr1() + 1)
4515 : const_cast<const LifetimeExtendedTemporaryDecl *>(
4538 unsigned NumExpansions;
4549 LParenLoc(LParenLoc), EllipsisLoc(EllipsisLoc), RParenLoc(RParenLoc),
4550 NumExpansions(NumExpansions ? *NumExpansions + 1 : 0), Opcode(Opcode) {
4562 return getLHS() && getLHS()->containsUnexpandedParameterPack();
4579 return NumExpansions - 1;
4617 enum SubExpr { Common, Ready, Suspend, Resume, Count };
4619 Stmt *SubExprs[SubExpr::Count];
4630 KeywordLoc(KeywordLoc), OpaqueValue(OpaqueValue) {
4631 SubExprs[SubExpr::Common] = Common;
4632 SubExprs[SubExpr::Ready] = Ready;
4633 SubExprs[SubExpr::Suspend] = Suspend;
4634 SubExprs[SubExpr::Resume] = Resume;
4641 KeywordLoc(KeywordLoc) {
4643 "wrong constructor for non-dependent co_await/co_yield expression");
4644 SubExprs[SubExpr::Common] = Common;
4645 SubExprs[SubExpr::Ready] =
nullptr;
4646 SubExprs[SubExpr::Suspend] =
nullptr;
4647 SubExprs[SubExpr::Resume] =
nullptr;
4651 SubExprs[SubExpr::Common] =
nullptr;
4652 SubExprs[SubExpr::Ready] =
nullptr;
4653 SubExprs[SubExpr::Suspend] =
nullptr;
4654 SubExprs[SubExpr::Resume] =
nullptr;
4660 return static_cast<Expr*
>(SubExprs[SubExpr::Common]);
4667 return static_cast<Expr*
>(SubExprs[SubExpr::Ready]);
4671 return static_cast<Expr*
>(SubExprs[SubExpr::Suspend]);
4675 return static_cast<Expr*
>(SubExprs[SubExpr::Resume]);
4681 return getCommonExpr()->getEndLoc();
4685 return child_range(SubExprs, SubExprs + SubExpr::Count);
4705 bool IsImplicit =
false)
4707 Suspend, Resume, OpaqueValue) {
4712 bool IsImplicit =
false)
4722 return getCommonExpr();
4748 KeywordLoc(KeywordLoc) {
4752 "wrong constructor for non-dependent co_await/co_yield expression");
4754 SubExprs[1] = OpCoawait;
4758 :
Expr(DependentCoawaitExprClass, Empty) {}
4763 return cast<UnresolvedLookupExpr>(SubExprs[1]);
4771 return getOperand()->getEndLoc();
4793 Suspend, Resume, OpaqueValue) {}
4801 return getCommonExpr();
4828 KWLoc(KWLoc), RParenLoc(RParenLoc) {}
4840 #endif // LLVM_CLANG_AST_EXPRCXX_H CXXUuidofExpr(QualType Ty, TypeSourceInfo *Operand, StringRef UuidStr, SourceRange R)
CoroutineSuspendExpr(StmtClass SC, SourceLocation KeywordLoc, Expr *Common, Expr *Ready, Expr *Suspend, Expr *Resume, OpaqueValueExpr *OpaqueValue)
Expr * getReadyExpr() const
A call to an overloaded operator written using operator syntax.
SourceLocation getLoc() const
getLoc - Returns the main location of the declaration name.
Raw form: operator "" X (const char *)
SourceLocation getBeginLoc() const LLVM_READONLY
MSPropertySubscriptExpr(EmptyShell Shell)
Create an empty array subscript expression.
CXXDeleteExpr(EmptyShell Shell)
void setRParenLoc(SourceLocation L)
LiteralOperatorKind
The kind of literal operator which is invoked.
operator "" X (long double)
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
The null pointer literal (C++11 [lex.nullptr])
const CXXDestructorDecl * getDestructor() const
SourceLocation getLAngleLoc() const
Retrieve the location of the left angle bracket starting the explicit template argument list followin...
SourceLocation getBeginLoc() const
unsigned getNumDecls() const
Gets the number of declarations in the unresolved set.
Represents a function declaration or definition.
Represents a 'co_await' expression while the type of the promise is dependent.
Optional< unsigned > getNumExpansions() const
Expr ** getArgs()
Retrieve the call arguments.
SourceLocation getEndLoc() const LLVM_READONLY
bool hasExplicitTemplateArgs() const
Determines whether this expression had explicit template arguments.
static bool classof(const Stmt *T)
CoawaitExpr(SourceLocation CoawaitLoc, QualType Ty, Expr *Operand, bool IsImplicit=false)
bool hasTemplateKeyword() const
Determines whether the name was preceded by the template keyword.
SourceLocation getRParenLoc() const
SourceLocation getEndLoc() const
UnresolvedMemberExprBitfields UnresolvedMemberExprBits
PointerType - C99 6.7.5.1 - Pointer Declarators.
CXXNullPtrLiteralExpr(QualType Ty, SourceLocation Loc)
llvm::iterator_range< arg_iterator > placement_arguments()
SourceLocation getUsedLocation() const
Retrieve the location where this default argument was actually used.
Stores the type being destroyed by a pseudo-destructor expression.
A (possibly-)qualified type.
CXXBoolLiteralExpr(EmptyShell Empty)
uint64_t getValue() const
SourceLocation getBeginLoc() const
ArrayRef< TemplateArgumentLoc > template_arguments() const
const Expr * getLHS() const
Expr * getArg(unsigned Arg)
getArg - Return the specified argument.
CXXDeleteExprBitfields CXXDeleteExprBits
SourceLocation getUsedLocation() const
Retrieve the location where this default initializer expression was actually used.
SourceRange getSourceRange() const
Defines enumerations for the type traits support.
void setLocation(SourceLocation L)
const Expr * getSubExpr() const
static QualType getObjectType(APValue::LValueBase B)
Retrieves the "underlying object type" of the given expression, as used by __builtin_object_size.
CoawaitExpr(EmptyShell Empty)
const_capture_init_iterator capture_init_begin() const
Retrieve the first initialization argument for this lambda expression (which initializes the first ca...
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
VarDecl * getParameterPack() const
Get the parameter pack which this expression refers to.
SourceLocation TemplateKWLoc
The source location of the template keyword; this is used as part of the representation of qualified ...
const_arg_iterator placement_arg_end() const
bool isListInitialization() const
Determine whether this expression models list-initialization.
SourceLocation getBeginLoc() const LLVM_READONLY
CXXThisExprBitfields CXXThisExprBits
bool hasExplicitResultType() const
Whether this lambda had its result type explicitly specified.
bool isThrownVariableInScope() const
Determines whether the variable thrown by this expression (if any!) is within the innermost try block...
CXXUnresolvedConstructExprBitfields CXXUnresolvedConstructExprBits
bool isLeftFold() const
Does this produce a left-associated sequence of operators?
Stmt - This represents one statement.
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this call.
Expr * getDimensionExpression() const
SourceLocation getUDSuffixLoc() const
Returns the location of a ud-suffix in the expression.
bool isArrayFormAsWritten() const
SourceLocation getLAngleLoc() const
Retrieve the location of the left angle bracket starting the explicit template argument list followin...
TemplateArgumentLoc const * getTemplateArgs() const
static bool classof(const Stmt *T)
C Language Family Type Representation.
SourceLocation getEndLoc() const LLVM_READONLY
const Expr * getSemanticForm() const
ArrayRef< CleanupObject > getObjects() const
FunctionDecl * getOperatorNew() const
LambdaCaptureDefault
The default, if any, capture method for a lambda expression.
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Defines the C++ template declaration subclasses.
const CXXRecordDecl * getNamingClass() const
const_child_range children() const
SourceLocation getEndLoc() const
const_child_range children() const
The base class of the type hierarchy.
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies this declaration.
bool requiresZeroInitialization() const
Whether this construction first requires zero-initialization before the initializer is called...
const_child_range children() const
SourceLocation getBeginLoc() const
getBeginLoc - Retrieve the location of the first token.
static bool classof(const Stmt *T)
CXXFoldExpr(QualType T, SourceLocation LParenLoc, Expr *LHS, BinaryOperatorKind Opcode, SourceLocation EllipsisLoc, Expr *RHS, SourceLocation RParenLoc, Optional< unsigned > NumExpansions)
SourceLocation getLocation() const
llvm::iterator_range< child_iterator > child_range
SourceLocation getKeywordLoc() const
Represents a call to a C++ constructor.
SourceLocation getEndLoc() const LLVM_READONLY
SourceLocation getBeginLoc() const LLVM_READONLY
An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent...
static bool classof(const Stmt *S)
const_child_range children() const
A container of type source information.
SourceLocation getBeginLoc() const LLVM_READONLY
NestedNameSpecifier * getQualifier() const
If the member name was qualified, retrieves the nested-name-specifier that precedes the member name...
StorageDuration
The storage duration for an object (per C++ [basic.stc]).
Floating point control options.
MS property subscript expression.
SourceLocation getBeginLoc() const LLVM_READONLY
SourceLocation getOperatorLoc() const
Determine the location of the 'sizeof' keyword.
SourceLocation getRParenLoc() const
static bool classof(const Stmt *T)
void setLocation(SourceLocation Loc)
Describes the capture of a variable or of this, or of a C++1y init-capture.
Represents a C++ constructor within a class.
Represents a prvalue temporary that is written into memory so that a reference can bind to it...
SourceLocation getEndLoc() const LLVM_READONLY
CXXRecordDecl * getNamingClass()
Gets the naming class of this lookup, if any.
void setRParenLoc(SourceLocation L)
static CXXOperatorCallExpr * Create(const ASTContext &Ctx, OverloadedOperatorKind OpKind, Expr *Fn, ArrayRef< Expr *> Args, QualType Ty, ExprValueKind VK, SourceLocation OperatorLoc, FPOptions FPFeatures, ADLCallKind UsesADL=NotADL)
const_child_range children() const
SourceLocation getBeginLoc() const LLVM_READONLY
Represents a variable declaration or definition.
const_child_range children() const
QualType getBaseType() const
SourceLocation getEndLoc() const LLVM_READONLY
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation getOperatorLoc() const
Retrieve the location of the '.' or '->' operator.
UnresolvedLookupExpr * getOperatorCoawaitLookup() const
IdentifierInfo * getIdentifier() const
SourceLocation getEndLoc() const
unsigned getNumArgs() const
Determine the number of arguments to this type trait.
SourceRange getSourceRange() const
llvm::iterator_range< arg_iterator > arg_range
CXXDeleteExpr(QualType Ty, bool GlobalDelete, bool ArrayForm, bool ArrayFormAsWritten, bool UsualArrayDeleteWantsSize, FunctionDecl *OperatorDelete, Expr *Arg, SourceLocation Loc)
SourceLocation getEndLoc() const
static bool classof(const Stmt *T)
DeclarationName getName() const
Gets the name looked up.
SourceLocation getEndLoc() const LLVM_READONLY
Implicit construction of a std::initializer_list<T> object from an array temporary within list-initia...
static bool classof(const Stmt *T)
Stores a list of template parameters for a TemplateDecl and its derived classes.
SourceLocation getBeginLoc() const LLVM_READONLY
static bool classof(const Stmt *T)
unsigned getNumPlacementArgs() const
bool requiresADL() const
True if this declaration should be extended by argument-dependent lookup.
const Expr * getRHS() const
static CXXDefaultInitExpr * Create(const ASTContext &Ctx, SourceLocation Loc, FieldDecl *Field, DeclContext *UsedContext)
Field is the non-static data member whose default initializer is used by this expression.
raw_arg_iterator raw_arg_begin()
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will call.
A C++ throw-expression (C++ [except.throw]).
Expr * getExprOperand() const
Represents an expression – generally a full-expression – that introduces cleanups to be run at the ...
TypeSourceInfo * getArg(unsigned I) const
Retrieve the Ith argument.
Represents a parameter to a function.
bool isAssignmentOp() const
CXXDefaultArgExpr(EmptyShell Empty)
bool hasQualifier() const
Evaluates true when this nested-name-specifier location is empty.
SourceLocation getBeginLoc() const LLVM_READONLY
CoawaitExprBitfields CoawaitBits
A C++ static_cast expression (C++ [expr.static.cast]).
Expr * getExprOperand() const
SourceLocation getEndLoc() const LLVM_READONLY
SourceLocation getRParenLoc() const
Retrieve the location of the closing parenthesis.
const LifetimeExtendedTemporaryDecl * getLifetimeExtendedTemporaryDecl() const
Expr * getSemanticForm()
Get an equivalent semantic form for this expression.
TypeSourceInfo * getScopeTypeInfo() const
Retrieve the scope type in a qualified pseudo-destructor expression.
One of these records is kept for each identifier that is lexed.
SourceLocation getTildeLoc() const
Retrieve the location of the '~'.
ValueDecl * getExtendingDecl()
bool cleanupsHaveSideEffects() const
const Expr * getArg(unsigned Arg) const
SourceLocation getBeginLoc() const LLVM_READONLY
SourceLocation getBeginLoc() const
void setExprOperand(Expr *E)
ExpressionTraitExpr(SourceLocation loc, ExpressionTrait et, Expr *queried, bool value, SourceLocation rparen, QualType resultType)
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
A C++ nested-name-specifier augmented with source location information.
static bool classof(const Stmt *T)
ConstCastIterator< Expr > ConstExprIterator
const_child_range children() const
static constexpr ADLCallKind UsesADL
const_child_range children() const
FullExpr - Represents a "full-expression" node.
static bool classof(const Stmt *T)
SourceLocation getBeginLoc() const LLVM_READONLY
Represents a member of a struct/union/class.
const FieldDecl * getField() const
Expr * getBase()
Retrieve the base object of this member expressions, e.g., the x in x.m.
static bool classof(const Stmt *T)
Defines the ExceptionSpecificationType enumeration and various utility functions. ...
NonTypeTemplateParmDecl * getParameter() const
SourceLocation getBeginLoc() const
const DeclarationNameInfo & getNameInfo() const
Gets the full name info.
llvm::iterator_range< const_arg_iterator > placement_arguments() const
void setRequiresZeroInitialization(bool ZeroInit)
SourceLocation getEndLoc() const LLVM_READONLY
void setArg(unsigned I, Expr *E)
const CXXConstructExpr * getConstructExpr() const
Returns the CXXConstructExpr from this new-expression, or null.
const Expr * getCookedLiteral() const
The iterator over UnresolvedSets.
void copyTemplateArgumentsInto(TemplateArgumentListInfo &List) const
Copies the template arguments (if present) into the given structure.
void copyTemplateArgumentsInto(TemplateArgumentListInfo &List) const
Copies the template arguments into the given structure.
bool isSpecificBuiltinType(unsigned K) const
Test for a particular builtin type.
Expr * getArg(unsigned I)
Represents a C++ member access expression for which lookup produced a set of overloaded functions...
CXXInheritedCtorInitExpr(EmptyShell Empty)
Construct an empty C++ inheriting construction expression.
SourceLocation getEndLoc() const LLVM_READONLY
static bool classof(const Stmt *T)
const_child_range children() const
CXXUuidofExpr(QualType Ty, Expr *Operand, StringRef UuidStr, SourceRange R)
Represents a reference to a non-type template parameter pack that has been substituted with a non-tem...
LambdaCaptureDefault getCaptureDefault() const
Determine the default capture kind for this lambda.
const_child_range children() const
ArrayRef< TemplateArgumentLoc > template_arguments() const
bool isGenericLambda() const
Whether this is a generic lambda.
bool hasExplicitTemplateArgs() const
Determines whether this lookup had explicit template arguments.
An r-value expression (a pr-value in the C++11 taxonomy) produces a temporary value.
SourceLocation getEndLoc() const LLVM_READONLY
void setDestroyedType(TypeSourceInfo *Info)
Set the destroyed type.
const Expr *const * const_arg_iterator
SourceLocation getBeginLoc() const
static bool classof(const Stmt *T)
SourceLocation getMemberLoc() const
A C++ typeid expression (C++ [expr.typeid]), which gets the type_info that corresponds to the supplie...
SourceLocation getBeginLoc() const LLVM_READONLY
Note: getBeginLoc() is the start of the whole DependentScopeDeclRefExpr, and differs from getLocation...
SourceLocation getBeginLoc() const LLVM_READONLY
Optional< Expr * > getArraySize()
MSPropertyRefExpr(Expr *baseExpr, MSPropertyDecl *decl, bool isArrow, QualType ty, ExprValueKind VK, NestedNameSpecifierLoc qualifierLoc, SourceLocation nameLoc)
unsigned getNumExpansions() const
Get the number of parameters in this parameter pack.
SourceLocation getEndLoc() const
SourceLocation getBeginLoc() const LLVM_READONLY
void setOperatorNew(FunctionDecl *D)
FunctionDecl * getOperatorDelete() const
void setLocation(SourceLocation L)
bool isElidable() const
Whether this construction is elidable.
Expr * getOperand() const
CXXScalarValueInitExprBitfields CXXScalarValueInitExprBits
static bool classof(const Stmt *T)
bool HasFormOfMemberPointer
SourceLocation getParameterPackLocation() const
Retrieve the location of the parameter pack name.
const_child_range children() const
A convenient class for passing around template argument information.
PseudoDestructorTypeStorage(IdentifierInfo *II, SourceLocation Loc)
const Expr * getPlacementArg(unsigned I) const
SourceLocation getBeginLoc() const LLVM_READONLY
SourceLocation getLocation() const
bool doesUsualArrayDeleteWantSize() const
Answers whether the usual array deallocation function for the allocated type expects the size of the ...
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
SourceLocation getEndLoc() const LLVM_READONLY
capture_init_iterator capture_init_begin()
Retrieve the first initialization argument for this lambda expression (which initializes the first ca...
Expr * getInitializer()
The initializer of this new-expression.
ExprValueKind getValueKind() const
getValueKind - The value kind that this expression produces.
SourceLocation getTemplateKeywordLoc() const
Retrieve the location of the template keyword preceding this name, if any.
static bool classof(const Stmt *T)
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
LifetimeExtendedTemporaryDecl * getLifetimeExtendedTemporaryDecl()
bool constructsVBase() const
Determine whether this constructor is actually constructing a base class (rather than a complete obje...
CXXScalarValueInitExpr(QualType Type, TypeSourceInfo *TypeInfo, SourceLocation RParenLoc)
Create an explicitly-written scalar-value initialization expression.
SourceLocation getThrowLoc() const
SourceLocation getEndLoc() const LLVM_READONLY
CXXBoolLiteralExpr(bool Val, QualType Ty, SourceLocation Loc)
static bool classof(const Stmt *T)
CXXThrowExpr(Expr *Operand, QualType Ty, SourceLocation Loc, bool IsThrownVariableInScope)
SourceLocation getRAngleLoc() const
Retrieve the location of the right angle bracket ending the explicit template argument list following...
const CallExpr * getConfig() const
SourceLocation getBeginLoc() const LLVM_READONLY
FPOptions getFPFeatures() const
New-expression has a C++98 paren-delimited initializer.
void setListInitialization(bool V)
unsigned getInt() const
Used to serialize this.
NestedNameSpecifier * getQualifier() const
Fetches the nested-name qualifier, if one was given.
SourceLocation getEndLoc() const
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
FieldDecl * getField()
Get the field whose initializer will be used.
CXXStdInitializerListExpr(QualType Ty, Expr *SubExpr)
Expr * getOperand() const
const_child_range children() const
SourceLocation getEndLoc() const LLVM_READONLY
Represents binding an expression to a temporary.
OpaqueValueExpr * getOpaqueValue() const
getOpaqueValue - Return the opaque value placeholder.
void setDestroyedType(IdentifierInfo *II, SourceLocation Loc)
Set the name of destroyed type for a dependent pseudo-destructor expression.
Expr * getCommonExpr() const
ArrayTypeTrait
Names for the array type traits.
const internal::VariadicDynCastAllOfMatcher< Stmt, CastExpr > castExpr
Matches any cast nodes of Clang's AST.
CXXTemporary * getTemporary()
static bool classof(const Stmt *T)
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
CXXRecordDecl * getNamingClass()
Gets the 'naming class' (in the sense of C++0x [class.access.base]p5) of the lookup.
DeclAccessPair * getTrailingResults()
Return the results. Defined after UnresolvedMemberExpr.
bool isTypeDependent() const
isTypeDependent - Determines whether this expression is type-dependent (C++ [temp.dep.expr]), which means that its type could change from one template instantiation to the next.
SourceLocation getBeginLoc() const
Default argument expressions have no representation in the source, so they have an empty source range...
DeclarationName getDeclName() const
Retrieve the name that this expression refers to.
An ordinary object is located at an address in memory.
const_child_range children() const
Represents a C++ member access expression where the actual member referenced could not be resolved be...
SubstNonTypeTemplateParmExpr(QualType Ty, ExprValueKind ValueKind, SourceLocation Loc, NonTypeTemplateParmDecl *Param, Expr *Replacement)
CXXBindTemporaryExpr(EmptyShell Empty)
SourceLocation getNameLoc() const
TypeSourceInfo * getTypeSourceInfo() const
const_arg_iterator arg_begin() const
A default argument (C++ [dcl.fct.default]).
bool isTypeOperand() const
void setSourceRange(SourceRange R)
arg_iterator placement_arg_end()
CoyieldExpr(SourceLocation CoyieldLoc, Expr *Operand, Expr *Ready, Expr *Suspend, Expr *Resume, OpaqueValueExpr *OpaqueValue)
SourceLocation getMemberLoc() const
Retrieve the location of the name of the member that this expression refers to.
NamedDecl * getFirstQualifierFoundInScope() const
Retrieve the first part of the nested-name-specifier that was found in the scope of the member access...
Represents the this expression in C++.
SourceLocation getBeginLoc() const LLVM_READONLY
CXXRewrittenBinaryOperator(EmptyShell Empty)
DeclarationName getMemberName() const
Retrieve the name of the member that this expression refers to.
New-expression has no initializer as written.
SourceLocation getRParenLoc() const
Retrieve the location of the right parentheses (')') that follows the argument list.
TypeSourceInfo * getAllocatedTypeSourceInfo() const
Represents an explicit template argument list in C++, e.g., the "<int>" in "sort<int>".
TypeTrait
Names for traits that operate specifically on types.
const Expr * getExpr() const
Get the initialization expression that will be used.
TypeSourceInfo * getQueriedTypeSourceInfo() const
const_child_range children() const
const_child_range children() const
bool isRightFold() const
Does this produce a right-associated sequence of operators?
CXXScalarValueInitExpr(EmptyShell Shell)
const_child_range children() const
const ValueDecl * getExtendingDecl() const
TypeSourceInfo * getTypeSourceInfo() const
SourceLocation getBeginLoc() const LLVM_READONLY
bool isStdInitListInitialization() const
Whether this constructor call was written as list-initialization, but was interpreted as forming a st...
Represents a C++ pseudo-destructor (C++ [expr.pseudo]).
SourceLocation getBeginLoc() const LLVM_READONLY
llvm::iterator_range< const_child_iterator > const_child_range
ASTTemplateKWAndArgsInfo * getTrailingASTTemplateKWAndArgsInfo()
Return the optional template keyword and arguments info.
CompoundStmt - This represents a group of statements like { stmt stmt }.
void setFPFeatures(FPOptions F)
unsigned NumTemplateArgs
The number of template arguments in TemplateArgs.
static bool classof(const Stmt *T)
QualType getQueriedType() const
CXXTypeidExpr(QualType Ty, TypeSourceInfo *Operand, SourceRange R)
ValueDecl * getExtendingDecl()
Get the declaration which triggered the lifetime-extension of this temporary, if any.
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will (ultimately) call.
ArrayTypeTraitExpr(EmptyShell Empty)
SourceLocation getEndLoc() const
const_arg_range arguments() const
CastKind
CastKind - The kind of operation required for a conversion.
const TemplateArgumentLoc * getTemplateArgs() const
Retrieve the template arguments provided as part of this template-id.
static bool classof(const Stmt *T)
CXXTypeidExpr(QualType Ty, Expr *Operand, SourceRange R)
static bool classof(const Stmt *T)
SourceLocation getLocation() const
SourceLocation getRBracketLoc() const
ArrayRef< TypeSourceInfo * > getArgs() const
Retrieve the argument types.
SourceLocation getEndLoc() const LLVM_READONLY
SourceLocation getEndLoc() const
bool isImplicitAccess() const
True if this is an implicit access, i.e.
ConstStmtIterator const_child_iterator
const_child_range children() const
SubstNonTypeTemplateParmExprBitfields SubstNonTypeTemplateParmExprBits
SourceLocation getDestroyedTypeLoc() const
Retrieve the starting location of the type being destroyed.
const_child_range children() const
void setOperatorDelete(FunctionDecl *D)
An expression "T()" which creates a value-initialized rvalue of type T, which is a non-class type...
SourceLocation getOperatorLoc() const
Retrieve the location of the '->' or '.' operator.
const_child_range children() const
SourceRange getSourceRange() const LLVM_READONLY
Retrieve the source range of the expression.
Represents a block literal declaration, which is like an unnamed FunctionDecl.
static bool classof(const Stmt *T)
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
This represents one expression.
Defines the clang::LangOptions interface.
static bool classof(const Stmt *T)
CXXRewrittenBinaryOperatorBitfields CXXRewrittenBinaryOperatorBits
void setIsImplicit(bool value=true)
ExprValueKind
The categorization of expression values, currently following the C++11 scheme.
SourceLocation getCaptureDefaultLoc() const
Retrieve the location of this lambda's capture-default, if any.
TemplateArgumentLoc const * getTemplateArgs() const
bool isArrow() const
Determine whether this member expression used the '->' operator; otherwise, it used the '...
SourceLocation getBeginLoc() const
const CXXRecordDecl * getNamingClass() const
static FindResult find(Expr *E)
Finds the overloaded expression in the given expression E of OverloadTy.
unsigned getPackLength() const
Retrieve the length of the parameter pack.
SourceLocation getBeginLoc() const LLVM_READONLY
const T * castAs() const
Member-template castAs<specific type>.
Represents a C++ functional cast expression that builds a temporary object.
SourceLocation getBeginLoc() const
Retrieve the location of the beginning of this nested-name-specifier.
A C++ const_cast expression (C++ [expr.const.cast]).
SourceLocation getExprLoc() const LLVM_READONLY
SourceLocation getLocation() const
void setTypeOperandSourceInfo(TypeSourceInfo *TSI)
Represents a C++ destructor within a class.
CXXRewrittenBinaryOperator(Expr *SemanticForm, bool IsReversed)
const internal::VariadicAllOfMatcher< Decl > decl
Matches declarations.
IdentifierInfo * getDestroyedTypeIdentifier() const
In a dependent pseudo-destructor expression for which we do not have full type information on the des...
Stmt::child_range childrenExpr()
Defines an enumeration for C++ overloaded operators.
SourceLocation getBeginLoc() const LLVM_READONLY
Stmt * getPreArg(unsigned I)
raw_arg_iterator raw_arg_end()
bool isArrow() const
Determine whether this pseudo-destructor expression was written using an '->' (otherwise, it used a '.
void setUuidStr(StringRef US)
unsigned getNumTemplateArgs() const
void copyTemplateArgumentsInto(TemplateArgumentListInfo &List) const
Copies the template arguments (if present) into the given structure.
static bool classof(const Stmt *T)
Represents an expression that computes the length of a parameter pack.
llvm::iterator_range< const_capture_init_iterator > capture_inits() const
Retrieve the initialization expressions for this lambda's captures.
static bool classof(const Stmt *T)
NonTypeTemplateParmDecl - Declares a non-type template parameter, e.g., "Size" in.
ArrayTypeTraitExpr(SourceLocation loc, ArrayTypeTrait att, TypeSourceInfo *queried, uint64_t value, Expr *dimension, SourceLocation rparen, QualType ty)
static bool classof(const Stmt *s)
ArrayTypeTrait getTrait() const
CXXDefaultInitExprBitfields CXXDefaultInitExprBits
decls_iterator decls_begin() const
static bool classof(const Stmt *T)
ExprWithCleanupsBitfields ExprWithCleanupsBits
const_child_range children() const
llvm::iterator_range< const_arg_iterator > const_arg_range
const_child_range children() const
SourceRange getAngleBrackets() const LLVM_READONLY
const Expr * getIdx() const
SourceLocation getOperatorLoc() const LLVM_READONLY
SourceLocation getLocation() const
Retrieve the location of the name within the expression.
const Expr * getInitializer() const
const_child_range children() const
SourceLocation getExprLoc() const LLVM_READONLY
Expr * getPattern() const
Get the pattern, that is, the operand that contains an unexpanded pack.
static bool classof(const Stmt *T)
CXXConstructExpr::ConstructionKind getConstructionKind() const
bool hasInitializer() const
Whether this new-expression has any initializer at all.
StorageDuration getStorageDuration() const
Retrieve the storage duration for the materialized temporary.
Represents a folding of a pack over an operator.
const_child_range children() const
static bool classof(const Stmt *T)
SourceLocation getEndLoc() const LLVM_READONLY
const Expr * getBase() const
SourceLocation getEnd() const
SourceLocation getEndLoc() const LLVM_READONLY
A member reference to an MSPropertyDecl.
StmtIterator child_iterator
Child Iterators: All subclasses must implement 'children' to permit easy iteration over the substatem...
Represents a reference to a non-type template parameter that has been substituted with a template arg...
const_child_range children() const
SourceLocation getBeginLoc() const
The result type of a method or function.
SourceRange getSourceRange() const LLVM_READONLY
const Expr * getSubExpr() const
SourceLocation getPackLoc() const
Determine the location of the parameter pack.
MSPropertyRefExpr(EmptyShell Empty)
const Expr *const * getArgs() const
CoyieldExpr(EmptyShell Empty)
const DeclContext * getUsedContext() const
DependentCoawaitExpr(SourceLocation KeywordLoc, QualType Ty, Expr *Op, UnresolvedLookupExpr *OpCoawait)
SourceLocation getEndLoc() const LLVM_READONLY
const_child_range children() const
MSPropertySubscriptExpr(Expr *Base, Expr *Idx, QualType Ty, ExprValueKind VK, ExprObjectKind OK, SourceLocation RBracketLoc)
SourceRange getSourceRange() const
SourceLocation getEndLoc() const LLVM_READONLY
static bool classof(const Stmt *T)
ExprObjectKind getObjectKind() const
getObjectKind - The object kind that this expression produces.
const_child_range children() const
static bool classof(const Stmt *T)
SourceLocation getOperatorLoc() const
Retrieve the location of the '->' or '.' operator.
void setTypeOperandSourceInfo(TypeSourceInfo *TSI)
const Expr * getArgument() const
const TemplateArgumentLoc * getTrailingTemplateArgumentLoc() const
const_child_range children() const
SourceLocation getLParenLoc() const
Retrieve the location of the left parentheses ('(') that precedes the argument list.
SourceLocation getBeginLoc() const
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the member name.
SourceLocation getOperatorLoc() const
Returns the location of the operator symbol in the expression.
static bool classof(const Stmt *T)
const DeclarationNameInfo & getNameInfo() const
Retrieve the name that this expression refers to.
const_arg_range arguments() const
SourceRange getSourceRange() const LLVM_READONLY
static bool classof(const Stmt *S)
const Expr * getBase() const
void copyInto(const TemplateArgumentLoc *ArgArray, TemplateArgumentListInfo &List) const
CanThrowResult
Possible results from evaluation of a noexcept expression.
void setLParenLoc(SourceLocation L)
A C++ dynamic_cast expression (C++ [expr.dynamic.cast]).
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class...
UnresolvedSetIterator iterator
MaterializeTemporaryExpr(EmptyShell Empty)
llvm::iterator_range< arg_iterator > arg_range
A reference to an overloaded function set, either an UnresolvedLookupExpr or an UnresolvedMemberExpr...
Expr * getInit() const
Get the operand that doesn't contain a pack, for a binary fold.
Represents a call to an inherited base class constructor from an inheriting constructor.
operator "" X (const CharT *, size_t)
ExpressionTrait getTrait() const
Expr ** getPlacementArgs()
static bool classof(const Stmt *T)
bool isInstantiationDependent() const
Whether this expression is instantiation-dependent, meaning that it depends in some way on a template...
StorageDuration getStorageDuration() const
Retrieve the storage duration for the materialized temporary.
Raw form: operator "" X<cs...> ()
static unsigned sizeOfTrailingObjects(unsigned NumArgs)
Return the size in bytes of the trailing objects.
SourceLocation getNameLoc() const
Gets the location of the name.
const_child_range children() const
bool inheritedFromVBase() const
Determine whether the inherited constructor is inherited from a virtual base of the object we constru...
void setHadMultipleCandidates(bool V)
Encodes a location in the source.
SourceLocation getEndLoc() const LLVM_READONLY
const_arg_iterator placement_arg_begin() const
Defines enumerations for expression traits intrinsics.
static bool classof(const Stmt *T)
static constexpr ADLCallKind NotADL
CastIterator< Expr > ExprIterator
CXXNamedCastExpr(StmtClass SC, QualType ty, ExprValueKind VK, CastKind kind, Expr *op, unsigned PathSize, TypeSourceInfo *writtenTy, SourceLocation l, SourceLocation RParenLoc, SourceRange AngleBrackets)
UnresolvedLookupExprBitfields UnresolvedLookupExprBits
static CXXOperatorCallExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, EmptyShell Empty)
Represents a C++ temporary.
bool hasExplicitTemplateArgs() const
Determines whether this member expression actually had a C++ template argument list explicitly specif...
SourceLocation getRAngleLoc() const
Retrieve the location of the right angle bracket ending the explicit template argument list following...
NestedNameSpecifierLoc getQualifierLoc() const
Retrieves the nested-name-specifier that qualifies the type name, with source-location information...
CXXThrowExprBitfields CXXThrowExprBits
SourceLocation getEndLoc() const LLVM_READONLY
bool hasUnresolvedUsing() const
Determine whether the lookup results contain an unresolved using declaration.
bool hasQualifier() const
Determines whether this member expression actually had a C++ nested-name-specifier prior to the name ...
PackExpansionExpr(EmptyShell Empty)
SourceLocation getOperatorLoc() const
Retrieve the location of the cast operator keyword, e.g., static_cast.
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)"...
SourceLocation getBeginLoc() const
DeclarationName getName() const
getName - Returns the embedded declaration name.
A call to a literal operator (C++11 [over.literal]) written as a user-defined literal (C++11 [lit...
void setSourceRange(SourceRange R)
Represents a C++2a __builtin_bit_cast(T, v) expression.
SourceLocation getEllipsisLoc() const
Retrieve the location of the ellipsis that describes this pack expansion.
Represents a call to a member function that may be written either with member call syntax (e...
llvm::iterator_range< capture_init_iterator > capture_inits()
Retrieve the initialization expressions for this lambda's captures.
static bool classof(const Stmt *T)
Defines several types used to describe C++ lambda expressions that are shared between the parser and ...
SourceLocation getEndLoc() const LLVM_READONLY
SourceLocation getEndLoc() const LLVM_READONLY
Expr * getInClassInitializer() const
Get the C++11 default member initializer for this member, or null if one has not been set...
ExprObjectKind
A further classification of the kind of object referenced by an l-value or x-value.
Represents a static or instance method of a struct/union/class.
void setTemporary(CXXTemporary *T)
static bool classof(const Stmt *T)
static bool classof(const Stmt *T)
SourceLocation getEndLoc() const
SourceLocation RAngleLoc
The source location of the right angle bracket ('>').
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
SourceLocation getEndLoc() const LLVM_READONLY
bool isFPContractableWithinStatement() const
void setDestructor(const CXXDestructorDecl *Dtor)
QualType getAllocatedType() const
DeclContext * getUsedContext()
bool isBoundToLvalueReference() const
Determine whether this materialized temporary is bound to an lvalue reference; otherwise, it's bound to an rvalue reference.
VarDecl * getExpansion(unsigned I) const
Get an expansion of the parameter pack by index.
Expr * getSuspendExpr() const
unsigned capture_size() const
Determine the number of captures in this lambda.
SourceLocation getEndLoc() const
static bool classof(const Stmt *T)
const_capture_init_iterator capture_init_end() const
Retrieve the iterator pointing one past the last initialization argument for this lambda expression...
bool isValueDependent() const
isValueDependent - Determines whether this expression is value-dependent (C++ [temp.dep.constexpr]).
SourceLocation getEndLoc() const LLVM_READONLY
CXXNamedCastExpr(StmtClass SC, EmptyShell Shell, unsigned PathSize)
bool hasTemplateKeyword() const
Determines whether the member name was preceded by the template keyword.
const_child_range children() const
bool isParenTypeId() const
bool isInfixBinaryOp() const
Is this written as an infix binary operator?
bool isImplicitAccess() const
An expression trait intrinsic.
SourceLocation getBeginLoc() const LLVM_READONLY
const_child_range children() const
ArrayRef< TemplateArgumentLoc > template_arguments() const
CoyieldExpr(SourceLocation CoyieldLoc, QualType Ty, Expr *Operand)
APValue * getOrCreateValue(bool MayCreate) const
Get the storage for the constant value of a materialized temporary of static storage duration...
const_child_range children() const
bool passAlignment() const
Indicates whether the required alignment should be implicitly passed to the allocation function...
llvm::iterator_range< const_arg_iterator > const_arg_range
FunctionDecl * getOperatorDelete() const
SourceLocation getBeginLoc() const LLVM_READONLY
SourceLocation getTemplateKeywordLoc() const
Retrieve the location of the template keyword preceding this name, if any.
A placeholder type used to construct an empty shell of a type, that will be filled in later (e...
SourceLocation getExprLoc() const LLVM_READONLY
getExprLoc - Return the preferred location for the arrow when diagnosing a problem with a generic exp...
PackExpansionExpr(QualType T, Expr *Pattern, SourceLocation EllipsisLoc, Optional< unsigned > NumExpansions)
A qualified reference to a name whose declaration cannot yet be resolved.
void setRBracketLoc(SourceLocation L)
InitializationStyle getInitializationStyle() const
The kind of initializer this new-expression has.
SourceLocation getLocation() const LLVM_READONLY
Defines various enumerations that describe declaration and type specifiers.
A POD class for pairing a NamedDecl* with an access specifier.
ArrayRef< TemplateArgument > getPartialArguments() const
Get.
SourceLocation getBeginLoc() const LLVM_READONLY
SourceLocation getExprLoc() const LLVM_READONLY
Represents a reference to a function parameter pack or init-capture pack that has been substituted bu...
DeclContext * getUsedContext()
Represents a template argument.
const DeclAccessPair * getTrailingResults() const
unsigned getManglingNumber() const
SourceLocation getMemberLoc() const
TypeSourceInfo * getDestroyedTypeInfo() const
Retrieve the source location information for the type being destroyed.
SourceLocation getEndLoc() const LLVM_READONLY
bool isTypeOperand() const
SourceLocation getLocation() const
static bool classof(const Stmt *T)
Dataflow Directional Tag Classes.
unsigned getManglingNumber() const
NestedNameSpecifier * getNestedNameSpecifier() const
Retrieve the nested-name-specifier to which this instance refers.
bool isValid() const
Return true if this is a valid SourceLocation object.
SourceLocation getExprLoc() const
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
CXXNullPtrLiteralExprBitfields CXXNullPtrLiteralExprBits
Represents a delete expression for memory deallocation and destructor calls, e.g. ...
static bool classof(const Stmt *T)
static std::string getName(const CallEvent &Call)
OverloadedOperatorKind getOperator() const
Returns the kind of overloaded operator that this expression refers to.
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
NonTypeTemplateParmDecl * getParameterPack() const
Retrieve the non-type template parameter pack being substituted.
const_arg_iterator arg_end() const
MSPropertyDecl * getPropertyDecl() const
CXXNoexceptExpr(EmptyShell Empty)
SourceLocation getBeginLoc() const LLVM_READONLY
CXXFoldExpr(EmptyShell Empty)
Reads an AST files chain containing the contents of a translation unit.
const Expr * getPattern() const
Retrieve the pattern of the pack expansion.
SourceLocation getBeginLoc() const LLVM_READONLY
TypeSourceInfo * getTypeSourceInfo() const
Retrieve the type source information for the type being constructed.
A C++ reinterpret_cast expression (C++ [expr.reinterpret.cast]).
CXXNoexceptExpr(QualType Ty, Expr *Operand, CanThrowResult Val, SourceLocation Keyword, SourceLocation RParen)
TypeSourceInfo * getTypeSourceInfo() const
Represents a 'co_yield' expression.
void setConstructionKind(ConstructionKind CK)
DeclarationName getMember() const
Retrieve the name of the member that this expression refers to.
The name of a declaration.
StmtClass getStmtClass() const
SourceRange getIntroducerRange() const
Retrieve the source range covering the lambda introducer, which contains the explicit capture list su...
const Expr * getExpr() const
OverloadExpr * Expression
SourceLocation getEndLoc() const LLVM_READONLY
Represents a C++11 pack expansion that produces a sequence of expressions.
bool isListInitialization() const
Whether this constructor call was written as list-initialization.
static bool classof(const Stmt *T)
static bool classof(const Stmt *T)
DependentScopeDeclRefExprBitfields DependentScopeDeclRefExprBits
SourceLocation getParameterPackLocation() const
Get the location of the parameter pack.
NestedNameSpecifierLoc getQualifierLoc() const
ExplicitCastExpr - An explicit cast written in the source code.
const DeclarationNameInfo & getMemberNameInfo() const
Retrieve the full name info for the member that this expression refers to.
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspnd...
Expr * getPlacementArg(unsigned I)
const_child_range children() const
CXXNullPtrLiteralExpr(EmptyShell Empty)
const_arg_iterator arg_begin() const
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
CXXNewExprBitfields CXXNewExprBits
Represents a C++11 noexcept expression (C++ [expr.unary.noexcept]).
SourceLocation getColonColonLoc() const
Retrieve the location of the '::' in a qualified pseudo-destructor expression.
SourceLocation getBeginLoc() const
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name, with source location information.
const_child_range children() const
CXXConstructExprBitfields CXXConstructExprBits
TemplateArgumentLoc * getTrailingTemplateArgumentLoc()
Return the optional template arguments.
Location wrapper for a TemplateArgument.
bool hasTemplateKeyword() const
Determines whether the name was preceded by the template keyword.
Iterator for iterating over Stmt * arrays that contain only T *.
SourceLocation getExprLoc() const LLVM_READONLY
Return the preferred location (the member name) for the arrow when diagnosing a problem with this exp...
static bool classof(const Stmt *T)
unsigned getNumObjects() const
CoroutineSuspendExpr(StmtClass SC, EmptyShell Empty)
SourceLocation getRParenLoc() const
Determine the location of the right parenthesis.
SourceLocation getBeginLoc() const LLVM_READONLY
Represents a call to a CUDA kernel function.
Represents a 'co_await' expression.
TypeTraitExprBitfields TypeTraitExprBits
void setParenOrBraceRange(SourceRange Range)
Expr * getReplacement() const
bool doesUsualArrayDeleteWantSize() const
Answers whether the usual array deallocation function for the allocated type expects the size of the ...
void setArg(unsigned Arg, Expr *ArgExpr)
Set the specified argument.
static bool classof(const Stmt *T)
CXXInheritedCtorInitExpr(SourceLocation Loc, QualType T, CXXConstructorDecl *Ctor, bool ConstructsVirtualBase, bool InheritedFromVirtualBase)
Construct a C++ inheriting construction expression.
SourceRange getDirectInitRange() const
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the member name, with source location information...
Expr * getArg(unsigned Arg)
Return the specified argument.
CXXBoolLiteralExprBitfields CXXBoolLiteralExprBits
static bool classof(const Stmt *T)
llvm::iterator_range< arg_iterator > arg_range
static bool classof(const Stmt *T)
static bool isAssignmentOp(OverloadedOperatorKind Opc)
bool isArrow() const
Determine whether this member expression used the '->' operator; otherwise, it used the '...
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat]...
CXXThrowExpr(EmptyShell Empty)
SourceLocation getBeginLoc() const LLVM_READONLY
Compute the begin and end locations from the decomposed form.
arg_iterator placement_arg_begin()
bool isPartiallySubstituted() const
Determine whether this represents a partially-substituted sizeof...
Represents an expression that might suspend coroutine execution; either a co_await or co_yield expres...
unsigned arg_size() const
Retrieve the number of arguments.
void setLParenLoc(SourceLocation L)
llvm::iterator_range< decls_iterator > decls() const
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
Expr * getResumeExpr() const
A use of a default initializer in a constructor or in aggregate initialization.
bool isListInitialization() const
Determine whether this expression models list-initialization.
SourceLocation getLAngleLoc() const
Retrieve the location of the left angle bracket starting the explicit template argument list followin...
OverloadExprBitfields OverloadExprBits
void setLocation(SourceLocation L)
StringRef getUuidStr() const
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate.h) and friends (in DeclFriend.h).
bool allowFPContractWithinStatement() const
const Expr * getSubExpr() const
SourceLocation getBeginLoc() const
CoroutineSuspendExpr(StmtClass SC, SourceLocation KeywordLoc, QualType Ty, Expr *Common)
Defines the clang::SourceLocation class and associated facilities.
BuiltinBitCastExpr(QualType T, ExprValueKind VK, CastKind CK, Expr *SrcExpr, TypeSourceInfo *DstType, SourceLocation KWLoc, SourceLocation RParenLoc)
Represents a C++ struct/union/class.
SourceLocation getExprLoc() const LLVM_READONLY
const CXXTemporary * getTemporary() const
CXXDefaultArgExprBitfields CXXDefaultArgExprBits
Represents an explicit C++ type conversion that uses "functional" notation (C++ [expr.type.conv]).
static bool classof(const Stmt *T)
SourceLocation getEndLoc() const LLVM_READONLY
Expr * getOperand() const
ExpressionTraitExpr(EmptyShell Empty)
CXXOperatorCallExprBitfields CXXOperatorCallExprBits
SourceRange getSourceRange() const LLVM_READONLY
SourceRange getParenOrBraceRange() const
CleanupObject getObject(unsigned i) const
const_arg_iterator raw_arg_end() const
SourceLocation getLParenLoc() const
bool containsUnexpandedParameterPack() const
Whether this expression contains an unexpanded parameter pack (for C++11 variadic templates)...
SourceLocation getEndLoc() const
unsigned kind
All of the diagnostics that can be emitted by the frontend.
Optional< unsigned > getNumExpansions() const
Determine the number of expansions that will be produced when this pack expansion is instantiated...
BinaryOperatorKind getOperator() const
const DeclContext * getUsedContext() const
void setExprOperand(Expr *E)
SourceLocation getEllipsisLoc() const
static CXXDefaultArgExpr * Create(const ASTContext &C, SourceLocation Loc, ParmVarDecl *Param, DeclContext *UsedContext)
const_child_range children() const
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation tokens are not useful in isolation - they are low level value objects created/interpre...
bool isGlobalDelete() const
bool isImplicitCXXThis() const
Whether this expression is an implicit reference to 'this' in C++.
Expr * getBase() const
Retrieve the base object of this member expressions, e.g., the x in x.m.
Full-expression storage duration (for temporaries).
bool hasExplicitParameters() const
Determine whether this lambda has an explicit parameter list vs.
Implicit declaration of a temporary that was materialized by a MaterializeTemporaryExpr and lifetime-...
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
CXXUuidofExpr(EmptyShell Empty, bool isExpr)
const_child_range children() const
SourceRange getTypeIdParens() const
Expr * getPattern()
Retrieve the pattern of the pack expansion.
const_child_range children() const
bool hasTemplateKWAndArgsInfo() const
const Expr * getArg(unsigned I) const
CXXTypeidExpr(EmptyShell Empty, bool isExpr)
static bool classof(const Stmt *T)
Abstract class common to all of the C++ "named"/"keyword" casts.
SourceLocation getRAngleLoc() const
Retrieve the location of the right angle bracket ending the explicit template argument list following...
const ParmVarDecl * getParam() const
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
SourceLocation getBeginLoc() const
SourceLocation getEndLoc() const
capture_init_iterator capture_init_end()
Retrieve the iterator pointing one past the last initialization argument for this lambda expression...
SourceLocation getEndLoc() const LLVM_READONLY
static bool classof(const Stmt *T)
A rewritten comparison expression that was originally written using operator syntax.
NestedNameSpecifierLoc getQualifierLoc() const
Fetches the nested-name qualifier with source-location information, if one was given.
Expr *const * const_capture_init_iterator
Const iterator that walks over the capture initialization arguments.
const CXXRecordDecl * getNamingClass() const
Expr * getOperand() const
const ASTTemplateKWAndArgsInfo * getTrailingASTTemplateKWAndArgsInfo() const
SourceLocation getTemplateKeywordLoc() const
Retrieve the location of the template keyword preceding the member name, if any.
CoawaitExpr(SourceLocation CoawaitLoc, Expr *Operand, Expr *Ready, Expr *Suspend, Expr *Resume, OpaqueValueExpr *OpaqueValue, bool IsImplicit=false)
CXXThisExpr(SourceLocation L, QualType Ty, bool IsImplicit)
bool hadMultipleCandidates() const
Whether the referred constructor was resolved from an overloaded set having size greater than 1...
An instance of this class represents the declaration of a property member.
CXXNoexceptExprBitfields CXXNoexceptExprBits
QualType getTypeAsWritten() const
Retrieve the type that is being constructed, as specified in the source code.
An l-value expression is a reference to an object with independent storage.
unsigned getNumArgs() const
Return the number of arguments to the constructor call.
A trivial tuple used to represent a source range.
DependentCoawaitExpr(EmptyShell Empty)
This represents a decl that may have a name.
A boolean literal, per ([C++ lex.bool] Boolean literals).
static bool classof(const Stmt *T)
SourceLocation getBeginLoc() const LLVM_READONLY
CXXPseudoDestructorExpr(EmptyShell Shell)
Expr * getQueriedExpression() const
A Microsoft C++ __uuidof expression, which gets the _GUID that corresponds to the supplied type or ex...
SourceLocation getRParenLoc() const
void setStdInitListInitialization(bool V)
unsigned getNumTemplateArgs() const
static bool classof(const Stmt *T)
SourceLocation LAngleLoc
The source location of the left angle bracket ('<').
static bool classof(const Stmt *T)
const_arg_iterator arg_end() const
SourceLocation getBegin() const
Expr * getSubExpr() const
Retrieve the temporary-generating subexpression whose value will be materialized into a glvalue...
BinaryOperatorKind getOperator() const
NamedDecl * getPack() const
Retrieve the parameter pack.
decls_iterator decls_end() const
SourceLocation getKeywordLoc() const
QualType getBaseType() const
Expr * getBaseExpr() const
static bool classof(const Stmt *T)
Declaration of a template function.
CXXThisExpr(EmptyShell Empty)
llvm::iterator_range< capture_iterator > capture_range
An iterator over a range of lambda captures.
const_arg_iterator raw_arg_begin() const
operator "" X (unsigned long long)
QualType getType() const
Return the type wrapped by this type source info.
TypeTrait getTrait() const
Determine which type trait this expression uses.
Optional< const Expr * > getArraySize() const
const DeclarationNameInfo & getMemberNameInfo() const
Retrieve the name of the member that this expression refers to.
SourceLocation getEndLoc() const LLVM_READONLY
Expr * IgnoreParens() LLVM_READONLY
Skip past any parentheses which might surround this expression until reaching a fixed point...
const_child_range children() const
ConstructionKind getConstructionKind() const
Determine whether this constructor is actually constructing a base class (rather than a complete obje...
SourceLocation getEndLoc() const LLVM_READONLY
CXXDependentScopeMemberExprBitfields CXXDependentScopeMemberExprBits
const_child_range children() const
SourceLocation getEndLoc() const LLVM_READONLY
static bool classof(const Stmt *T)
llvm::iterator_range< const_arg_iterator > const_arg_range
bool isOverloaded() const
True if this lookup is overloaded.