clang: lib/AST/ExprCXX.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
34#include "llvm/ADT/ArrayRef.h"
35#include "llvm/Support/ErrorHandling.h"
36#include
37#include
38#include
39#include
40#include
41
42using namespace clang;
43
44
45
46
47
49
50
51
52
54 return false;
55
57 case OO_Call: case OO_Subscript:
58 return false;
59 default:
60 return true;
61 }
62}
63
68
69
70 bool SkippedNot = false;
71 if (auto *NotEq = dyn_cast(E)) {
72 assert(NotEq->getOpcode() == UO_LNot);
74 SkippedNot = true;
75 }
76
77
78 if (auto *BO = dyn_cast(E)) {
79 assert(!SkippedNot || BO->getOpcode() == BO_EQ);
80 Result.Opcode = SkippedNot ? BO_NE : BO->getOpcode();
81 Result.LHS = BO->getLHS();
82 Result.RHS = BO->getRHS();
83 Result.InnerBinOp = BO;
84 } else if (auto *BO = dyn_cast(E)) {
85 assert(!SkippedNot || BO->getOperator() == OO_EqualEqual);
86 assert(BO->isInfixBinaryOp());
87 switch (BO->getOperator()) {
88 case OO_Less: Result.Opcode = BO_LT; break;
89 case OO_LessEqual: Result.Opcode = BO_LE; break;
90 case OO_Greater: Result.Opcode = BO_GT; break;
91 case OO_GreaterEqual: Result.Opcode = BO_GE; break;
92 case OO_Spaceship: Result.Opcode = BO_Cmp; break;
93 case OO_EqualEqual: Result.Opcode = SkippedNot ? BO_NE : BO_EQ; break;
94 default: llvm_unreachable("unexpected binop in rewritten operator expr");
95 }
96 Result.LHS = BO->getArg(0);
97 Result.RHS = BO->getArg(1);
98 Result.InnerBinOp = BO;
99 } else {
100 llvm_unreachable("unexpected rewritten operator form");
101 }
102
103
104
107
108
109 if (Result.Opcode == BO_EQ || Result.Opcode == BO_NE)
111
112
113 E = Result.LHS->IgnoreUnlessSpelledInSource();
114 if (auto *BO = dyn_cast(E)) {
115 assert(BO->getOpcode() == BO_Cmp);
116 Result.LHS = BO->getLHS();
117 Result.RHS = BO->getRHS();
118 Result.InnerBinOp = BO;
119 } else if (auto *BO = dyn_cast(E)) {
120 assert(BO->getOperator() == OO_Spaceship);
121 Result.LHS = BO->getArg(0);
122 Result.RHS = BO->getArg(1);
123 Result.InnerBinOp = BO;
124 } else {
125 llvm_unreachable("unexpected rewritten operator form");
126 }
127
128
132}
133
136 return false;
137
138
139
140
143 if (RD->isPolymorphic() && E->isGLValue())
144 return true;
145
146 return false;
147}
148
150 assert(() && "Cannot call isMostDerived for typeid(type)");
152 if (const auto *DRE = dyn_cast(E)) {
153 QualType Ty = DRE->getDecl()->getType();
155 return true;
156 }
157
158 return false;
159}
160
162 assert(isTypeOperand() && "Cannot call getTypeOperand for typeid(expr)");
165 cast<TypeSourceInfo *>(Operand)->getType().getNonReferenceType(), Quals);
166}
167
170
171 if (const auto *CE = dyn_cast(E)) {
172 if (!CE->getSubExpr()->isGLValue())
173 return false;
175 }
176
177 if (const auto *OVE = dyn_cast(E))
179
180 if (const auto *BO = dyn_cast(E))
181 if (BO->getOpcode() == BO_Comma)
183
184 if (const auto *ACO = dyn_cast(E))
187
188
189
190 if (isa(E))
191 return true;
192
193 if (const auto *UO = dyn_cast(E))
194 if (UO->getOpcode() == UO_Deref)
195 return true;
196
197 return false;
198}
199
202 return false;
203
204
205
206
207
208
209
210
211
213}
214
216 assert(isTypeOperand() && "Cannot call getTypeOperand for __uuidof(expr)");
219 cast<TypeSourceInfo *>(Operand)->getType().getNonReferenceType(), Quals);
220}
221
222
225}
226
227
228CXXNewExpr::CXXNewExpr(bool IsGlobalNew, FunctionDecl *OperatorNew,
229 FunctionDecl *OperatorDelete, bool ShouldPassAlignment,
230 bool UsualArrayDeleteWantsSize,
232 std::optional<Expr *> ArraySize,
238 OperatorNew(OperatorNew), OperatorDelete(OperatorDelete),
239 AllocatedTypeInfo(AllocatedTypeInfo), Range(Range),
240 DirectInitRange(DirectInitRange) {
241
244 "Only CXXNewInitializationStyle::None can have no initializer!");
245
248 CXXNewExprBits.ShouldPassAlignment = ShouldPassAlignment;
249 CXXNewExprBits.UsualArrayDeleteWantsSize = UsualArrayDeleteWantsSize;
252 llvm::to_underlying(InitializationStyle);
253 bool IsParenTypeId = TypeIdParens.isValid();
255 CXXNewExprBits.NumPlacementArgs = PlacementArgs.size();
256
257 if (ArraySize)
258 getTrailingObjects<Stmt *>()[arraySizeOffset()] = *ArraySize;
260 getTrailingObjects<Stmt *>()[initExprOffset()] = Initializer;
261 for (unsigned I = 0; I != PlacementArgs.size(); ++I)
262 getTrailingObjects<Stmt *>()[placementNewArgsOffset() + I] =
263 PlacementArgs[I];
264 if (IsParenTypeId)
265 getTrailingObjects()[0] = TypeIdParens;
266
267 switch (getInitializationStyle()) {
269 this->Range.setEnd(DirectInitRange.getEnd());
270 break;
273 break;
274 default:
275 if (IsParenTypeId)
277 break;
278 }
279
281}
282
283CXXNewExpr::CXXNewExpr(EmptyShell Empty, bool IsArray,
284 unsigned NumPlacementArgs, bool IsParenTypeId)
289}
290
293 FunctionDecl *OperatorDelete, bool ShouldPassAlignment,
294 bool UsualArrayDeleteWantsSize, ArrayRef<Expr *> PlacementArgs,
295 SourceRange TypeIdParens, std::optional<Expr *> ArraySize,
299 bool IsArray = ArraySize.has_value();
301 unsigned NumPlacementArgs = PlacementArgs.size();
302 bool IsParenTypeId = TypeIdParens.isValid();
303 void *Mem =
304 Ctx.Allocate(totalSizeToAlloc<Stmt *, SourceRange>(
305 IsArray + HasInit + NumPlacementArgs, IsParenTypeId),
307 return new (Mem)
308 CXXNewExpr(IsGlobalNew, OperatorNew, OperatorDelete, ShouldPassAlignment,
309 UsualArrayDeleteWantsSize, PlacementArgs, TypeIdParens,
310 ArraySize, InitializationStyle, Initializer, Ty,
311 AllocatedTypeInfo, Range, DirectInitRange);
312}
313
315 bool HasInit, unsigned NumPlacementArgs,
316 bool IsParenTypeId) {
317 void *Mem =
318 Ctx.Allocate(totalSizeToAlloc<Stmt *, SourceRange>(
319 IsArray + HasInit + NumPlacementArgs, IsParenTypeId),
321 return new (Mem)
323}
324
327 return true;
332 ->isNothrow() &&
334}
335
336
339
340
341
342
343 while (const auto *ICE = dyn_cast(Arg)) {
344 if (ICE->getCastKind() == CK_DerivedToBase ||
345 ICE->getCastKind() == CK_UncheckedDerivedToBase ||
346 ICE->getCastKind() == CK_NoOp) {
347 assert((ICE->getCastKind() == CK_NoOp ||
349 "only a destroying operator delete can have a converted arg");
350 Arg = ICE->getSubExpr();
351 } else
352 break;
353 }
354
355
357
360
362}
363
364
366 : Type(Info) {
368}
369
375 : Expr(CXXPseudoDestructorExprClass, Context.BoundMemberTy, VK_PRValue,
377 Base(static_cast<Stmt *>(Base)), IsArrow(isArrow),
378 OperatorLoc(OperatorLoc), QualifierLoc(QualifierLoc),
379 ScopeType(ScopeType), ColonColonLoc(ColonColonLoc), TildeLoc(TildeLoc),
380 DestroyedType(DestroyedType) {
382}
383
386 return TInfo->getType();
387
389}
390
394 End = TInfo->getTypeLoc().getSourceRange().getEnd();
395 return End;
396}
397
398
399UnresolvedLookupExpr::UnresolvedLookupExpr(
405 bool KnownInstantiationDependent)
406 : OverloadExpr(UnresolvedLookupExprClass, Context, QualifierLoc,
407 TemplateKWLoc, NameInfo, TemplateArgs, Begin, End,
408 KnownDependent, KnownInstantiationDependent, false),
409 NamingClass(NamingClass) {
411}
412
413UnresolvedLookupExpr::UnresolvedLookupExpr(EmptyShell Empty,
414 unsigned NumResults,
415 bool HasTemplateKWAndArgsInfo)
417 HasTemplateKWAndArgsInfo) {}
418
423 bool KnownDependent, bool KnownInstantiationDependent) {
424 unsigned NumResults = End - Begin;
429 Context, NamingClass, QualifierLoc,
430 SourceLocation(), NameInfo, RequiresADL,
431 nullptr, Begin, End, KnownDependent,
432 KnownInstantiationDependent);
433}
434
441 bool KnownInstantiationDependent) {
442 unsigned NumResults = End - Begin;
443 bool HasTemplateKWAndArgsInfo = Args || TemplateKWLoc.isValid();
444 unsigned NumTemplateArgs = Args ? Args->size() : 0;
447 NumResults, HasTemplateKWAndArgsInfo, NumTemplateArgs);
450 Context, NamingClass, QualifierLoc, TemplateKWLoc, NameInfo, RequiresADL,
451 Args, Begin, End, KnownDependent, KnownInstantiationDependent);
452}
453
455 const ASTContext &Context, unsigned NumResults,
456 bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs) {
457 assert(NumTemplateArgs == 0 || HasTemplateKWAndArgsInfo);
460 NumResults, HasTemplateKWAndArgsInfo, NumTemplateArgs);
462 return new (Mem)
464}
465
473 bool KnownInstantiationDependent,
474 bool KnownContainsUnexpandedParameterPack)
476 QualifierLoc(QualifierLoc) {
477 unsigned NumResults = End - Begin;
480 (TemplateArgs != nullptr ) || TemplateKWLoc.isValid();
481
482 if (NumResults) {
483
484
487 }
488
489 if (TemplateArgs) {
490 auto Deps = TemplateArgumentDependence::None;
493 } else if (TemplateKWLoc.isValid()) {
495 }
496
498 KnownInstantiationDependent,
499 KnownContainsUnexpandedParameterPack));
502}
503
505 bool HasTemplateKWAndArgsInfo)
508 OverloadExprBits.HasTemplateKWAndArgsInfo = HasTemplateKWAndArgsInfo;
509}
510
511
512DependentScopeDeclRefExpr::DependentScopeDeclRefExpr(
517 QualifierLoc(QualifierLoc), NameInfo(NameInfo) {
519 (Args != nullptr) || TemplateKWLoc.isValid();
520 if (Args) {
521 auto Deps = TemplateArgumentDependence::None;
522 getTrailingObjects()->initializeFrom(
523 TemplateKWLoc, *Args, getTrailingObjects(), Deps);
524 } else if (TemplateKWLoc.isValid()) {
525 getTrailingObjects()->initializeFrom(
526 TemplateKWLoc);
527 }
529}
530
535 assert(QualifierLoc && "should be created for dependent qualifiers");
536 bool HasTemplateKWAndArgsInfo = Args || TemplateKWLoc.isValid();
537 std::size_t Size =
538 totalSizeToAlloc<ASTTemplateKWAndArgsInfo, TemplateArgumentLoc>(
539 HasTemplateKWAndArgsInfo, Args ? Args->size() : 0);
540 void *Mem = Context.Allocate(Size);
542 TemplateKWLoc, NameInfo, Args);
543}
544
547 bool HasTemplateKWAndArgsInfo,
548 unsigned NumTemplateArgs) {
549 assert(NumTemplateArgs == 0 || HasTemplateKWAndArgsInfo);
550 std::size_t Size =
551 totalSizeToAlloc<ASTTemplateKWAndArgsInfo, TemplateArgumentLoc>(
552 HasTemplateKWAndArgsInfo, NumTemplateArgs);
553 void *Mem = Context.Allocate(Size);
558 HasTemplateKWAndArgsInfo;
559 return E;
560}
561
563 if (const auto *TOE = dyn_cast(this))
564 return TOE->getBeginLoc();
566}
567
569 if (const auto *TOE = dyn_cast(this))
570 return TOE->getEndLoc();
571
572 if (ParenOrBraceRange.isValid())
573 return ParenOrBraceRange.getEnd();
574
576 for (unsigned I = getNumArgs(); I > 0; --I) {
581 End = NewEnd;
582 break;
583 }
584 }
585 }
586
587 return End;
588}
589
595 ADLCallKind UsesADL)
596 : CallExpr(CXXOperatorCallExprClass, Fn, {}, Args, Ty, VK,
597 OperatorLoc, FPFeatures, 0, UsesADL) {
598 CXXOperatorCallExprBits.OperatorKind = OpKind;
599 assert(
600 (CXXOperatorCallExprBits.OperatorKind == static_cast<unsigned>(OpKind)) &&
601 "OperatorKind overflow!");
602 Range = getSourceRangeImpl();
603}
604
605CXXOperatorCallExpr::CXXOperatorCallExpr(unsigned NumArgs, bool HasFPFeatures,
606 EmptyShell Empty)
607 : CallExpr(CXXOperatorCallExprClass, 0, NumArgs,
608 HasFPFeatures, Empty) {}
609
616
617 unsigned NumArgs = Args.size();
622 return new (Mem) CXXOperatorCallExpr(OpKind, Fn, Args, Ty, VK, OperatorLoc,
624}
625
627 unsigned NumArgs,
628 bool HasFPFeatures,
630
631 unsigned SizeOfTrailingObjects =
636}
637
638SourceRange CXXOperatorCallExpr::getSourceRangeImpl() const {
640 if (Kind == OO_PlusPlus || Kind == OO_MinusMinus) {
642
644 else
645
647 } else if (Kind == OO_Arrow) {
649 } else if (Kind == OO_Call) {
651 } else if (Kind == OO_Subscript) {
657 } else {
659 }
660}
661
666 unsigned MinNumArgs)
667 : CallExpr(CXXMemberCallExprClass, Fn, {}, Args, Ty, VK, RP,
668 FPOptions, MinNumArgs, NotADL) {}
669
670CXXMemberCallExpr::CXXMemberCallExpr(unsigned NumArgs, bool HasFPFeatures,
671 EmptyShell Empty)
672 : CallExpr(CXXMemberCallExprClass, 0, NumArgs, HasFPFeatures,
674
680 unsigned MinNumArgs) {
681
682 unsigned NumArgs = std::max(Args.size(), MinNumArgs);
687 return new (Mem)
689}
690
692 unsigned NumArgs,
693 bool HasFPFeatures,
695
696 unsigned SizeOfTrailingObjects =
701}
702
705 if (const auto *MemExpr = dyn_cast(Callee))
706 return MemExpr->getBase();
707 if (const auto *BO = dyn_cast(Callee))
708 if (BO->getOpcode() == BO_PtrMemD || BO->getOpcode() == BO_PtrMemI)
709 return BO->getLHS();
710
711
712 return nullptr;
713}
714
719 return Ty;
720}
721
724 return cast(MemExpr->getMemberDecl());
725
726
727
728 return nullptr;
729}
730
733 if (!ThisArg)
734 return nullptr;
735
738
740}
741
742
743
744
745
746
747
748
751 case CXXStaticCastExprClass: return "static_cast";
752 case CXXDynamicCastExprClass: return "dynamic_cast";
753 case CXXReinterpretCastExprClass: return "reinterpret_cast";
754 case CXXConstCastExprClass: return "const_cast";
755 case CXXAddrspaceCastExprClass: return "addrspace_cast";
756 default: return "";
757 }
758}
759
766 unsigned PathSize = (BasePath ? BasePath->size() : 0);
767 void *Buffer =
768 C.Allocate(totalSizeToAlloc<CXXBaseSpecifier *, FPOptionsOverride>(
770 auto *E = new (Buffer) CXXStaticCastExpr(T, VK, K, Op, PathSize, WrittenTy,
771 FPO, L, RParenLoc, AngleBrackets);
772 if (PathSize)
773 std::uninitialized_copy_n(BasePath->data(), BasePath->size(),
775 return E;
776}
777
779 unsigned PathSize,
780 bool HasFPFeatures) {
781 void *Buffer =
782 C.Allocate(totalSizeToAlloc<CXXBaseSpecifier *, FPOptionsOverride>(
783 PathSize, HasFPFeatures));
785}
786
795 unsigned PathSize = (BasePath ? BasePath->size() : 0);
796 void *Buffer = C.Allocate(totalSizeToAlloc<CXXBaseSpecifier *>(PathSize));
797 auto *E =
799 RParenLoc, AngleBrackets);
800 if (PathSize)
801 std::uninitialized_copy_n(BasePath->data(), BasePath->size(),
803 return E;
804}
805
807 unsigned PathSize) {
808 void *Buffer = C.Allocate(totalSizeToAlloc<CXXBaseSpecifier *>(PathSize));
810}
811
812
813
814
815
816
817
818
819
822 return false;
823
826
828 return false;
829
833 }
834
837 assert(SrcRD && DestRD);
838
839 if (SrcRD->isEffectivelyFinal()) {
840 assert(!SrcRD->isDerivedFrom(DestRD) &&
841 "upcasts should not use CK_Dynamic");
842 return true;
843 }
844
845 if (DestRD->isEffectivelyFinal() && !DestRD->isDerivedFrom(SrcRD))
846 return true;
847
848 return false;
849}
850
858 unsigned PathSize = (BasePath ? BasePath->size() : 0);
859 void *Buffer = C.Allocate(totalSizeToAlloc<CXXBaseSpecifier *>(PathSize));
860 auto *E =
862 RParenLoc, AngleBrackets);
863 if (PathSize)
864 std::uninitialized_copy_n(BasePath->data(), BasePath->size(),
866 return E;
867}
868
871 void *Buffer = C.Allocate(totalSizeToAlloc<CXXBaseSpecifier *>(PathSize));
873}
874
881 return new (C) CXXConstCastExpr(T, VK, Op, WrittenTy, L, RParenLoc, AngleBrackets);
882}
883
886}
887
894 AngleBrackets);
895}
896
899}
900
905 unsigned PathSize = (BasePath ? BasePath->size() : 0);
906 void *Buffer =
907 C.Allocate(totalSizeToAlloc<CXXBaseSpecifier *, FPOptionsOverride>(
909 auto *E = new (Buffer)
911 if (PathSize)
912 std::uninitialized_copy_n(BasePath->data(), BasePath->size(),
914 return E;
915}
916
918 unsigned PathSize,
919 bool HasFPFeatures) {
920 void *Buffer =
921 C.Allocate(totalSizeToAlloc<CXXBaseSpecifier *, FPOptionsOverride>(
922 PathSize, HasFPFeatures));
923 return new (Buffer)
925}
926
929}
930
933}
934
940 : CallExpr(UserDefinedLiteralClass, Fn, {}, Args, Ty, VK,
941 LitEndLoc, FPFeatures, 0, NotADL),
942 UDSuffixLoc(SuffixLoc) {}
943
944UserDefinedLiteral::UserDefinedLiteral(unsigned NumArgs, bool HasFPFeatures,
945 EmptyShell Empty)
946 : CallExpr(UserDefinedLiteralClass, 0, NumArgs,
947 HasFPFeatures, Empty) {}
948
955
956 unsigned NumArgs = Args.size();
961 return new (Mem)
962 UserDefinedLiteral(Fn, Args, Ty, VK, LitEndLoc, SuffixLoc, FPFeatures);
963}
964
966 unsigned NumArgs,
967 bool HasFPOptions,
969
970 unsigned SizeOfTrailingObjects =
975}
976
983
984 assert(getNumArgs() == 1 && "unexpected #args in literal operator call");
986 cast(getCalleeDecl())->getParamDecl(0)->getType();
995
996 llvm_unreachable("unknown kind of literal operator");
997}
998
1000#ifndef NDEBUG
1002 assert(LOK != LOK_Template && LOK != LOK_Raw && "not a cooked literal");
1003#endif
1005}
1006
1008 return cast(getCalleeDecl())->getLiteralIdentifier();
1009}
1010
1012 bool HasRewrittenInit) {
1013 size_t Size = totalSizeToAlloc<Expr *>(HasRewrittenInit);
1016}
1017
1021 Expr *RewrittenExpr,
1023 size_t Size = totalSizeToAlloc<Expr *>(RewrittenExpr != nullptr);
1026 RewrittenExpr, UsedContext);
1027}
1028
1032}
1033
1036 "expected this CXXDefaultArgExpr to have a rewritten init.");
1038 if (auto *E = dyn_cast_if_present(Init))
1039 if (!isa(E))
1040 return E->getSubExpr();
1041 return Init;
1042}
1043
1044CXXDefaultInitExpr::CXXDefaultInitExpr(const ASTContext &Ctx,
1047 Expr *RewrittenInitExpr)
1048 : Expr(CXXDefaultInitExprClass, Ty.getNonLValueExprType(Ctx),
1049 Ty->isLValueReferenceType() ? VK_LValue
1050 : Ty->isRValueReferenceType() ? VK_XValue
1053 Field(Field), UsedContext(UsedContext) {
1056
1058 *getTrailingObjects<Expr *>() = RewrittenInitExpr;
1059
1060 assert(Field->hasInClassInitializer());
1061
1063}
1064
1066 bool HasRewrittenInit) {
1067 size_t Size = totalSizeToAlloc<Expr *>(HasRewrittenInit);
1070}
1071
1076 Expr *RewrittenInitExpr) {
1077
1078 size_t Size = totalSizeToAlloc<Expr *>(RewrittenInitExpr != nullptr);
1081 UsedContext, RewrittenInitExpr);
1082}
1083
1085 assert(Field->getInClassInitializer() && "initializer hasn't been parsed");
1088
1089 return Field->getInClassInitializer();
1090}
1091
1095}
1096
1099 Expr* SubExpr) {
1102 "Expression bound to a temporary must have record or array type!");
1103
1105}
1106
1107CXXTemporaryObjectExpr::CXXTemporaryObjectExpr(
1110 bool HadMultipleCandidates, bool ListInitialization,
1111 bool StdInitListInitialization, bool ZeroInitialization)
1113 CXXTemporaryObjectExprClass, Ty, TSI->getTypeLoc().getBeginLoc(),
1114 Cons, false, Args, HadMultipleCandidates,
1115 ListInitialization, StdInitListInitialization, ZeroInitialization,
1117 TSI(TSI) {
1119}
1120
1121CXXTemporaryObjectExpr::CXXTemporaryObjectExpr(EmptyShell Empty,
1122 unsigned NumArgs)
1124
1128 bool HadMultipleCandidates, bool ListInitialization,
1129 bool StdInitListInitialization, bool ZeroInitialization) {
1131 void *Mem =
1135 Cons, Ty, TSI, Args, ParenOrBraceRange, HadMultipleCandidates,
1136 ListInitialization, StdInitListInitialization, ZeroInitialization);
1137}
1138
1142 void *Mem =
1146}
1147
1150}
1151
1156 return Loc;
1157}
1158
1162 bool HadMultipleCandidates, bool ListInitialization,
1163 bool StdInitListInitialization, bool ZeroInitialization,
1169 CXXConstructExprClass, Ty, Loc, Ctor, Elidable, Args,
1170 HadMultipleCandidates, ListInitialization, StdInitListInitialization,
1171 ZeroInitialization, ConstructKind, ParenOrBraceRange);
1172}
1173
1175 unsigned NumArgs) {
1179 return new (Mem)
1181}
1182
1185 bool Elidable, ArrayRef<Expr *> Args, bool HadMultipleCandidates,
1186 bool ListInitialization, bool StdInitListInitialization,
1190 ParenOrBraceRange(ParenOrBraceRange), NumArgs(Args.size()) {
1199
1200 Stmt **TrailingArgs = getTrailingArgs();
1201 for (unsigned I = 0, N = Args.size(); I != N; ++I) {
1202 assert(Args[I] && "NULL argument in CXXConstructExpr!");
1203 TrailingArgs[I] = Args[I];
1204 }
1205
1206
1207 if (SC == CXXConstructExprClass)
1209}
1210
1212 unsigned NumArgs)
1213 : Expr(SC, Empty), NumArgs(NumArgs) {}
1214
1218 : DeclAndBits(Var, 0), Loc(Loc), EllipsisLoc(EllipsisLoc) {
1219 unsigned Bits = 0;
1221 Bits |= Capture_Implicit;
1222
1223 switch (Kind) {
1225 Bits |= Capture_ByCopy;
1226 [[fallthrough]];
1228 assert(!Var && "'this' capture cannot have a variable!");
1229 Bits |= Capture_This;
1230 break;
1231
1233 Bits |= Capture_ByCopy;
1234 [[fallthrough]];
1236 assert(Var && "capture must have a variable!");
1237 break;
1239 assert(!Var && "VLA type capture cannot have a variable!");
1240 break;
1241 }
1242 DeclAndBits.setInt(Bits);
1243}
1244
1248 bool CapByCopy = DeclAndBits.getInt() & Capture_ByCopy;
1252}
1253
1256 SourceLocation CaptureDefaultLoc, bool ExplicitParams,
1259 bool ContainsUnexpandedParameterPack)
1261 IntroducerRange(IntroducerRange), CaptureDefaultLoc(CaptureDefaultLoc),
1262 ClosingBrace(ClosingBrace) {
1263 LambdaExprBits.NumCaptures = CaptureInits.size();
1264 LambdaExprBits.CaptureDefault = CaptureDefault;
1265 LambdaExprBits.ExplicitParams = ExplicitParams;
1266 LambdaExprBits.ExplicitResultType = ExplicitResultType;
1267
1270 assert(capture_size() == Class->capture_size() && "Wrong number of captures");
1271 assert(getCaptureDefault() == Class->getLambdaCaptureDefault());
1272
1273
1274 Stmt **Stored = getStoredStmts();
1275 for (unsigned I = 0, N = CaptureInits.size(); I != N; ++I)
1276 *Stored++ = CaptureInits[I];
1277
1278
1279 *Stored++ = getCallOperator()->getBody();
1280
1281 setDependence(computeDependence(this, ContainsUnexpandedParameterPack));
1282}
1283
1284LambdaExpr::LambdaExpr(EmptyShell Empty, unsigned NumCaptures)
1285 : Expr(LambdaExprClass, Empty) {
1286 LambdaExprBits.NumCaptures = NumCaptures;
1287
1288
1289
1290 getStoredStmts()[NumCaptures] = nullptr;
1291}
1292
1297 bool ExplicitParams, bool ExplicitResultType,
1300 bool ContainsUnexpandedParameterPack) {
1301
1302
1304
1305 unsigned Size = totalSizeToAlloc<Stmt *>(CaptureInits.size() + 1);
1306 void *Mem = Context.Allocate(Size);
1307 return new (Mem)
1308 LambdaExpr(T, IntroducerRange, CaptureDefault, CaptureDefaultLoc,
1309 ExplicitParams, ExplicitResultType, CaptureInits, ClosingBrace,
1310 ContainsUnexpandedParameterPack);
1311}
1312
1314 unsigned NumCaptures) {
1315 unsigned Size = totalSizeToAlloc<Stmt *>(NumCaptures + 1);
1316 void *Mem = C.Allocate(Size);
1318}
1319
1320void LambdaExpr::initBodyIfNeeded() const {
1322 auto *This = const_cast<LambdaExpr *>(this);
1324 }
1325}
1326
1328 initBodyIfNeeded();
1330}
1331
1334 if (const auto *CoroBody = dyn_cast(Body))
1335 return cast(CoroBody->getBody());
1336 return cast(Body);
1337}
1338
1340 return C->capturesVariable() && C->getCapturedVar()->isInitCapture() &&
1342}
1343
1346}
1347
1350}
1351
1354}
1355
1358}
1359
1362 getLambdaClass()->getLambdaData().NumExplicitCaptures;
1363}
1364
1367}
1368
1371}
1372
1375}
1376
1379}
1380
1383}
1384
1387 return Record->getLambdaCallOperator();
1388}
1389
1392 return Record->getDependentLambdaCallOperator();
1393}
1394
1397 return Record->getGenericLambdaTemplateParameterList();
1398}
1399
1402 return Record->getLambdaExplicitTemplateParameters();
1403}
1404
1407}
1408
1410
1412 initBodyIfNeeded();
1414}
1415
1417 initBodyIfNeeded();
1420}
1421
1422ExprWithCleanups::ExprWithCleanups(Expr *subexpr,
1423 bool CleanupsHaveSideEffects,
1425 : FullExpr(ExprWithCleanupsClass, subexpr) {
1428 for (unsigned i = 0, e = objects.size(); i != e; ++i)
1429 getTrailingObjects()[i] = objects[i];
1430}
1431
1433 bool CleanupsHaveSideEffects,
1435 void *buffer = C.Allocate(totalSizeToAlloc(objects.size()),
1437 return new (buffer)
1438 ExprWithCleanups(subexpr, CleanupsHaveSideEffects, objects);
1439}
1440
1441ExprWithCleanups::ExprWithCleanups(EmptyShell empty, unsigned numObjects)
1442 : FullExpr(ExprWithCleanupsClass, empty) {
1444}
1445
1448 unsigned numObjects) {
1449 void *buffer = C.Allocate(totalSizeToAlloc(numObjects),
1452}
1453
1454CXXUnresolvedConstructExpr::CXXUnresolvedConstructExpr(
1457 : Expr(CXXUnresolvedConstructExprClass, T,
1458 (TSI->getType()->isLValueReferenceType() ? VK_LValue
1459 : TSI->getType()->isRValueReferenceType() ? VK_XValue
1462 TypeAndInitForm(TSI, IsListInit), LParenLoc(LParenLoc),
1463 RParenLoc(RParenLoc) {
1465 auto **StoredArgs = getTrailingObjects<Expr *>();
1466 for (unsigned I = 0; I != Args.size(); ++I)
1467 StoredArgs[I] = Args[I];
1469}
1470
1474 bool IsListInit) {
1475 void *Mem = Context.Allocate(totalSizeToAlloc<Expr *>(Args.size()));
1477 RParenLoc, IsListInit);
1478}
1479
1482 unsigned NumArgs) {
1483 void *Mem = Context.Allocate(totalSizeToAlloc<Expr *>(NumArgs));
1485}
1486
1488 return TypeAndInitForm.getPointer()->getTypeLoc().getBeginLoc();
1489}
1490
1491CXXDependentScopeMemberExpr::CXXDependentScopeMemberExpr(
1497 : Expr(CXXDependentScopeMemberExprClass, Ctx.DependentTy, VK_LValue,
1499 Base(Base), BaseType(BaseType), QualifierLoc(QualifierLoc),
1500 MemberNameInfo(MemberNameInfo) {
1503 (TemplateArgs != nullptr) || TemplateKWLoc.isValid();
1505 FirstQualifierFoundInScope != nullptr;
1507
1508 if (TemplateArgs) {
1509 auto Deps = TemplateArgumentDependence::None;
1510 getTrailingObjects()->initializeFrom(
1511 TemplateKWLoc, *TemplateArgs, getTrailingObjects(),
1512 Deps);
1513 } else if (TemplateKWLoc.isValid()) {
1514 getTrailingObjects()->initializeFrom(
1515 TemplateKWLoc);
1516 }
1517
1518 if (hasFirstQualifierFoundInScope())
1519 *getTrailingObjects<NamedDecl *>() = FirstQualifierFoundInScope;
1521}
1522
1523CXXDependentScopeMemberExpr::CXXDependentScopeMemberExpr(
1524 EmptyShell Empty, bool HasTemplateKWAndArgsInfo,
1525 bool HasFirstQualifierFoundInScope)
1526 : Expr(CXXDependentScopeMemberExprClass, Empty) {
1528 HasTemplateKWAndArgsInfo;
1530 HasFirstQualifierFoundInScope;
1531}
1532
1539 bool HasTemplateKWAndArgsInfo =
1540 (TemplateArgs != nullptr) || TemplateKWLoc.isValid();
1541 unsigned NumTemplateArgs = TemplateArgs ? TemplateArgs->size() : 0;
1542 bool HasFirstQualifierFoundInScope = FirstQualifierFoundInScope != nullptr;
1543
1546 HasTemplateKWAndArgsInfo, NumTemplateArgs, HasFirstQualifierFoundInScope);
1547
1550 Ctx, Base, BaseType, IsArrow, OperatorLoc, QualifierLoc, TemplateKWLoc,
1551 FirstQualifierFoundInScope, MemberNameInfo, TemplateArgs);
1552}
1553
1555 const ASTContext &Ctx, bool HasTemplateKWAndArgsInfo,
1556 unsigned NumTemplateArgs, bool HasFirstQualifierFoundInScope) {
1557 assert(NumTemplateArgs == 0 || HasTemplateKWAndArgsInfo);
1558
1561 HasTemplateKWAndArgsInfo, NumTemplateArgs, HasFirstQualifierFoundInScope);
1562
1565 EmptyShell(), HasTemplateKWAndArgsInfo, HasFirstQualifierFoundInScope);
1566}
1567
1569 QualType Ty, bool IsImplicit) {
1570 return new (Ctx) CXXThisExpr(L, Ty, IsImplicit,
1572}
1573
1576}
1577
1580 do {
1582 if (isa(decl))
1583 return false;
1584
1585
1586
1587 if (cast(decl->getUnderlyingDecl()->getAsFunction())
1588 ->isStatic())
1589 return false;
1590 } while (++begin != end);
1591
1592 return true;
1593}
1594
1595UnresolvedMemberExpr::UnresolvedMemberExpr(
1603 UnresolvedMemberExprClass, Context, QualifierLoc, TemplateKWLoc,
1604 MemberNameInfo, TemplateArgs, Begin, End,
1605
1606 ((Base && Base->isTypeDependent()) || BaseType->isDependentType()),
1607 ((Base && Base->isInstantiationDependent()) ||
1608 BaseType->isInstantiationDependentType()),
1609
1610 ((Base && Base->containsUnexpandedParameterPack()) ||
1611 BaseType->containsUnexpandedParameterPack())),
1612 Base(Base), BaseType(BaseType), OperatorLoc(OperatorLoc) {
1613 UnresolvedMemberExprBits.IsArrow = IsArrow;
1614 UnresolvedMemberExprBits.HasUnresolvedUsing = HasUnresolvedUsing;
1615
1616
1617
1620}
1621
1622UnresolvedMemberExpr::UnresolvedMemberExpr(EmptyShell Empty,
1623 unsigned NumResults,
1624 bool HasTemplateKWAndArgsInfo)
1626 HasTemplateKWAndArgsInfo) {}
1627
1630 return true;
1631
1632 return cast(Base)->isImplicitCXXThis();
1633}
1634
1642 unsigned NumResults = End - Begin;
1643 bool HasTemplateKWAndArgsInfo = TemplateArgs || TemplateKWLoc.isValid();
1644 unsigned NumTemplateArgs = TemplateArgs ? TemplateArgs->size() : 0;
1647 NumResults, HasTemplateKWAndArgsInfo, NumTemplateArgs);
1650 Context, HasUnresolvedUsing, Base, BaseType, IsArrow, OperatorLoc,
1651 QualifierLoc, TemplateKWLoc, MemberNameInfo, TemplateArgs, Begin, End);
1652}
1653
1655 const ASTContext &Context, unsigned NumResults,
1656 bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs) {
1657 assert(NumTemplateArgs == 0 || HasTemplateKWAndArgsInfo);
1660 NumResults, HasTemplateKWAndArgsInfo, NumTemplateArgs);
1662 return new (Mem)
1664}
1665
1667
1668
1669
1670
1671
1676 assert(T && "qualifier in member expression does not name type");
1678 assert(Record && "qualifier in member expression does not name record");
1679 }
1680
1681 else {
1685
1687 assert(Record && "base of member expression does not name record");
1688 }
1689
1691}
1692
1697 std::optional Length,
1699 void *Storage =
1700 Context.Allocate(totalSizeToAlloc(PartialArgs.size()));
1702 PackLoc, RParenLoc, Length, PartialArgs);
1703}
1704
1706 unsigned NumPartialArgs) {
1707 void *Storage =
1708 Context.Allocate(totalSizeToAlloc(NumPartialArgs));
1710}
1711
1713 return cast(
1715}
1716
1719 Expr *PackIdExpr, Expr *IndexExpr, std::optional<int64_t> Index,
1722 if (Index && FullySubstituted && !SubstitutedExprs.empty())
1723 Type = SubstitutedExprs[*Index]->getType();
1724 else
1726
1727 void *Storage =
1728 Context.Allocate(totalSizeToAlloc<Expr *>(SubstitutedExprs.size()));
1729 return new (Storage)
1731 SubstitutedExprs, FullySubstituted);
1732}
1733
1736 NamedDecl *ND = dyn_cast(D->getDecl());
1737 assert(ND && "exected a named decl");
1738 return ND;
1739 }
1740 assert(false && "invalid declaration kind in pack indexing expression");
1741 return nullptr;
1742}
1743
1746 unsigned NumTransformedExprs) {
1747 void *Storage =
1748 Context.Allocate(totalSizeToAlloc<Expr *>(NumTransformedExprs));
1750}
1751
1754
1755
1759}
1760
1761SubstNonTypeTemplateParmPackExpr::SubstNonTypeTemplateParmPackExpr(
1764 : Expr(SubstNonTypeTemplateParmPackExprClass, T, ValueKind, OK_Ordinary),
1765 AssociatedDecl(AssociatedDecl), Arguments(ArgPack.pack_begin()),
1766 NumArguments(ArgPack.pack_size()), Index(Index), NameLoc(NameLoc) {
1767 assert(AssociatedDecl != nullptr);
1768 setDependence(ExprDependence::TypeValueInstantiation |
1769 ExprDependence::UnexpandedPack);
1770}
1771
1774 return cast(
1776}
1777
1780}
1781
1782FunctionParmPackExpr::FunctionParmPackExpr(QualType T, VarDecl *ParamPack,
1784 unsigned NumParams,
1787 ParamPack(ParamPack), NameLoc(NameLoc), NumParameters(NumParams) {
1788 if (Params)
1789 std::uninitialized_copy(Params, Params + NumParams,
1790 getTrailingObjects<VarDecl *>());
1791 setDependence(ExprDependence::TypeValueInstantiation |
1792 ExprDependence::UnexpandedPack);
1793}
1794
1799 return new (Context.Allocate(totalSizeToAlloc<VarDecl *>(Params.size())))
1801}
1802
1805 unsigned NumParams) {
1806 return new (Context.Allocate(totalSizeToAlloc<VarDecl *>(NumParams)))
1808}
1809
1811 QualType T, Expr *Temporary, bool BoundToLvalueReference,
1813 : Expr(MaterializeTemporaryExprClass, T,
1815 if (MTD) {
1816 State = MTD;
1817 MTD->ExprWithTemporary = Temporary;
1818 return;
1819 }
1820 State = Temporary;
1822}
1823
1825 unsigned ManglingNumber) {
1826
1827 if (!ExtendedBy)
1828 return;
1829
1830
1831
1832 if (!isa<LifetimeExtendedTemporaryDecl *>(State))
1834 cast(cast<Stmt *>(State)), ExtendedBy, ManglingNumber);
1835
1836 auto ES = cast<LifetimeExtendedTemporaryDecl *>(State);
1837 ES->ExtendingDecl = ExtendedBy;
1838 ES->ManglingNumber = ManglingNumber;
1839}
1840
1843
1844
1845
1846
1847
1852 VD->isUsableInConstantExpressions(Context);
1853}
1854
1859 RParenLoc(RParenLoc) {
1860 assert(Kind <= TT_Last && "invalid enum value!");
1863 "TypeTraitExprBits.Kind overflow!");
1867 "TypeTraitExprBits.NumArgs overflow!");
1868
1869 auto **ToArgs = getTrailingObjects<TypeSourceInfo *>();
1870 for (unsigned I = 0, N = Args.size(); I != N; ++I)
1871 ToArgs[I] = Args[I];
1872
1874}
1875
1882 void *Mem = C.Allocate(totalSizeToAlloc<TypeSourceInfo *>(Args.size()));
1884}
1885
1887 unsigned NumArgs) {
1888 void *Mem = C.Allocate(totalSizeToAlloc<TypeSourceInfo *>(NumArgs));
1890}
1891
1892CUDAKernelCallExpr::CUDAKernelCallExpr(Expr *Fn, CallExpr *Config,
1896 unsigned MinNumArgs)
1897 : CallExpr(CUDAKernelCallExprClass, Fn, Config, Args, Ty, VK,
1898 RP, FPFeatures, MinNumArgs, NotADL) {}
1899
1900CUDAKernelCallExpr::CUDAKernelCallExpr(unsigned NumArgs, bool HasFPFeatures,
1901 EmptyShell Empty)
1902 : CallExpr(CUDAKernelCallExprClass, END_PREARG, NumArgs,
1903 HasFPFeatures, Empty) {}
1904
1909 unsigned MinNumArgs) {
1910
1911 unsigned NumArgs = std::max(Args.size(), MinNumArgs);
1916 return new (Mem)
1917 CUDAKernelCallExpr(Fn, Config, Args, Ty, VK, RP, FPFeatures, MinNumArgs);
1918}
1919
1921 unsigned NumArgs,
1922 bool HasFPFeatures,
1924
1926 END_PREARG, NumArgs, HasFPFeatures);
1930}
1931
1934 unsigned NumUserSpecifiedExprs,
1937 void *Mem = C.Allocate(totalSizeToAlloc<Expr *>(Args.size()));
1939 LParenLoc, RParenLoc);
1940}
1941
1943 unsigned NumExprs,
1945 void *Mem = C.Allocate(totalSizeToAlloc<Expr *>(NumExprs),
1948}
1949
1955 std::optional NumExpansions)
1957 EllipsisLoc(EllipsisLoc), RParenLoc(RParenLoc),
1958 NumExpansions(NumExpansions ? *NumExpansions + 1 : 0), Opcode(Opcode) {
1959
1962 "Exactly one of LHS or RHS should contain an unexpanded pack");
1963 SubExprs[SubExpr::Callee] = Callee;
1964 SubExprs[SubExpr::LHS] = LHS;
1965 SubExprs[SubExpr::RHS] = RHS;
1967}
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)
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
QualType getLValueReferenceType(QualType T, bool SpelledAsLValue=true) const
Return the uniqued reference to the type for an lvalue reference to the specified type.
QualType getTypeDeclType(const TypeDecl *Decl, const TypeDecl *PrevDecl=nullptr) const
Return the unique reference to the type for the specified type declaration.
const LangOptions & getLangOpts() const
CanQualType getSizeType() const
Return the unique type for "size_t" (C99 7.17), defined in <stddef.h>.
CanQualType BoundMemberTy
void * Allocate(size_t Size, unsigned Align=8) const
QualType getUnqualifiedArrayType(QualType T, Qualifiers &Quals) const
Return this type as a completely-unqualified array type, capturing the qualifiers in Quals.
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.
Represents binding an expression to a temporary.
static CXXBindTemporaryExpr * Create(const ASTContext &C, CXXTemporary *Temp, Expr *SubExpr)
A C++ const_cast expression (C++ [expr.const.cast]).
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.
A default argument (C++ [dcl.fct.default]).
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
A use of a default initializer in a constructor or in aggregate initialization.
static CXXDefaultInitExpr * Create(const ASTContext &Ctx, SourceLocation Loc, FieldDecl *Field, DeclContext *UsedContext, Expr *RewrittenInitExpr)
Field is the non-static data member whose default initializer is used by this expression.
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.
Represents a C++ member access expression where the actual member referenced could not be resolved be...
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.
A C++ dynamic_cast expression (C++ [expr.dynamic.cast]).
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.
CXXFoldExpr(QualType T, UnresolvedLookupExpr *Callee, SourceLocation LParenLoc, Expr *LHS, BinaryOperatorKind Opcode, SourceLocation EllipsisLoc, Expr *RHS, SourceLocation RParenLoc, std::optional< unsigned > NumExpansions)
Represents an explicit C++ type conversion that uses "functional" notation (C++ [expr....
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)
Represents a call to a member function that may be written either with member call syntax (e....
CXXMethodDecl * getMethodDecl() const
Retrieve the declaration of the called method.
Expr * getImplicitObjectArgument() const
Retrieve the implicit object argument for the member call.
static CXXMemberCallExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, bool HasFPFeatures, EmptyShell Empty)
static CXXMemberCallExpr * Create(const ASTContext &Ctx, Expr *Fn, ArrayRef< Expr * > Args, QualType Ty, ExprValueKind VK, SourceLocation RP, FPOptionsOverride FPFeatures, unsigned MinNumArgs=0)
QualType getObjectType() const
Retrieve the type of the object argument.
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",...
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)".
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
static CXXNewExpr * Create(const ASTContext &Ctx, bool IsGlobalNew, FunctionDecl *OperatorNew, FunctionDecl *OperatorDelete, bool ShouldPassAlignment, bool UsualArrayDeleteWantsSize, ArrayRef< Expr * > PlacementArgs, SourceRange TypeIdParens, std::optional< Expr * > ArraySize, CXXNewInitializationStyle InitializationStyle, Expr *Initializer, QualType Ty, TypeSourceInfo *AllocatedTypeInfo, SourceRange Range, SourceRange DirectInitRange)
Create a c++ new expression.
A call to an overloaded operator written using operator syntax.
bool isInfixBinaryOp() const
Is this written as an infix binary operator?
SourceLocation getOperatorLoc() const
Returns the location of the operator symbol in the expression.
SourceLocation getEndLoc() const
OverloadedOperatorKind getOperator() const
Returns the kind of overloaded operator that this expression refers to.
static CXXOperatorCallExpr * Create(const ASTContext &Ctx, OverloadedOperatorKind OpKind, Expr *Fn, ArrayRef< Expr * > Args, QualType Ty, ExprValueKind VK, SourceLocation OperatorLoc, FPOptionsOverride FPFeatures, ADLCallKind UsesADL=NotADL)
static CXXOperatorCallExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, bool HasFPFeatures, EmptyShell Empty)
SourceLocation getBeginLoc() const
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)
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
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)
Represents the this expression in C++.
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.
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.
Expr * getTrailingRequiresClause()
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)
TypeSourceInfo * getTypeInfoAsWritten() const
getTypeInfoAsWritten - Returns the type source info for the type that this expression is casting to.
Represents an expression – generally a full-expression – that introduces cleanups to be run at the en...
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.
bool containsUnexpandedParameterPack() const
Whether this expression contains an unexpanded parameter pack (for C++11 variadic templates).
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 or init-capture pack that has been substituted bu...
static FunctionParmPackExpr * Create(const ASTContext &Context, QualType T, VarDecl *ParamPack, SourceLocation NameLoc, ArrayRef< VarDecl * > 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 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.
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.
Expr * getTrailingRequiresClause() const
Get the trailing requires clause, if any.
capture_iterator explicit_capture_begin() const
Retrieve an iterator pointing to the first explicit lambda capture.
child_range children()
Includes the captures and the body of the lambda.
FunctionTemplateDecl * getDependentCallOperator() const
Retrieve the function template call operator associated with this lambda expression.
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.
@ Super
Microsoft's '__super' specifier, stored as a CXXRecordDecl* of the class it appeared in.
const Type * getAsType() const
Retrieve the type stored in this nested name specifier.
NonTypeTemplateParmDecl - Declares a non-type template parameter, e.g., "Size" in.
A reference to an overloaded function set, either an UnresolvedLookupExpr or an UnresolvedMemberExpr.
NestedNameSpecifier * getQualifier() const
Fetches the nested-name qualifier, if one was given.
ASTTemplateKWAndArgsInfo * getTrailingASTTemplateKWAndArgsInfo()
Return the optional template keyword and arguments info.
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
SourceLocation getLocation() const
TypeSourceInfo * getTypeSourceInfo() const
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...
QualType getUnqualifiedType() const
Retrieve the unqualified variant of the given type, removing as little sugar as possible.
The collection of all-type qualifiers we support.
Represents an expression that computes the length of a parameter pack.
static SizeOfPackExpr * Create(ASTContext &Context, SourceLocation OperatorLoc, NamedDecl *Pack, SourceLocation PackLoc, SourceLocation RParenLoc, std::optional< unsigned > Length=std::nullopt, ArrayRef< TemplateArgument > PartialArgs={})
static SizeOfPackExpr * CreateDeserialized(ASTContext &Context, unsigned NumPartialArgs)
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
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.
QualType getParameterType(const ASTContext &Ctx) const
Determine the substituted type of the template parameter.
bool isReferenceParameter() const
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.
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, unsigned NumArgs)
The base class of the type hierarchy.
CXXRecordDecl * getAsCXXRecordDecl() const
Retrieves the CXXRecordDecl that this type refers to, either because the type is a RecordType or beca...
bool isLiteralType(const ASTContext &Ctx) const
Return true if this is a literal type (C++11 [basic.types]p10)
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.
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 isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
bool isPointerOrReferenceType() const
bool isFloatingType() const
bool isAnyPointerType() const
bool isRecordType() 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)
Represents a C++ member access expression for which lookup produced a set of overloaded functions.
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.
A call to a literal operator (C++11 [over.literal]) written as a user-defined literal (C++11 [lit....
LiteralOperatorKind getLiteralOperatorKind() const
Returns the kind of literal operator invocation which this expression represents.
const IdentifierInfo * getUDSuffix() const
Returns the ud-suffix specified for this literal.
static UserDefinedLiteral * Create(const ASTContext &Ctx, Expr *Fn, ArrayRef< Expr * > Args, QualType Ty, ExprValueKind VK, SourceLocation LitEndLoc, SourceLocation SuffixLoc, FPOptionsOverride FPFeatures)
static UserDefinedLiteral * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, bool HasFPOptions, EmptyShell Empty)
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 ...
Represents a variable declaration or definition.
const internal::VariadicAllOfMatcher< Decl > decl
Matches declarations.
The JSON file list parser is used to communicate input to InstallAPI.
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
@ 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)
@ Result
The result type of a method or function.
TemplateParameterList * getReplacedTemplateParameterList(Decl *D)
Internal helper used by Subst* nodes to retrieve the parameter list for their AssociatedDecl.
CastKind
CastKind - The kind of operation required for a conversion.
LambdaCaptureDefault
The default, if any, capture method for a lambda expression.
ExprValueKind
The categorization of expression values, currently following the C++11 scheme.
@ VK_PRValue
A pr-value expression (in the C++11 taxonomy) produces a temporary value.
@ VK_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.
const FunctionProtoType * T
@ Class
The "class" keyword introduces the elaborated-type-specifier.
TypeTrait
Names for traits that operate specifically on types.
CXXNewInitializationStyle
@ Parens
New-expression has a C++98 paren-delimited initializer.
@ None
New-expression has no initializer as written.
@ Braces
New-expression has a C++11 list-initializer.
@ Implicit
An implicit conversion.
Represents an explicit template argument list in C++, e.g., the "" in "sort".
void initializeFrom(SourceLocation TemplateKWLoc, const TemplateArgumentListInfo &List, TemplateArgumentLoc *OutArgArray)
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspon...
A placeholder type used to construct an empty shell of a type, that will be filled in later (e....