15 #ifndef LLVM_CLANG_AST_EXPRCXX_H 16 #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;
96 :
CallExpr(C, CXXOperatorCallExprClass, fn, args, t, VK, operatorloc),
97 Operator(Op), FPFeatures(FPFeatures) {
98 Range = getSourceRangeImpl();
102 :
CallExpr(C, CXXOperatorCallExprClass, Empty) {}
109 return Opc == OO_Equal || Opc == OO_StarEqual ||
110 Opc == OO_SlashEqual || Opc == OO_PercentEqual ||
111 Opc == OO_PlusEqual || Opc == OO_MinusEqual ||
112 Opc == OO_LessLessEqual || Opc == OO_GreaterGreaterEqual ||
113 Opc == OO_AmpEqual || Opc == OO_CaretEqual ||
129 return (Operator < OO_Plus || Operator >= OO_Arrow ||
130 Operator == OO_PlusPlus || Operator == OO_MinusMinus)
170 :
CallExpr(C, CXXMemberCallExprClass, fn, args, t, VK, RP) {}
173 :
CallExpr(C, CXXMemberCallExprClass, Empty) {}
178 Expr *getImplicitObjectArgument()
const;
207 enum { CONFIG, END_PREARG };
213 :
CallExpr(C, CUDAKernelCallExprClass, fn, Config, args, t, VK, RP) {}
216 :
CallExpr(C, CUDAKernelCallExprClass, END_PREARG, Empty) {}
219 return cast_or_null<CallExpr>(
getPreArg(CONFIG));
228 assert(!getConfig() &&
229 "Cannot call setConfig if config is not null");
268 RParenLoc(RParenLoc), AngleBrackets(AngleBrackets) {}
274 const char *getCastName()
const;
291 case CXXStaticCastExprClass:
292 case CXXDynamicCastExprClass:
293 case CXXReinterpretCastExprClass:
294 case CXXConstCastExprClass:
309 CXXBaseSpecifier *> {
315 writtenTy, l, RParenLoc, AngleBrackets) {}
317 explicit CXXStaticCastExpr(
EmptyShell Empty,
unsigned PathSize)
320 size_t numTrailingObjects(OverloadToken<CastExpr::BasePathSizeTy>)
const {
321 return path_empty() ? 0 : 1;
350 CXXDynamicCastExpr, CastExpr::BasePathSizeTy, CXXBaseSpecifier *> {
356 writtenTy, l, RParenLoc, AngleBrackets) {}
358 explicit CXXDynamicCastExpr(
EmptyShell Empty,
unsigned pathSize)
361 size_t numTrailingObjects(OverloadToken<CastExpr::BasePathSizeTy>)
const {
362 return path_empty() ? 0 : 1;
379 bool isAlwaysNull()
const;
397 CastExpr::BasePathSizeTy,
398 CXXBaseSpecifier *> {
400 Expr *op,
unsigned pathSize,
405 pathSize, writtenTy, l, RParenLoc, AngleBrackets) {}
407 CXXReinterpretCastExpr(
EmptyShell Empty,
unsigned pathSize)
410 size_t numTrailingObjects(OverloadToken<CastExpr::BasePathSizeTy>)
const {
411 return path_empty() ? 0 : 1;
428 return T->
getStmtClass() == CXXReinterpretCastExprClass;
442 CXXBaseSpecifier *> {
447 0, writtenTy, l, RParenLoc, AngleBrackets) {}
452 size_t numTrailingObjects(OverloadToken<CastExpr::BasePathSizeTy>)
const {
453 return path_empty() ? 0 : 1;
492 :
CallExpr(C, UserDefinedLiteralClass, Fn, Args, T, VK, LitEndLoc),
493 UDSuffixLoc(SuffixLoc) {}
496 :
CallExpr(C, UserDefinedLiteralClass, Empty) {}
526 Expr *getCookedLiteral();
533 if (getLiteralOperatorKind() == LOK_Template)
564 Value(val), Loc(l) {}
567 :
Expr(CXXBoolLiteralExprClass, Empty) {}
603 :
Expr(CXXNullPtrLiteralExprClass, Empty) {}
625 Stmt *SubExpr =
nullptr;
628 :
Expr(CXXStdInitializerListExprClass, Empty) {}
660 return S->
getStmtClass() == CXXStdInitializerListExprClass;
673 llvm::PointerUnion<Stmt *, TypeSourceInfo *> Operand;
683 Operand->
getType()->isDependentType(),
684 Operand->
getType()->isInstantiationDependentType(),
686 Operand(Operand), Range(R) {}
697 Operand(Operand), Range(R) {}
700 :
Expr(CXXTypeidExprClass, Empty) {
702 Operand = (
Expr*)
nullptr;
709 bool isPotentiallyEvaluated()
const;
719 assert(isTypeOperand() &&
"Cannot call getTypeOperand for typeid(expr)");
724 assert(isTypeOperand() &&
"Cannot call getTypeOperand for typeid(expr)");
729 assert(!isTypeOperand() &&
"Cannot call getExprOperand for typeid(type)");
730 return static_cast<Expr*
>(Operand.get<
Stmt *>());
734 assert(!isTypeOperand() &&
"Cannot call getExprOperand for typeid(type)");
753 auto **begin =
reinterpret_cast<Stmt **
>(&Operand);
781 BaseExpr(baseExpr), TheDecl(decl),
782 MemberLoc(nameLoc), IsArrow(isArrow),
783 QualifierLoc(qualifierLoc) {}
792 return getBaseExpr() && getBaseExpr()->isImplicitCXXThis();
797 if (!isImplicitAccess())
799 else if (QualifierLoc)
837 enum { BASE_EXPR, IDX_EXPR, NUM_SUBEXPRS = 2 };
839 Stmt *SubExprs[NUM_SUBEXPRS];
842 void setBase(
Expr *
Base) { SubExprs[BASE_EXPR] = Base; }
843 void setIdx(
Expr *Idx) { SubExprs[IDX_EXPR] = Idx; }
851 RBracketLoc(RBracketLoc) {
852 SubExprs[BASE_EXPR] = Base;
853 SubExprs[IDX_EXPR] = Idx;
858 :
Expr(MSPropertySubscriptExprClass, Shell) {}
861 const Expr *
getBase()
const {
return cast<Expr>(SubExprs[BASE_EXPR]); }
864 const Expr *
getIdx()
const {
return cast<Expr>(SubExprs[IDX_EXPR]); }
868 return getBase()->getLocStart();
878 return getBase()->getExprLoc();
882 return T->
getStmtClass() == MSPropertySubscriptExprClass;
887 return child_range(&SubExprs[0], &SubExprs[0] + NUM_SUBEXPRS);
897 llvm::PointerUnion<Stmt *, TypeSourceInfo *> Operand;
905 Operand->
getType()->isDependentType(),
906 Operand->
getType()->isInstantiationDependentType(),
908 Operand(Operand), UuidStr(UuidStr), Range(R) {}
914 Operand(Operand), UuidStr(UuidStr), Range(R) {}
917 :
Expr(CXXUuidofExprClass, Empty) {
919 Operand = (
Expr*)
nullptr;
932 assert(isTypeOperand() &&
"Cannot call getTypeOperand for __uuidof(expr)");
937 assert(isTypeOperand() &&
"Cannot call getTypeOperand for __uuidof(expr)");
942 assert(!isTypeOperand() &&
"Cannot call getExprOperand for __uuidof(type)");
943 return static_cast<Expr*
>(Operand.get<
Stmt *>());
947 assert(!isTypeOperand() &&
"Cannot call getExprOperand for __uuidof(type)");
969 auto **begin =
reinterpret_cast<Stmt **
>(&Operand);
995 Type->isDependentType(), Type->isDependentType(),
996 Type->isInstantiationDependentType(),
998 Loc(L), Implicit(isImplicit) {}
1035 unsigned IsThrownVariableInScope : 1;
1042 bool IsThrownVariableInScope)
1046 Op(expr), ThrowLoc(l),
1047 IsThrownVariableInScope(IsThrownVariableInScope) {}
1069 return getSubExpr()->getLocEnd();
1102 Param(param), Loc(Loc) {}
1123 return getParam()->getDefaultArg();
1126 return getParam()->getDefaultArg();
1218 : Destructor(destructor) {}
1247 Stmt *SubExpr =
nullptr;
1250 :
Expr(CXXBindTemporaryExprClass, SubExpr->
getType(),
1255 Temp(temp), SubExpr(SubExpr) {}
1259 :
Expr(CXXBindTemporaryExprClass, Empty) {}
1305 unsigned NumArgs : 16;
1306 unsigned Elidable : 1;
1307 unsigned HadMultipleCandidates : 1;
1308 unsigned ListInitialization : 1;
1309 unsigned StdInitListInitialization : 1;
1310 unsigned ZeroInitialization : 1;
1311 unsigned ConstructKind : 2;
1312 Stmt **Args =
nullptr;
1322 bool HadMultipleCandidates,
1323 bool ListInitialization,
1324 bool StdInitListInitialization,
1325 bool ZeroInitialization,
1331 :
Expr(SC, Empty), NumArgs(0), Elidable(
false),
1332 HadMultipleCandidates(
false), ListInitialization(
false),
1333 ZeroInitialization(
false), ConstructKind(0) {}
1347 bool HadMultipleCandidates,
1348 bool ListInitialization,
1349 bool StdInitListInitialization,
1350 bool ZeroInitialization,
1384 ZeroInitialization = ZeroInit;
1419 assert(Arg < NumArgs &&
"Arg access out of range!");
1420 return cast<Expr>(Args[Arg]);
1423 assert(Arg < NumArgs &&
"Arg access out of range!");
1424 return cast<Expr>(Args[Arg]);
1429 assert(Arg < NumArgs &&
"Arg access out of range!");
1430 Args[Arg] = ArgExpr;
1463 unsigned ConstructsVirtualBase : 1;
1467 unsigned InheritedFromVirtualBase : 1;
1475 bool InheritedFromVirtualBase)
1478 Constructor(Ctor), Loc(Loc),
1479 ConstructsVirtualBase(ConstructsVirtualBase),
1480 InheritedFromVirtualBase(InheritedFromVirtualBase) {
1486 :
Expr(CXXInheritedCtorInitExprClass, Empty),
1487 ConstructsVirtualBase(
false), InheritedFromVirtualBase(
false) {}
1513 return T->
getStmtClass() == CXXInheritedCtorInitExprClass;
1531 CXXFunctionalCastExpr, CastExpr::BasePathSizeTy, CXXBaseSpecifier *> {
1540 castExpr, pathSize, writtenTy),
1541 LParenLoc(lParenLoc), RParenLoc(rParenLoc) {}
1546 size_t numTrailingObjects(OverloadToken<CastExpr::BasePathSizeTy>)
const {
1547 return path_empty() ? 0 : 1;
1578 return T->
getStmtClass() == CXXFunctionalCastExprClass;
1609 bool HadMultipleCandidates,
1610 bool ListInitialization,
1611 bool StdInitListInitialization,
1612 bool ZeroInitialization);
1624 return T->
getStmtClass() == CXXTemporaryObjectExprClass;
1658 unsigned NumCaptures : 16;
1662 unsigned CaptureDefault : 2;
1666 unsigned ExplicitParams : 1;
1669 unsigned ExplicitResultType : 1;
1685 bool ExplicitParams,
bool ExplicitResultType,
1687 bool ContainsUnexpandedParameterPack);
1691 :
Expr(LambdaExprClass, Empty), NumCaptures(NumCaptures),
1692 CaptureDefault(
LCD_None), ExplicitParams(
false),
1693 ExplicitResultType(
false) {
1694 getStoredStmts()[NumCaptures] =
nullptr;
1697 Stmt **getStoredStmts() {
return getTrailingObjects<Stmt *>(); }
1699 Stmt *
const *getStoredStmts()
const {
return getTrailingObjects<Stmt *>(); }
1712 SourceLocation ClosingBrace,
bool ContainsUnexpandedParameterPack);
1717 unsigned NumCaptures);
1726 return CaptureDefaultLoc;
1784 return llvm::make_range(capture_init_begin(), capture_init_end());
1789 return llvm::make_range(capture_init_begin(), capture_init_end());
1795 return reinterpret_cast<Expr **
>(getStoredStmts());
1801 return reinterpret_cast<Expr *
const *
>(getStoredStmts());
1807 return capture_init_begin() + NumCaptures;
1813 return capture_init_begin() + NumCaptures;
1844 bool isMutable()
const;
1867 return child_range(getStoredStmts(), getStoredStmts() + NumCaptures + 1);
1885 false,
false, Type->isInstantiationDependentType(),
1887 RParenLoc(rParenLoc), TypeInfo(TypeInfo) {}
1890 :
Expr(CXXScalarValueInitExprClass, Shell) {}
1904 return T->
getStmtClass() == CXXScalarValueInitExprClass;
1921 Stmt **SubExprs =
nullptr;
1944 unsigned GlobalNew : 1;
1950 unsigned PassAlignment : 1;
1954 unsigned UsualArrayDeleteWantsSize : 1;
1957 unsigned NumPlacementArgs : 26;
1962 unsigned StoredInitializationStyle : 2;
1984 :
Expr(CXXNewExprClass, Shell) {}
1986 void AllocateArgsArray(
const ASTContext &
C,
bool isArray,
1987 unsigned numPlaceArgs,
bool hasInitializer);
1990 assert(
getType()->isPointerType());
1995 return AllocatedTypeInfo;
2013 bool shouldNullCheckAllocation(
const ASTContext &Ctx)
const;
2023 return Array ? cast<Expr>(SubExprs[0]) :
nullptr;
2026 return Array ? cast<Expr>(SubExprs[0]) :
nullptr;
2032 return reinterpret_cast<Expr **
>(SubExprs + Array + hasInitializer());
2036 assert(i < NumPlacementArgs &&
"Index out of range");
2037 return getPlacementArgs()[i];
2040 assert(i < NumPlacementArgs &&
"Index out of range");
2041 return const_cast<CXXNewExpr*
>(
this)->getPlacementArg(i);
2054 if (StoredInitializationStyle == 0)
2061 return hasInitializer() ? cast<Expr>(SubExprs[Array]) :
nullptr;
2064 return hasInitializer() ? cast<Expr>(SubExprs[Array]) :
nullptr;
2069 return dyn_cast_or_null<CXXConstructExpr>(getInitializer());
2075 return PassAlignment;
2082 return UsualArrayDeleteWantsSize;
2089 return llvm::make_range(placement_arg_begin(), placement_arg_end());
2093 return llvm::make_range(placement_arg_begin(), placement_arg_end());
2097 return SubExprs + Array + hasInitializer();
2100 return SubExprs + Array + hasInitializer() + getNumPlacementArgs();
2103 return SubExprs + Array + hasInitializer();
2106 return SubExprs + Array + hasInitializer() + getNumPlacementArgs();
2113 return SubExprs + Array + hasInitializer() + getNumPlacementArgs();
2117 return SubExprs + Array + hasInitializer() + getNumPlacementArgs();
2139 return child_range(raw_arg_begin(), raw_arg_end());
2150 Stmt *Argument =
nullptr;
2156 bool GlobalDelete : 1;
2164 bool ArrayFormAsWritten : 1;
2168 bool UsualArrayDeleteWantsSize : 1;
2174 bool arrayFormAsWritten,
bool usualArrayDeleteWantsSize,
2179 OperatorDelete(operatorDelete), Argument(arg), Loc(loc),
2180 GlobalDelete(globalDelete),
2181 ArrayForm(arrayForm), ArrayFormAsWritten(arrayFormAsWritten),
2182 UsualArrayDeleteWantsSize(usualArrayDeleteWantsSize) {}
2194 return UsualArrayDeleteWantsSize;
2227 llvm::PointerUnion<TypeSourceInfo *, IdentifierInfo *>
Type;
2236 : Type(II), Location(Loc) {}
2316 :
Expr(CXXPseudoDestructorExprClass, Shell), IsArrow(
false) {}
2406 return T->
getStmtClass() == CXXPseudoDestructorExprClass;
2440 size_t numTrailingObjects(OverloadToken<TypeSourceInfo *>)
const {
2474 assert(I <
getNumArgs() &&
"Argument out-of-range");
2480 return llvm::makeArrayRef(getTrailingObjects<TypeSourceInfo *>(),
2526 virtual void anchor();
2536 (queried->
getType()->isInstantiationDependentType() ||
2539 ATT(att), Value(value), Dimension(dimension),
2540 Loc(loc), RParen(rparen), QueriedType(queried) {}
2543 :
Expr(ArrayTypeTraitExprClass, Empty), ATT(0) {}
2593 Expr* QueriedExpression =
nullptr;
2599 Expr *queried,
bool value,
2607 ET(et),
Value(value), Loc(loc), RParen(rparen),
2608 QueriedExpression(queried) {}
2649 unsigned NumResults = 0;
2654 bool HasTemplateKWAndArgsInfo =
false;
2662 bool KnownDependent,
2663 bool KnownInstantiationDependent,
2664 bool KnownContainsUnexpandedParameterPack);
2670 getTrailingASTTemplateKWAndArgsInfo();
2675 ->getTrailingASTTemplateKWAndArgsInfo();
2706 if (isa<UnaryOperator>(E)) {
2707 assert(cast<UnaryOperator>(E)->
getOpcode() == UO_AddrOf);
2708 E = cast<UnaryOperator>(E)->getSubExpr();
2711 Result.HasFormOfMemberPointer = (E == Ovl && Ovl->getQualifier());
2712 Result.IsAddressOfOperand =
true;
2713 Result.Expression = Ovl;
2715 Result.HasFormOfMemberPointer =
false;
2716 Result.IsAddressOfOperand =
false;
2717 Result.Expression = cast<OverloadExpr>(E);
2732 llvm::iterator_range<decls_iterator>
decls()
const {
2733 return llvm::make_range(decls_begin(), decls_end());
2761 return getTrailingASTTemplateKWAndArgsInfo()->
TemplateKWLoc;
2768 return getTrailingASTTemplateKWAndArgsInfo()->
LAngleLoc;
2775 return getTrailingASTTemplateKWAndArgsInfo()->
RAngleLoc;
2785 if (!hasExplicitTemplateArgs())
2787 return const_cast<OverloadExpr *
>(
this)->getTrailingTemplateArgumentLoc();
2791 if (!hasExplicitTemplateArgs())
2798 return {getTemplateArgs(), getNumTemplateArgs()};
2803 if (hasExplicitTemplateArgs())
2804 getTrailingASTTemplateKWAndArgsInfo()->
copyInto(getTemplateArgs(), List);
2808 return T->
getStmtClass() == UnresolvedLookupExprClass ||
2827 UnresolvedLookupExpr, ASTTemplateKWAndArgsInfo, TemplateArgumentLoc> {
2835 bool RequiresADL =
false;
2839 bool Overloaded =
false;
2853 bool RequiresADL,
bool Overloaded,
2856 :
OverloadExpr(UnresolvedLookupExprClass, C, QualifierLoc, TemplateKWLoc,
2858 RequiresADL(RequiresADL),
2859 Overloaded(Overloaded), NamingClass(NamingClass) {}
2864 size_t numTrailingObjects(OverloadToken<ASTTemplateKWAndArgsInfo>)
const {
2865 return HasTemplateKWAndArgsInfo ? 1 : 0;
2873 bool ADL,
bool Overloaded,
2878 ADL, Overloaded,
nullptr,
Begin,
End);
2892 bool HasTemplateKWAndArgsInfo,
2893 unsigned NumTemplateArgs);
2910 return l.getBeginLoc();
2911 return getNameInfo().getLocStart();
2916 if (hasExplicitTemplateArgs())
2917 return getRAngleLoc();
2918 return getNameInfo().getLocEnd();
2947 ASTTemplateKWAndArgsInfo,
2948 TemplateArgumentLoc> {
2958 bool HasTemplateKWAndArgsInfo;
2966 size_t numTrailingObjects(OverloadToken<ASTTemplateKWAndArgsInfo>)
const {
2967 return HasTemplateKWAndArgsInfo ? 1 : 0;
2982 bool HasTemplateKWAndArgsInfo,
2983 unsigned NumTemplateArgs);
3010 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->TemplateKWLoc;
3017 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->LAngleLoc;
3024 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->RAngleLoc;
3036 if (hasExplicitTemplateArgs())
3037 getTrailingObjects<ASTTemplateKWAndArgsInfo>()->copyInto(
3038 getTrailingObjects<TemplateArgumentLoc>(), List);
3042 if (!hasExplicitTemplateArgs())
3045 return getTrailingObjects<TemplateArgumentLoc>();
3049 if (!hasExplicitTemplateArgs())
3052 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->NumTemplateArgs;
3056 return {getTemplateArgs(), getNumTemplateArgs()};
3068 if (hasExplicitTemplateArgs())
3069 return getRAngleLoc();
3070 return getLocation();
3074 return T->
getStmtClass() == DependentScopeDeclRefExprClass;
3114 unsigned numObjects);
3117 bool CleanupsHaveSideEffects,
3121 return llvm::makeArrayRef(getTrailingObjects<CleanupObject>(),
3128 assert(i < getNumObjects() &&
"Index out of range");
3129 return getObjects()[i];
3207 :
Expr(CXXUnresolvedConstructExprClass, Empty), NumArgs(NumArgs) {}
3258 assert(I < NumArgs &&
"Argument index out-of-range");
3263 assert(I < NumArgs &&
"Argument index out-of-range");
3268 assert(I < NumArgs &&
"Argument index out-of-range");
3277 if (!RParenLoc.
isValid() && NumArgs > 0)
3283 return T->
getStmtClass() == CXXUnresolvedConstructExprClass;
3303 ASTTemplateKWAndArgsInfo,
3304 TemplateArgumentLoc> {
3319 bool HasTemplateKWAndArgsInfo : 1;
3342 size_t numTrailingObjects(OverloadToken<ASTTemplateKWAndArgsInfo>)
const {
3343 return HasTemplateKWAndArgsInfo ? 1 : 0;
3376 unsigned NumTemplateArgs);
3381 bool isImplicitAccess()
const;
3386 assert(!isImplicitAccess());
3387 return cast<Expr>(Base);
3421 return FirstQualifierFoundInScope;
3427 return MemberNameInfo;
3442 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->TemplateKWLoc;
3449 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->LAngleLoc;
3456 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->RAngleLoc;
3469 if (hasExplicitTemplateArgs())
3470 getTrailingObjects<ASTTemplateKWAndArgsInfo>()->copyInto(
3471 getTrailingObjects<TemplateArgumentLoc>(), List);
3477 if (!hasExplicitTemplateArgs())
3480 return getTrailingObjects<TemplateArgumentLoc>();
3486 if (!hasExplicitTemplateArgs())
3489 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->NumTemplateArgs;
3493 return {getTemplateArgs(), getNumTemplateArgs()};
3498 if (!isImplicitAccess())
3501 return getQualifierLoc().getBeginLoc();
3507 if (hasExplicitTemplateArgs())
3508 return getRAngleLoc();
3513 return T->
getStmtClass() == CXXDependentScopeMemberExprClass;
3518 if (isImplicitAccess())
3542 UnresolvedMemberExpr, ASTTemplateKWAndArgsInfo, TemplateArgumentLoc> {
3553 bool HasUnresolvedUsing : 1;
3578 HasUnresolvedUsing(
false) {}
3580 size_t numTrailingObjects(OverloadToken<ASTTemplateKWAndArgsInfo>)
const {
3581 return HasTemplateKWAndArgsInfo ? 1 : 0;
3597 unsigned NumTemplateArgs);
3603 bool isImplicitAccess()
const;
3608 assert(!isImplicitAccess());
3609 return cast<Expr>(Base);
3612 assert(!isImplicitAccess());
3613 return cast<Expr>(Base);
3650 if (!isImplicitAccess())
3653 return l.getBeginLoc();
3654 return getMemberNameInfo().getLocStart();
3659 if (hasExplicitTemplateArgs())
3660 return getRAngleLoc();
3661 return getMemberNameInfo().getLocEnd();
3670 if (isImplicitAccess())
3678 if (!HasTemplateKWAndArgsInfo)
3681 if (isa<UnresolvedLookupExpr>(
this))
3682 return cast<UnresolvedLookupExpr>(
this)
3683 ->getTrailingObjects<ASTTemplateKWAndArgsInfo>();
3685 return cast<UnresolvedMemberExpr>(
this)
3686 ->getTrailingObjects<ASTTemplateKWAndArgsInfo>();
3690 if (isa<UnresolvedLookupExpr>(
this))
3691 return cast<UnresolvedLookupExpr>(
this)
3692 ->getTrailingObjects<TemplateArgumentLoc>();
3694 return cast<UnresolvedMemberExpr>(
this)
3695 ->getTrailingObjects<TemplateArgumentLoc>();
3717 Value(Val ==
CT_Cannot), Operand(Operand), Range(Keyword, RParen) {}
3767 unsigned NumExpansions;
3778 EllipsisLoc(EllipsisLoc),
3779 NumExpansions(NumExpansions ? *NumExpansions + 1 : 0),
3798 return NumExpansions - 1;
3870 OperatorLoc(OperatorLoc), PackLoc(PackLoc), RParenLoc(RParenLoc),
3871 Length(Length ? *Length : PartialArgs.size()), Pack(Pack) {
3872 assert((!Length || PartialArgs.empty()) &&
3873 "have partial args for non-dependent sizeof... expression");
3874 auto *Args = getTrailingObjects<TemplateArgument>();
3875 std::uninitialized_copy(PartialArgs.begin(), PartialArgs.end(), Args);
3880 :
Expr(SizeOfPackExprClass, Empty), Length(NumPartialArgs) {}
3889 unsigned NumPartialArgs);
3909 "Cannot get the length of a value-dependent pack size expression");
3924 assert(isPartiallySubstituted());
3925 const auto *Args = getTrailingObjects<TemplateArgument>();
3926 return llvm::makeArrayRef(Args, Args + Length);
3960 :
Expr(SubstNonTypeTemplateParmExprClass, Empty) {}
3968 :
Expr(SubstNonTypeTemplateParmExprClass, type, valueKind,
OK_Ordinary,
3972 Param(param), Replacement(replacement), NameLoc(loc) {}
3985 return s->
getStmtClass() == SubstNonTypeTemplateParmExprClass;
4016 unsigned NumArguments;
4022 :
Expr(SubstNonTypeTemplateParmPackExprClass, Empty) {}
4047 return T->
getStmtClass() == SubstNonTypeTemplateParmPackExprClass;
4084 unsigned NumParameters;
4096 unsigned NumParams);
4164 unsigned ManglingNumber;
4166 llvm::PointerUnion<Stmt *, ExtraState *>
State;
4168 void initializeExtraState(
const ValueDecl *ExtendedBy,
4169 unsigned ManglingNumber);
4173 bool BoundToLvalueReference)
4174 :
Expr(MaterializeTemporaryExprClass, T,
4182 :
Expr(MaterializeTemporaryExprClass, Empty) {}
4185 return State.is<
Stmt *>() ? State.get<
Stmt *>()
4186 : State.get<ExtraState *>()->Temporary;
4195 const ValueDecl *ExtendingDecl = getExtendingDecl();
4200 if (isa<FieldDecl>(ExtendingDecl))
4204 if (isa<BindingDecl>(ExtendingDecl))
4208 return cast<VarDecl>(ExtendingDecl)->getStorageDuration();
4214 return State.is<
Stmt *>() ?
nullptr 4215 : State.get<ExtraState *>()->ExtendingDecl;
4218 void setExtendingDecl(
const ValueDecl *ExtendedBy,
unsigned ManglingNumber);
4221 return State.is<
Stmt *>() ? 0 : State.get<ExtraState *>()->ManglingNumber;
4232 return getTemporary()->getLocStart();
4237 return getTemporary()->getLocEnd();
4241 return T->
getStmtClass() == MaterializeTemporaryExprClass;
4246 if (State.is<
Stmt *>())
4247 return child_range(State.getAddrOfPtr1(), State.getAddrOfPtr1() + 1);
4249 auto ES = State.get<ExtraState *>();
4250 return child_range(&ES->Temporary, &ES->Temporary + 1);
4279 LParenLoc(LParenLoc), EllipsisLoc(EllipsisLoc), RParenLoc(RParenLoc),
4292 return getLHS() && getLHS()->containsUnexpandedParameterPack();
4339 enum SubExpr { Common, Ready, Suspend, Resume, Count };
4341 Stmt *SubExprs[SubExpr::Count];
4352 KeywordLoc(KeywordLoc), OpaqueValue(OpaqueValue) {
4353 SubExprs[SubExpr::Common] = Common;
4354 SubExprs[SubExpr::Ready] = Ready;
4355 SubExprs[SubExpr::Suspend] = Suspend;
4356 SubExprs[SubExpr::Resume] = Resume;
4363 KeywordLoc(KeywordLoc) {
4365 "wrong constructor for non-dependent co_await/co_yield expression");
4366 SubExprs[SubExpr::Common] = Common;
4367 SubExprs[SubExpr::Ready] =
nullptr;
4368 SubExprs[SubExpr::Suspend] =
nullptr;
4369 SubExprs[SubExpr::Resume] =
nullptr;
4373 SubExprs[SubExpr::Common] =
nullptr;
4374 SubExprs[SubExpr::Ready] =
nullptr;
4375 SubExprs[SubExpr::Suspend] =
nullptr;
4376 SubExprs[SubExpr::Resume] =
nullptr;
4382 return static_cast<Expr*
>(SubExprs[SubExpr::Common]);
4389 return static_cast<Expr*
>(SubExprs[SubExpr::Ready]);
4393 return static_cast<Expr*
>(SubExprs[SubExpr::Suspend]);
4397 return static_cast<Expr*
>(SubExprs[SubExpr::Resume]);
4405 return getCommonExpr()->getLocEnd();
4409 return child_range(SubExprs, SubExprs + SubExpr::Count);
4425 bool IsImplicit =
false)
4427 Suspend, Resume, OpaqueValue) {
4432 bool IsImplicit =
false)
4442 return getCommonExpr();
4468 KeywordLoc(KeywordLoc) {
4472 "wrong constructor for non-dependent co_await/co_yield expression");
4474 SubExprs[1] = OpCoawait;
4478 :
Expr(DependentCoawaitExprClass, Empty) {}
4483 return cast<UnresolvedLookupExpr>(SubExprs[1]);
4493 return getOperand()->getLocEnd();
4511 Suspend, Resume, OpaqueValue) {}
4519 return getCommonExpr();
4529 #endif // LLVM_CLANG_AST_EXPRCXX_H CXXUuidofExpr(QualType Ty, TypeSourceInfo *Operand, StringRef UuidStr, SourceRange R)
SourceLocation getLocStart() const LLVM_READONLY
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...
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.
void setPreArg(unsigned i, Stmt *PreArg)
Expr ** getArgs()
Retrieve the call arguments.
SourceLocation getEndLoc() const LLVM_READONLY
bool hasExplicitTemplateArgs() const
Determines whether this expression had explicit template arguments.
SourceRange getSourceRange() const LLVM_READONLY
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
PointerType - C99 6.7.5.1 - Pointer Declarators.
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
ArrayRef< TemplateArgumentLoc > template_arguments() const
Expr * getArg(unsigned Arg)
getArg - Return the specified argument.
SourceLocation getEndLoc() const LLVM_READONLY
Defines enumerations for the type traits support.
SourceLocation getBeginLoc() const LLVM_READONLY
void setLocation(SourceLocation L)
const Expr * getSubExpr() const
Expr(StmtClass SC, QualType T, ExprValueKind VK, ExprObjectKind OK, bool TD, bool VD, bool ID, bool ContainsUnexpandedParameterPack)
SourceLocation getLocStart() const LLVM_READONLY
SourceLocation getLocEnd() const LLVM_READONLY
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.
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
CXXDeleteExpr(QualType ty, bool globalDelete, bool arrayForm, bool arrayFormAsWritten, bool usualArrayDeleteWantsSize, FunctionDecl *operatorDelete, Expr *arg, SourceLocation loc)
bool isListInitialization() const
Determine whether this expression models list-initialization.
SourceLocation getBeginLoc() const LLVM_READONLY
static UnresolvedLookupExpr * Create(const ASTContext &C, CXXRecordDecl *NamingClass, NestedNameSpecifierLoc QualifierLoc, const DeclarationNameInfo &NameInfo, bool ADL, bool Overloaded, UnresolvedSetIterator Begin, UnresolvedSetIterator End)
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...
SourceLocation getStartLoc() const LLVM_READONLY
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 getLocStart() const LLVM_READONLY
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 getLocStart() const LLVM_READONLY
SourceLocation getEndLoc() const LLVM_READONLY
ArrayRef< CleanupObject > getObjects() const
CXXOperatorCallExpr(ASTContext &C, OverloadedOperatorKind Op, Expr *fn, ArrayRef< Expr *> args, QualType t, ExprValueKind VK, SourceLocation operatorloc, FPOptions FPFeatures)
SourceLocation getLocStart() const LLVM_READONLY
SourceLocation getLocStart() const LLVM_READONLY
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...
SourceLocation getEndLoc() const
QualType getNonReferenceType() const
If Type is a reference type (e.g., const int&), returns the type that the reference refers to ("const...
SourceLocation getLocEnd() const LLVM_READONLY
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...
SourceLocation getBeginLoc() const
getBeginLoc - Retrieve the location of the first token.
static bool classof(const Stmt *T)
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)
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...
SourceLocation getEndLoc() const LLVM_READONLY
StorageDuration
The storage duration for an object (per C++ [basic.stc]).
Floating point control options.
Stmt * getTemporary() const
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)
SourceLocation getLocEnd() const LLVM_READONLY
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
const Expr * getSubExpr() const
void setRParenLoc(SourceLocation L)
SourceLocation getLocStart() const LLVM_READONLY
SourceLocation getLocStart() const LLVM_READONLY
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation getBeginLoc() const LLVM_READONLY
QualType getBaseType() const
SourceLocation getEndLoc() const LLVM_READONLY
SourceLocation getBeginLoc() const LLVM_READONLY
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation getOperatorLoc() const
Retrieve the location of the '.' or '->' operator.
const internal::VariadicDynCastAllOfMatcher< Stmt, Expr > expr
Matches expressions.
UnresolvedLookupExpr * getOperatorCoawaitLookup() const
IdentifierInfo * getIdentifier() const
const T * getAs() const
Member-template getAs<specific type>'.
unsigned getNumArgs() const
Determine the number of arguments to this type trait.
llvm::iterator_range< arg_iterator > arg_range
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
void setContainsUnexpandedParameterPack(bool PP=true)
Set the bit that describes whether this expression contains an unexpanded parameter pack...
static bool classof(const Stmt *T)
unsigned getNumPlacementArgs() const
bool requiresADL() const
True if this declaration should be extended by argument-dependent lookup.
SourceLocation getLocEnd() const LLVM_READONLY
SourceLocation getLocStart() const LLVM_READONLY
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.
std::string getName(ArrayRef< StringRef > Parts) const
Get the platform-specific name separator.
SourceLocation getBeginLoc() const LLVM_READONLY
CoawaitExprBitfields CoawaitBits
A C++ static_cast expression (C++ [expr.static.cast]).
SourceLocation getLocEnd() const LLVM_READONLY
Expr * getExprOperand() const
SourceLocation getEndLoc() const LLVM_READONLY
SourceLocation getRParenLoc() const
Retrieve the location of the closing parenthesis.
CXXConstructExpr(StmtClass SC, EmptyShell Empty)
Construct an empty C++ construction expression.
SourceLocation getLocEnd() const LLVM_READONLY
SourceLocation getLocEnd() const LLVM_READONLY
SourceLocation getLocEnd() const LLVM_READONLY
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.
Expr * GetTemporaryExpr() const
Retrieve the temporary-generating subexpression whose value will be materialized into a glvalue...
SourceLocation getTildeLoc() const
Retrieve the location of the '~'.
SourceLocation getLocEnd() const LLVM_READONLY
bool cleanupsHaveSideEffects() const
const Expr * getArg(unsigned Arg) const
SourceLocation getBeginLoc() const LLVM_READONLY
void setExprOperand(Expr *E)
ExpressionTraitExpr(SourceLocation loc, ExpressionTrait et, Expr *queried, bool value, SourceLocation rparen, QualType resultType)
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
A C++ nested-name-specifier augmented with source location information.
static bool classof(const Stmt *T)
static bool classof(const Stmt *T)
SourceLocation getLocStart() const LLVM_READONLY
Represents a member of a struct/union/class.
const FieldDecl * getField() const
SourceLocation getEndLoc() const LLVM_READONLY
llvm::iterator_range< const_arg_iterator > arg_const_range
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. ...
SourceLocation getLocStart() const LLVM_READONLY
NonTypeTemplateParmDecl * getParameter() const
SourceLocation getBeginLoc() const
const DeclarationNameInfo & getNameInfo() const
Gets the full name info.
llvm::iterator_range< const_arg_iterator > placement_arguments() const
SourceLocation getLocStart() const LLVM_READONLY
void setRequiresZeroInitialization(bool ZeroInit)
SourceLocation getEndLoc() const LLVM_READONLY
void setArg(unsigned I, Expr *E)
SourceLocation getLocEnd() const LLVM_READONLY
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.
Expr * getPlacementArg(unsigned i)
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...
SourceLocation getLocStart() const LLVM_READONLY
CXXScalarValueInitExpr(QualType Type, TypeSourceInfo *TypeInfo, SourceLocation rParenLoc)
Create an explicitly-written scalar-value initialization expression.
CXXInheritedCtorInitExpr(EmptyShell Empty)
Construct an empty C++ inheriting construction expression.
SourceLocation getEndLoc() const LLVM_READONLY
SourceLocation getLocStart() const LLVM_READONLY
static bool classof(const Stmt *T)
CXXUuidofExpr(QualType Ty, Expr *Operand, StringRef UuidStr, SourceRange R)
Represents a reference to a non-type template parameter pack that has been substituted with a non-tem...
SourceLocation getLocStart() const LLVM_READONLY
LambdaCaptureDefault getCaptureDefault() const
Determine the default capture kind for this lambda.
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.
SourceLocation getLocEnd() const LLVM_READONLY
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
SubstNonTypeTemplateParmExpr(QualType type, ExprValueKind valueKind, SourceLocation loc, NonTypeTemplateParmDecl *param, Expr *replacement)
SourceLocation getBeginLoc() const LLVM_READONLY
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
SourceLocation getBeginLoc() const LLVM_READONLY
SourceLocation getLocStart() const LLVM_READONLY
MSPropertyRefExpr(Expr *baseExpr, MSPropertyDecl *decl, bool isArrow, QualType ty, ExprValueKind VK, NestedNameSpecifierLoc qualifierLoc, SourceLocation nameLoc)
CXXThisExpr(SourceLocation L, QualType Type, bool isImplicit)
unsigned getNumExpansions() const
Get the number of parameters in this parameter pack.
SourceLocation getLocStart() const LLVM_READONLY
SourceLocation getBeginLoc() const LLVM_READONLY
SourceLocation getLocStart() 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
static bool classof(const Stmt *T)
bool HasFormOfMemberPointer
SourceLocation getParameterPackLocation() const
Retrieve the location of the parameter pack name.
A convenient class for passing around template argument information.
SourceLocation getBeginLoc() const LLVM_READONLY
PseudoDestructorTypeStorage(IdentifierInfo *II, SourceLocation Loc)
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...
SourceLocation getLocStart() const LLVM_READONLY
Expr * getInitializer()
The initializer of this new-expression.
An x-value expression is a reference to an object with independent storage but which can be "moved"...
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.
SourceLocation getLocStart() const LLVM_READONLY
static bool classof(const Stmt *T)
CXXFoldExpr(QualType T, SourceLocation LParenLoc, Expr *LHS, BinaryOperatorKind Opcode, SourceLocation EllipsisLoc, Expr *RHS, SourceLocation RParenLoc)
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
bool constructsVBase() const
Determine whether this constructor is actually constructing a base class (rather than a complete obje...
SourceLocation getThrowLoc() const
SourceLocation getEndLoc() const LLVM_READONLY
static bool classof(const Stmt *T)
SourceLocation getLocStart() const LLVM_READONLY
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.
bool hasUnparsedDefaultArg() const
Determines whether this parameter has a default argument that has not yet been parsed.
SourceLocation getLocEnd() const LLVM_READONLY
void setListInitialization(bool V)
const Expr * getArraySize() const
NestedNameSpecifier * getQualifier() const
Fetches the nested-name qualifier, if one was given.
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
SourceLocation getLocEnd() const LLVM_READONLY
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)
SourceLocation getLocStart() const LLVM_READONLY
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
SourceLocation getLocEnd() const LLVM_READONLY
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.
DeclarationName getDeclName() const
Retrieve the name that this expression refers to.
An ordinary object is located at an address in memory.
Represents a C++ member access expression where the actual member referenced could not be resolved be...
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()
Iterator for iterating over Stmt * arrays that contain only Expr *.
CoyieldExpr(SourceLocation CoyieldLoc, Expr *Operand, Expr *Ready, Expr *Suspend, Expr *Resume, OpaqueValueExpr *OpaqueValue)
SourceLocation getMemberLoc() const
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
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
arg_const_range arguments() const
bool isRightFold() const
Does this produce a right-associated sequence of operators?
UserDefinedLiteral(const ASTContext &C, EmptyShell Empty)
CXXScalarValueInitExpr(EmptyShell Shell)
Const iterator for iterating over Stmt * arrays that contain only Expr *.
const ValueDecl * getExtendingDecl() const
Get the declaration which triggered the lifetime-extension of this temporary, if any.
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
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)
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will (ultimately) call.
ArrayTypeTraitExpr(EmptyShell Empty)
CastKind
CastKind - The kind of operation required for a conversion.
SourceLocation getLocStart() const LLVM_READONLY
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)
Stmt * getPreArg(unsigned i)
static bool classof(const Stmt *T)
SourceLocation getLocation() const
SourceLocation getRBracketLoc() const
SourceLocation getLocStart() const LLVM_READONLY
ArrayRef< TypeSourceInfo * > getArgs() const
Retrieve the argument types.
static CXXDefaultArgExpr * Create(const ASTContext &C, SourceLocation Loc, ParmVarDecl *Param)
SourceLocation getEndLoc() const LLVM_READONLY
SourceLocation getLocEnd() const LLVM_READONLY
SourceLocation getLocEnd() const LLVM_READONLY
SourceLocation getLocStart() const LLVM_READONLY
SourceLocation getLocEnd() const LLVM_READONLY
SourceLocation getDestroyedTypeLoc() const
Retrieve the starting location of the type being destroyed.
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.
SourceLocation getEndLoc() const LLVM_READONLY
SourceLocation getLocEnd() const LLVM_READONLY
SourceRange getSourceRange() const LLVM_READONLY
Retrieve the source range of the expression.
Pepresents 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 ...
Expr - This represents one expression.
Defines the clang::LangOptions interface.
SourceLocation getLocStart() const LLVM_READONLY
static bool classof(const Stmt *T)
SourceLocation getLocEnd() const LLVM_READONLY
void setIsImplicit(bool value=true)
SourceLocation getLocStart() const LLVM_READONLY
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
SourceLocation getLocEnd() const LLVM_READONLY
bool isArrow() const
Determine whether this member expression used the '->' operator; otherwise, it used the '...
SourceLocation getLocStart() const LLVM_READONLY
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
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.
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...
Defines an enumeration for C++ overloaded operators.
const Expr * getCallee() const
SourceLocation getBeginLoc() const LLVM_READONLY
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
DeclContext * getDeclContext()
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
decls_iterator decls_begin() const
static bool classof(const Stmt *T)
SourceLocation getLocStart() const LLVM_READONLY
SourceLocation getBeginLoc() const LLVM_READONLY
ExprWithCleanupsBitfields ExprWithCleanupsBits
SourceRange getAngleBrackets() const LLVM_READONLY
const Expr * getIdx() const
bool isFunctionOrMethod() const
SourceLocation getLocation() const
Retrieve the location of the name within the expression.
const Expr * getInitializer() const
SourceLocation getBeginLoc() const LLVM_READONLY
SourceLocation getExprLoc() const LLVM_READONLY
static OMPLinearClause * CreateEmpty(const ASTContext &C, unsigned NumVars)
Creates an empty clause with the place for NumVars variables.
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.
static bool classof(const Stmt *T)
SourceLocation getEndLoc() const LLVM_READONLY
const Expr * getBase() const
SourceLocation getEnd() const
SourceLocation getEndLoc() const LLVM_READONLY
SourceLocation getLocEnd() 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...
CXXMemberCallExpr(ASTContext &C, EmptyShell Empty)
The result type of a method or function.
ParmVarDecl *const * iterator
Iterators over the parameters which the parameter pack expanded into.
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)
SourceLocation getLocStart() const LLVM_READONLY
DependentCoawaitExpr(SourceLocation KeywordLoc, QualType Ty, Expr *Op, UnresolvedLookupExpr *OpCoawait)
SourceLocation getEndLoc() const LLVM_READONLY
CXXNewExpr(EmptyShell Shell)
MSPropertySubscriptExpr(Expr *Base, Expr *Idx, QualType Ty, ExprValueKind VK, ExprObjectKind OK, SourceLocation RBracketLoc)
SourceRange getSourceRange() const
static bool classof(const Stmt *T)
ExprObjectKind getObjectKind() const
getObjectKind - The object kind that this expression produces.
static bool classof(const Stmt *T)
SourceLocation getOperatorLoc() const
Retrieve the location of the '->' or '.' operator.
void setTypeOperandSourceInfo(TypeSourceInfo *TSI)
const Expr * getArgument() const
SourceLocation getLParenLoc() const
Retrieve the location of the left parentheses ('(') that precedes the argument list.
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.
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
SourceLocation getLocEnd() const LLVM_READONLY
MaterializeTemporaryExpr(EmptyShell Empty)
SourceLocation getEndLoc() const LLVM_READONLY
llvm::iterator_range< arg_iterator > arg_range
A reference to an overloaded function set, either an UnresolvedLookupExpr or an UnresolvedMemberExpr...
SourceLocation getBeginLoc() const LLVM_READONLY
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...
SourceLocation getLocEnd() const LLVM_READONLY
SourceLocation getLocStart() const LLVM_READONLY
Raw form: operator "" X<cs...> ()
SourceLocation getNameLoc() const
Gets the location of the name.
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
SourceLocation getLocEnd() const LLVM_READONLY
Defines enumerations for expression traits intrinsics.
static bool classof(const Stmt *T)
CXXNamedCastExpr(StmtClass SC, QualType ty, ExprValueKind VK, CastKind kind, Expr *op, unsigned PathSize, TypeSourceInfo *writtenTy, SourceLocation l, SourceLocation RParenLoc, SourceRange AngleBrackets)
Represents a C++ temporary.
bool hasExplicitTemplateArgs() const
Determines whether this member expression actually had a C++ template argument list explicitly specif...
SourceLocation getEndLoc() const LLVM_READONLY
SourceLocation getRAngleLoc() const
Retrieve the location of the right angle bracket ending the explicit template argument list following...
SourceLocation getLocEnd() const LLVM_READONLY
NestedNameSpecifierLoc getQualifierLoc() const
Retrieves the nested-name-specifier that qualifies the type name, with source-location information...
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)
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.
SourceLocation getLocStart() const LLVM_READONLY
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.
SourceLocation getLocStart() const LLVM_READONLY
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
bool isBoundToLvalueReference() const
Determine whether this materialized temporary is bound to an lvalue reference; otherwise, it's bound to an rvalue reference.
Expr * getSuspendExpr() const
void setConfig(CallExpr *E)
Sets the kernel configuration expression.
CUDAKernelCallExpr(ASTContext &C, Expr *fn, CallExpr *Config, ArrayRef< Expr *> args, QualType t, ExprValueKind VK, SourceLocation RP)
unsigned capture_size() const
Determine the number of captures in this lambda.
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)
static CXXDefaultInitExpr * Create(const ASTContext &C, SourceLocation Loc, FieldDecl *Field)
Field is the non-static data member whose default initializer is used by this expression.
SourceLocation getLocEnd() const LLVM_READONLY
bool hasTemplateKeyword() const
Determines whether the member name was preceded by the template keyword.
SourceLocation getLocEnd() const LLVM_READONLY
OverloadExpr(StmtClass K, EmptyShell Empty)
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
CXXOperatorCallExpr(ASTContext &C, EmptyShell Empty)
SourceLocation getLocStart() const LLVM_READONLY
ArrayRef< TemplateArgumentLoc > template_arguments() const
CoyieldExpr(SourceLocation CoyieldLoc, QualType Ty, Expr *Operand)
ParmVarDecl * getExpansion(unsigned I) const
Get an expansion of the parameter pack by index.
bool passAlignment() const
Indicates whether the required alignment should be implicitly passed to the allocation function...
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)
SourceLocation getLocEnd() const LLVM_READONLY
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.
SourceLocation getLocEnd() const LLVM_READONLY
ArrayRef< TemplateArgument > getPartialArguments() const
Get.
SourceLocation getBeginLoc() const LLVM_READONLY
SourceLocation getLocStart() const LLVM_READONLY
Represents a reference to a function parameter pack that has been substituted but not yet expanded...
Represents a template argument.
unsigned getManglingNumber() const
SourceLocation getMemberLoc() const
TypeSourceInfo * getDestroyedTypeInfo() const
Retrieve the source location information for the type being destroyed.
SourceLocation getEndLoc() const LLVM_READONLY
SourceLocation getBeginLoc() const LLVM_READONLY
bool isTypeOperand() const
CXXTemporaryObjectExpr(EmptyShell Empty)
SourceLocation getLocation() const
static bool classof(const Stmt *T)
Dataflow Directional Tag Classes.
SourceLocation getLocStart() const LLVM_READONLY
NestedNameSpecifier * getNestedNameSpecifier() const
Retrieve the nested-name-specifier to which this instance refers.
SourceLocation getLocStart() const LLVM_READONLY
bool isValid() const
Return true if this is a valid SourceLocation object.
SourceLocation getLocEnd() const LLVM_READONLY
Represents a delete expression for memory deallocation and destructor calls, e.g. ...
CXXMemberCallExpr(ASTContext &C, Expr *fn, ArrayRef< Expr *> args, QualType t, ExprValueKind VK, SourceLocation RP)
SourceLocation getLocEnd() const LLVM_READONLY
static bool classof(const Stmt *T)
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.
SourceLocation getLocStart() const LLVM_READONLY
BinaryOperator::Opcode getOpcode(const SymExpr *SE)
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
SourceLocation getLocEnd() const LLVM_READONLY
Represents a 'co_yield' expression.
void setConstructionKind(ConstructionKind CK)
DeclarationName getMember() const
Retrieve the name of the member that this expression refers to.
DeclarationName - 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)
SourceLocation getLocEnd() const LLVM_READONLY
SourceLocation getLocEnd() const LLVM_READONLY
SourceLocation getLocEnd() const LLVM_READONLY
void setInstantiationDependent(bool ID)
Set whether this expression is instantiation-dependent or not.
llvm::iterator_range< const_arg_iterator > arg_const_range
SourceLocation getParameterPackLocation() const
Get the location of the parameter pack.
CXXNullPtrLiteralExpr(QualType Ty, SourceLocation l)
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...
CXXNullPtrLiteralExpr(EmptyShell Empty)
SourceLocation getLocEnd() const LLVM_READONLY
const_arg_iterator arg_begin() const
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
CXXRecordDecl * getNamingClass() const
Gets the 'naming class' (in the sense of C++0x [class.access.base]p5) of the lookup.
Represents a C++11 noexcept expression (C++ [expr.unary.noexcept]).
SourceLocation getColonColonLoc() const
Retrieve the location of the '::' in a qualified pseudo-destructor expression.
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name, with source location information.
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.
SourceLocation getLocEnd() const LLVM_READONLY
SourceLocation getExprLoc() const LLVM_READONLY
static bool classof(const Stmt *T)
SourceLocation getLocEnd() const LLVM_READONLY
SourceLocation getEndLoc() const LLVM_READONLY
unsigned getNumObjects() const
CoroutineSuspendExpr(StmtClass SC, EmptyShell Empty)
SourceLocation getRParenLoc() const
Determine the location of the right parenthesis.
SourceLocation getBeginLoc() const LLVM_READONLY
void setSubExpr(Expr *E)
As with any mutator of the AST, be very careful when modifying an existing AST to preserve its invari...
Represents a call to a CUDA kernel function.
Represents a 'co_await' expression.
TypeTraitExprBitfields TypeTraitExprBits
MaterializeTemporaryExpr(QualType T, Expr *Temporary, bool BoundToLvalueReference)
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...
SourceLocation getLocStart() const LLVM_READONLY
Note: getLocStart() is the start of the whole DependentScopeDeclRefExpr, and differs from getLocation...
Expr * getArg(unsigned Arg)
Return the specified argument.
CXXBoolLiteralExpr(bool val, QualType Ty, SourceLocation l)
static bool classof(const Stmt *T)
SourceLocation getLocStart() const LLVM_READONLY
Default argument expressions have no representation in the source, so they have an empty source range...
static bool classof(const Stmt *T)
static bool isAssignmentOp(OverloadedOperatorKind Opc)
bool isArrow() const
Determine whether this member expression used the '->' operator; otherwise, it used the '...
CXXThrowExpr(EmptyShell Empty)
SourceLocation getLocStart() const LLVM_READONLY
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.
SourceLocation getLocEnd() const LLVM_READONLY
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...
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
CoroutineSuspendExpr(StmtClass SC, SourceLocation KeywordLoc, QualType Ty, Expr *Common)
Defines the clang::SourceLocation class and associated facilities.
SourceLocation getLocStart() const LLVM_READONLY
UserDefinedLiteral(const ASTContext &C, Expr *Fn, ArrayRef< Expr *> Args, QualType T, ExprValueKind VK, SourceLocation LitEndLoc, SourceLocation SuffixLoc)
Represents a C++ struct/union/class.
SourceLocation getExprLoc() const LLVM_READONLY
SourceLocation getLocStart() const LLVM_READONLY
const CXXTemporary * getTemporary() const
SourceLocation getLocEnd() const LLVM_READONLY
Represents an explicit C++ type conversion that uses "functional" notation (C++ [expr.type.conv]).
static bool classof(const Stmt *T)
Expr * getOperand() const
ExpressionTraitExpr(EmptyShell Empty)
SourceRange getParenOrBraceRange() const
CleanupObject getObject(unsigned i) const
const_arg_iterator raw_arg_end() const
SourceLocation getBeginLoc() const LLVM_READONLY
SourceLocation getLParenLoc() const
bool containsUnexpandedParameterPack() const
Whether this expression contains an unexpanded parameter pack (for C++11 variadic templates)...
SourceLocation getEndLoc() const LLVM_READONLY
SourceLocation getLocEnd() const LLVM_READONLY
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...
void setExprOperand(Expr *E)
SourceLocation getEllipsisLoc() const
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation tokens are not useful in isolation - they are low level value objects created/interpre...
bool isGlobalDelete() const
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.
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
SourceLocation getExprLoc() const LLVM_READONLY
CXXUuidofExpr(EmptyShell Empty, bool isExpr)
SourceRange getTypeIdParens() const
Expr * getPattern()
Retrieve the pattern of the pack expansion.
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...
SourceLocation getLocEnd() const LLVM_READONLY
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)
SourceLocation getLocEnd() const LLVM_READONLY
SourceLocation getEndLoc() const LLVM_READONLY
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.
SourceLocation getBeginLoc() const LLVM_READONLY
Expr * getOperand() const
const ASTTemplateKWAndArgsInfo * getTrailingASTTemplateKWAndArgsInfo() const
Return the optional template keyword and arguments info.
CUDAKernelCallExpr(ASTContext &C, EmptyShell Empty)
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)
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.
QualType getTypeAsWritten() const
Retrieve the type that is being constructed, as specified in the source code.
ParmVarDecl * getParameterPack() const
Get the parameter pack which this expression refers to.
An l-value expression is a reference to an object with independent storage.
unsigned getNumArgs() const
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)
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
Automatic storage duration (most local variables).
void setStdInitListInitialization(bool V)
unsigned getNumTemplateArgs() const
const Expr * getPlacementArg(unsigned i) 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
CXXThrowExpr(Expr *expr, QualType Ty, SourceLocation l, bool IsThrownVariableInScope)
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)
CXXThisExpr(EmptyShell Empty)
SourceLocation getLocStart() const LLVM_READONLY
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.
const DeclarationNameInfo & getMemberNameInfo() const
Retrieve the name of the member that this expression refers to.
SourceLocation getEndLoc() const LLVM_READONLY
CXXConstructExpr(EmptyShell Empty)
Construct an empty C++ construction expression.
Expr * IgnoreParens() LLVM_READONLY
IgnoreParens - Ignore parentheses.
static OMPLinearClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, OpenMPLinearClauseKind Modifier, SourceLocation ModifierLoc, SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef< Expr *> VL, ArrayRef< Expr *> PL, ArrayRef< Expr *> IL, Expr *Step, Expr *CalcStep, Stmt *PreInit, Expr *PostUpdate)
Creates clause with a list of variables VL and a linear step Step.
ConstructionKind getConstructionKind() const
Determine whether this constructor is actually constructing a base class (rather than a complete obje...
SourceLocation getLocEnd() const LLVM_READONLY
SourceLocation getEndLoc() const LLVM_READONLY
static bool classof(const Stmt *T)
bool isOverloaded() const
True if this lookup is overloaded.