32 #include "llvm/ADT/ArrayRef.h" 33 #include "llvm/Support/Casting.h" 34 #include "llvm/Support/ErrorHandling.h" 40 using namespace clang;
55 case OO_Call:
case OO_Subscript:
69 const Expr *E = getExprOperand();
71 if (RD->isPolymorphic() && E->
isGLValue())
78 assert(isTypeOperand() &&
"Cannot call getTypeOperand for typeid(expr)");
85 assert(isTypeOperand() &&
"Cannot call getTypeOperand for __uuidof(expr)");
97 CXXNewExpr::CXXNewExpr(
bool IsGlobalNew,
FunctionDecl *OperatorNew,
99 bool UsualArrayDeleteWantsSize,
101 Expr *ArraySize, 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();
127 ExprBits.InstantiationDependent =
true;
129 ExprBits.ContainsUnexpandedParameterPack =
true;
131 getTrailingObjects<Stmt *>()[arraySizeOffset()] = ArraySize;
136 ExprBits.InstantiationDependent =
true;
138 ExprBits.ContainsUnexpandedParameterPack =
true;
140 getTrailingObjects<Stmt *>()[initExprOffset()] = Initializer;
143 for (
unsigned I = 0; I != PlacementArgs.size(); ++I) {
145 ExprBits.InstantiationDependent =
true;
147 ExprBits.ContainsUnexpandedParameterPack =
true;
149 getTrailingObjects<Stmt *>()[placementNewArgsOffset() + I] =
154 getTrailingObjects<SourceRange>()[0] = TypeIdParens;
156 switch (getInitializationStyle()) {
170 CXXNewExpr::CXXNewExpr(
EmptyShell Empty,
bool IsArray,
171 unsigned NumPlacementArgs,
bool IsParenTypeId)
172 :
Expr(CXXNewExprClass, Empty) {
181 bool ShouldPassAlignment,
bool UsualArrayDeleteWantsSize,
187 bool IsArray = ArraySize !=
nullptr;
188 bool HasInit = Initializer !=
nullptr;
189 unsigned NumPlacementArgs = PlacementArgs.size();
190 bool IsParenTypeId = TypeIdParens.
isValid();
192 Ctx.
Allocate(totalSizeToAlloc<Stmt *, SourceRange>(
193 IsArray + HasInit + NumPlacementArgs, IsParenTypeId),
196 CXXNewExpr(IsGlobalNew, OperatorNew, OperatorDelete, ShouldPassAlignment,
197 UsualArrayDeleteWantsSize, PlacementArgs, TypeIdParens,
198 ArraySize, InitializationStyle, Initializer, Ty,
199 AllocatedTypeInfo, Range, DirectInitRange);
203 bool HasInit,
unsigned NumPlacementArgs,
204 bool IsParenTypeId) {
206 Ctx.
Allocate(totalSizeToAlloc<Stmt *, SourceRange>(
207 IsArray + HasInit + NumPlacementArgs, IsParenTypeId),
214 return getOperatorNew()
218 !getOperatorNew()->isReservedGlobalPlacementOperator();
228 while (
const auto *ICE = dyn_cast<ImplicitCastExpr>(Arg)) {
229 if (ICE->getCastKind() == CK_DerivedToBase ||
230 ICE->getCastKind() == CK_UncheckedDerivedToBase ||
231 ICE->getCastKind() == CK_NoOp) {
232 assert((ICE->getCastKind() == CK_NoOp ||
233 getOperatorDelete()->isDestroyingOperatorDelete()) &&
234 "only a destroying operator delete can have a converted arg");
235 Arg = ICE->getSubExpr();
260 :
Expr(CXXPseudoDestructorExprClass,
261 Context.BoundMemberTy,
263 (Base->isTypeDependent() ||
266 Base->isValueDependent(),
267 (Base->isInstantiationDependent() ||
269 QualifierLoc.getNestedNameSpecifier()->isInstantiationDependent()) ||
271 ScopeType->getType()->isInstantiationDependentType()) ||
274 ->isInstantiationDependentType())),
276 (Base->containsUnexpandedParameterPack() ||
278 QualifierLoc.getNestedNameSpecifier()
279 ->containsUnexpandedParameterPack()) ||
281 ScopeType->getType()->containsUnexpandedParameterPack()) ||
284 ->containsUnexpandedParameterPack()))),
285 Base(static_cast<
Stmt *>(Base)), IsArrow(isArrow),
286 OperatorLoc(OperatorLoc), QualifierLoc(QualifierLoc),
287 ScopeType(ScopeType), ColonColonLoc(ColonColonLoc), TildeLoc(TildeLoc),
288 DestroyedType(DestroyedType) {}
292 return TInfo->getType();
300 End = TInfo->getTypeLoc().getLocalSourceRange().getEnd();
305 UnresolvedLookupExpr::UnresolvedLookupExpr(
311 :
OverloadExpr(UnresolvedLookupExprClass, Context, QualifierLoc,
312 TemplateKWLoc, NameInfo, TemplateArgs, Begin, End,
false,
314 NamingClass(NamingClass) {
319 UnresolvedLookupExpr::UnresolvedLookupExpr(
EmptyShell Empty,
321 bool HasTemplateKWAndArgsInfo)
322 :
OverloadExpr(UnresolvedLookupExprClass, Empty, NumResults,
323 HasTemplateKWAndArgsInfo) {}
330 unsigned NumResults = End -
Begin;
345 assert(Args || TemplateKWLoc.
isValid());
346 unsigned NumResults = End -
Begin;
347 unsigned NumTemplateArgs = Args ? Args->
size() : 0;
353 TemplateKWLoc, NameInfo, RequiresADL,
354 true, Args, Begin, End);
358 const ASTContext &Context,
unsigned NumResults,
359 bool HasTemplateKWAndArgsInfo,
unsigned NumTemplateArgs) {
360 assert(NumTemplateArgs == 0 || HasTemplateKWAndArgsInfo);
363 NumResults, HasTemplateKWAndArgsInfo, NumTemplateArgs);
376 bool KnownInstantiationDependent,
377 bool KnownContainsUnexpandedParameterPack)
384 (KnownContainsUnexpandedParameterPack ||
386 (QualifierLoc && QualifierLoc.getNestedNameSpecifier()
388 NameInfo(NameInfo), QualifierLoc(QualifierLoc) {
389 unsigned NumResults = End -
Begin;
392 (TemplateArgs != nullptr ) || TemplateKWLoc.
isValid();
397 if ((*I)->getDeclContext()->isDependentContext() ||
398 isa<UnresolvedUsingValueDecl>(*I)) {
401 ExprBits.InstantiationDependent =
true;
415 bool Dependent =
false;
416 bool InstantiationDependent =
false;
417 bool ContainsUnexpandedParameterPack =
false;
420 Dependent, InstantiationDependent, ContainsUnexpandedParameterPack);
426 if (InstantiationDependent)
427 ExprBits.InstantiationDependent =
true;
428 if (ContainsUnexpandedParameterPack)
429 ExprBits.ContainsUnexpandedParameterPack =
true;
430 }
else if (TemplateKWLoc.
isValid()) {
439 bool HasTemplateKWAndArgsInfo)
446 DependentScopeDeclRefExpr::DependentScopeDeclRefExpr(
459 QualifierLoc(QualifierLoc), NameInfo(NameInfo) {
461 (Args !=
nullptr) || TemplateKWLoc.
isValid();
463 bool Dependent =
true;
464 bool InstantiationDependent =
true;
465 bool ContainsUnexpandedParameterPack
466 =
ExprBits.ContainsUnexpandedParameterPack;
467 getTrailingObjects<ASTTemplateKWAndArgsInfo>()->initializeFrom(
468 TemplateKWLoc, *Args, getTrailingObjects<TemplateArgumentLoc>(),
469 Dependent, InstantiationDependent, ContainsUnexpandedParameterPack);
470 ExprBits.ContainsUnexpandedParameterPack = ContainsUnexpandedParameterPack;
471 }
else if (TemplateKWLoc.
isValid()) {
472 getTrailingObjects<ASTTemplateKWAndArgsInfo>()->initializeFrom(
481 assert(QualifierLoc &&
"should be created for dependent qualifiers");
482 bool HasTemplateKWAndArgsInfo = Args || TemplateKWLoc.
isValid();
484 totalSizeToAlloc<ASTTemplateKWAndArgsInfo, TemplateArgumentLoc>(
485 HasTemplateKWAndArgsInfo, Args ? Args->
size() : 0);
488 TemplateKWLoc, NameInfo, Args);
493 bool HasTemplateKWAndArgsInfo,
494 unsigned NumTemplateArgs) {
495 assert(NumTemplateArgs == 0 || HasTemplateKWAndArgsInfo);
497 totalSizeToAlloc<ASTTemplateKWAndArgsInfo, TemplateArgumentLoc>(
498 HasTemplateKWAndArgsInfo, NumTemplateArgs);
504 HasTemplateKWAndArgsInfo;
509 if (isa<CXXTemporaryObjectExpr>(
this))
510 return cast<CXXTemporaryObjectExpr>(
this)->
getBeginLoc();
511 return getLocation();
515 if (isa<CXXTemporaryObjectExpr>(
this))
516 return cast<CXXTemporaryObjectExpr>(
this)->
getEndLoc();
518 if (ParenOrBraceRange.isValid())
519 return ParenOrBraceRange.getEnd();
522 for (
unsigned I = getNumArgs(); I > 0; --I) {
523 const Expr *Arg = getArg(I-1);
542 :
CallExpr(CXXOperatorCallExprClass, Fn, {}, Args, Ty, VK,
543 OperatorLoc, 0, UsesADL) {
548 "OperatorKind overflow!");
550 "FPFeatures overflow!");
551 Range = getSourceRangeImpl();
554 CXXOperatorCallExpr::CXXOperatorCallExpr(
unsigned NumArgs,
EmptyShell Empty)
555 :
CallExpr(CXXOperatorCallExprClass, 0, NumArgs, Empty) {}
562 unsigned NumArgs = Args.size();
563 unsigned SizeOfTrailingObjects =
568 FPFeatures, UsesADL);
575 unsigned SizeOfTrailingObjects =
582 SourceRange CXXOperatorCallExpr::getSourceRangeImpl()
const {
584 if (Kind == OO_PlusPlus || Kind == OO_MinusMinus) {
585 if (getNumArgs() == 1)
591 }
else if (Kind == OO_Arrow) {
592 return getArg(0)->getSourceRange();
593 }
else if (Kind == OO_Call) {
595 }
else if (Kind == OO_Subscript) {
597 }
else if (getNumArgs() == 1) {
599 }
else if (getNumArgs() == 2) {
602 return getOperatorLoc();
609 :
CallExpr(CXXMemberCallExprClass, Fn, {}, Args, Ty, VK, RP,
610 MinNumArgs, NotADL) {}
612 CXXMemberCallExpr::CXXMemberCallExpr(
unsigned NumArgs,
EmptyShell Empty)
613 :
CallExpr(CXXMemberCallExprClass, 0, NumArgs, Empty) {}
619 unsigned MinNumArgs) {
621 unsigned NumArgs = std::max<unsigned>(Args.size(), MinNumArgs);
622 unsigned SizeOfTrailingObjects =
633 unsigned SizeOfTrailingObjects =
642 if (
const auto *MemExpr = dyn_cast<MemberExpr>(Callee))
643 return MemExpr->getBase();
644 if (
const auto *BO = dyn_cast<BinaryOperator>(Callee))
645 if (BO->getOpcode() == BO_PtrMemD || BO->getOpcode() == BO_PtrMemI)
653 if (
const auto *MemExpr = dyn_cast<MemberExpr>(getCallee()->
IgnoreParens()))
654 return cast<CXXMethodDecl>(MemExpr->getMemberDecl());
661 Expr* ThisArg = getImplicitObjectArgument();
680 case CXXStaticCastExprClass:
return "static_cast";
681 case CXXDynamicCastExprClass:
return "dynamic_cast";
682 case CXXReinterpretCastExprClass:
return "reinterpret_cast";
683 case CXXConstCastExprClass:
return "const_cast";
684 default:
return "<invalid cast>";
696 unsigned PathSize = (BasePath ? BasePath->size() : 0);
697 void *Buffer = C.
Allocate(totalSizeToAlloc<CXXBaseSpecifier *>(PathSize));
700 RParenLoc, AngleBrackets);
702 std::uninitialized_copy_n(BasePath->data(), BasePath->size(),
709 void *Buffer = C.
Allocate(totalSizeToAlloc<CXXBaseSpecifier *>(PathSize));
721 unsigned PathSize = (BasePath ? BasePath->size() : 0);
722 void *Buffer = C.
Allocate(totalSizeToAlloc<CXXBaseSpecifier *>(PathSize));
725 RParenLoc, AngleBrackets);
727 std::uninitialized_copy_n(BasePath->data(), BasePath->size(),
734 void *Buffer = C.
Allocate(totalSizeToAlloc<CXXBaseSpecifier *>(PathSize));
748 QualType SrcType = getSubExpr()->getType();
762 if (!SrcRD->hasAttr<FinalAttr>())
768 return !DestRD->isDerivedFrom(SrcRD);
778 unsigned PathSize = (BasePath ? BasePath->size() : 0);
779 void *Buffer = C.
Allocate(totalSizeToAlloc<CXXBaseSpecifier *>(PathSize));
782 RParenLoc, AngleBrackets);
784 std::uninitialized_copy_n(BasePath->data(), BasePath->size(),
791 void *Buffer = C.
Allocate(totalSizeToAlloc<CXXBaseSpecifier *>(PathSize));
801 return new (
C)
CXXConstCastExpr(T, VK, Op, WrittenTy, L, RParenLoc, AngleBrackets);
813 unsigned PathSize = (BasePath ? BasePath->size() : 0);
814 void *Buffer = C.
Allocate(totalSizeToAlloc<CXXBaseSpecifier *>(PathSize));
818 std::uninitialized_copy_n(BasePath->data(), BasePath->size(),
825 void *Buffer = C.
Allocate(totalSizeToAlloc<CXXBaseSpecifier *>(PathSize));
830 return getTypeInfoAsWritten()->getTypeLoc().getBeginLoc();
834 return RParenLoc.
isValid() ? RParenLoc : getSubExpr()->getEndLoc();
841 :
CallExpr(UserDefinedLiteralClass, Fn, {}, Args, Ty, VK,
842 LitEndLoc, 0, NotADL),
843 UDSuffixLoc(SuffixLoc) {}
845 UserDefinedLiteral::UserDefinedLiteral(
unsigned NumArgs,
EmptyShell Empty)
846 :
CallExpr(UserDefinedLiteralClass, 0, NumArgs, Empty) {}
854 unsigned NumArgs = Args.size();
855 unsigned SizeOfTrailingObjects =
866 unsigned SizeOfTrailingObjects =
875 if (getNumArgs() == 0)
877 if (getNumArgs() == 2)
880 assert(getNumArgs() == 1 &&
"unexpected #args in literal operator call");
882 cast<FunctionDecl>(getCalleeDecl())->getParamDecl(0)->getType();
886 return LOK_Character;
892 llvm_unreachable(
"unknown kind of literal operator");
898 assert(LOK != LOK_Template && LOK != LOK_Raw &&
"not a cooked literal");
904 return cast<FunctionDecl>(getCalleeDecl())->getLiteralIdentifier();
929 "Expression bound to a temporary must have record or array type!");
934 CXXTemporaryObjectExpr::CXXTemporaryObjectExpr(
937 bool HadMultipleCandidates,
bool ListInitialization,
938 bool StdInitListInitialization,
bool ZeroInitialization)
941 Cons,
false, Args, HadMultipleCandidates,
942 ListInitialization, StdInitListInitialization, ZeroInitialization,
946 CXXTemporaryObjectExpr::CXXTemporaryObjectExpr(
EmptyShell Empty,
953 bool HadMultipleCandidates,
bool ListInitialization,
954 bool StdInitListInitialization,
bool ZeroInitialization) {
955 unsigned SizeOfTrailingObjects = sizeOfTrailingObjects(Args.size());
960 Cons, Ty, TSI, Args, ParenOrBraceRange, HadMultipleCandidates,
961 ListInitialization, StdInitListInitialization, ZeroInitialization);
966 unsigned SizeOfTrailingObjects = sizeOfTrailingObjects(NumArgs);
974 return getTypeSourceInfo()->getTypeLoc().getBeginLoc();
980 Loc = getArg(getNumArgs() - 1)->
getEndLoc();
987 bool HadMultipleCandidates,
bool ListInitialization,
988 bool StdInitListInitialization,
bool ZeroInitialization,
990 unsigned SizeOfTrailingObjects = sizeOfTrailingObjects(Args.size());
994 CXXConstructExprClass, Ty, Loc, Ctor, Elidable, Args,
995 HadMultipleCandidates, ListInitialization, StdInitListInitialization,
996 ZeroInitialization, ConstructKind, ParenOrBraceRange);
1001 unsigned SizeOfTrailingObjects = sizeOfTrailingObjects(NumArgs);
1011 bool ListInitialization,
bool StdInitListInitialization,
1015 Ty->isDependentType(), Ty->isInstantiationDependentType(),
1017 Constructor(Ctor), ParenOrBraceRange(ParenOrBraceRange),
1018 NumArgs(Args.size()) {
1027 Stmt **TrailingArgs = getTrailingArgs();
1028 for (
unsigned I = 0, N = Args.size(); I != N; ++I) {
1029 assert(Args[I] &&
"NULL argument in CXXConstructExpr!");
1034 ExprBits.InstantiationDependent =
true;
1036 ExprBits.ContainsUnexpandedParameterPack =
true;
1038 TrailingArgs[I] = Args[I];
1044 :
Expr(SC, Empty), NumArgs(NumArgs) {}
1049 : DeclAndBits(Var, 0), Loc(Loc), EllipsisLoc(EllipsisLoc) {
1052 Bits |= Capture_Implicit;
1056 Bits |= Capture_ByCopy;
1059 assert(!Var &&
"'this' capture cannot have a variable!");
1060 Bits |= Capture_This;
1064 Bits |= Capture_ByCopy;
1067 assert(Var &&
"capture must have a variable!");
1070 assert(!Var &&
"VLA type capture cannot have a variable!");
1073 DeclAndBits.setInt(Bits);
1079 bool CapByCopy = DeclAndBits.getInt() & Capture_ByCopy;
1091 bool ContainsUnexpandedParameterPack)
1094 ContainsUnexpandedParameterPack),
1095 IntroducerRange(IntroducerRange), CaptureDefaultLoc(CaptureDefaultLoc),
1096 NumCaptures(Captures.size()), CaptureDefault(CaptureDefault),
1097 ExplicitParams(ExplicitParams), ExplicitResultType(ExplicitResultType),
1098 ClosingBrace(ClosingBrace) {
1099 assert(CaptureInits.size() == Captures.size() &&
"Wrong number of arguments");
1101 CXXRecordDecl::LambdaDefinitionData &Data = Class->getLambdaData();
1106 const ASTContext &Context = Class->getASTContext();
1107 Data.NumCaptures = NumCaptures;
1108 Data.NumExplicitCaptures = 0;
1112 for (
unsigned I = 0, N = Captures.size(); I != N; ++I) {
1114 ++Data.NumExplicitCaptures;
1116 *ToCapture++ = Captures[I];
1120 Stmt **Stored = getStoredStmts();
1121 for (
unsigned I = 0, N = CaptureInits.size(); I != N; ++I)
1122 *Stored++ = CaptureInits[I];
1125 *Stored++ = getCallOperator()->getBody();
1132 bool ExplicitParams,
bool ExplicitResultType,
ArrayRef<Expr *> CaptureInits,
1133 SourceLocation ClosingBrace,
bool ContainsUnexpandedParameterPack) {
1138 unsigned Size = totalSizeToAlloc<Stmt *>(Captures.size() + 1);
1139 void *Mem = Context.
Allocate(Size);
1141 LambdaExpr(T, IntroducerRange, CaptureDefault, CaptureDefaultLoc,
1142 Captures, ExplicitParams, ExplicitResultType, CaptureInits,
1143 ClosingBrace, ContainsUnexpandedParameterPack);
1147 unsigned NumCaptures) {
1148 unsigned Size = totalSizeToAlloc<Stmt *>(NumCaptures + 1);
1159 return getLambdaClass()->getLambdaData().Captures;
1163 return capture_begin() + NumCaptures;
1171 return capture_begin();
1175 struct CXXRecordDecl::LambdaDefinitionData &Data
1176 = getLambdaClass()->getLambdaData();
1177 return Data.Captures + Data.NumExplicitCaptures;
1181 return capture_range(explicit_capture_begin(), explicit_capture_end());
1185 return explicit_capture_end();
1189 return capture_end();
1193 return capture_range(implicit_capture_begin(), implicit_capture_end());
1197 return getType()->getAsCXXRecordDecl();
1215 if (!getStoredStmts()[NumCaptures])
1216 *
const_cast<Stmt **
>(&getStoredStmts()[NumCaptures]) =
1217 getCallOperator()->getBody();
1219 return static_cast<CompoundStmt *
>(getStoredStmts()[NumCaptures]);
1223 return !getCallOperator()->isConst();
1226 ExprWithCleanups::ExprWithCleanups(
Expr *subexpr,
1227 bool CleanupsHaveSideEffects,
1229 :
FullExpr(ExprWithCleanupsClass, subexpr) {
1230 ExprWithCleanupsBits.CleanupsHaveSideEffects = CleanupsHaveSideEffects;
1231 ExprWithCleanupsBits.NumObjects = objects.size();
1232 for (
unsigned i = 0, e = objects.size(); i != e; ++i)
1233 getTrailingObjects<CleanupObject>()[i] = objects[i];
1237 bool CleanupsHaveSideEffects,
1239 void *buffer = C.
Allocate(totalSizeToAlloc<CleanupObject>(objects.size()),
1245 ExprWithCleanups::ExprWithCleanups(
EmptyShell empty,
unsigned numObjects)
1246 :
FullExpr(ExprWithCleanupsClass, empty) {
1247 ExprWithCleanupsBits.NumObjects = numObjects;
1252 unsigned numObjects) {
1253 void *buffer = C.
Allocate(totalSizeToAlloc<CleanupObject>(numObjects),
1258 CXXUnresolvedConstructExpr::CXXUnresolvedConstructExpr(
TypeSourceInfo *TSI,
1262 :
Expr(CXXUnresolvedConstructExprClass,
1272 TSI(TSI), LParenLoc(LParenLoc), RParenLoc(RParenLoc) {
1273 CXXUnresolvedConstructExprBits.NumArgs = Args.size();
1274 auto **StoredArgs = getTrailingObjects<Expr *>();
1275 for (
unsigned I = 0; I != Args.size(); ++I) {
1276 if (Args[I]->containsUnexpandedParameterPack())
1277 ExprBits.ContainsUnexpandedParameterPack =
true;
1279 StoredArgs[I] = Args[I];
1286 void *Mem = Context.
Allocate(totalSizeToAlloc<Expr *>(Args.size()));
1293 void *Mem = Context.
Allocate(totalSizeToAlloc<Expr *>(NumArgs));
1301 CXXDependentScopeMemberExpr::CXXDependentScopeMemberExpr(
1313 Base(Base), BaseType(BaseType), QualifierLoc(QualifierLoc),
1314 MemberNameInfo(MemberNameInfo) {
1315 CXXDependentScopeMemberExprBits.IsArrow = IsArrow;
1316 CXXDependentScopeMemberExprBits.HasTemplateKWAndArgsInfo =
1317 (TemplateArgs !=
nullptr) || TemplateKWLoc.
isValid();
1318 CXXDependentScopeMemberExprBits.HasFirstQualifierFoundInScope =
1319 FirstQualifierFoundInScope !=
nullptr;
1320 CXXDependentScopeMemberExprBits.OperatorLoc = OperatorLoc;
1323 bool Dependent =
true;
1324 bool InstantiationDependent =
true;
1325 bool ContainsUnexpandedParameterPack =
false;
1326 getTrailingObjects<ASTTemplateKWAndArgsInfo>()->initializeFrom(
1327 TemplateKWLoc, *TemplateArgs, getTrailingObjects<TemplateArgumentLoc>(),
1328 Dependent, InstantiationDependent, ContainsUnexpandedParameterPack);
1329 if (ContainsUnexpandedParameterPack)
1330 ExprBits.ContainsUnexpandedParameterPack =
true;
1331 }
else if (TemplateKWLoc.
isValid()) {
1332 getTrailingObjects<ASTTemplateKWAndArgsInfo>()->initializeFrom(
1336 if (hasFirstQualifierFoundInScope())
1337 *getTrailingObjects<NamedDecl *>() = FirstQualifierFoundInScope;
1340 CXXDependentScopeMemberExpr::CXXDependentScopeMemberExpr(
1341 EmptyShell Empty,
bool HasTemplateKWAndArgsInfo,
1342 bool HasFirstQualifierFoundInScope)
1343 :
Expr(CXXDependentScopeMemberExprClass, Empty) {
1344 CXXDependentScopeMemberExprBits.HasTemplateKWAndArgsInfo =
1345 HasTemplateKWAndArgsInfo;
1346 CXXDependentScopeMemberExprBits.HasFirstQualifierFoundInScope =
1347 HasFirstQualifierFoundInScope;
1356 bool HasTemplateKWAndArgsInfo =
1357 (TemplateArgs !=
nullptr) || TemplateKWLoc.
isValid();
1358 unsigned NumTemplateArgs = TemplateArgs ? TemplateArgs->
size() : 0;
1359 bool HasFirstQualifierFoundInScope = FirstQualifierFoundInScope !=
nullptr;
1363 HasTemplateKWAndArgsInfo, NumTemplateArgs, HasFirstQualifierFoundInScope);
1367 Ctx, Base, BaseType, IsArrow, OperatorLoc, QualifierLoc, TemplateKWLoc,
1368 FirstQualifierFoundInScope, MemberNameInfo, TemplateArgs);
1372 const ASTContext &Ctx,
bool HasTemplateKWAndArgsInfo,
1373 unsigned NumTemplateArgs,
bool HasFirstQualifierFoundInScope) {
1374 assert(NumTemplateArgs == 0 || HasTemplateKWAndArgsInfo);
1378 HasTemplateKWAndArgsInfo, NumTemplateArgs, HasFirstQualifierFoundInScope);
1382 EmptyShell(), HasTemplateKWAndArgsInfo, HasFirstQualifierFoundInScope);
1389 if (isa<UnresolvedUsingValueDecl>(decl))
1397 }
while (++begin != end);
1402 UnresolvedMemberExpr::UnresolvedMemberExpr(
1410 UnresolvedMemberExprClass, Context, QualifierLoc, TemplateKWLoc,
1411 MemberNameInfo, TemplateArgs, Begin, End,
1419 Base(Base), BaseType(BaseType), OperatorLoc(OperatorLoc) {
1420 UnresolvedMemberExprBits.IsArrow = IsArrow;
1421 UnresolvedMemberExprBits.HasUnresolvedUsing = HasUnresolvedUsing;
1429 UnresolvedMemberExpr::UnresolvedMemberExpr(EmptyShell Empty,
1430 unsigned NumResults,
1431 bool HasTemplateKWAndArgsInfo)
1432 :
OverloadExpr(UnresolvedMemberExprClass, Empty, NumResults,
1433 HasTemplateKWAndArgsInfo) {}
1439 return cast<Expr>(Base)->isImplicitCXXThis();
1449 unsigned NumResults = End -
Begin;
1450 bool HasTemplateKWAndArgsInfo = TemplateArgs || TemplateKWLoc.
isValid();
1451 unsigned NumTemplateArgs = TemplateArgs ? TemplateArgs->
size() : 0;
1454 NumResults, HasTemplateKWAndArgsInfo, NumTemplateArgs);
1457 Context, HasUnresolvedUsing, Base, BaseType, IsArrow, OperatorLoc,
1458 QualifierLoc, TemplateKWLoc, MemberNameInfo, TemplateArgs, Begin, End);
1462 const ASTContext &Context,
unsigned NumResults,
1463 bool HasTemplateKWAndArgsInfo,
unsigned NumTemplateArgs) {
1464 assert(NumTemplateArgs == 0 || HasTemplateKWAndArgsInfo);
1467 NumResults, HasTemplateKWAndArgsInfo, NumTemplateArgs);
1480 auto *NNS = getQualifier();
1482 const Type *T = getQualifier()->getAsType();
1483 assert(T &&
"qualifier in member expression does not name type");
1485 assert(Record &&
"qualifier in member expression does not name record");
1492 assert(PT &&
"base of arrow member access is not pointer");
1497 assert(Record &&
"base of member expression does not name record");
1510 Context.
Allocate(totalSizeToAlloc<TemplateArgument>(PartialArgs.size()));
1512 PackLoc, RParenLoc, Length, PartialArgs);
1516 unsigned NumPartialArgs) {
1518 Context.
Allocate(totalSizeToAlloc<TemplateArgument>(NumPartialArgs));
1522 SubstNonTypeTemplateParmPackExpr::
1528 :
Expr(SubstNonTypeTemplateParmPackExprClass, T, ValueKind,
OK_Ordinary,
1530 Param(Param), Arguments(ArgPack.pack_begin()),
1531 NumArguments(ArgPack.pack_size()), NameLoc(NameLoc) {}
1543 ParamPack(ParamPack), NameLoc(NameLoc), NumParameters(NumParams) {
1545 std::uninitialized_copy(Params, Params + NumParams,
1546 getTrailingObjects<ParmVarDecl *>());
1553 return new (Context.
Allocate(totalSizeToAlloc<ParmVarDecl *>(Params.size())))
1559 unsigned NumParams) {
1560 return new (Context.
Allocate(totalSizeToAlloc<ParmVarDecl *>(NumParams)))
1565 unsigned ManglingNumber) {
1572 if (!
State.is<ExtraState *>()) {
1578 auto ES =
State.get<ExtraState *>();
1579 ES->ExtendingDecl = ExtendedBy;
1580 ES->ManglingNumber = ManglingNumber;
1592 Loc(Loc), RParenLoc(RParenLoc) {
1597 auto **ToArgs = getTrailingObjects<TypeSourceInfo *>();
1599 for (
unsigned I = 0, N = Args.size(); I != N; ++I) {
1607 ToArgs[I] = Args[I];
1617 void *Mem = C.
Allocate(totalSizeToAlloc<TypeSourceInfo *>(Args.size()));
1618 return new (Mem)
TypeTraitExpr(T, Loc, Kind, Args, RParenLoc, Value);
1623 void *Mem = C.
Allocate(totalSizeToAlloc<TypeSourceInfo *>(NumArgs));
1627 CUDAKernelCallExpr::CUDAKernelCallExpr(
Expr *Fn,
CallExpr *Config,
1630 unsigned MinNumArgs)
1631 :
CallExpr(CUDAKernelCallExprClass, Fn, Config, Args, Ty, VK,
1632 RP, MinNumArgs, NotADL) {}
1634 CUDAKernelCallExpr::CUDAKernelCallExpr(
unsigned NumArgs,
EmptyShell Empty)
1635 :
CallExpr(CUDAKernelCallExprClass, END_PREARG, NumArgs,
1643 unsigned NumArgs = std::max<unsigned>(Args.size(), MinNumArgs);
1644 unsigned SizeOfTrailingObjects =
1655 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.
Expr(StmtClass SC, QualType T, ExprValueKind VK, ExprObjectKind OK, bool TD, bool VD, bool ID, bool ContainsUnexpandedParameterPack)
__SIZE_TYPE__ size_t
The unsigned integer type of the result of the sizeof operator.
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
Retrieves 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.
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
Retrieves 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 ...
Represents a parameter to a function.
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.
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.
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.
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
Retrieves 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 CXXNewExpr * Create(const ASTContext &Ctx, bool IsGlobalNew, FunctionDecl *OperatorNew, FunctionDecl *OperatorDelete, bool ShouldPassAlignment, bool UsualArrayDeleteWantsSize, ArrayRef< Expr *> PlacementArgs, SourceRange TypeIdParens, Expr *ArraySize, InitializationStyle InitializationStyle, Expr *Initializer, QualType Ty, TypeSourceInfo *AllocatedTypeInfo, SourceRange Range, SourceRange DirectInitRange)
Create a c++ new expression.
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)
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 that has been substituted but not yet expanded...
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...
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.
static FunctionParmPackExpr * Create(const ASTContext &Context, QualType T, ParmVarDecl *ParamPack, SourceLocation NameLoc, ArrayRef< ParmVarDecl *> Params)
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...
Expr * IgnoreParens() LLVM_READONLY
IgnoreParens - Ignore parentheses.
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)