31 #include "llvm/ADT/ArrayRef.h" 32 #include "llvm/Support/Casting.h" 33 #include "llvm/Support/ErrorHandling.h" 39 using namespace clang;
54 case OO_Call:
case OO_Subscript:
68 const Expr *E = getExprOperand();
70 if (RD->isPolymorphic() && E->
isGLValue())
77 assert(isTypeOperand() &&
"Cannot call getTypeOperand for typeid(expr)");
84 assert(isTypeOperand() &&
"Cannot call getTypeOperand for __uuidof(expr)");
96 CXXNewExpr::CXXNewExpr(
bool IsGlobalNew,
FunctionDecl *OperatorNew,
98 bool UsualArrayDeleteWantsSize,
101 InitializationStyle InitializationStyle,
108 OperatorNew(OperatorNew), OperatorDelete(OperatorDelete),
109 AllocatedTypeInfo(AllocatedTypeInfo), Range(Range),
110 DirectInitRange(DirectInitRange) {
112 assert((Initializer !=
nullptr || InitializationStyle ==
NoInit) &&
113 "Only NoInit can have no initializer!");
118 CXXNewExprBits.UsualArrayDeleteWantsSize = UsualArrayDeleteWantsSize;
120 Initializer ? InitializationStyle + 1 : 0;
121 bool IsParenTypeId = TypeIdParens.
isValid();
126 if (
Expr *SizeExpr = *ArraySize) {
127 if (SizeExpr->isInstantiationDependent())
128 ExprBits.InstantiationDependent =
true;
129 if (SizeExpr->containsUnexpandedParameterPack())
130 ExprBits.ContainsUnexpandedParameterPack =
true;
133 getTrailingObjects<Stmt *>()[arraySizeOffset()] = *ArraySize;
138 ExprBits.InstantiationDependent =
true;
140 ExprBits.ContainsUnexpandedParameterPack =
true;
142 getTrailingObjects<Stmt *>()[initExprOffset()] =
Initializer;
145 for (
unsigned I = 0; I != PlacementArgs.size(); ++I) {
147 ExprBits.InstantiationDependent =
true;
149 ExprBits.ContainsUnexpandedParameterPack =
true;
151 getTrailingObjects<Stmt *>()[placementNewArgsOffset() + I] =
156 getTrailingObjects<SourceRange>()[0] = TypeIdParens;
158 switch (getInitializationStyle()) {
172 CXXNewExpr::CXXNewExpr(
EmptyShell Empty,
bool IsArray,
173 unsigned NumPlacementArgs,
bool IsParenTypeId)
174 :
Expr(CXXNewExprClass, Empty) {
183 bool ShouldPassAlignment,
bool UsualArrayDeleteWantsSize,
189 bool IsArray = ArraySize.hasValue();
190 bool HasInit = Initializer !=
nullptr;
191 unsigned NumPlacementArgs = PlacementArgs.size();
192 bool IsParenTypeId = TypeIdParens.
isValid();
194 Ctx.
Allocate(totalSizeToAlloc<Stmt *, SourceRange>(
195 IsArray + HasInit + NumPlacementArgs, IsParenTypeId),
198 CXXNewExpr(IsGlobalNew, OperatorNew, OperatorDelete, ShouldPassAlignment,
199 UsualArrayDeleteWantsSize, PlacementArgs, TypeIdParens,
200 ArraySize, InitializationStyle, Initializer, Ty,
201 AllocatedTypeInfo, Range, DirectInitRange);
205 bool HasInit,
unsigned NumPlacementArgs,
206 bool IsParenTypeId) {
208 Ctx.
Allocate(totalSizeToAlloc<Stmt *, SourceRange>(
209 IsArray + HasInit + NumPlacementArgs, IsParenTypeId),
216 return getOperatorNew()
220 !getOperatorNew()->isReservedGlobalPlacementOperator();
230 while (
const auto *ICE = dyn_cast<ImplicitCastExpr>(Arg)) {
231 if (ICE->getCastKind() == CK_DerivedToBase ||
232 ICE->getCastKind() == CK_UncheckedDerivedToBase ||
233 ICE->getCastKind() == CK_NoOp) {
234 assert((ICE->getCastKind() == CK_NoOp ||
235 getOperatorDelete()->isDestroyingOperatorDelete()) &&
236 "only a destroying operator delete can have a converted arg");
237 Arg = ICE->getSubExpr();
262 :
Expr(CXXPseudoDestructorExprClass,
263 Context.BoundMemberTy,
265 (Base->isTypeDependent() ||
268 Base->isValueDependent(),
269 (Base->isInstantiationDependent() ||
271 QualifierLoc.getNestedNameSpecifier()->isInstantiationDependent()) ||
273 ScopeType->getType()->isInstantiationDependentType()) ||
276 ->isInstantiationDependentType())),
278 (Base->containsUnexpandedParameterPack() ||
280 QualifierLoc.getNestedNameSpecifier()
281 ->containsUnexpandedParameterPack()) ||
283 ScopeType->getType()->containsUnexpandedParameterPack()) ||
286 ->containsUnexpandedParameterPack()))),
287 Base(static_cast<
Stmt *>(Base)), IsArrow(isArrow),
288 OperatorLoc(OperatorLoc), QualifierLoc(QualifierLoc),
289 ScopeType(ScopeType), ColonColonLoc(ColonColonLoc), TildeLoc(TildeLoc),
290 DestroyedType(DestroyedType) {}
294 return TInfo->getType();
302 End = TInfo->getTypeLoc().getLocalSourceRange().getEnd();
307 UnresolvedLookupExpr::UnresolvedLookupExpr(
313 :
OverloadExpr(UnresolvedLookupExprClass, Context, QualifierLoc,
314 TemplateKWLoc, NameInfo, TemplateArgs, Begin, End,
false,
316 NamingClass(NamingClass) {
321 UnresolvedLookupExpr::UnresolvedLookupExpr(
EmptyShell Empty,
323 bool HasTemplateKWAndArgsInfo)
324 :
OverloadExpr(UnresolvedLookupExprClass, Empty, NumResults,
325 HasTemplateKWAndArgsInfo) {}
332 unsigned NumResults = End -
Begin;
347 assert(Args || TemplateKWLoc.
isValid());
348 unsigned NumResults = End -
Begin;
349 unsigned NumTemplateArgs = Args ? Args->
size() : 0;
355 TemplateKWLoc, NameInfo, RequiresADL,
356 true, Args, Begin, End);
360 const ASTContext &Context,
unsigned NumResults,
361 bool HasTemplateKWAndArgsInfo,
unsigned NumTemplateArgs) {
362 assert(NumTemplateArgs == 0 || HasTemplateKWAndArgsInfo);
365 NumResults, HasTemplateKWAndArgsInfo, NumTemplateArgs);
378 bool KnownInstantiationDependent,
379 bool KnownContainsUnexpandedParameterPack)
386 (KnownContainsUnexpandedParameterPack ||
388 (QualifierLoc && QualifierLoc.getNestedNameSpecifier()
390 NameInfo(NameInfo), QualifierLoc(QualifierLoc) {
391 unsigned NumResults = End -
Begin;
394 (TemplateArgs != nullptr ) || TemplateKWLoc.
isValid();
399 if ((*I)->getDeclContext()->isDependentContext() ||
400 isa<UnresolvedUsingValueDecl>(*I)) {
403 ExprBits.InstantiationDependent =
true;
417 bool Dependent =
false;
418 bool InstantiationDependent =
false;
419 bool ContainsUnexpandedParameterPack =
false;
422 Dependent, InstantiationDependent, ContainsUnexpandedParameterPack);
428 if (InstantiationDependent)
429 ExprBits.InstantiationDependent =
true;
430 if (ContainsUnexpandedParameterPack)
431 ExprBits.ContainsUnexpandedParameterPack =
true;
432 }
else if (TemplateKWLoc.
isValid()) {
441 bool HasTemplateKWAndArgsInfo)
448 DependentScopeDeclRefExpr::DependentScopeDeclRefExpr(
461 QualifierLoc(QualifierLoc), NameInfo(NameInfo) {
463 (Args !=
nullptr) || TemplateKWLoc.
isValid();
465 bool Dependent =
true;
466 bool InstantiationDependent =
true;
467 bool ContainsUnexpandedParameterPack
468 =
ExprBits.ContainsUnexpandedParameterPack;
469 getTrailingObjects<ASTTemplateKWAndArgsInfo>()->initializeFrom(
470 TemplateKWLoc, *Args, getTrailingObjects<TemplateArgumentLoc>(),
471 Dependent, InstantiationDependent, ContainsUnexpandedParameterPack);
472 ExprBits.ContainsUnexpandedParameterPack = ContainsUnexpandedParameterPack;
473 }
else if (TemplateKWLoc.
isValid()) {
474 getTrailingObjects<ASTTemplateKWAndArgsInfo>()->initializeFrom(
483 assert(QualifierLoc &&
"should be created for dependent qualifiers");
484 bool HasTemplateKWAndArgsInfo = Args || TemplateKWLoc.
isValid();
486 totalSizeToAlloc<ASTTemplateKWAndArgsInfo, TemplateArgumentLoc>(
487 HasTemplateKWAndArgsInfo, Args ? Args->
size() : 0);
490 TemplateKWLoc, NameInfo, Args);
495 bool HasTemplateKWAndArgsInfo,
496 unsigned NumTemplateArgs) {
497 assert(NumTemplateArgs == 0 || HasTemplateKWAndArgsInfo);
499 totalSizeToAlloc<ASTTemplateKWAndArgsInfo, TemplateArgumentLoc>(
500 HasTemplateKWAndArgsInfo, NumTemplateArgs);
506 HasTemplateKWAndArgsInfo;
511 if (isa<CXXTemporaryObjectExpr>(
this))
512 return cast<CXXTemporaryObjectExpr>(
this)->
getBeginLoc();
513 return getLocation();
517 if (isa<CXXTemporaryObjectExpr>(
this))
518 return cast<CXXTemporaryObjectExpr>(
this)->
getEndLoc();
520 if (ParenOrBraceRange.isValid())
521 return ParenOrBraceRange.getEnd();
524 for (
unsigned I = getNumArgs(); I > 0; --I) {
525 const Expr *Arg = getArg(I-1);
544 :
CallExpr(CXXOperatorCallExprClass, Fn, {}, Args, Ty, VK,
545 OperatorLoc, 0, UsesADL) {
550 "OperatorKind overflow!");
552 "FPFeatures overflow!");
553 Range = getSourceRangeImpl();
556 CXXOperatorCallExpr::CXXOperatorCallExpr(
unsigned NumArgs,
EmptyShell Empty)
557 :
CallExpr(CXXOperatorCallExprClass, 0, NumArgs, Empty) {}
564 unsigned NumArgs = Args.size();
565 unsigned SizeOfTrailingObjects =
570 FPFeatures, UsesADL);
577 unsigned SizeOfTrailingObjects =
584 SourceRange CXXOperatorCallExpr::getSourceRangeImpl()
const {
586 if (Kind == OO_PlusPlus || Kind == OO_MinusMinus) {
587 if (getNumArgs() == 1)
593 }
else if (Kind == OO_Arrow) {
594 return getArg(0)->getSourceRange();
595 }
else if (Kind == OO_Call) {
597 }
else if (Kind == OO_Subscript) {
599 }
else if (getNumArgs() == 1) {
601 }
else if (getNumArgs() == 2) {
604 return getOperatorLoc();
611 :
CallExpr(CXXMemberCallExprClass, Fn, {}, Args, Ty, VK, RP,
612 MinNumArgs, NotADL) {}
614 CXXMemberCallExpr::CXXMemberCallExpr(
unsigned NumArgs,
EmptyShell Empty)
615 :
CallExpr(CXXMemberCallExprClass, 0, NumArgs, Empty) {}
621 unsigned MinNumArgs) {
623 unsigned NumArgs = std::max<unsigned>(Args.size(), MinNumArgs);
624 unsigned SizeOfTrailingObjects =
635 unsigned SizeOfTrailingObjects =
644 if (
const auto *MemExpr = dyn_cast<MemberExpr>(Callee))
645 return MemExpr->getBase();
646 if (
const auto *BO = dyn_cast<BinaryOperator>(Callee))
647 if (BO->getOpcode() == BO_PtrMemD || BO->getOpcode() == BO_PtrMemI)
655 QualType Ty = getImplicitObjectArgument()->getType();
662 if (
const auto *MemExpr = dyn_cast<MemberExpr>(getCallee()->
IgnoreParens()))
663 return cast<CXXMethodDecl>(MemExpr->getMemberDecl());
670 Expr* ThisArg = getImplicitObjectArgument();
689 case CXXStaticCastExprClass:
return "static_cast";
690 case CXXDynamicCastExprClass:
return "dynamic_cast";
691 case CXXReinterpretCastExprClass:
return "reinterpret_cast";
692 case CXXConstCastExprClass:
return "const_cast";
693 default:
return "<invalid cast>";
705 unsigned PathSize = (BasePath ? BasePath->size() : 0);
706 void *Buffer = C.
Allocate(totalSizeToAlloc<CXXBaseSpecifier *>(PathSize));
709 RParenLoc, AngleBrackets);
711 std::uninitialized_copy_n(BasePath->data(), BasePath->size(),
718 void *Buffer = C.
Allocate(totalSizeToAlloc<CXXBaseSpecifier *>(PathSize));
730 unsigned PathSize = (BasePath ? BasePath->size() : 0);
731 void *Buffer = C.
Allocate(totalSizeToAlloc<CXXBaseSpecifier *>(PathSize));
734 RParenLoc, AngleBrackets);
736 std::uninitialized_copy_n(BasePath->data(), BasePath->size(),
743 void *Buffer = C.
Allocate(totalSizeToAlloc<CXXBaseSpecifier *>(PathSize));
757 QualType SrcType = getSubExpr()->getType();
771 if (!SrcRD->hasAttr<FinalAttr>())
777 return !DestRD->isDerivedFrom(SrcRD);
787 unsigned PathSize = (BasePath ? BasePath->size() : 0);
788 void *Buffer = C.
Allocate(totalSizeToAlloc<CXXBaseSpecifier *>(PathSize));
791 RParenLoc, AngleBrackets);
793 std::uninitialized_copy_n(BasePath->data(), BasePath->size(),
800 void *Buffer = C.
Allocate(totalSizeToAlloc<CXXBaseSpecifier *>(PathSize));
810 return new (
C)
CXXConstCastExpr(T, VK, Op, WrittenTy, L, RParenLoc, AngleBrackets);
822 unsigned PathSize = (BasePath ? BasePath->size() : 0);
823 void *Buffer = C.
Allocate(totalSizeToAlloc<CXXBaseSpecifier *>(PathSize));
827 std::uninitialized_copy_n(BasePath->data(), BasePath->size(),
834 void *Buffer = C.
Allocate(totalSizeToAlloc<CXXBaseSpecifier *>(PathSize));
839 return getTypeInfoAsWritten()->getTypeLoc().getBeginLoc();
843 return RParenLoc.
isValid() ? RParenLoc : getSubExpr()->getEndLoc();
850 :
CallExpr(UserDefinedLiteralClass, Fn, {}, Args, Ty, VK,
851 LitEndLoc, 0, NotADL),
852 UDSuffixLoc(SuffixLoc) {}
854 UserDefinedLiteral::UserDefinedLiteral(
unsigned NumArgs,
EmptyShell Empty)
855 :
CallExpr(UserDefinedLiteralClass, 0, NumArgs, Empty) {}
863 unsigned NumArgs = Args.size();
864 unsigned SizeOfTrailingObjects =
875 unsigned SizeOfTrailingObjects =
884 if (getNumArgs() == 0)
886 if (getNumArgs() == 2)
889 assert(getNumArgs() == 1 &&
"unexpected #args in literal operator call");
891 cast<FunctionDecl>(getCalleeDecl())->getParamDecl(0)->getType();
895 return LOK_Character;
901 llvm_unreachable(
"unknown kind of literal operator");
907 assert(LOK != LOK_Template && LOK != LOK_Raw &&
"not a cooked literal");
913 return cast<FunctionDecl>(getCalleeDecl())->getLiteralIdentifier();
924 Field(Field), UsedContext(UsedContext) {
939 "Expression bound to a temporary must have record or array type!");
944 CXXTemporaryObjectExpr::CXXTemporaryObjectExpr(
947 bool HadMultipleCandidates,
bool ListInitialization,
948 bool StdInitListInitialization,
bool ZeroInitialization)
951 Cons,
false, Args, HadMultipleCandidates,
952 ListInitialization, StdInitListInitialization, ZeroInitialization,
956 CXXTemporaryObjectExpr::CXXTemporaryObjectExpr(
EmptyShell Empty,
963 bool HadMultipleCandidates,
bool ListInitialization,
964 bool StdInitListInitialization,
bool ZeroInitialization) {
965 unsigned SizeOfTrailingObjects = sizeOfTrailingObjects(Args.size());
970 Cons, Ty, TSI, Args, ParenOrBraceRange, HadMultipleCandidates,
971 ListInitialization, StdInitListInitialization, ZeroInitialization);
976 unsigned SizeOfTrailingObjects = sizeOfTrailingObjects(NumArgs);
984 return getTypeSourceInfo()->getTypeLoc().getBeginLoc();
990 Loc = getArg(getNumArgs() - 1)->
getEndLoc();
997 bool HadMultipleCandidates,
bool ListInitialization,
998 bool StdInitListInitialization,
bool ZeroInitialization,
1000 unsigned SizeOfTrailingObjects = sizeOfTrailingObjects(Args.size());
1004 CXXConstructExprClass, Ty, Loc, Ctor, Elidable, Args,
1005 HadMultipleCandidates, ListInitialization, StdInitListInitialization,
1006 ZeroInitialization, ConstructKind, ParenOrBraceRange);
1011 unsigned SizeOfTrailingObjects = sizeOfTrailingObjects(NumArgs);
1021 bool ListInitialization,
bool StdInitListInitialization,
1025 Ty->isDependentType(), Ty->isInstantiationDependentType(),
1027 Constructor(Ctor), ParenOrBraceRange(ParenOrBraceRange),
1028 NumArgs(Args.size()) {
1037 Stmt **TrailingArgs = getTrailingArgs();
1038 for (
unsigned I = 0, N = Args.size(); I != N; ++I) {
1039 assert(Args[I] &&
"NULL argument in CXXConstructExpr!");
1044 ExprBits.InstantiationDependent =
true;
1046 ExprBits.ContainsUnexpandedParameterPack =
true;
1048 TrailingArgs[I] = Args[I];
1054 :
Expr(SC, Empty), NumArgs(NumArgs) {}
1059 : DeclAndBits(Var, 0), Loc(Loc), EllipsisLoc(EllipsisLoc) {
1062 Bits |= Capture_Implicit;
1066 Bits |= Capture_ByCopy;
1069 assert(!Var &&
"'this' capture cannot have a variable!");
1070 Bits |= Capture_This;
1074 Bits |= Capture_ByCopy;
1077 assert(Var &&
"capture must have a variable!");
1080 assert(!Var &&
"VLA type capture cannot have a variable!");
1083 DeclAndBits.setInt(Bits);
1089 bool CapByCopy = DeclAndBits.getInt() & Capture_ByCopy;
1101 bool ContainsUnexpandedParameterPack)
1104 ContainsUnexpandedParameterPack),
1105 IntroducerRange(IntroducerRange), CaptureDefaultLoc(CaptureDefaultLoc),
1106 NumCaptures(Captures.size()), CaptureDefault(CaptureDefault),
1107 ExplicitParams(ExplicitParams), ExplicitResultType(ExplicitResultType),
1108 ClosingBrace(ClosingBrace) {
1109 assert(CaptureInits.size() == Captures.size() &&
"Wrong number of arguments");
1111 CXXRecordDecl::LambdaDefinitionData &Data = Class->getLambdaData();
1116 const ASTContext &Context = Class->getASTContext();
1117 Data.NumCaptures = NumCaptures;
1118 Data.NumExplicitCaptures = 0;
1122 for (
unsigned I = 0, N = Captures.size(); I != N; ++I) {
1124 ++Data.NumExplicitCaptures;
1126 *ToCapture++ = Captures[I];
1130 Stmt **Stored = getStoredStmts();
1131 for (
unsigned I = 0, N = CaptureInits.size(); I != N; ++I)
1132 *Stored++ = CaptureInits[I];
1135 *Stored++ = getCallOperator()->getBody();
1142 bool ExplicitParams,
bool ExplicitResultType,
ArrayRef<Expr *> CaptureInits,
1143 SourceLocation ClosingBrace,
bool ContainsUnexpandedParameterPack) {
1148 unsigned Size = totalSizeToAlloc<Stmt *>(Captures.size() + 1);
1149 void *Mem = Context.
Allocate(Size);
1151 LambdaExpr(T, IntroducerRange, CaptureDefault, CaptureDefaultLoc,
1152 Captures, ExplicitParams, ExplicitResultType, CaptureInits,
1153 ClosingBrace, ContainsUnexpandedParameterPack);
1157 unsigned NumCaptures) {
1158 unsigned Size = totalSizeToAlloc<Stmt *>(NumCaptures + 1);
1169 return getLambdaClass()->getLambdaData().Captures;
1173 return capture_begin() + NumCaptures;
1181 return capture_begin();
1185 struct CXXRecordDecl::LambdaDefinitionData &Data
1186 = getLambdaClass()->getLambdaData();
1187 return Data.Captures + Data.NumExplicitCaptures;
1191 return capture_range(explicit_capture_begin(), explicit_capture_end());
1195 return explicit_capture_end();
1199 return capture_end();
1203 return capture_range(implicit_capture_begin(), implicit_capture_end());
1207 return getType()->getAsCXXRecordDecl();
1229 if (!getStoredStmts()[NumCaptures])
1230 *
const_cast<Stmt **
>(&getStoredStmts()[NumCaptures]) =
1231 getCallOperator()->getBody();
1233 return static_cast<CompoundStmt *
>(getStoredStmts()[NumCaptures]);
1237 return !getCallOperator()->isConst();
1240 ExprWithCleanups::ExprWithCleanups(
Expr *subexpr,
1241 bool CleanupsHaveSideEffects,
1243 :
FullExpr(ExprWithCleanupsClass, subexpr) {
1244 ExprWithCleanupsBits.CleanupsHaveSideEffects = CleanupsHaveSideEffects;
1245 ExprWithCleanupsBits.NumObjects = objects.size();
1246 for (
unsigned i = 0, e = objects.size();
i != e; ++
i)
1247 getTrailingObjects<CleanupObject>()[
i] = objects[
i];
1251 bool CleanupsHaveSideEffects,
1253 void *buffer = C.
Allocate(totalSizeToAlloc<CleanupObject>(objects.size()),
1259 ExprWithCleanups::ExprWithCleanups(
EmptyShell empty,
unsigned numObjects)
1260 :
FullExpr(ExprWithCleanupsClass, empty) {
1261 ExprWithCleanupsBits.NumObjects = numObjects;
1266 unsigned numObjects) {
1267 void *buffer = C.
Allocate(totalSizeToAlloc<CleanupObject>(numObjects),
1272 CXXUnresolvedConstructExpr::CXXUnresolvedConstructExpr(
TypeSourceInfo *TSI,
1276 :
Expr(CXXUnresolvedConstructExprClass,
1286 TSI(TSI), LParenLoc(LParenLoc), RParenLoc(RParenLoc) {
1287 CXXUnresolvedConstructExprBits.NumArgs = Args.size();
1288 auto **StoredArgs = getTrailingObjects<Expr *>();
1289 for (
unsigned I = 0; I != Args.size(); ++I) {
1290 if (Args[I]->containsUnexpandedParameterPack())
1291 ExprBits.ContainsUnexpandedParameterPack =
true;
1293 StoredArgs[I] = Args[I];
1300 void *Mem = Context.
Allocate(totalSizeToAlloc<Expr *>(Args.size()));
1307 void *Mem = Context.
Allocate(totalSizeToAlloc<Expr *>(NumArgs));
1315 CXXDependentScopeMemberExpr::CXXDependentScopeMemberExpr(
1327 Base(Base), BaseType(BaseType), QualifierLoc(QualifierLoc),
1328 MemberNameInfo(MemberNameInfo) {
1329 CXXDependentScopeMemberExprBits.IsArrow = IsArrow;
1330 CXXDependentScopeMemberExprBits.HasTemplateKWAndArgsInfo =
1331 (TemplateArgs !=
nullptr) || TemplateKWLoc.
isValid();
1332 CXXDependentScopeMemberExprBits.HasFirstQualifierFoundInScope =
1333 FirstQualifierFoundInScope !=
nullptr;
1334 CXXDependentScopeMemberExprBits.OperatorLoc = OperatorLoc;
1337 bool Dependent =
true;
1338 bool InstantiationDependent =
true;
1339 bool ContainsUnexpandedParameterPack =
false;
1340 getTrailingObjects<ASTTemplateKWAndArgsInfo>()->initializeFrom(
1341 TemplateKWLoc, *TemplateArgs, getTrailingObjects<TemplateArgumentLoc>(),
1342 Dependent, InstantiationDependent, ContainsUnexpandedParameterPack);
1343 if (ContainsUnexpandedParameterPack)
1344 ExprBits.ContainsUnexpandedParameterPack =
true;
1345 }
else if (TemplateKWLoc.
isValid()) {
1346 getTrailingObjects<ASTTemplateKWAndArgsInfo>()->initializeFrom(
1350 if (hasFirstQualifierFoundInScope())
1351 *getTrailingObjects<NamedDecl *>() = FirstQualifierFoundInScope;
1354 CXXDependentScopeMemberExpr::CXXDependentScopeMemberExpr(
1355 EmptyShell Empty,
bool HasTemplateKWAndArgsInfo,
1356 bool HasFirstQualifierFoundInScope)
1357 :
Expr(CXXDependentScopeMemberExprClass, Empty) {
1358 CXXDependentScopeMemberExprBits.HasTemplateKWAndArgsInfo =
1359 HasTemplateKWAndArgsInfo;
1360 CXXDependentScopeMemberExprBits.HasFirstQualifierFoundInScope =
1361 HasFirstQualifierFoundInScope;
1370 bool HasTemplateKWAndArgsInfo =
1371 (TemplateArgs !=
nullptr) || TemplateKWLoc.
isValid();
1372 unsigned NumTemplateArgs = TemplateArgs ? TemplateArgs->
size() : 0;
1373 bool HasFirstQualifierFoundInScope = FirstQualifierFoundInScope !=
nullptr;
1377 HasTemplateKWAndArgsInfo, NumTemplateArgs, HasFirstQualifierFoundInScope);
1381 Ctx, Base, BaseType, IsArrow, OperatorLoc, QualifierLoc, TemplateKWLoc,
1382 FirstQualifierFoundInScope, MemberNameInfo, TemplateArgs);
1386 const ASTContext &Ctx,
bool HasTemplateKWAndArgsInfo,
1387 unsigned NumTemplateArgs,
bool HasFirstQualifierFoundInScope) {
1388 assert(NumTemplateArgs == 0 || HasTemplateKWAndArgsInfo);
1392 HasTemplateKWAndArgsInfo, NumTemplateArgs, HasFirstQualifierFoundInScope);
1396 EmptyShell(), HasTemplateKWAndArgsInfo, HasFirstQualifierFoundInScope);
1403 if (isa<UnresolvedUsingValueDecl>(decl))
1411 }
while (++begin != end);
1416 UnresolvedMemberExpr::UnresolvedMemberExpr(
1424 UnresolvedMemberExprClass, Context, QualifierLoc, TemplateKWLoc,
1425 MemberNameInfo, TemplateArgs, Begin, End,
1433 Base(Base), BaseType(BaseType), OperatorLoc(OperatorLoc) {
1434 UnresolvedMemberExprBits.IsArrow = IsArrow;
1435 UnresolvedMemberExprBits.HasUnresolvedUsing = HasUnresolvedUsing;
1443 UnresolvedMemberExpr::UnresolvedMemberExpr(EmptyShell Empty,
1444 unsigned NumResults,
1445 bool HasTemplateKWAndArgsInfo)
1446 :
OverloadExpr(UnresolvedMemberExprClass, Empty, NumResults,
1447 HasTemplateKWAndArgsInfo) {}
1453 return cast<Expr>(Base)->isImplicitCXXThis();
1463 unsigned NumResults = End -
Begin;
1464 bool HasTemplateKWAndArgsInfo = TemplateArgs || TemplateKWLoc.
isValid();
1465 unsigned NumTemplateArgs = TemplateArgs ? TemplateArgs->
size() : 0;
1468 NumResults, HasTemplateKWAndArgsInfo, NumTemplateArgs);
1471 Context, HasUnresolvedUsing, Base, BaseType, IsArrow, OperatorLoc,
1472 QualifierLoc, TemplateKWLoc, MemberNameInfo, TemplateArgs, Begin, End);
1476 const ASTContext &Context,
unsigned NumResults,
1477 bool HasTemplateKWAndArgsInfo,
unsigned NumTemplateArgs) {
1478 assert(NumTemplateArgs == 0 || HasTemplateKWAndArgsInfo);
1481 NumResults, HasTemplateKWAndArgsInfo, NumTemplateArgs);
1494 auto *NNS = getQualifier();
1496 const Type *T = getQualifier()->getAsType();
1497 assert(T &&
"qualifier in member expression does not name type");
1499 assert(Record &&
"qualifier in member expression does not name record");
1506 assert(PT &&
"base of arrow member access is not pointer");
1511 assert(Record &&
"base of member expression does not name record");
1524 Context.
Allocate(totalSizeToAlloc<TemplateArgument>(PartialArgs.size()));
1526 PackLoc, RParenLoc, Length, PartialArgs);
1530 unsigned NumPartialArgs) {
1532 Context.
Allocate(totalSizeToAlloc<TemplateArgument>(NumPartialArgs));
1536 SubstNonTypeTemplateParmPackExpr::
1542 :
Expr(SubstNonTypeTemplateParmPackExprClass, T, ValueKind,
OK_Ordinary,
1544 Param(Param), Arguments(ArgPack.pack_begin()),
1545 NumArguments(ArgPack.pack_size()), NameLoc(NameLoc) {}
1551 FunctionParmPackExpr::FunctionParmPackExpr(
QualType T,
VarDecl *ParamPack,
1557 ParamPack(ParamPack), NameLoc(NameLoc), NumParameters(NumParams) {
1559 std::uninitialized_copy(Params, Params + NumParams,
1560 getTrailingObjects<VarDecl *>());
1567 return new (Context.
Allocate(totalSizeToAlloc<VarDecl *>(Params.size())))
1573 unsigned NumParams) {
1574 return new (Context.
Allocate(totalSizeToAlloc<VarDecl *>(NumParams)))
1579 unsigned ManglingNumber) {
1586 if (!
State.is<ExtraState *>()) {
1592 auto ES =
State.get<ExtraState *>();
1593 ES->ExtendingDecl = ExtendedBy;
1594 ES->ManglingNumber = ManglingNumber;
1606 Loc(Loc), RParenLoc(RParenLoc) {
1611 auto **ToArgs = getTrailingObjects<TypeSourceInfo *>();
1613 for (
unsigned I = 0, N = Args.size(); I != N; ++I) {
1621 ToArgs[I] = Args[I];
1631 void *Mem = C.
Allocate(totalSizeToAlloc<TypeSourceInfo *>(Args.size()));
1632 return new (Mem)
TypeTraitExpr(T, Loc, Kind, Args, RParenLoc, Value);
1637 void *Mem = C.
Allocate(totalSizeToAlloc<TypeSourceInfo *>(NumArgs));
1641 CUDAKernelCallExpr::CUDAKernelCallExpr(
Expr *Fn,
CallExpr *Config,
1644 unsigned MinNumArgs)
1645 :
CallExpr(CUDAKernelCallExprClass, Fn, Config, Args, Ty, VK,
1646 RP, MinNumArgs, NotADL) {}
1648 CUDAKernelCallExpr::CUDAKernelCallExpr(
unsigned NumArgs,
EmptyShell Empty)
1649 :
CallExpr(CUDAKernelCallExprClass, END_PREARG, NumArgs,
1657 unsigned NumArgs = std::max<unsigned>(Args.size(), MinNumArgs);
1658 unsigned SizeOfTrailingObjects =
1669 unsigned SizeOfTrailingObjects =
A call to an overloaded operator written using operator syntax.
static DependentScopeDeclRefExpr * CreateEmpty(const ASTContext &Context, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
void setValueDependent(bool VD)
Set whether this expression is value-dependent or not.
Defines the clang::ASTContext interface.
LiteralOperatorKind
The kind of literal operator which is invoked.
VarDecl * getCapturedVar() const
Retrieve the declaration of the local variable being captured.
capture_iterator explicit_capture_end() const
Retrieve an iterator pointing past the end of the sequence of explicit lambda captures.
static CXXConstructExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs)
Create an empty C++ construction expression.
Represents a function declaration or definition.
SourceLocation getRParenLoc() const
QualType getTypeOperand(ASTContext &Context) const
Retrieves the type operand of this __uuidof() expression after various required adjustments (removing...
if(T->getSizeExpr()) TRY_TO(TraverseStmt(T -> getSizeExpr()))
PointerType - C99 6.7.5.1 - Pointer Declarators.
Stores the type being destroyed by a pseudo-destructor expression.
A (possibly-)qualified type.
static const TemplateArgument & getArgument(const TemplateArgument &A)
capture_iterator capture_end() const
Retrieve an iterator pointing past the end of the sequence of lambda captures.
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
Stmt - This represents one statement.
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this call.
LambdaCapture(SourceLocation Loc, bool Implicit, LambdaCaptureKind Kind, VarDecl *Var=nullptr, SourceLocation EllipsisLoc=SourceLocation())
Create a new capture of a variable or of this.
QualType getPointeeType() const
If this is a pointer, ObjC object pointer, or block pointer, this returns the respective pointee...
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 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)
C Language Family Type Representation.
Microsoft's '__super' specifier, stored as a CXXRecordDecl* of the class it appeared in...
bool isRecordType() const
static unsigned sizeOfTrailingObjects(unsigned NumPreArgs, unsigned NumArgs)
Return the size in bytes needed for the trailing objects.
Expr * getImplicitObjectArgument() const
Retrieve the implicit object argument for the member call.
LambdaCaptureDefault
The default, if any, capture method for a lambda expression.
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
QualType getNonReferenceType() const
If Type is a reference type (e.g., const int&), returns the type that the reference refers to ("const...
The base class of the type hierarchy.
SourceLocation getEndLoc() const LLVM_READONLY
Represents a call to a C++ constructor.
ArrayRef< NamedDecl * > getLambdaExplicitTemplateParameters() const
Retrieve the lambda template parameters that were specified explicitly.
A container of type source information.
Floating point control options.
bool isInstantiationDependent() const
Determine whether this name involves a template parameter.
static CXXFunctionalCastExpr * Create(const ASTContext &Context, QualType T, ExprValueKind VK, TypeSourceInfo *Written, CastKind Kind, Expr *Op, const CXXCastPath *Path, SourceLocation LPLoc, SourceLocation RPLoc)
Describes the capture of a variable or of this, or of a C++1y init-capture.
Represents a C++ constructor within a class.
bool hasInClassInitializer() const
Determine whether this member has a C++11 default member initializer.
static CXXOperatorCallExpr * Create(const ASTContext &Ctx, OverloadedOperatorKind OpKind, Expr *Fn, ArrayRef< Expr *> Args, QualType Ty, ExprValueKind VK, SourceLocation OperatorLoc, FPOptions FPFeatures, ADLCallKind UsesADL=NotADL)
capture_range implicit_captures() const
Retrieve this lambda's implicit captures.
SourceLocation getBeginLoc() const LLVM_READONLY
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, ConstructionKind ConstructKind, SourceRange ParenOrBraceRange)
Create a C++ construction expression.
CXXRecordDecl * getRecordDecl() const
Retrieve the CXXRecordDecl for the underlying type of the implicit object argument.
Represents a variable declaration or definition.
const T * getAs() const
Member-template getAs<specific type>'.
PseudoDestructorTypeStorage()=default
static FunctionParmPackExpr * CreateEmpty(const ASTContext &Context, unsigned NumParams)
NamedDecl * getUnderlyingDecl()
Looks through UsingDecls and ObjCCompatibleAliasDecls for the underlying named decl.
SourceLocation getEndLoc() const LLVM_READONLY
Stores a list of template parameters for a TemplateDecl and its derived classes.
void setContainsUnexpandedParameterPack(bool PP=true)
Set the bit that describes whether this expression contains an unexpanded parameter pack...
Represents an expression – generally a full-expression – that introduces cleanups to be run at the ...
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)
TemplateParameterList * getGenericLambdaTemplateParameterList() const
Retrieve the generic lambda's template parameter list.
Defines the clang::Expr interface and subclasses for C++ expressions.
The collection of all-type qualifiers we support.
CXXRecordDecl * getLambdaClass() const
Retrieve the class that corresponds to the lambda.
A C++ static_cast expression (C++ [expr.static.cast]).
static CXXUnresolvedConstructExpr * Create(const ASTContext &Context, TypeSourceInfo *Type, SourceLocation LParenLoc, ArrayRef< Expr *> Args, SourceLocation RParenLoc)
One of these records is kept for each identifier that is lexed.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
A C++ nested-name-specifier augmented with source location information.
FullExpr - Represents a "full-expression" node.
SourceLocation getBeginLoc() const LLVM_READONLY
LambdaCaptureKind
The different capture forms in a lambda introducer.
Represents a member of a struct/union/class.
SourceLocation getEndLoc() const LLVM_READONLY
CompoundStmt * getBody() const
Retrieve the body of the lambda.
SourceLocation getBeginLoc() const LLVM_READONLY
The iterator over UnresolvedSets.
QualType getDestroyedType() const
Retrieve the type being destroyed.
capture_iterator implicit_capture_end() const
Retrieve an iterator pointing past the end of the sequence of implicit lambda captures.
__SIZE_TYPE__ size_t
The unsigned integer type of the result of the sizeof operator.
Represents a C++ member access expression for which lookup produced a set of overloaded functions...
An r-value expression (a pr-value in the C++11 taxonomy) produces a temporary value.
TemplateArgument getArgumentPack() const
Retrieve the template argument pack containing the substituted template arguments.
CXXConstructExpr(StmtClass SC, QualType Ty, SourceLocation Loc, CXXConstructorDecl *Ctor, bool Elidable, ArrayRef< Expr *> Args, bool HadMultipleCandidates, bool ListInitialization, bool StdInitListInitialization, bool ZeroInitialization, ConstructionKind ConstructKind, SourceRange ParenOrBraceRange)
Build a C++ construction expression.
< Capturing the *this object by copy
bool capturesThis() const
Determine whether this capture handles the C++ this pointer.
A convenient class for passing around template argument information.
SourceLocation getLocation() const
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
An x-value expression is a reference to an object with independent storage but which can be "moved"...
bool containsUnexpandedParameterPack() const
Whether this type is or contains an unexpanded parameter pack, used to support C++0x variadic templat...
bool isRValueReferenceType() const
unsigned getInt() const
Used to serialize this.
QualType getObjectType() const
Retrieve the type of the object argument.
Represents binding an expression to a temporary.
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
DeclAccessPair * getTrailingResults()
Return the results. Defined after UnresolvedMemberExpr.
bool isTypeDependent() const
isTypeDependent - Determines whether this expression is type-dependent (C++ [temp.dep.expr]), which means that its type could change from one template instantiation to the next.
An ordinary object is located at an address in memory.
Represents a C++ member access expression where the actual member referenced could not be resolved be...
bool containsUnexpandedParameterPack() const
Determine whether this name contains an unexpanded parameter pack.
bool isInitCapture(const LambdaCapture *Capture) const
Determine whether one of this lambda's captures is an init-capture.
static UnresolvedLookupExpr * Create(const ASTContext &Context, CXXRecordDecl *NamingClass, NestedNameSpecifierLoc QualifierLoc, const DeclarationNameInfo &NameInfo, bool RequiresADL, bool Overloaded, UnresolvedSetIterator Begin, UnresolvedSetIterator End)
const IdentifierInfo * getUDSuffix() const
Returns the ud-suffix specified for this literal.
Represents an explicit template argument list in C++, e.g., the "<int>" in "sort<int>".
TypeTrait
Names for traits that operate specifically on types.
bool isInstantiationDependent() const
Whether this nested name specifier involves a template parameter.
ASTTemplateKWAndArgsInfo * getTrailingASTTemplateKWAndArgsInfo()
Return the optional template keyword and arguments info.
CompoundStmt - This represents a group of statements like { stmt stmt }.
CXXRecordDecl * getAsCXXRecordDecl() const
Retrieves the CXXRecordDecl that this type refers to, either because the type is a RecordType or beca...
Represents a prototype with parameter type info, e.g.
CastKind
CastKind - The kind of operation required for a conversion.
SourceRange getLocalSourceRange() const
Get the local source range.
static FunctionParmPackExpr * Create(const ASTContext &Context, QualType T, VarDecl *ParamPack, SourceLocation NameLoc, ArrayRef< VarDecl *> Params)
SourceLocation getBeginLoc() const
Get the begin source location.
SourceLocation getBeginLoc() const LLVM_READONLY
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
This represents one expression.
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.
ExprValueKind
The categorization of expression values, currently following the C++11 scheme.
static CXXMemberCallExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, EmptyShell Empty)
bool isImplicitAccess() const
True if this is an implicit access, i.e., one in which the member being accessed was not written in t...
const T * castAs() const
Member-template castAs<specific type>.
Represents a C++ functional cast expression that builds a temporary object.
A C++ const_cast expression (C++ [expr.const.cast]).
Represents a C++ destructor within a class.
const internal::VariadicAllOfMatcher< Decl > decl
Matches declarations.
Defines an enumeration for C++ overloaded operators.
static CXXStaticCastExpr * Create(const ASTContext &Context, QualType T, ExprValueKind VK, CastKind K, Expr *Op, const CXXCastPath *Path, TypeSourceInfo *Written, SourceLocation L, SourceLocation RParenLoc, SourceRange AngleBrackets)
static CXXReinterpretCastExpr * CreateEmpty(const ASTContext &Context, unsigned pathSize)
DeclContext * getDeclContext()
static UserDefinedLiteral * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, EmptyShell Empty)
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)
Represents an expression that computes the length of a parameter pack.
NonTypeTemplateParmDecl - Declares a non-type template parameter, e.g., "Size" in.
CXXDefaultInitExprBitfields CXXDefaultInitExprBits
Defines the clang::TypeLoc interface and its subclasses.
static LambdaExpr * Create(const ASTContext &C, CXXRecordDecl *Class, SourceRange IntroducerRange, LambdaCaptureDefault CaptureDefault, SourceLocation CaptureDefaultLoc, ArrayRef< LambdaCapture > Captures, bool ExplicitParams, bool ExplicitResultType, ArrayRef< Expr *> CaptureInits, SourceLocation ClosingBrace, bool ContainsUnexpandedParameterPack)
Construct a new lambda expression.
SourceLocation getEnd() const
CXXMethodDecl * getMethodDecl() const
Retrieve the declaration of the called method.
QualType getTypeOperand(ASTContext &Context) const
Retrieves the type operand of this typeid() expression after various required adjustments (removing r...
static UnresolvedLookupExpr * CreateEmpty(const ASTContext &Context, unsigned NumResults, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
QualType getTypeDeclType(const TypeDecl *Decl, const TypeDecl *PrevDecl=nullptr) const
Return the unique reference to the type for the specified type declaration.
QualType getDestroyedType() const
Retrieve the type being destroyed.
CXXMethodDecl * getCallOperator() const
Retrieve the function call operator associated with this lambda expression.
SourceRange getSourceRange() const
SourceLocation getEndLoc() const LLVM_READONLY
bool capturesVariable() const
Determine whether this capture handles a variable.
LiteralOperatorKind getLiteralOperatorKind() const
Returns the kind of literal operator invocation which this expression represents. ...
bool containsUnexpandedParameterPack() const
Whether this nested-name-specifier contains an unexpanded parameter pack (for C++11 variadic template...
A C++ dynamic_cast expression (C++ [expr.dynamic.cast]).
static CXXConstCastExpr * Create(const ASTContext &Context, QualType T, ExprValueKind VK, Expr *Op, TypeSourceInfo *WrittenTy, SourceLocation L, SourceLocation RParenLoc, SourceRange AngleBrackets)
static CXXBindTemporaryExpr * Create(const ASTContext &C, CXXTemporary *Temp, Expr *SubExpr)
A reference to an overloaded function set, either an UnresolvedLookupExpr or an UnresolvedMemberExpr...
capture_iterator implicit_capture_begin() const
Retrieve an iterator pointing to the first implicit lambda capture.
bool isInstantiationDependent() const
Whether this expression is instantiation-dependent, meaning that it depends in some way on a template...
FunctionDecl * getAsFunction() LLVM_READONLY
Returns the function itself, or the templated function if this is a function template.
static CXXDynamicCastExpr * CreateEmpty(const ASTContext &Context, unsigned pathSize)
Encodes a location in the source.
capture_iterator explicit_capture_begin() const
Retrieve an iterator pointing to the first explicit lambda capture.
SourceLocation getEndLoc() const LLVM_READONLY
static DependentScopeDeclRefExpr * Create(const ASTContext &Context, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, const DeclarationNameInfo &NameInfo, const TemplateArgumentListInfo *TemplateArgs)
static CXXOperatorCallExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, EmptyShell Empty)
UnresolvedLookupExprBitfields UnresolvedLookupExprBits
Represents a C++ temporary.
bool shouldNullCheckAllocation() const
True if the allocation result needs to be null-checked.
static CXXConstCastExpr * CreateEmpty(const ASTContext &Context)
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)"...
A call to a literal operator (C++11 [over.literal]) written as a user-defined literal (C++11 [lit...
static SizeOfPackExpr * Create(ASTContext &Context, SourceLocation OperatorLoc, NamedDecl *Pack, SourceLocation PackLoc, SourceLocation RParenLoc, Optional< unsigned > Length=None, ArrayRef< TemplateArgument > PartialArgs=None)
Represents a call to a member function that may be written either with member call syntax (e...
ASTContext & getASTContext() const LLVM_READONLY
Represents a static or instance method of a struct/union/class.
static ExprWithCleanups * Create(const ASTContext &C, EmptyShell empty, unsigned numObjects)
ArrayRef< NamedDecl * > getExplicitTemplateParameters() const
Get the template parameters were explicitly specified (as opposed to being invented by use of an auto...
bool isValueDependent() const
isValueDependent - Determines whether this expression is value-dependent (C++ [temp.dep.constexpr]).
bool isAnyPointerType() const
bool isInfixBinaryOp() const
Is this written as an infix binary operator?
bool isExplicit() const
Determine whether this was an explicit capture (written between the square brackets introducing the l...
bool isAnyCharacterType() const
Determine whether this type is any of the built-in character types.
static CXXDependentScopeMemberExpr * CreateEmpty(const ASTContext &Ctx, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs, bool HasFirstQualifierFoundInScope)
__DEVICE__ void * memcpy(void *__a, const void *__b, size_t __c)
static SizeOfPackExpr * CreateDeserialized(ASTContext &Context, unsigned NumPartialArgs)
CXXRecordDecl * getNamingClass()
Retrieve the naming class of this lookup.
SourceLocation getBeginLoc() const LLVM_READONLY
static CXXTemporaryObjectExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs)
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)
bool isInstantiationDependentType() const
Determine whether this type is an instantiation-dependent type, meaning that the type involves a temp...
A placeholder type used to construct an empty shell of a type, that will be filled in later (e...
A qualified reference to a name whose declaration cannot yet be resolved.
static bool hasOnlyNonStaticMemberFunctions(UnresolvedSetIterator begin, UnresolvedSetIterator end)
Defines various enumerations that describe declaration and type specifiers.
A POD class for pairing a NamedDecl* with an access specifier.
void * Allocate(size_t Size, unsigned Align=8) const
Represents a reference to a function parameter pack or init-capture pack that has been substituted bu...
Represents a template argument.
static CXXUnresolvedConstructExpr * CreateEmpty(const ASTContext &Context, unsigned NumArgs)
bool isMutable() const
Determine whether the lambda is mutable, meaning that any captures values can be modified.
Dataflow Directional Tag Classes.
void setExtendingDecl(const ValueDecl *ExtendedBy, unsigned ManglingNumber)
NestedNameSpecifier * getNestedNameSpecifier() const
Retrieve the nested-name-specifier to which this instance refers.
bool isValid() const
Return true if this is a valid SourceLocation object.
CXXMethodDecl * getLambdaCallOperator() const
Retrieve the lambda call operator of the closure type if this is a closure type.
DeducedType * getContainedDeducedType() const
Get the DeducedType whose type will be deduced for a variable with an initializer of this type...
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
OverloadedOperatorKind getOperator() const
Returns the kind of overloaded operator that this expression refers to.
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
A C++ reinterpret_cast expression (C++ [expr.reinterpret.cast]).
LambdaCaptureKind getCaptureKind() const
Determine the kind of capture.
TypeSourceInfo * getTypeSourceInfo() const
bool capturesVLAType() const
Determine whether this captures a variable length array bound expression.
StmtClass getStmtClass() const
static LambdaExpr * CreateDeserialized(const ASTContext &C, unsigned NumCaptures)
Construct a new lambda expression that will be deserialized from an external source.
void setInstantiationDependent(bool ID)
Set whether this expression is instantiation-dependent or not.
DependentScopeDeclRefExprBitfields DependentScopeDeclRefExprBits
bool isInitCapture() const
Whether this variable is the implicit variable for a lambda init-capture.
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspnd...
TemplateParameterList * getTemplateParameterList() const
If this is a generic lambda expression, retrieve the template parameter list associated with it...
CXXNewExprBitfields CXXNewExprBits
SourceLocation getBeginLoc() const LLVM_READONLY
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)
Capturing variable-length array type.
CXXConstructExprBitfields CXXConstructExprBits
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...
TemplateArgumentLoc * getTrailingTemplateArgumentLoc()
Return the optional template arguments.
Location wrapper for a TemplateArgument.
static CUDAKernelCallExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, EmptyShell Empty)
bool isIntegerType() const
isIntegerType() does not include complex integers (a GCC extension).
Represents a call to a CUDA kernel function.
TypeTraitExprBitfields TypeTraitExprBits
CanQualType BoundMemberTy
static CXXFunctionalCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize)
QualType getNonLValueExprType(const ASTContext &Context) const
Determine the type of a (typically non-lvalue) expression with the specified result type...
Capturing the *this object by reference.
Represents a base class of a C++ class.
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
bool isLValueReferenceType() const
TypeLoc getTypeLoc() const
Return the TypeLoc wrapper for the type source info.
OverloadExprBitfields OverloadExprBits
static CXXMemberCallExpr * Create(const ASTContext &Ctx, Expr *Fn, ArrayRef< Expr *> Args, QualType Ty, ExprValueKind VK, SourceLocation RP, unsigned MinNumArgs=0)
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate.h) and friends (in DeclFriend.h).
Defines the clang::SourceLocation class and associated facilities.
void setEnd(SourceLocation e)
Represents a C++ struct/union/class.
static CXXStaticCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize)
static CXXTemporary * Create(const ASTContext &C, const CXXDestructorDecl *Destructor)
Represents an explicit C++ type conversion that uses "functional" notation (C++ [expr.type.conv]).
static TypeTraitExpr * CreateDeserialized(const ASTContext &C, unsigned NumArgs)
CXXOperatorCallExprBitfields CXXOperatorCallExprBits
void initializeFrom(SourceLocation TemplateKWLoc, const TemplateArgumentListInfo &List, TemplateArgumentLoc *OutArgArray)
static CXXNewExpr * CreateEmpty(const ASTContext &Ctx, bool IsArray, bool HasInit, unsigned NumPlacementArgs, bool IsParenTypeId)
Create an empty c++ new expression.
bool containsUnexpandedParameterPack() const
Whether this expression contains an unexpanded parameter pack (for C++11 variadic templates)...
capture_range captures() const
Retrieve this lambda's captures.
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
CXXPseudoDestructorExpr(const ASTContext &Context, Expr *Base, bool isArrow, SourceLocation OperatorLoc, NestedNameSpecifierLoc QualifierLoc, TypeSourceInfo *ScopeType, SourceLocation ColonColonLoc, SourceLocation TildeLoc, PseudoDestructorTypeStorage DestroyedType)
static CUDAKernelCallExpr * Create(const ASTContext &Ctx, Expr *Fn, CallExpr *Config, ArrayRef< Expr *> Args, QualType Ty, ExprValueKind VK, SourceLocation RP, unsigned MinNumArgs=0)
capture_iterator capture_begin() const
Retrieve an iterator pointing to the first lambda capture.
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
bool isAlwaysNull() const
isAlwaysNull - Return whether the result of the dynamic_cast is proven to always be null...
bool isPointerType() const
const char * getCastName() const
getCastName - Get the name of the C++ cast being used, e.g., "static_cast", "dynamic_cast", "reinterpret_cast", or "const_cast".
bool isDefaultArgument() const
Determine whether this expression is a default function argument.
An l-value expression is a reference to an object with independent storage.
bool isFloatingType() const
A trivial tuple used to represent a source range.
This represents a decl that may have a name.
bool isPotentiallyEvaluated() const
Determine whether this typeid has a type operand which is potentially evaluated, per C++11 [expr...
static UserDefinedLiteral * Create(const ASTContext &Ctx, Expr *Fn, ArrayRef< Expr *> Args, QualType Ty, ExprValueKind VK, SourceLocation LitEndLoc, SourceLocation SuffixLoc)
capture_range explicit_captures() const
Retrieve this lambda's explicit captures.
SourceLocation getBegin() const
llvm::iterator_range< capture_iterator > capture_range
An iterator over a range of lambda captures.
QualType getUnqualifiedArrayType(QualType T, Qualifiers &Quals)
Return this type as a completely-unqualified array type, capturing the qualifiers in Quals...
QualType getType() const
Return the type wrapped by this type source info.
Defines the LambdaCapture class.
Expr * getCookedLiteral()
If this is not a raw user-defined literal, get the underlying cooked literal (representing the litera...
static CXXNewExpr * Create(const ASTContext &Ctx, bool IsGlobalNew, FunctionDecl *OperatorNew, FunctionDecl *OperatorDelete, bool ShouldPassAlignment, bool UsualArrayDeleteWantsSize, ArrayRef< Expr *> PlacementArgs, SourceRange TypeIdParens, Optional< Expr *> ArraySize, InitializationStyle InitializationStyle, Expr *Initializer, QualType Ty, TypeSourceInfo *AllocatedTypeInfo, SourceRange Range, SourceRange DirectInitRange)
Create a c++ new expression.
Expr * IgnoreParens() LLVM_READONLY
Skip past any parentheses which might surround this expression until reaching a fixed point...
CanQualType getSizeType() const
Return the unique type for "size_t" (C99 7.17), defined in <stddef.h>.
static UnresolvedMemberExpr * CreateEmpty(const ASTContext &Context, unsigned NumResults, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)