36#include "llvm/ADT/ArrayRef.h"
37#include "llvm/Support/ErrorHandling.h"
59 case OO_Call:
case OO_Subscript:
72 bool SkippedNot =
false;
73 if (
auto *NotEq = dyn_cast<UnaryOperator>(E)) {
74 assert(NotEq->getOpcode() == UO_LNot);
80 if (
auto *BO = dyn_cast<BinaryOperator>(E)) {
81 assert(!SkippedNot || BO->getOpcode() == BO_EQ);
82 Result.Opcode = SkippedNot ? BO_NE : BO->getOpcode();
86 }
else if (
auto *BO = dyn_cast<CXXOperatorCallExpr>(E)) {
87 assert(!SkippedNot || BO->getOperator() == OO_EqualEqual);
88 assert(BO->isInfixBinaryOp());
89 switch (BO->getOperator()) {
90 case OO_Less:
Result.Opcode = BO_LT;
break;
91 case OO_LessEqual:
Result.Opcode = BO_LE;
break;
92 case OO_Greater:
Result.Opcode = BO_GT;
break;
93 case OO_GreaterEqual:
Result.Opcode = BO_GE;
break;
94 case OO_Spaceship:
Result.Opcode = BO_Cmp;
break;
95 case OO_EqualEqual:
Result.Opcode = SkippedNot ? BO_NE : BO_EQ;
break;
96 default: llvm_unreachable(
"unexpected binop in rewritten operator expr");
98 Result.LHS = BO->getArg(0);
99 Result.RHS = BO->getArg(1);
102 llvm_unreachable(
"unexpected rewritten operator form");
115 E =
Result.LHS->IgnoreUnlessSpelledInSource();
116 if (
auto *BO = dyn_cast<BinaryOperator>(E)) {
117 assert(BO->getOpcode() == BO_Cmp);
118 Result.LHS = BO->getLHS();
119 Result.RHS = BO->getRHS();
121 }
else if (
auto *BO = dyn_cast<CXXOperatorCallExpr>(E)) {
122 assert(BO->getOperator() == OO_Spaceship);
123 Result.LHS = BO->getArg(0);
124 Result.RHS = BO->getArg(1);
127 llvm_unreachable(
"unexpected rewritten operator form");
145 if (RD->isPolymorphic() && E->
isGLValue())
152 assert(!
isTypeOperand() &&
"Cannot call isMostDerived for typeid(type)");
156 if (RD->isEffectivelyFinal())
159 if (
const auto *DRE = dyn_cast<DeclRefExpr>(E)) {
160 QualType Ty = DRE->getDecl()->getType();
169 assert(
isTypeOperand() &&
"Cannot call getTypeOperand for typeid(expr)");
171 return Context.getUnqualifiedArrayType(
178 if (
const auto *CE = dyn_cast<CastExpr>(E)) {
179 if (!CE->getSubExpr()->isGLValue())
184 if (
const auto *OVE = dyn_cast<OpaqueValueExpr>(E))
187 if (
const auto *BO = dyn_cast<BinaryOperator>(E))
188 if (BO->getOpcode() == BO_Comma)
191 if (
const auto *ACO = dyn_cast<AbstractConditionalOperator>(E))
200 if (
const auto *UO = dyn_cast<UnaryOperator>(E))
201 if (UO->getOpcode() == UO_Deref)
223 assert(
isTypeOperand() &&
"Cannot call getTypeOperand for __uuidof(expr)");
225 return Context.getUnqualifiedArrayType(
231 return TypeInfo ? TypeInfo->getTypeLoc().getBeginLoc() :
getRParenLoc();
235CXXNewExpr::CXXNewExpr(
bool IsGlobalNew,
FunctionDecl *OperatorNew,
238 bool UsualArrayDeleteWantsSize,
240 std::optional<Expr *> ArraySize,
246 OperatorNew(OperatorNew), OperatorDelete(OperatorDelete),
247 AllocatedTypeInfo(AllocatedTypeInfo), Range(Range),
248 DirectInitRange(DirectInitRange) {
252 "Only CXXNewInitializationStyle::None can have no initializer!");
259 CXXNewExprBits.UsualArrayDeleteWantsSize = UsualArrayDeleteWantsSize;
262 llvm::to_underlying(InitializationStyle);
263 bool IsParenTypeId = TypeIdParens.
isValid();
268 getTrailingObjects<Stmt *>()[arraySizeOffset()] = *ArraySize;
270 getTrailingObjects<Stmt *>()[initExprOffset()] =
Initializer;
271 llvm::copy(PlacementArgs,
272 getTrailingObjects<Stmt *>() + placementNewArgsOffset());
274 getTrailingObjects<SourceRange>()[0] = TypeIdParens;
276 switch (getInitializationStyle()) {
292CXXNewExpr::CXXNewExpr(EmptyShell
Empty,
bool IsArray,
293 unsigned NumPlacementArgs,
bool IsParenTypeId)
304 SourceRange TypeIdParens, std::optional<Expr *> ArraySize,
308 bool IsArray = ArraySize.has_value();
310 unsigned NumPlacementArgs = PlacementArgs.size();
311 bool IsParenTypeId = TypeIdParens.
isValid();
313 Ctx.
Allocate(totalSizeToAlloc<Stmt *, SourceRange>(
314 IsArray + HasInit + NumPlacementArgs, IsParenTypeId),
315 alignof(CXXNewExpr));
316 return new (Mem) CXXNewExpr(
317 IsGlobalNew, OperatorNew, OperatorDelete, IAP, UsualArrayDeleteWantsSize,
318 PlacementArgs, TypeIdParens, ArraySize, InitializationStyle,
Initializer,
319 Ty, AllocatedTypeInfo, Range, DirectInitRange);
323 bool HasInit,
unsigned NumPlacementArgs,
324 bool IsParenTypeId) {
326 Ctx.
Allocate(totalSizeToAlloc<Stmt *, SourceRange>(
327 IsArray + HasInit + NumPlacementArgs, IsParenTypeId),
328 alignof(CXXNewExpr));
330 CXXNewExpr(
EmptyShell(), IsArray, NumPlacementArgs, IsParenTypeId);
351 while (
const auto *ICE = dyn_cast<ImplicitCastExpr>(Arg)) {
352 if (ICE->getCastKind() == CK_DerivedToBase ||
353 ICE->getCastKind() == CK_UncheckedDerivedToBase ||
354 ICE->getCastKind() == CK_NoOp) {
355 assert((ICE->getCastKind() == CK_NoOp ||
357 "only a destroying operator delete can have a converted arg");
358 Arg = ICE->getSubExpr();
383 :
Expr(CXXPseudoDestructorExprClass, Context.BoundMemberTy,
VK_PRValue,
386 OperatorLoc(OperatorLoc), QualifierLoc(QualifierLoc),
387 ScopeType(ScopeType), ColonColonLoc(ColonColonLoc), TildeLoc(TildeLoc),
388 DestroyedType(DestroyedType) {
394 return TInfo->getType();
402 End = TInfo->getTypeLoc().getSourceRange().getEnd();
406DependentTemplateIdExpr::DependentTemplateIdExpr(
409 :
Expr(DependentTemplateIdExprClass, Context.DependentTy,
VK_LValue,
411 NameInfo(NameInfo), Name(Name) {
412 KWAndArgs.initializeFrom({}, TemplateArgs,
413 getTrailingObjects());
417DependentTemplateIdExpr::DependentTemplateIdExpr(EmptyShell
Empty,
418 unsigned NumTemplateArgs)
419 :
Expr(DependentTemplateIdExprClass,
Empty) {
420 KWAndArgs.NumTemplateArgs = NumTemplateArgs;
426 void *Mem = Context.Allocate(
427 totalSizeToAlloc<TemplateArgumentLoc>(TemplateArgs.
size()),
428 alignof(DependentTemplateIdExpr));
430 DependentTemplateIdExpr(Context, NameInfo, Name, TemplateArgs);
435 unsigned NumTemplateArgs) {
437 Context.Allocate(totalSizeToAlloc<TemplateArgumentLoc>(NumTemplateArgs),
438 alignof(DependentTemplateIdExpr));
439 return new (Mem) DependentTemplateIdExpr(
EmptyShell(), NumTemplateArgs);
443UnresolvedLookupExpr::UnresolvedLookupExpr(
449 bool KnownInstantiationDependent)
450 :
OverloadExpr(UnresolvedLookupExprClass, Context, QualifierLoc,
451 TemplateKWLoc, NameInfo, TemplateArgs, Begin, End,
452 KnownDependent, KnownInstantiationDependent,
454 NamingClass(NamingClass) {
458UnresolvedLookupExpr::UnresolvedLookupExpr(EmptyShell
Empty,
460 bool HasTemplateKWAndArgsInfo)
462 HasTemplateKWAndArgsInfo) {}
468 bool KnownDependent,
bool KnownInstantiationDependent) {
469 unsigned NumResults = End - Begin;
472 void *Mem = Context.Allocate(Size,
alignof(UnresolvedLookupExpr));
473 return new (Mem) UnresolvedLookupExpr(
474 Context, NamingClass, QualifierLoc,
476 nullptr, Begin, End, KnownDependent,
477 KnownInstantiationDependent);
486 bool KnownInstantiationDependent) {
487 unsigned NumResults = End - Begin;
488 bool HasTemplateKWAndArgsInfo = Args || TemplateKWLoc.
isValid();
489 unsigned NumTemplateArgs = Args ? Args->
size() : 0;
492 NumResults, HasTemplateKWAndArgsInfo, NumTemplateArgs);
493 void *Mem = Context.Allocate(Size,
alignof(UnresolvedLookupExpr));
494 return new (Mem) UnresolvedLookupExpr(
495 Context, NamingClass, QualifierLoc, TemplateKWLoc, NameInfo, RequiresADL,
496 Args, Begin, End, KnownDependent, KnownInstantiationDependent);
500 const ASTContext &Context,
unsigned NumResults,
501 bool HasTemplateKWAndArgsInfo,
unsigned NumTemplateArgs) {
502 assert(NumTemplateArgs == 0 || HasTemplateKWAndArgsInfo);
505 NumResults, HasTemplateKWAndArgsInfo, NumTemplateArgs);
506 void *Mem = Context.Allocate(Size,
alignof(UnresolvedLookupExpr));
508 UnresolvedLookupExpr(
EmptyShell(), NumResults, HasTemplateKWAndArgsInfo);
518 bool KnownInstantiationDependent,
519 bool KnownContainsUnexpandedParameterPack)
521 QualifierLoc(QualifierLoc) {
522 unsigned NumResults = End - Begin;
537 }
else if (TemplateKWLoc.
isValid()) {
538 getTrailingASTTemplateKWAndArgsInfo()->initializeFrom(TemplateKWLoc);
542 KnownInstantiationDependent,
543 KnownContainsUnexpandedParameterPack));
549 bool HasTemplateKWAndArgsInfo)
556DependentScopeDeclRefExpr::DependentScopeDeclRefExpr(
561 QualifierLoc(QualifierLoc), NameInfo(NameInfo) {
563 (Args !=
nullptr) || TemplateKWLoc.
isValid();
565 getTrailingObjects<ASTTemplateKWAndArgsInfo>()->initializeFrom(
566 TemplateKWLoc, *Args, getTrailingObjects<TemplateArgumentLoc>());
567 }
else if (TemplateKWLoc.
isValid()) {
568 getTrailingObjects<ASTTemplateKWAndArgsInfo>()->initializeFrom(
578 assert(QualifierLoc &&
"should be created for dependent qualifiers");
579 bool HasTemplateKWAndArgsInfo = Args || TemplateKWLoc.
isValid();
581 totalSizeToAlloc<ASTTemplateKWAndArgsInfo, TemplateArgumentLoc>(
582 HasTemplateKWAndArgsInfo, Args ? Args->
size() : 0);
583 void *Mem = Context.Allocate(Size);
584 return new (Mem) DependentScopeDeclRefExpr(Context.DependentTy, QualifierLoc,
585 TemplateKWLoc, NameInfo, Args);
590 bool HasTemplateKWAndArgsInfo,
591 unsigned NumTemplateArgs) {
592 assert(NumTemplateArgs == 0 || HasTemplateKWAndArgsInfo);
594 totalSizeToAlloc<ASTTemplateKWAndArgsInfo, TemplateArgumentLoc>(
595 HasTemplateKWAndArgsInfo, NumTemplateArgs);
596 void *Mem = Context.Allocate(Size);
597 auto *E =
new (Mem) DependentScopeDeclRefExpr(
600 E->DependentScopeDeclRefExprBits.HasTemplateKWAndArgsInfo =
601 HasTemplateKWAndArgsInfo;
606 if (
const auto *TOE = dyn_cast<CXXTemporaryObjectExpr>(
this))
607 return TOE->getBeginLoc();
612 if (
const auto *TOE = dyn_cast<CXXTemporaryObjectExpr>(
this))
613 return TOE->getEndLoc();
615 if (ParenOrBraceRange.isValid())
616 return ParenOrBraceRange.getEnd();
638 ADLCallKind UsesADL,
bool IsReversed)
639 :
CallExpr(CXXOperatorCallExprClass, Fn, {}, Args, Ty,
VK,
640 OperatorLoc, FPFeatures, 0, UsesADL) {
641 CXXOperatorCallExprBits.OperatorKind = OpKind;
642 CXXOperatorCallExprBits.IsReversed = IsReversed;
644 (CXXOperatorCallExprBits.OperatorKind ==
static_cast<unsigned>(OpKind)) &&
645 "OperatorKind overflow!");
646 BeginLoc = getSourceRangeImpl().getBegin();
649CXXOperatorCallExpr::CXXOperatorCallExpr(
unsigned NumArgs,
bool HasFPFeatures,
651 :
CallExpr(CXXOperatorCallExprClass, 0, NumArgs,
652 HasFPFeatures,
Empty) {}
660 unsigned NumArgs = Args.size();
665 SizeOfTrailingObjects),
666 alignof(CXXOperatorCallExpr));
667 return new (Mem) CXXOperatorCallExpr(OpKind, Fn, Args, Ty,
VK, OperatorLoc,
668 FPFeatures,
UsesADL, IsReversed);
676 unsigned SizeOfTrailingObjects =
680 SizeOfTrailingObjects),
681 alignof(CXXOperatorCallExpr));
682 return new (Mem) CXXOperatorCallExpr(NumArgs, HasFPFeatures,
Empty);
685SourceRange CXXOperatorCallExpr::getSourceRangeImpl()
const {
687 if (Kind == OO_PlusPlus || Kind == OO_MinusMinus) {
694 }
else if (Kind == OO_Arrow) {
696 }
else if (Kind == OO_Call) {
698 }
else if (Kind == OO_Subscript) {
716 :
CallExpr(CXXMemberCallExprClass,
Fn, {}, Args, Ty, VK, RP,
719CXXMemberCallExpr::CXXMemberCallExpr(
unsigned NumArgs,
bool HasFPFeatures,
721 :
CallExpr(CXXMemberCallExprClass, 0, NumArgs, HasFPFeatures,
729 unsigned MinNumArgs) {
731 unsigned NumArgs = std::max<unsigned>(Args.size(), MinNumArgs);
735 SizeOfTrailingObjects),
736 alignof(CXXMemberCallExpr));
738 CXXMemberCallExpr(Fn, Args, Ty,
VK, RP, FPFeatures, MinNumArgs);
746 unsigned SizeOfTrailingObjects =
749 SizeOfTrailingObjects),
750 alignof(CXXMemberCallExpr));
751 return new (Mem) CXXMemberCallExpr(NumArgs, HasFPFeatures,
Empty);
756 if (
const auto *MemExpr = dyn_cast<MemberExpr>(Callee))
757 return MemExpr->getBase();
758 if (
const auto *BO = dyn_cast<BinaryOperator>(Callee))
759 if (BO->getOpcode() == BO_PtrMemD || BO->getOpcode() == BO_PtrMemI)
802 case CXXStaticCastExprClass:
return "static_cast";
803 case CXXDynamicCastExprClass:
return "dynamic_cast";
804 case CXXReinterpretCastExprClass:
return "reinterpret_cast";
805 case CXXConstCastExprClass:
return "const_cast";
806 case CXXAddrspaceCastExprClass:
return "addrspace_cast";
807 default:
return "<invalid cast>";
817 unsigned PathSize = (BasePath ? BasePath->size() : 0);
819 C.Allocate(totalSizeToAlloc<CXXBaseSpecifier *, FPOptionsOverride>(
821 auto *E =
new (Buffer) CXXStaticCastExpr(
T,
VK, K, Op, PathSize, WrittenTy,
822 FPO, L, RParenLoc, AngleBrackets);
824 llvm::uninitialized_copy(*BasePath,
831 bool HasFPFeatures) {
833 C.Allocate(totalSizeToAlloc<CXXBaseSpecifier *, FPOptionsOverride>(
834 PathSize, HasFPFeatures));
835 return new (Buffer) CXXStaticCastExpr(
EmptyShell(), PathSize, HasFPFeatures);
846 unsigned PathSize = (BasePath ? BasePath->size() : 0);
847 void *Buffer =
C.Allocate(totalSizeToAlloc<CXXBaseSpecifier *>(PathSize));
849 new (Buffer) CXXDynamicCastExpr(
T,
VK, K, Op, PathSize, WrittenTy, L,
850 RParenLoc, AngleBrackets);
852 llvm::uninitialized_copy(*BasePath, E->getTrailingObjects());
858 void *Buffer =
C.Allocate(totalSizeToAlloc<CXXBaseSpecifier *>(PathSize));
859 return new (Buffer) CXXDynamicCastExpr(
EmptyShell(), PathSize);
887 assert(SrcRD && DestRD);
889 if (SrcRD->isEffectivelyFinal()) {
890 assert(!SrcRD->isDerivedFrom(DestRD) &&
891 "upcasts should not use CK_Dynamic");
895 if (DestRD->isEffectivelyFinal() && !DestRD->isDerivedFrom(SrcRD))
908 unsigned PathSize = (BasePath ? BasePath->size() : 0);
909 void *Buffer =
C.Allocate(totalSizeToAlloc<CXXBaseSpecifier *>(PathSize));
911 new (Buffer) CXXReinterpretCastExpr(
T,
VK, K, Op, PathSize, WrittenTy, L,
912 RParenLoc, AngleBrackets);
914 llvm::uninitialized_copy(*BasePath, E->getTrailingObjects());
920 void *Buffer =
C.Allocate(totalSizeToAlloc<CXXBaseSpecifier *>(PathSize));
921 return new (Buffer) CXXReinterpretCastExpr(
EmptyShell(), PathSize);
930 return new (
C) CXXConstCastExpr(
T,
VK, Op, WrittenTy, L, RParenLoc, AngleBrackets);
942 return new (
C) CXXAddrspaceCastExpr(
T,
VK, K, Op, WrittenTy, L, RParenLoc,
954 unsigned PathSize = (BasePath ? BasePath->size() : 0);
956 C.Allocate(totalSizeToAlloc<CXXBaseSpecifier *, FPOptionsOverride>(
958 auto *E =
new (Buffer)
959 CXXFunctionalCastExpr(
T,
VK, Written, K, Op, PathSize, FPO, L, R);
961 llvm::uninitialized_copy(*BasePath,
968 bool HasFPFeatures) {
970 C.Allocate(totalSizeToAlloc<CXXBaseSpecifier *, FPOptionsOverride>(
971 PathSize, HasFPFeatures));
973 CXXFunctionalCastExpr(
EmptyShell(), PathSize, HasFPFeatures);
989 :
CallExpr(UserDefinedLiteralClass, Fn, {}, Args, Ty,
VK,
990 LitEndLoc, FPFeatures, 0, NotADL),
991 UDSuffixLoc(SuffixLoc) {}
993UserDefinedLiteral::UserDefinedLiteral(
unsigned NumArgs,
bool HasFPFeatures,
995 :
CallExpr(UserDefinedLiteralClass, 0, NumArgs,
996 HasFPFeatures,
Empty) {}
1005 unsigned NumArgs = Args.size();
1010 SizeOfTrailingObjects),
1011 alignof(UserDefinedLiteral));
1013 UserDefinedLiteral(Fn, Args, Ty,
VK, LitEndLoc, SuffixLoc, FPFeatures);
1021 unsigned SizeOfTrailingObjects =
1025 SizeOfTrailingObjects),
1026 alignof(UserDefinedLiteral));
1027 return new (Mem) UserDefinedLiteral(NumArgs, HasFPOptions,
Empty);
1037 assert(
getNumArgs() == 1 &&
"unexpected #args in literal operator call");
1049 llvm_unreachable(
"unknown kind of literal operator");
1065 bool HasRewrittenInit) {
1066 size_t Size = totalSizeToAlloc<Expr *>(HasRewrittenInit);
1067 auto *Mem =
C.Allocate(Size,
alignof(CXXDefaultArgExpr));
1068 return new (Mem) CXXDefaultArgExpr(
EmptyShell(), HasRewrittenInit);
1074 Expr *RewrittenExpr,
1076 size_t Size = totalSizeToAlloc<Expr *>(RewrittenExpr !=
nullptr);
1077 auto *Mem =
C.Allocate(Size,
alignof(CXXDefaultArgExpr));
1078 return new (Mem) CXXDefaultArgExpr(CXXDefaultArgExprClass, Loc, Param,
1079 RewrittenExpr, UsedContext);
1089 "expected this CXXDefaultArgExpr to have a rewritten init.");
1091 if (
auto *E = dyn_cast_if_present<FullExpr>(
Init))
1093 return E->getSubExpr();
1097CXXDefaultInitExpr::CXXDefaultInitExpr(
const ASTContext &Ctx,
1100 Expr *RewrittenInitExpr)
1101 :
Expr(CXXDefaultInitExprClass, Ty.getNonLValueExprType(Ctx),
1103 : Ty->isRValueReferenceType() ?
VK_XValue
1106 Field(Field), UsedContext(UsedContext) {
1111 *getTrailingObjects() = RewrittenInitExpr;
1113 assert(Field->hasInClassInitializer());
1119 bool HasRewrittenInit) {
1120 size_t Size = totalSizeToAlloc<Expr *>(HasRewrittenInit);
1121 auto *Mem =
C.Allocate(Size,
alignof(CXXDefaultInitExpr));
1122 return new (Mem) CXXDefaultInitExpr(
EmptyShell(), HasRewrittenInit);
1129 Expr *RewrittenInitExpr) {
1131 size_t Size = totalSizeToAlloc<Expr *>(RewrittenInitExpr !=
nullptr);
1132 auto *Mem = Ctx.
Allocate(Size,
alignof(CXXDefaultInitExpr));
1133 return new (Mem) CXXDefaultInitExpr(Ctx, Loc, Field, Field->getType(),
1134 UsedContext, RewrittenInitExpr);
1138 assert(Field->getInClassInitializer() &&
"initializer hasn't been parsed");
1142 return Field->getInClassInitializer();
1147 return new (
C) CXXTemporary(Destructor);
1153 assert((SubExpr->getType()->isRecordType() ||
1154 SubExpr->getType()->isArrayType()) &&
1155 "Expression bound to a temporary must have record or array type!");
1157 return new (
C) CXXBindTemporaryExpr(Temp, SubExpr);
1160CXXTemporaryObjectExpr::CXXTemporaryObjectExpr(
1163 bool HadMultipleCandidates,
bool ListInitialization,
1164 bool StdInitListInitialization,
bool ZeroInitialization)
1166 CXXTemporaryObjectExprClass, Ty, TSI->getTypeLoc().getBeginLoc(),
1167 Cons,
false, Args, HadMultipleCandidates,
1168 ListInitialization, StdInitListInitialization, ZeroInitialization,
1174CXXTemporaryObjectExpr::CXXTemporaryObjectExpr(EmptyShell
Empty,
1181 bool HadMultipleCandidates,
bool ListInitialization,
1182 bool StdInitListInitialization,
bool ZeroInitialization) {
1185 Ctx.
Allocate(
sizeof(CXXTemporaryObjectExpr) + SizeOfTrailingObjects,
1186 alignof(CXXTemporaryObjectExpr));
1187 return new (Mem) CXXTemporaryObjectExpr(
1188 Cons, Ty, TSI, Args, ParenOrBraceRange, HadMultipleCandidates,
1189 ListInitialization, StdInitListInitialization, ZeroInitialization);
1196 Ctx.
Allocate(
sizeof(CXXTemporaryObjectExpr) + SizeOfTrailingObjects,
1197 alignof(CXXTemporaryObjectExpr));
1198 return new (Mem) CXXTemporaryObjectExpr(
EmptyShell(), NumArgs);
1215 bool HadMultipleCandidates,
bool ListInitialization,
1216 bool StdInitListInitialization,
bool ZeroInitialization,
1222 CXXConstructExprClass, Ty, Loc, Ctor, Elidable, Args,
1223 HadMultipleCandidates, ListInitialization, StdInitListInitialization,
1224 ZeroInitialization, ConstructKind, ParenOrBraceRange);
1239 bool ListInitialization,
bool StdInitListInitialization,
1243 ParenOrBraceRange(ParenOrBraceRange), NumArgs(Args.size()) {
1253 Stmt **TrailingArgs = getTrailingArgs();
1254 llvm::copy(Args, TrailingArgs);
1255 assert(!llvm::is_contained(Args,
nullptr));
1258 if (SC == CXXConstructExprClass)
1269 : DeclAndBits(Var, 0), Loc(Loc), EllipsisLoc(EllipsisLoc) {
1272 Bits |= Capture_Implicit;
1276 Bits |= Capture_ByCopy;
1279 assert(!Var &&
"'this' capture cannot have a variable!");
1280 Bits |= Capture_This;
1284 Bits |= Capture_ByCopy;
1287 assert(Var &&
"capture must have a variable!");
1290 assert(!Var &&
"VLA type capture cannot have a variable!");
1293 DeclAndBits.setInt(Bits);
1299 bool CapByCopy = DeclAndBits.getInt() & Capture_ByCopy;
1310 bool ContainsUnexpandedParameterPack)
1312 IntroducerRange(IntroducerRange), CaptureDefaultLoc(CaptureDefaultLoc),
1313 ClosingBrace(ClosingBrace) {
1314 LambdaExprBits.NumCaptures = CaptureInits.size();
1315 LambdaExprBits.CaptureDefault = CaptureDefault;
1316 LambdaExprBits.ExplicitParams = ExplicitParams;
1317 LambdaExprBits.ExplicitResultType = ExplicitResultType;
1321 assert(capture_size() ==
Class->capture_size() &&
"Wrong number of captures");
1322 assert(getCaptureDefault() ==
Class->getLambdaCaptureDefault());
1325 Stmt **Stored = getStoredStmts();
1326 for (
unsigned I = 0, N = CaptureInits.size(); I != N; ++I)
1327 *Stored++ = CaptureInits[I];
1330 *Stored++ = getCallOperator()->getBody();
1335LambdaExpr::LambdaExpr(EmptyShell
Empty,
unsigned NumCaptures)
1337 LambdaExprBits.NumCaptures = NumCaptures;
1341 getStoredStmts()[NumCaptures] =
nullptr;
1348 bool ExplicitParams,
bool ExplicitResultType,
1351 bool ContainsUnexpandedParameterPack) {
1356 unsigned Size = totalSizeToAlloc<Stmt *>(CaptureInits.size() + 1);
1357 void *Mem = Context.Allocate(Size);
1359 LambdaExpr(
T, IntroducerRange, CaptureDefault, CaptureDefaultLoc,
1360 ExplicitParams, ExplicitResultType, CaptureInits, ClosingBrace,
1361 ContainsUnexpandedParameterPack);
1365 unsigned NumCaptures) {
1366 unsigned Size = totalSizeToAlloc<Stmt *>(NumCaptures + 1);
1367 void *Mem =
C.Allocate(Size);
1371void LambdaExpr::initBodyIfNeeded()
const {
1385 if (
const auto *CoroBody = dyn_cast<CoroutineBodyStmt>(Body))
1391 return C->capturesVariable() &&
C->getCapturedVar()->isInitCapture() &&
1438 return Record->getLambdaCallOperator();
1443 return Record->getDependentLambdaCallOperator();
1448 return Record->getGenericLambdaTemplateParameterList();
1453 return Record->getLambdaExplicitTemplateParameters();
1473ExprWithCleanups::ExprWithCleanups(
Expr *subexpr,
1474 bool CleanupsHaveSideEffects,
1476 :
FullExpr(ExprWithCleanupsClass, subexpr) {
1479 llvm::copy(objects, getTrailingObjects());
1483 bool CleanupsHaveSideEffects,
1485 void *buffer =
C.Allocate(totalSizeToAlloc<CleanupObject>(objects.size()),
1486 alignof(ExprWithCleanups));
1488 ExprWithCleanups(subexpr, CleanupsHaveSideEffects, objects);
1491ExprWithCleanups::ExprWithCleanups(EmptyShell empty,
unsigned numObjects)
1492 :
FullExpr(ExprWithCleanupsClass, empty) {
1498 unsigned numObjects) {
1499 void *buffer =
C.Allocate(totalSizeToAlloc<CleanupObject>(numObjects),
1500 alignof(ExprWithCleanups));
1501 return new (buffer) ExprWithCleanups(empty, numObjects);
1504CXXUnresolvedConstructExpr::CXXUnresolvedConstructExpr(
1507 :
Expr(CXXUnresolvedConstructExprClass,
T,
1512 TypeAndInitForm(TSI, IsListInit), LParenLoc(LParenLoc),
1513 RParenLoc(RParenLoc) {
1515 auto **StoredArgs = getTrailingObjects();
1516 llvm::copy(Args, StoredArgs);
1524 void *Mem = Context.Allocate(totalSizeToAlloc<Expr *>(Args.size()));
1525 return new (Mem) CXXUnresolvedConstructExpr(
T, TSI, LParenLoc, Args,
1526 RParenLoc, IsListInit);
1532 void *Mem = Context.Allocate(totalSizeToAlloc<Expr *>(NumArgs));
1533 return new (Mem) CXXUnresolvedConstructExpr(
EmptyShell(), NumArgs);
1537 return TypeAndInitForm.getPointer()->getTypeLoc().getBeginLoc();
1540CXXDependentScopeMemberExpr::CXXDependentScopeMemberExpr(
1546 :
Expr(CXXDependentScopeMemberExprClass, Ctx.DependentTy,
VK_LValue,
1548 Base(
Base), BaseType(BaseType), QualifierLoc(QualifierLoc),
1549 MemberNameInfo(MemberNameInfo) {
1552 (TemplateArgs !=
nullptr) || TemplateKWLoc.
isValid();
1554 FirstQualifierFoundInScope !=
nullptr;
1558 getTrailingObjects<ASTTemplateKWAndArgsInfo>()->initializeFrom(
1559 TemplateKWLoc, *TemplateArgs,
1560 getTrailingObjects<TemplateArgumentLoc>());
1561 }
else if (TemplateKWLoc.
isValid()) {
1562 getTrailingObjects<ASTTemplateKWAndArgsInfo>()->initializeFrom(
1566 if (hasFirstQualifierFoundInScope())
1567 *getTrailingObjects<NamedDecl *>() = FirstQualifierFoundInScope;
1571CXXDependentScopeMemberExpr::CXXDependentScopeMemberExpr(
1572 EmptyShell
Empty,
bool HasTemplateKWAndArgsInfo,
1573 bool HasFirstQualifierFoundInScope)
1574 :
Expr(CXXDependentScopeMemberExprClass,
Empty) {
1576 HasTemplateKWAndArgsInfo;
1578 HasFirstQualifierFoundInScope;
1587 bool HasTemplateKWAndArgsInfo =
1588 (TemplateArgs !=
nullptr) || TemplateKWLoc.
isValid();
1589 unsigned NumTemplateArgs = TemplateArgs ? TemplateArgs->
size() : 0;
1590 bool HasFirstQualifierFoundInScope = FirstQualifierFoundInScope !=
nullptr;
1594 HasTemplateKWAndArgsInfo, NumTemplateArgs, HasFirstQualifierFoundInScope);
1596 void *Mem = Ctx.
Allocate(Size,
alignof(CXXDependentScopeMemberExpr));
1597 return new (Mem) CXXDependentScopeMemberExpr(
1598 Ctx, Base, BaseType, IsArrow, OperatorLoc, QualifierLoc, TemplateKWLoc,
1599 FirstQualifierFoundInScope, MemberNameInfo, TemplateArgs);
1603 const ASTContext &Ctx,
bool HasTemplateKWAndArgsInfo,
1604 unsigned NumTemplateArgs,
bool HasFirstQualifierFoundInScope) {
1605 assert(NumTemplateArgs == 0 || HasTemplateKWAndArgsInfo);
1609 HasTemplateKWAndArgsInfo, NumTemplateArgs, HasFirstQualifierFoundInScope);
1611 void *Mem = Ctx.
Allocate(Size,
alignof(CXXDependentScopeMemberExpr));
1612 return new (Mem) CXXDependentScopeMemberExpr(
1613 EmptyShell(), HasTemplateKWAndArgsInfo, HasFirstQualifierFoundInScope);
1618 return new (Ctx) CXXThisExpr(L, Ty, IsImplicit,
1637 }
while (++begin != end);
1642UnresolvedMemberExpr::UnresolvedMemberExpr(
1650 UnresolvedMemberExprClass, Context, QualifierLoc, TemplateKWLoc,
1651 MemberNameInfo, TemplateArgs, Begin, End,
1653 ((
Base &&
Base->isTypeDependent()) || BaseType->isDependentType()),
1654 ((
Base &&
Base->isInstantiationDependent()) ||
1655 BaseType->isInstantiationDependentType()),
1657 ((
Base &&
Base->containsUnexpandedParameterPack()) ||
1658 BaseType->containsUnexpandedParameterPack())),
1659 Base(
Base), BaseType(BaseType), OperatorLoc(OperatorLoc) {
1660 UnresolvedMemberExprBits.IsArrow = IsArrow;
1661 UnresolvedMemberExprBits.HasUnresolvedUsing = HasUnresolvedUsing;
1666 setType(Context.BoundMemberTy);
1669UnresolvedMemberExpr::UnresolvedMemberExpr(EmptyShell
Empty,
1670 unsigned NumResults,
1671 bool HasTemplateKWAndArgsInfo)
1673 HasTemplateKWAndArgsInfo) {}
1679 return cast<Expr>(Base)->isImplicitCXXThis();
1689 unsigned NumResults = End - Begin;
1690 bool HasTemplateKWAndArgsInfo = TemplateArgs || TemplateKWLoc.
isValid();
1691 unsigned NumTemplateArgs = TemplateArgs ? TemplateArgs->
size() : 0;
1694 NumResults, HasTemplateKWAndArgsInfo, NumTemplateArgs);
1695 void *Mem = Context.Allocate(Size,
alignof(UnresolvedMemberExpr));
1696 return new (Mem) UnresolvedMemberExpr(
1697 Context, HasUnresolvedUsing, Base, BaseType, IsArrow, OperatorLoc,
1698 QualifierLoc, TemplateKWLoc, MemberNameInfo, TemplateArgs, Begin, End);
1702 const ASTContext &Context,
unsigned NumResults,
1703 bool HasTemplateKWAndArgsInfo,
unsigned NumTemplateArgs) {
1704 assert(NumTemplateArgs == 0 || HasTemplateKWAndArgsInfo);
1707 NumResults, HasTemplateKWAndArgsInfo, NumTemplateArgs);
1708 void *Mem = Context.Allocate(Size,
alignof(UnresolvedMemberExpr));
1710 UnresolvedMemberExpr(
EmptyShell(), NumResults, HasTemplateKWAndArgsInfo);
1723 Record =
T->getAsCXXRecordDecl();
1724 assert(
Record &&
"qualifier in member expression does not name record");
1732 Record = BaseType->getAsCXXRecordDecl();
1733 assert(
Record &&
"base of member expression does not name record");
1746 Context.Allocate(totalSizeToAlloc<TemplateArgument>(PartialArgs.size()));
1747 return new (Storage) SizeOfPackExpr(Context.getSizeType(), OperatorLoc, Pack,
1748 PackLoc, RParenLoc, Length, PartialArgs);
1752 unsigned NumPartialArgs) {
1754 Context.Allocate(totalSizeToAlloc<TemplateArgument>(NumPartialArgs));
1755 return new (Storage) SizeOfPackExpr(
EmptyShell(), NumPartialArgs);
1765 Expr *PackIdExpr,
Expr *IndexExpr, std::optional<int64_t> Index,
1768 if (Index && FullySubstituted && !SubstitutedExprs.empty())
1769 Type = SubstitutedExprs[*Index]->getType();
1774 Context.Allocate(totalSizeToAlloc<Expr *>(SubstitutedExprs.size()));
1775 return new (Storage)
1776 PackIndexingExpr(
Type, EllipsisLoc, RSquareLoc, PackIdExpr, IndexExpr,
1777 SubstitutedExprs, FullySubstituted);
1782 return D->getDecl();
1784 assert(
false &&
"invalid declaration kind in pack indexing expression");
1790 unsigned NumTransformedExprs) {
1792 Context.Allocate(totalSizeToAlloc<Expr *>(NumTransformedExprs));
1793 return new (Storage) PackIndexingExpr(
EmptyShell{});
1796SubstNonTypeTemplateParmPackExpr::SubstNonTypeTemplateParmPackExpr(
1801 AssociatedDecl(AssociatedDecl), Arguments(ArgPack.pack_begin()),
1802 NumArguments(ArgPack.pack_size()), Final(Final), Index(Index),
1804 assert(AssociatedDecl !=
nullptr);
1806 ExprDependence::UnexpandedPack);
1824 ParamPack(ParamPack), NameLoc(NameLoc), NumParameters(NumParams) {
1826 std::uninitialized_copy(Params, Params + NumParams, getTrailingObjects());
1828 ExprDependence::UnexpandedPack);
1835 return new (Context.Allocate(totalSizeToAlloc<ValueDecl *>(Params.size())))
1836 FunctionParmPackExpr(
T, ParamPack, NameLoc, Params.size(), Params.data());
1841 unsigned NumParams) {
1842 return new (Context.Allocate(totalSizeToAlloc<ValueDecl *>(NumParams)))
1849 :
Expr(MaterializeTemporaryExprClass,
T,
1853 MTD->ExprWithTemporary = Temporary;
1861 unsigned ManglingNumber) {
1873 ES->ExtendingDecl = ExtendedBy;
1874 ES->ManglingNumber = ManglingNumber;
1888 VD->isUsableInConstantExpressions(Context);
1891TypeTraitExpr::TypeTraitExpr(
1894 std::variant<bool, APValue, ComparisonCategoryResult>
Value)
1896 RParenLoc(RParenLoc) {
1897 assert(Kind <= TT_Last &&
"invalid enum value!");
1901 "TypeTraitExprBits.Kind overflow!");
1905 std::holds_alternative<ComparisonCategoryResult>(
Value);
1909 if (
auto *CCR = std::get_if<ComparisonCategoryResult>(&
Value)) {
1910 llvm::APSInt EncodedValue = llvm::APSInt::get(llvm::to_underlying(*CCR));
1911 ::new (getTrailingObjects<APValue>())
APValue(
std::move(EncodedValue));
1913 ::new (getTrailingObjects<
APValue>())
1919 "TypeTraitExprBits.NumArgs overflow!");
1921 llvm::copy(Args, ToArgs);
1926 getAPValue().isInt() || getAPValue().isAbsent()) &&
1927 "Only int values are supported by clang");
1933 if (!IsStoredAsBool)
1934 ::new (getTrailingObjects<APValue>())
APValue();
1944 C.Allocate(totalSizeToAlloc<APValue, TypeSourceInfo *>(0, Args.size()));
1945 return new (Mem) TypeTraitExpr(
T, Loc, Kind, Args, RParenLoc,
Value);
1953 C.Allocate(totalSizeToAlloc<APValue, TypeSourceInfo *>(1, Args.size()));
1954 return new (Mem) TypeTraitExpr(
T, Loc, Kind, Args, RParenLoc,
Value);
1963 C.Allocate(totalSizeToAlloc<APValue, TypeSourceInfo *>(1, Args.size()));
1964 return new (Mem) TypeTraitExpr(
T, Loc, Kind, Args, RParenLoc,
Value);
1968 bool IsStoredAsBool,
1970 void *Mem =
C.Allocate(totalSizeToAlloc<APValue, TypeSourceInfo *>(
1971 IsStoredAsBool ? 0 : 1, NumArgs));
1972 return new (Mem) TypeTraitExpr(
EmptyShell(), IsStoredAsBool);
1975CXXReflectExpr::CXXReflectExpr(EmptyShell
Empty)
1986 return new (
C) CXXReflectExpr(
C, CaretCaretLoc, TSI);
1993CUDAKernelCallExpr::CUDAKernelCallExpr(
Expr *Fn,
CallExpr *Config,
1997 unsigned MinNumArgs)
1998 :
CallExpr(CUDAKernelCallExprClass, Fn, Config, Args, Ty,
VK,
1999 RP, FPFeatures, MinNumArgs, NotADL) {}
2001CUDAKernelCallExpr::CUDAKernelCallExpr(
unsigned NumArgs,
bool HasFPFeatures,
2003 :
CallExpr(CUDAKernelCallExprClass, END_PREARG, NumArgs,
2004 HasFPFeatures,
Empty) {}
2010 unsigned MinNumArgs) {
2012 unsigned NumArgs = std::max<unsigned>(Args.size(), MinNumArgs);
2017 SizeOfTrailingObjects),
2018 alignof(CUDAKernelCallExpr));
2020 CUDAKernelCallExpr(Fn, Config, Args, Ty,
VK, RP, FPFeatures, MinNumArgs);
2029 END_PREARG, NumArgs, HasFPFeatures);
2032 SizeOfTrailingObjects),
2033 alignof(CUDAKernelCallExpr));
2034 return new (Mem) CUDAKernelCallExpr(NumArgs, HasFPFeatures,
Empty);
2039 unsigned NumUserSpecifiedExprs,
2042 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(Args.size()));
2043 return new (Mem) CXXParenListInitExpr(Args,
T, NumUserSpecifiedExprs, InitLoc,
2044 LParenLoc, RParenLoc);
2050 void *Mem =
C.Allocate(totalSizeToAlloc<Expr *>(NumExprs),
2051 alignof(CXXParenListInitExpr));
2052 return new (Mem) CXXParenListInitExpr(
Empty, NumExprs);
2061 EllipsisLoc(EllipsisLoc), RParenLoc(RParenLoc),
2062 NumExpansions(NumExpansions) {
2066 assert(LHS->containsUnexpandedParameterPack() !=
2067 RHS->containsUnexpandedParameterPack() &&
2068 "Exactly one of LHS or RHS should contain an unexpanded pack");
2069 SubExprs[SubExpr::Callee] = Callee;
2070 SubExprs[SubExpr::LHS] = LHS;
2071 SubExprs[SubExpr::RHS] = RHS;
2076 :
Expr(CXXExpansionSelectExprClass,
Empty) {}
2083 SubExprs[RANGE] = Range;
2084 SubExprs[INDEX] = Idx;
Defines the clang::ASTContext interface.
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....
Defines the C++ template declaration subclasses.
static bool hasOnlyNonStaticMemberFunctions(UnresolvedSetIterator begin, UnresolvedSetIterator end)
static bool isGLValueFromPointerDeref(const Expr *E)
Defines the clang::Expr interface and subclasses for C++ expressions.
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
Defines the LambdaCapture class.
llvm::MachO::Record Record
Defines an enumeration for C++ overloaded operators.
Defines the clang::SourceLocation class and associated facilities.
Defines various enumerations that describe declaration and type specifiers.
static QualType getPointeeType(const MemRegion *R)
Defines the clang::TypeLoc interface and its subclasses.
C Language Family Type Representation.
__DEVICE__ void * memcpy(void *__a, const void *__b, size_t __c)
a trap message and trap category.
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat],...
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
const LangOptions & getLangOpts() const
void * Allocate(size_t Size, unsigned Align=8) const
Represents a call to a CUDA kernel function.
static CUDAKernelCallExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, bool HasFPFeatures, EmptyShell Empty)
static CUDAKernelCallExpr * Create(const ASTContext &Ctx, Expr *Fn, CallExpr *Config, ArrayRef< Expr * > Args, QualType Ty, ExprValueKind VK, SourceLocation RP, FPOptionsOverride FPFeatures, unsigned MinNumArgs=0)
A C++ addrspace_cast expression (currently only enabled for OpenCL).
static CXXAddrspaceCastExpr * CreateEmpty(const ASTContext &Context)
static CXXAddrspaceCastExpr * Create(const ASTContext &Context, QualType T, ExprValueKind VK, CastKind Kind, Expr *Op, TypeSourceInfo *WrittenTy, SourceLocation L, SourceLocation RParenLoc, SourceRange AngleBrackets)
Represents a base class of a C++ class.
static CXXBindTemporaryExpr * Create(const ASTContext &C, CXXTemporary *Temp, Expr *SubExpr)
static CXXConstCastExpr * Create(const ASTContext &Context, QualType T, ExprValueKind VK, Expr *Op, TypeSourceInfo *WrittenTy, SourceLocation L, SourceLocation RParenLoc, SourceRange AngleBrackets)
static CXXConstCastExpr * CreateEmpty(const ASTContext &Context)
Represents a call to a C++ constructor.
SourceRange getParenOrBraceRange() const
static CXXConstructExpr * Create(const ASTContext &Ctx, QualType Ty, SourceLocation Loc, CXXConstructorDecl *Ctor, bool Elidable, ArrayRef< Expr * > Args, bool HadMultipleCandidates, bool ListInitialization, bool StdInitListInitialization, bool ZeroInitialization, CXXConstructionKind ConstructKind, SourceRange ParenOrBraceRange)
Create a C++ construction expression.
Expr * getArg(unsigned Arg)
Return the specified argument.
CXXConstructExpr(StmtClass SC, QualType Ty, SourceLocation Loc, CXXConstructorDecl *Ctor, bool Elidable, ArrayRef< Expr * > Args, bool HadMultipleCandidates, bool ListInitialization, bool StdInitListInitialization, bool ZeroInitialization, CXXConstructionKind ConstructKind, SourceRange ParenOrBraceRange)
Build a C++ construction expression.
SourceLocation getLocation() const
static unsigned sizeOfTrailingObjects(unsigned NumArgs)
Return the size in bytes of the trailing objects.
SourceLocation getEndLoc() const LLVM_READONLY
SourceLocation getBeginLoc() const LLVM_READONLY
unsigned getNumArgs() const
Return the number of arguments to the constructor call.
static CXXConstructExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs)
Create an empty C++ construction expression.
Represents a C++ constructor within a class.
const ParmVarDecl * getParam() const
Expr * getRewrittenExpr()
Expr * getAdjustedRewrittenExpr()
static CXXDefaultArgExpr * Create(const ASTContext &C, SourceLocation Loc, ParmVarDecl *Param, Expr *RewrittenExpr, DeclContext *UsedContext)
static CXXDefaultArgExpr * CreateEmpty(const ASTContext &C, bool HasRewrittenInit)
bool hasRewrittenInit() const
static CXXDefaultInitExpr * Create(const ASTContext &Ctx, SourceLocation Loc, FieldDecl *Field, DeclContext *UsedContext, Expr *RewrittenInitExpr)
Field is the non-static data member whose default initializer is used by this expression.
const Expr * getRewrittenExpr() const
Retrieve the initializing expression with evaluated immediate calls, if any.
bool hasRewrittenInit() const
Expr * getExpr()
Get the initialization expression that will be used.
static CXXDefaultInitExpr * CreateEmpty(const ASTContext &C, bool HasRewrittenInit)
FunctionDecl * getOperatorDelete() const
QualType getDestroyedType() const
Retrieve the type being destroyed.
static CXXDependentScopeMemberExpr * Create(const ASTContext &Ctx, Expr *Base, QualType BaseType, bool IsArrow, SourceLocation OperatorLoc, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, NamedDecl *FirstQualifierFoundInScope, DeclarationNameInfo MemberNameInfo, const TemplateArgumentListInfo *TemplateArgs)
static CXXDependentScopeMemberExpr * CreateEmpty(const ASTContext &Ctx, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs, bool HasFirstQualifierFoundInScope)
Represents a C++ destructor within a class.
static CXXDynamicCastExpr * Create(const ASTContext &Context, QualType T, ExprValueKind VK, CastKind Kind, Expr *Op, const CXXCastPath *Path, TypeSourceInfo *Written, SourceLocation L, SourceLocation RParenLoc, SourceRange AngleBrackets)
static CXXDynamicCastExpr * CreateEmpty(const ASTContext &Context, unsigned pathSize)
bool isAlwaysNull() const
isAlwaysNull - Return whether the result of the dynamic_cast is proven to always be null.
CXXExpansionSelectExpr(EmptyShell Empty)
CXXFoldExpr(QualType T, UnresolvedLookupExpr *Callee, SourceLocation LParenLoc, Expr *LHS, BinaryOperatorKind Opcode, SourceLocation EllipsisLoc, Expr *RHS, SourceLocation RParenLoc, UnsignedOrNone NumExpansions)
static CXXFunctionalCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize, bool HasFPFeatures)
SourceLocation getBeginLoc() const LLVM_READONLY
SourceLocation getEndLoc() const LLVM_READONLY
static CXXFunctionalCastExpr * Create(const ASTContext &Context, QualType T, ExprValueKind VK, TypeSourceInfo *Written, CastKind Kind, Expr *Op, const CXXCastPath *Path, FPOptionsOverride FPO, SourceLocation LPLoc, SourceLocation RPLoc)
CXXMethodDecl * getMethodDecl() const
Retrieve the declaration of the called method.
Expr * getImplicitObjectArgument() const
Retrieve the implicit object argument for the member call.
static CXXMemberCallExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, bool HasFPFeatures, EmptyShell Empty)
static CXXMemberCallExpr * Create(const ASTContext &Ctx, Expr *Fn, ArrayRef< Expr * > Args, QualType Ty, ExprValueKind VK, SourceLocation RP, FPOptionsOverride FPFeatures, unsigned MinNumArgs=0)
QualType getObjectType() const
Retrieve the type of the object argument.
CXXRecordDecl * getRecordDecl() const
Retrieve the CXXRecordDecl for the underlying type of the implicit object argument.
Represents a static or instance method of a struct/union/class.
const char * getCastName() const
getCastName - Get the name of the C++ cast being used, e.g., "static_cast", "dynamic_cast",...
static CXXNewExpr * Create(const ASTContext &Ctx, bool IsGlobalNew, FunctionDecl *OperatorNew, FunctionDecl *OperatorDelete, const ImplicitAllocationParameters &IAP, bool UsualArrayDeleteWantsSize, ArrayRef< Expr * > PlacementArgs, SourceRange TypeIdParens, std::optional< Expr * > ArraySize, CXXNewInitializationStyle InitializationStyle, Expr *Initializer, QualType Ty, TypeSourceInfo *AllocatedTypeInfo, SourceRange Range, SourceRange DirectInitRange)
Create a c++ new expression.
static CXXNewExpr * CreateEmpty(const ASTContext &Ctx, bool IsArray, bool HasInit, unsigned NumPlacementArgs, bool IsParenTypeId)
Create an empty c++ new expression.
bool shouldNullCheckAllocation() const
True if the allocation result needs to be null-checked.
FunctionDecl * getOperatorNew() const
bool isInfixBinaryOp() const
Is this written as an infix binary operator?
SourceLocation getOperatorLoc() const
Returns the location of the operator symbol in the expression.
static CXXOperatorCallExpr * Create(const ASTContext &Ctx, OverloadedOperatorKind OpKind, Expr *Fn, ArrayRef< Expr * > Args, QualType Ty, ExprValueKind VK, SourceLocation OperatorLoc, FPOptionsOverride FPFeatures, ADLCallKind UsesADL=NotADL, bool IsReversed=false)
SourceLocation getEndLoc() const
OverloadedOperatorKind getOperator() const
Returns the kind of overloaded operator that this expression refers to.
static CXXOperatorCallExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, bool HasFPFeatures, EmptyShell Empty)
SourceLocation getBeginLoc() const
Represents a list-initialization with parenthesis.
static CXXParenListInitExpr * Create(ASTContext &C, ArrayRef< Expr * > Args, QualType T, unsigned NumUserSpecifiedExprs, SourceLocation InitLoc, SourceLocation LParenLoc, SourceLocation RParenLoc)
static CXXParenListInitExpr * CreateEmpty(ASTContext &C, unsigned numExprs, EmptyShell Empty)
bool isArrow() const
Determine whether this pseudo-destructor expression was written using an '->' (otherwise,...
CXXPseudoDestructorExpr(const ASTContext &Context, Expr *Base, bool isArrow, SourceLocation OperatorLoc, NestedNameSpecifierLoc QualifierLoc, TypeSourceInfo *ScopeType, SourceLocation ColonColonLoc, SourceLocation TildeLoc, PseudoDestructorTypeStorage DestroyedType)
SourceLocation getEndLoc() const LLVM_READONLY
QualType getDestroyedType() const
Retrieve the type being destroyed.
Represents a C++ struct/union/class.
capture_const_iterator captures_end() const
capture_const_iterator captures_begin() const
static CXXReflectExpr * Create(ASTContext &C, SourceLocation OperatorLoc, const TypeSourceInfo *TSI)
static CXXReflectExpr * CreateEmpty(ASTContext &C)
A C++ reinterpret_cast expression (C++ [expr.reinterpret.cast]).
static CXXReinterpretCastExpr * Create(const ASTContext &Context, QualType T, ExprValueKind VK, CastKind Kind, Expr *Op, const CXXCastPath *Path, TypeSourceInfo *WrittenTy, SourceLocation L, SourceLocation RParenLoc, SourceRange AngleBrackets)
static CXXReinterpretCastExpr * CreateEmpty(const ASTContext &Context, unsigned pathSize)
Expr * getSemanticForm()
Get an equivalent semantic form for this expression.
bool isReversed() const
Determine whether this expression was rewritten in reverse form.
DecomposedForm getDecomposedForm() const LLVM_READONLY
Decompose this operator into its syntactic form.
SourceLocation getBeginLoc() const LLVM_READONLY
SourceLocation getRParenLoc() const
A C++ static_cast expression (C++ [expr.static.cast]).
static CXXStaticCastExpr * Create(const ASTContext &Context, QualType T, ExprValueKind VK, CastKind K, Expr *Op, const CXXCastPath *Path, TypeSourceInfo *Written, FPOptionsOverride FPO, SourceLocation L, SourceLocation RParenLoc, SourceRange AngleBrackets)
static CXXStaticCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize, bool hasFPFeatures)
Represents a C++ functional cast expression that builds a temporary object.
static CXXTemporaryObjectExpr * Create(const ASTContext &Ctx, CXXConstructorDecl *Cons, QualType Ty, TypeSourceInfo *TSI, ArrayRef< Expr * > Args, SourceRange ParenOrBraceRange, bool HadMultipleCandidates, bool ListInitialization, bool StdInitListInitialization, bool ZeroInitialization)
TypeSourceInfo * getTypeSourceInfo() const
SourceLocation getEndLoc() const LLVM_READONLY
static CXXTemporaryObjectExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs)
SourceLocation getBeginLoc() const LLVM_READONLY
Represents a C++ temporary.
static CXXTemporary * Create(const ASTContext &C, const CXXDestructorDecl *Destructor)
static CXXThisExpr * CreateEmpty(const ASTContext &Ctx)
static CXXThisExpr * Create(const ASTContext &Ctx, SourceLocation L, QualType Ty, bool IsImplicit)
bool isTypeOperand() const
QualType getTypeOperand(const ASTContext &Context) const
Retrieves the type operand of this typeid() expression after various required adjustments (removing r...
Expr * getExprOperand() const
bool isMostDerived(const ASTContext &Context) const
Best-effort check if the expression operand refers to a most derived object.
bool isPotentiallyEvaluated() const
Determine whether this typeid has a type operand which is potentially evaluated, per C++11 [expr....
bool hasNullCheck() const
Whether this is of a form like "typeid(*ptr)" that can throw a std::bad_typeid if a pointer is a null...
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
static CXXUnresolvedConstructExpr * Create(const ASTContext &Context, QualType T, TypeSourceInfo *TSI, SourceLocation LParenLoc, ArrayRef< Expr * > Args, SourceLocation RParenLoc, bool IsListInit)
SourceLocation getBeginLoc() const LLVM_READONLY
static CXXUnresolvedConstructExpr * CreateEmpty(const ASTContext &Context, unsigned NumArgs)
QualType getTypeOperand(ASTContext &Context) const
Retrieves the type operand of this __uuidof() expression after various required adjustments (removing...
bool isTypeOperand() const
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Expr * getArg(unsigned Arg)
getArg - Return the specified argument.
static unsigned sizeOfTrailingObjects(unsigned NumPreArgs, unsigned NumArgs, bool HasFPFeatures)
Return the size in bytes needed for the trailing objects.
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this call.
CallExpr(StmtClass SC, Expr *Fn, ArrayRef< Expr * > PreArgs, ArrayRef< Expr * > Args, QualType Ty, ExprValueKind VK, SourceLocation RParenLoc, FPOptionsOverride FPFeatures, unsigned MinNumArgs, ADLCallKind UsesADL)
Build a call expression, assuming that appropriate storage has been allocated for the trailing object...
static constexpr unsigned sizeToAllocateForCallExprSubclass(unsigned SizeOfTrailingObjects)
SourceLocation getRParenLoc() const
static constexpr ADLCallKind UsesADL
CastKind getCastKind() const
CompoundStmt - This represents a group of statements like { stmt stmt }.
A POD class for pairing a NamedDecl* with an access specifier.
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
Decl - This represents one declaration (or definition), e.g.
const AssociatedConstraint & getTrailingRequiresClause() const
Get the constraint-expression introduced by the trailing requires-clause in the function/member decla...
A qualified reference to a name whose declaration cannot yet be resolved.
static DependentScopeDeclRefExpr * Create(const ASTContext &Context, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, const DeclarationNameInfo &NameInfo, const TemplateArgumentListInfo *TemplateArgs)
static DependentScopeDeclRefExpr * CreateEmpty(const ASTContext &Context, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
A template-id naming a variable template or a concept through a template template parameter.
static DependentTemplateIdExpr * Create(const ASTContext &Context, const DeclarationNameInfo &NameInfo, TemplateName Name, const TemplateArgumentListInfo &TemplateArgs)
static DependentTemplateIdExpr * CreateEmpty(const ASTContext &Context, unsigned NumTemplateArgs)
TypeSourceInfo * getTypeInfoAsWritten() const
getTypeInfoAsWritten - Returns the type source info for the type that this expression is casting to.
static ExprWithCleanups * Create(const ASTContext &C, EmptyShell empty, unsigned numObjects)
This represents one expression.
Expr * IgnoreParenNoopCasts(const ASTContext &Ctx) LLVM_READONLY
Skip past any parentheses and casts which do not change the value (including ptr->int casts of the sa...
bool isValueDependent() const
Determines whether the value of this expression depends on.
bool isTypeDependent() const
Determines whether the type of this expression depends on.
Expr * IgnoreImplicit() LLVM_READONLY
Skip past any implicit AST nodes which might surround this expression until reaching a fixed point.
Expr * IgnoreParens() LLVM_READONLY
Skip past any parentheses which might surround this expression until reaching a fixed point.
bool isDefaultArgument() const
Determine whether this expression is a default function argument.
void setDependence(ExprDependence Deps)
Each concrete expr subclass is expected to compute its dependence and call this in the constructor.
Represents difference between two FPOptions values.
bool requiresTrailingStorage() const
Represents a member of a struct/union/class.
FullExpr - Represents a "full-expression" node.
Represents a function declaration or definition.
Stmt * getBody(const FunctionDecl *&Definition) const
Retrieve the body (definition) of the function.
bool isReservedGlobalPlacementOperator() const
Determines whether this operator new or delete is one of the reserved global placement operators: voi...
Represents a reference to a function parameter pack, init-capture pack, or binding pack that has been...
static FunctionParmPackExpr * Create(const ASTContext &Context, QualType T, ValueDecl *ParamPack, SourceLocation NameLoc, ArrayRef< ValueDecl * > Params)
static FunctionParmPackExpr * CreateEmpty(const ASTContext &Context, unsigned NumParams)
Represents a prototype with parameter type info, e.g.
Declaration of a template function.
One of these records is kept for each identifier that is lexed.
Describes an C or C++ initializer list.
Describes the capture of a variable or of this, or of a C++1y init-capture.
bool capturesVLAType() const
Determine whether this captures a variable length array bound expression.
LambdaCapture(SourceLocation Loc, bool Implicit, LambdaCaptureKind Kind, ValueDecl *Var=nullptr, SourceLocation EllipsisLoc=SourceLocation())
Create a new capture of a variable or of this.
LambdaCaptureKind getCaptureKind() const
Determine the kind of capture.
bool capturesThis() const
Determine whether this capture handles the C++ this pointer.
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
capture_iterator capture_begin() const
Retrieve an iterator pointing to the first lambda capture.
static LambdaExpr * CreateDeserialized(const ASTContext &C, unsigned NumCaptures)
Construct a new lambda expression that will be deserialized from an external source.
static LambdaExpr * Create(const ASTContext &C, CXXRecordDecl *Class, SourceRange IntroducerRange, LambdaCaptureDefault CaptureDefault, SourceLocation CaptureDefaultLoc, bool ExplicitParams, bool ExplicitResultType, ArrayRef< Expr * > CaptureInits, SourceLocation ClosingBrace, bool ContainsUnexpandedParameterPack)
Construct a new lambda expression.
Stmt * getBody() const
Retrieve the body of the lambda.
bool isMutable() const
Determine whether the lambda is mutable, meaning that any captures values can be modified.
capture_iterator implicit_capture_end() const
Retrieve an iterator pointing past the end of the sequence of implicit lambda captures.
unsigned capture_size() const
Determine the number of captures in this lambda.
capture_range explicit_captures() const
Retrieve this lambda's explicit captures.
bool isInitCapture(const LambdaCapture *Capture) const
Determine whether one of this lambda's captures is an init-capture.
CXXMethodDecl * getCallOperator() const
Retrieve the function call operator associated with this lambda expression.
const CompoundStmt * getCompoundStmtBody() const
Retrieve the CompoundStmt representing the body of the lambda.
capture_range implicit_captures() const
Retrieve this lambda's implicit captures.
const AssociatedConstraint & getTrailingRequiresClause() const
Get the trailing requires clause, if any.
TemplateParameterList * getTemplateParameterList() const
If this is a generic lambda expression, retrieve the template parameter list associated with it,...
ArrayRef< NamedDecl * > getExplicitTemplateParameters() const
Get the template parameters were explicitly specified (as opposed to being invented by use of an auto...
capture_iterator implicit_capture_begin() const
Retrieve an iterator pointing to the first implicit lambda capture.
capture_iterator explicit_capture_end() const
Retrieve an iterator pointing past the end of the sequence of explicit lambda captures.
capture_iterator capture_end() const
Retrieve an iterator pointing past the end of the sequence of lambda captures.
llvm::iterator_range< capture_iterator > capture_range
An iterator over a range of lambda captures.
const LambdaCapture * capture_iterator
An iterator that walks over the captures of the lambda, both implicit and explicit.
capture_iterator explicit_capture_begin() const
Retrieve an iterator pointing to the first explicit lambda capture.
child_range children()
Includes the captures and the body of the lambda.
FunctionTemplateDecl * getDependentCallOperator() const
Retrieve the function template call operator associated with this lambda expression.
capture_range captures() const
Retrieve this lambda's captures.
CXXRecordDecl * getLambdaClass() const
Retrieve the class that corresponds to the lambda.
Implicit declaration of a temporary that was materialized by a MaterializeTemporaryExpr and lifetime-...
static LifetimeExtendedTemporaryDecl * Create(Expr *Temp, ValueDecl *EDec, unsigned Mangling)
MaterializeTemporaryExpr(QualType T, Expr *Temporary, bool BoundToLvalueReference, LifetimeExtendedTemporaryDecl *MTD=nullptr)
ValueDecl * getExtendingDecl()
Get the declaration which triggered the lifetime-extension of this temporary, if any.
bool isUsableInConstantExpressions(const ASTContext &Context) const
Determine whether this temporary object is usable in constant expressions, as specified in C++20 [exp...
void setExtendingDecl(ValueDecl *ExtendedBy, unsigned ManglingNumber)
This represents a decl that may have a name.
A C++ nested-name-specifier augmented with source location information.
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
const Type * getAsType() const
@ Type
A type, stored as a Type*.
NonTypeTemplateParmDecl - Declares a non-type template parameter, e.g., "Size" in.
A reference to an overloaded function set, either an UnresolvedLookupExpr or an UnresolvedMemberExpr.
ASTTemplateKWAndArgsInfo * getTrailingASTTemplateKWAndArgsInfo()
Return the optional template keyword and arguments info.
NestedNameSpecifier getQualifier() const
Fetches the nested-name qualifier, if one was given.
TemplateArgumentLoc * getTrailingTemplateArgumentLoc()
Return the optional template arguments.
DeclAccessPair * getTrailingResults()
Return the results. Defined after UnresolvedMemberExpr.
OverloadExpr(StmtClass SC, const ASTContext &Context, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, const DeclarationNameInfo &NameInfo, const TemplateArgumentListInfo *TemplateArgs, UnresolvedSetIterator Begin, UnresolvedSetIterator End, bool KnownDependent, bool KnownInstantiationDependent, bool KnownContainsUnexpandedParameterPack)
NamedDecl * getPackDecl() const
static PackIndexingExpr * CreateDeserialized(ASTContext &Context, unsigned NumTransformedExprs)
Expr * getPackIdExpression() const
static PackIndexingExpr * Create(ASTContext &Context, SourceLocation EllipsisLoc, SourceLocation RSquareLoc, Expr *PackIdExpr, Expr *IndexExpr, std::optional< int64_t > Index, ArrayRef< Expr * > SubstitutedExprs={}, bool FullySubstituted=false)
Represents a parameter to a function.
PointerType - C99 6.7.5.1 - Pointer Declarators.
Stores the type being destroyed by a pseudo-destructor expression.
PseudoDestructorTypeStorage()=default
A (possibly-)qualified type.
bool isVolatileQualified() const
Determine whether this type is volatile-qualified.
bool isConstant(const ASTContext &Ctx) const
QualType getNonReferenceType() const
If Type is a reference type (e.g., const int&), returns the type that the reference refers to ("const...
The collection of all-type qualifiers we support.
static SizeOfPackExpr * CreateDeserialized(ASTContext &Context, unsigned NumPartialArgs)
static SizeOfPackExpr * Create(ASTContext &Context, SourceLocation OperatorLoc, NamedDecl *Pack, SourceLocation PackLoc, SourceLocation RParenLoc, UnsignedOrNone Length=std::nullopt, ArrayRef< TemplateArgument > PartialArgs={})
Encodes a location in the source.
bool isValid() const
Return true if this is a valid SourceLocation object.
A trivial tuple used to represent a source range.
SourceLocation getEnd() const
void setEnd(SourceLocation e)
Stmt - This represents one statement.
SourceLocation getEndLoc() const LLVM_READONLY
CXXUnresolvedConstructExprBitfields CXXUnresolvedConstructExprBits
UnresolvedLookupExprBitfields UnresolvedLookupExprBits
ExprWithCleanupsBitfields ExprWithCleanupsBits
StmtClass getStmtClass() const
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation tokens are not useful in isolation - they are low level value objects created/interpre...
OverloadExprBitfields OverloadExprBits
CXXConstructExprBitfields CXXConstructExprBits
CXXDependentScopeMemberExprBitfields CXXDependentScopeMemberExprBits
TypeTraitExprBitfields TypeTraitExprBits
CXXNewExprBitfields CXXNewExprBits
llvm::iterator_range< child_iterator > child_range
CXXFoldExprBitfields CXXFoldExprBits
CXXOperatorCallExprBitfields CXXOperatorCallExprBits
CXXDefaultInitExprBitfields CXXDefaultInitExprBits
DependentScopeDeclRefExprBitfields DependentScopeDeclRefExprBits
llvm::iterator_range< const_child_iterator > const_child_range
CXXDefaultArgExprBitfields CXXDefaultArgExprBits
Decl * getAssociatedDecl() const
A template-like entity which owns the whole pattern being substituted.
NonTypeTemplateParmDecl * getParameter() const
TemplateArgument getArgumentPack() const
Retrieve the template argument pack containing the substituted template arguments.
NonTypeTemplateParmDecl * getParameterPack() const
Retrieve the non-type template parameter pack being substituted.
Decl * getAssociatedDecl() const
A template-like entity which owns the whole pattern being substituted.
A convenient class for passing around template argument information.
Location wrapper for a TemplateArgument.
Represents a template argument.
Represents a C++ template name within the type system.
Stores a list of template parameters for a TemplateDecl and its derived classes.
SourceLocation getBeginLoc() const
Get the begin source location.
A container of type source information.
TypeLoc getTypeLoc() const
Return the TypeLoc wrapper for the type source info.
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
static TypeTraitExpr * Create(const ASTContext &C, QualType T, SourceLocation Loc, TypeTrait Kind, ArrayRef< TypeSourceInfo * > Args, SourceLocation RParenLoc, bool Value)
Create a new type trait expression.
static TypeTraitExpr * CreateDeserialized(const ASTContext &C, bool IsStoredAsBool, unsigned NumArgs)
The base class of the type hierarchy.
bool isLiteralType(const ASTContext &Ctx) const
Return true if this is a literal type (C++11 [basic.types]p10)
CXXRecordDecl * getAsCXXRecordDecl() const
Retrieves the CXXRecordDecl that this type refers to, either because the type is a RecordType or beca...
bool isVoidPointerType() const
bool isPointerType() const
bool isIntegerType() const
isIntegerType() does not include complex integers (a GCC extension).
const T * castAs() const
Member-template castAs<specific type>.
QualType getPointeeType() const
If this is a pointer, ObjC object pointer, or block pointer, this returns the respective pointee.
bool isAnyCharacterType() const
Determine whether this type is any of the built-in character types.
bool isPointerOrReferenceType() const
bool isFloatingType() const
bool isAnyPointerType() const
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
static UnresolvedLookupExpr * CreateEmpty(const ASTContext &Context, unsigned NumResults, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
static UnresolvedLookupExpr * Create(const ASTContext &Context, CXXRecordDecl *NamingClass, NestedNameSpecifierLoc QualifierLoc, const DeclarationNameInfo &NameInfo, bool RequiresADL, UnresolvedSetIterator Begin, UnresolvedSetIterator End, bool KnownDependent, bool KnownInstantiationDependent)
QualType getBaseType() const
bool isArrow() const
Determine whether this member expression used the '->' operator; otherwise, it used the '.
static UnresolvedMemberExpr * Create(const ASTContext &Context, bool HasUnresolvedUsing, Expr *Base, QualType BaseType, bool IsArrow, SourceLocation OperatorLoc, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, const DeclarationNameInfo &MemberNameInfo, const TemplateArgumentListInfo *TemplateArgs, UnresolvedSetIterator Begin, UnresolvedSetIterator End)
CXXRecordDecl * getNamingClass()
Retrieve the naming class of this lookup.
bool isImplicitAccess() const
True if this is an implicit access, i.e., one in which the member being accessed was not written in t...
static UnresolvedMemberExpr * CreateEmpty(const ASTContext &Context, unsigned NumResults, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
The iterator over UnresolvedSets.
LiteralOperatorKind getLiteralOperatorKind() const
Returns the kind of literal operator invocation which this expression represents.
const IdentifierInfo * getUDSuffix() const
Returns the ud-suffix specified for this literal.
static UserDefinedLiteral * Create(const ASTContext &Ctx, Expr *Fn, ArrayRef< Expr * > Args, QualType Ty, ExprValueKind VK, SourceLocation LitEndLoc, SourceLocation SuffixLoc, FPOptionsOverride FPFeatures)
static UserDefinedLiteral * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, bool HasFPOptions, EmptyShell Empty)
Expr * getCookedLiteral()
If this is not a raw user-defined literal, get the underlying cooked literal (representing the litera...
LiteralOperatorKind
The kind of literal operator which is invoked.
@ LOK_String
operator "" X (const CharT *, size_t)
@ LOK_Raw
Raw form: operator "" X (const char *)
@ LOK_Floating
operator "" X (long double)
@ LOK_Integer
operator "" X (unsigned long long)
@ LOK_Template
Raw form: operator "" X<cs...> ()
@ LOK_Character
operator "" X (CharT)
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
const internal::VariadicAllOfMatcher< Decl > decl
Matches declarations.
Top level wrappers for InstallAPI frontend operations.
CanQual< Type > CanQualType
Represents a canonical, potentially-qualified type.
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
bool isa(CodeGen::Address addr)
if(T->getSizeExpr()) TRY_TO(TraverseStmt(const_cast< Expr * >(T -> getSizeExpr())))
@ OK_Ordinary
An ordinary object is located at an address in memory.
LambdaCaptureKind
The different capture forms in a lambda introducer.
@ LCK_ByCopy
Capturing by copy (a.k.a., by value)
@ LCK_ByRef
Capturing by reference.
@ LCK_VLAType
Capturing variable-length array type.
@ LCK_StarThis
Capturing the *this object by copy.
@ LCK_This
Capturing the *this object by reference.
ExprDependence computeDependence(FullExpr *E)
nullptr
This class represents a compute construct, representing a 'Kind' of ‘parallel’, 'serial',...
bool isAlignedAllocation(AlignedAllocationMode Mode)
ComparisonCategoryResult
An enumeration representing the possible results of a three-way comparison.
@ Result
The result type of a method or function.
OptionalUnsigned< unsigned > UnsignedOrNone
const FunctionProtoType * T
bool isTypeAwareAllocation(TypeAwareAllocationMode Mode)
CastKind
CastKind - The kind of operation required for a conversion.
std::tuple< NamedDecl *, TemplateArgument > getReplacedTemplateParameter(Decl *D, unsigned Index)
Internal helper used by Subst* nodes to retrieve a parameter from the AssociatedDecl,...
LambdaCaptureDefault
The default, if any, capture method for a lambda expression.
ExprValueKind
The categorization of expression values, currently following the C++11 scheme.
@ VK_PRValue
A pr-value expression (in the C++11 taxonomy) produces a temporary value.
@ VK_XValue
An x-value expression is a reference to an object with independent storage but which can be "moved",...
@ VK_LValue
An l-value expression is a reference to an object with independent storage.
SmallVector< CXXBaseSpecifier *, 4 > CXXCastPath
A simple array of base specifiers.
U cast(CodeGen::Address addr)
@ Class
The "class" keyword introduces the elaborated-type-specifier.
CXXNewInitializationStyle
@ Parens
New-expression has a C++98 paren-delimited initializer.
@ None
New-expression has no initializer as written.
@ Braces
New-expression has a C++11 list-initializer.
@ Implicit
An implicit conversion.
Diagnostic wrappers for TextAPI types for error reporting.
Represents an explicit template argument list in C++, e.g., the "<int>" in "sort<int>".
void initializeFrom(SourceLocation TemplateKWLoc, const TemplateArgumentListInfo &List, TemplateArgumentLoc *OutArgArray)
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspon...
AlignedAllocationMode PassAlignment
TypeAwareAllocationMode PassTypeIdentity
A placeholder type used to construct an empty shell of a type, that will be filled in later (e....