21 using namespace clang;
37 if (RD->isPolymorphic() && E->
isGLValue())
44 assert(
isTypeOperand() &&
"Cannot call getTypeOperand for typeid(expr)");
51 assert(
isTypeOperand() &&
"Cannot call getTypeOperand for __uuidof(expr)");
65 bool usualArrayDeleteWantsSize,
73 ty->isDependentType(), ty->isDependentType(),
74 ty->isInstantiationDependentType(),
75 ty->containsUnexpandedParameterPack()),
76 SubExprs(nullptr), OperatorNew(operatorNew), OperatorDelete(operatorDelete),
77 AllocatedTypeInfo(allocatedTypeInfo), TypeIdParens(typeIdParens),
78 Range(Range), DirectInitRange(directInitRange),
79 GlobalNew(globalNew), UsualArrayDeleteWantsSize(usualArrayDeleteWantsSize) {
80 assert((initializer !=
nullptr || initializationStyle ==
NoInit) &&
81 "Only NoInit can have no initializer.");
82 StoredInitializationStyle = initializer ? initializationStyle + 1 : 0;
84 initializer !=
nullptr);
88 ExprBits.InstantiationDependent =
true;
91 ExprBits.ContainsUnexpandedParameterPack =
true;
93 SubExprs[i++] = arraySize;
98 ExprBits.InstantiationDependent =
true;
101 ExprBits.ContainsUnexpandedParameterPack =
true;
103 SubExprs[i++] = initializer;
106 for (
unsigned j = 0; j != placementArgs.size(); ++j) {
108 ExprBits.InstantiationDependent =
true;
110 ExprBits.ContainsUnexpandedParameterPack =
true;
112 SubExprs[i++] = placementArgs[j];
128 unsigned numPlaceArgs,
bool hasInitializer){
129 assert(SubExprs ==
nullptr &&
"SubExprs already allocated");
131 NumPlacementArgs = numPlaceArgs;
133 unsigned TotalSize = Array + hasInitializer + NumPlacementArgs;
134 SubExprs =
new (C)
Stmt*[TotalSize];
167 :
Expr(CXXPseudoDestructorExprClass,
168 Context.BoundMemberTy,
170 (Base->isTypeDependent() ||
171 (DestroyedType.getTypeSourceInfo() &&
172 DestroyedType.getTypeSourceInfo()->getType()->isDependentType())),
173 Base->isValueDependent(),
174 (Base->isInstantiationDependent() ||
176 QualifierLoc.getNestedNameSpecifier()->isInstantiationDependent()) ||
178 ScopeType->getType()->isInstantiationDependentType()) ||
179 (DestroyedType.getTypeSourceInfo() &&
180 DestroyedType.getTypeSourceInfo()->getType()
181 ->isInstantiationDependentType())),
183 (Base->containsUnexpandedParameterPack() ||
185 QualifierLoc.getNestedNameSpecifier()
186 ->containsUnexpandedParameterPack()) ||
188 ScopeType->getType()->containsUnexpandedParameterPack()) ||
189 (DestroyedType.getTypeSourceInfo() &&
190 DestroyedType.getTypeSourceInfo()->getType()
191 ->containsUnexpandedParameterPack()))),
192 Base(static_cast<
Stmt *>(Base)), IsArrow(isArrow),
193 OperatorLoc(OperatorLoc), QualifierLoc(QualifierLoc),
194 ScopeType(ScopeType), ColonColonLoc(ColonColonLoc), TildeLoc(TildeLoc),
195 DestroyedType(DestroyedType) { }
199 return TInfo->getType();
207 End = TInfo->getTypeLoc().getLocalSourceRange().getEnd();
223 assert(Args || TemplateKWLoc.
isValid());
224 unsigned num_args = Args ? Args->
size() : 0;
227 totalSizeToAlloc<ASTTemplateKWAndArgsInfo, TemplateArgumentLoc>(1,
229 void *Mem = C.
Allocate(Size, llvm::alignOf<UnresolvedLookupExpr>());
231 TemplateKWLoc, NameInfo,
238 bool HasTemplateKWAndArgsInfo,
239 unsigned NumTemplateArgs) {
240 assert(NumTemplateArgs == 0 || HasTemplateKWAndArgsInfo);
242 totalSizeToAlloc<ASTTemplateKWAndArgsInfo, TemplateArgumentLoc>(
244 void *Mem = C.
Allocate(Size, llvm::alignOf<UnresolvedLookupExpr>());
258 bool KnownInstantiationDependent,
259 bool KnownContainsUnexpandedParameterPack)
262 (KnownInstantiationDependent ||
263 NameInfo.isInstantiationDependent() ||
265 QualifierLoc.getNestedNameSpecifier()->isInstantiationDependent())),
266 (KnownContainsUnexpandedParameterPack ||
267 NameInfo.containsUnexpandedParameterPack() ||
269 QualifierLoc.getNestedNameSpecifier()
270 ->containsUnexpandedParameterPack()))),
271 NameInfo(NameInfo), QualifierLoc(QualifierLoc),
272 Results(nullptr), NumResults(End - Begin),
273 HasTemplateKWAndArgsInfo(TemplateArgs != nullptr ||
274 TemplateKWLoc.isValid()) {
275 NumResults = End - Begin;
279 if ((*I)->getDeclContext()->isDependentContext() ||
280 isa<UnresolvedUsingValueDecl>(*I)) {
281 ExprBits.TypeDependent =
true;
282 ExprBits.ValueDependent =
true;
283 ExprBits.InstantiationDependent =
true;
289 llvm::alignOf<DeclAccessPair>()));
297 bool Dependent =
false;
298 bool InstantiationDependent =
false;
299 bool ContainsUnexpandedParameterPack =
false;
302 Dependent, InstantiationDependent, ContainsUnexpandedParameterPack);
305 ExprBits.TypeDependent =
true;
306 ExprBits.ValueDependent =
true;
308 if (InstantiationDependent)
309 ExprBits.InstantiationDependent =
true;
310 if (ContainsUnexpandedParameterPack)
311 ExprBits.ContainsUnexpandedParameterPack =
true;
312 }
else if (TemplateKWLoc.
isValid()) {
323 assert(!Results &&
"Results already initialized!");
324 NumResults = End - Begin;
329 llvm::alignOf<DeclAccessPair>()));
335 if (isa<UnresolvedLookupExpr>(
this))
342 DependentScopeDeclRefExpr::DependentScopeDeclRefExpr(
QualType T,
349 (NameInfo.isInstantiationDependent() ||
351 QualifierLoc.getNestedNameSpecifier()->isInstantiationDependent())),
352 (NameInfo.containsUnexpandedParameterPack() ||
354 QualifierLoc.getNestedNameSpecifier()
355 ->containsUnexpandedParameterPack()))),
356 QualifierLoc(QualifierLoc), NameInfo(NameInfo),
357 HasTemplateKWAndArgsInfo(Args != nullptr || TemplateKWLoc.isValid())
360 bool Dependent =
true;
361 bool InstantiationDependent =
true;
362 bool ContainsUnexpandedParameterPack
363 = ExprBits.ContainsUnexpandedParameterPack;
364 getTrailingObjects<ASTTemplateKWAndArgsInfo>()->initializeFrom(
365 TemplateKWLoc, *Args, getTrailingObjects<TemplateArgumentLoc>(),
366 Dependent, InstantiationDependent, ContainsUnexpandedParameterPack);
367 ExprBits.ContainsUnexpandedParameterPack = ContainsUnexpandedParameterPack;
368 }
else if (TemplateKWLoc.
isValid()) {
369 getTrailingObjects<ASTTemplateKWAndArgsInfo>()->initializeFrom(
380 assert(QualifierLoc &&
"should be created for dependent qualifiers");
381 bool HasTemplateKWAndArgsInfo = Args || TemplateKWLoc.
isValid();
383 totalSizeToAlloc<ASTTemplateKWAndArgsInfo, TemplateArgumentLoc>(
384 HasTemplateKWAndArgsInfo, Args ? Args->
size() : 0);
387 TemplateKWLoc, NameInfo, Args);
392 bool HasTemplateKWAndArgsInfo,
393 unsigned NumTemplateArgs) {
394 assert(NumTemplateArgs == 0 || HasTemplateKWAndArgsInfo);
396 totalSizeToAlloc<ASTTemplateKWAndArgsInfo, TemplateArgumentLoc>(
397 HasTemplateKWAndArgsInfo, NumTemplateArgs);
403 E->HasTemplateKWAndArgsInfo = HasTemplateKWAndArgsInfo;
408 if (isa<CXXTemporaryObjectExpr>(
this))
409 return cast<CXXTemporaryObjectExpr>(
this)->
getLocStart();
414 if (isa<CXXTemporaryObjectExpr>(
this))
415 return cast<CXXTemporaryObjectExpr>(
this)->
getLocEnd();
417 if (ParenOrBraceRange.
isValid())
418 return ParenOrBraceRange.
getEnd();
435 SourceRange CXXOperatorCallExpr::getSourceRangeImpl()
const {
437 if (Kind == OO_PlusPlus || Kind == OO_MinusMinus) {
444 }
else if (Kind == OO_Arrow) {
445 return getArg(0)->getSourceRange();
446 }
else if (Kind == OO_Call) {
448 }
else if (Kind == OO_Subscript) {
461 if (
const MemberExpr *MemExpr = dyn_cast<MemberExpr>(Callee))
462 return MemExpr->getBase();
464 if (BO->getOpcode() == BO_PtrMemD || BO->getOpcode() == BO_PtrMemI)
474 return cast<CXXMethodDecl>(MemExpr->getMemberDecl());
501 switch (getStmtClass()) {
502 case CXXStaticCastExprClass:
return "static_cast";
503 case CXXDynamicCastExprClass:
return "dynamic_cast";
504 case CXXReinterpretCastExprClass:
return "reinterpret_cast";
505 case CXXConstCastExprClass:
return "const_cast";
506 default:
return "<invalid cast>";
518 unsigned PathSize = (BasePath ? BasePath->size() : 0);
519 void *
Buffer = C.
Allocate(totalSizeToAlloc<CXXBaseSpecifier *>(PathSize));
522 RParenLoc, AngleBrackets);
524 std::uninitialized_copy_n(BasePath->data(), BasePath->size(),
531 void *
Buffer = C.
Allocate(totalSizeToAlloc<CXXBaseSpecifier *>(PathSize));
543 unsigned PathSize = (BasePath ? BasePath->size() : 0);
544 void *
Buffer = C.
Allocate(totalSizeToAlloc<CXXBaseSpecifier *>(PathSize));
547 RParenLoc, AngleBrackets);
549 std::uninitialized_copy_n(BasePath->data(), BasePath->size(),
556 void *
Buffer = C.
Allocate(totalSizeToAlloc<CXXBaseSpecifier *>(PathSize));
584 if (!SrcRD->hasAttr<FinalAttr>())
600 unsigned PathSize = (BasePath ? BasePath->size() : 0);
601 void *
Buffer = C.
Allocate(totalSizeToAlloc<CXXBaseSpecifier *>(PathSize));
604 RParenLoc, AngleBrackets);
606 std::uninitialized_copy_n(BasePath->data(), BasePath->size(),
613 void *
Buffer = C.
Allocate(totalSizeToAlloc<CXXBaseSpecifier *>(PathSize));
623 return new (C)
CXXConstCastExpr(T, VK, Op, WrittenTy, L, RParenLoc, AngleBrackets);
635 unsigned PathSize = (BasePath ? BasePath->size() : 0);
636 void *
Buffer = C.
Allocate(totalSizeToAlloc<CXXBaseSpecifier *>(PathSize));
640 std::uninitialized_copy_n(BasePath->data(), BasePath->size(),
647 void *
Buffer = C.
Allocate(totalSizeToAlloc<CXXBaseSpecifier *>(PathSize));
666 assert(
getNumArgs() == 1 &&
"unexpected #args in literal operator call");
668 cast<FunctionDecl>(
getCalleeDecl())->getParamDecl(0)->getType();
678 llvm_unreachable(
"unknown kind of literal operator");
690 return cast<FunctionDecl>(
getCalleeDecl())->getLiteralIdentifier();
695 :
Expr(CXXDefaultInitExprClass, T.getNonLValueExprType(C),
696 T->isLValueReferenceType() ?
VK_LValue : T->isRValueReferenceType()
700 Field(Field), Loc(Loc) {
714 "Expression bound to a temporary must have record or array type!");
724 bool HadMultipleCandidates,
725 bool ListInitialization,
726 bool StdInitListInitialization,
727 bool ZeroInitialization)
729 Type->getType().getNonReferenceType(),
730 Type->getTypeLoc().getBeginLoc(),
732 HadMultipleCandidates,
734 StdInitListInitialization,
741 return Type->getTypeLoc().getBeginLoc();
756 bool HadMultipleCandidates,
757 bool ListInitialization,
758 bool StdInitListInitialization,
759 bool ZeroInitialization,
763 Ctor, Elidable, Args,
764 HadMultipleCandidates, ListInitialization,
765 StdInitListInitialization,
766 ZeroInitialization, ConstructKind,
775 bool HadMultipleCandidates,
776 bool ListInitialization,
777 bool StdInitListInitialization,
778 bool ZeroInitialization,
782 T->isDependentType(), T->isDependentType(),
783 T->isInstantiationDependentType(),
784 T->containsUnexpandedParameterPack()),
785 Constructor(Ctor), Loc(Loc), ParenOrBraceRange(ParenOrBraceRange),
787 Elidable(Elidable), HadMultipleCandidates(HadMultipleCandidates),
788 ListInitialization(ListInitialization),
789 StdInitListInitialization(StdInitListInitialization),
790 ZeroInitialization(ZeroInitialization),
791 ConstructKind(ConstructKind), Args(nullptr)
794 this->Args =
new (C)
Stmt*[Args.size()];
796 for (
unsigned i = 0; i != Args.size(); ++i) {
797 assert(Args[i] &&
"NULL argument in CXXConstructExpr");
800 ExprBits.ValueDependent =
true;
802 ExprBits.InstantiationDependent =
true;
804 ExprBits.ContainsUnexpandedParameterPack =
true;
806 this->Args[i] = Args[i];
814 : DeclAndBits(Var, 0), Loc(Loc), EllipsisLoc(EllipsisLoc)
818 Bits |= Capture_Implicit;
822 Bits |= Capture_ByCopy;
825 assert(!Var &&
"'this' capture cannot have a variable!");
826 Bits |= Capture_This;
830 Bits |= Capture_ByCopy;
833 assert(Var &&
"capture must have a variable!");
836 assert(!Var &&
"VLA type capture cannot have a variable!");
839 DeclAndBits.setInt(Bits);
845 bool CapByCopy = DeclAndBits.getInt() & Capture_ByCopy;
859 bool ContainsUnexpandedParameterPack)
861 T->isDependentType(), T->isDependentType(),
862 ContainsUnexpandedParameterPack),
863 IntroducerRange(IntroducerRange), CaptureDefaultLoc(CaptureDefaultLoc),
864 NumCaptures(Captures.size()), CaptureDefault(CaptureDefault),
865 ExplicitParams(ExplicitParams), ExplicitResultType(ExplicitResultType),
866 ClosingBrace(ClosingBrace) {
867 assert(CaptureInits.size() == Captures.size() &&
"Wrong number of arguments");
869 CXXRecordDecl::LambdaDefinitionData &Data = Class->getLambdaData();
875 Data.NumCaptures = NumCaptures;
876 Data.NumExplicitCaptures = 0;
880 for (
unsigned I = 0, N = Captures.size();
I != N; ++
I) {
882 ++Data.NumExplicitCaptures;
884 *ToCapture++ = Captures[
I];
888 Stmt **Stored = getStoredStmts();
889 for (
unsigned I = 0, N = CaptureInits.size();
I != N; ++
I)
890 *Stored++ = CaptureInits[
I];
893 *Stored++ = getCallOperator()->getBody();
896 HasArrayIndexVars = !ArrayIndexVars.empty();
897 if (HasArrayIndexVars) {
898 assert(ArrayIndexStarts.size() == NumCaptures);
899 memcpy(getArrayIndexVars(), ArrayIndexVars.data(),
900 sizeof(
VarDecl *) * ArrayIndexVars.size());
901 memcpy(getArrayIndexStarts(), ArrayIndexStarts.data(),
902 sizeof(
unsigned) * Captures.size());
903 getArrayIndexStarts()[Captures.size()] = ArrayIndexVars.size();
911 bool ExplicitParams,
bool ExplicitResultType,
ArrayRef<Expr *> CaptureInits,
913 SourceLocation ClosingBrace,
bool ContainsUnexpandedParameterPack) {
918 unsigned Size = totalSizeToAlloc<Stmt *, unsigned, VarDecl *>(
919 Captures.size() + 1, ArrayIndexVars.empty() ? 0 : Captures.size() + 1,
920 ArrayIndexVars.size());
922 return new (Mem)
LambdaExpr(T, IntroducerRange,
923 CaptureDefault, CaptureDefaultLoc, Captures,
924 ExplicitParams, ExplicitResultType,
925 CaptureInits, ArrayIndexVars, ArrayIndexStarts,
926 ClosingBrace, ContainsUnexpandedParameterPack);
930 unsigned NumCaptures,
931 unsigned NumArrayIndexVars) {
932 unsigned Size = totalSizeToAlloc<Stmt *, unsigned, VarDecl *>(
933 NumCaptures + 1, NumArrayIndexVars ? NumCaptures + 1 : 0,
936 return new (Mem)
LambdaExpr(EmptyShell(), NumCaptures, NumArrayIndexVars > 0);
961 struct CXXRecordDecl::LambdaDefinitionData &Data
963 return Data.Captures + Data.NumExplicitCaptures;
984 assert(HasArrayIndexVars &&
"No array index-var data?");
988 "Capture index out-of-range");
989 VarDecl *
const *IndexVars = getArrayIndexVars();
990 const unsigned *IndexStarts = getArrayIndexStarts();
991 return llvm::makeArrayRef(IndexVars + IndexStarts[Index],
992 IndexVars + IndexStarts[Index + 1]);
1014 if (!getStoredStmts()[NumCaptures])
1015 *
const_cast<clang::Stmt **
>(&getStoredStmts()[NumCaptures]) =
1018 return static_cast<CompoundStmt *
>(getStoredStmts()[NumCaptures]);
1025 ExprWithCleanups::ExprWithCleanups(
Expr *subexpr,
1026 bool CleanupsHaveSideEffects,
1028 :
Expr(ExprWithCleanupsClass, subexpr->getType(),
1029 subexpr->getValueKind(), subexpr->getObjectKind(),
1030 subexpr->isTypeDependent(), subexpr->isValueDependent(),
1031 subexpr->isInstantiationDependent(),
1032 subexpr->containsUnexpandedParameterPack()),
1034 ExprWithCleanupsBits.CleanupsHaveSideEffects = CleanupsHaveSideEffects;
1035 ExprWithCleanupsBits.NumObjects = objects.size();
1036 for (
unsigned i = 0, e = objects.size(); i != e; ++i)
1037 getTrailingObjects<CleanupObject>()[i] = objects[i];
1041 bool CleanupsHaveSideEffects,
1043 void *buffer = C.
Allocate(totalSizeToAlloc<CleanupObject>(objects.size()),
1044 llvm::alignOf<ExprWithCleanups>());
1049 ExprWithCleanups::ExprWithCleanups(EmptyShell empty,
unsigned numObjects)
1050 :
Expr(ExprWithCleanupsClass, empty) {
1051 ExprWithCleanupsBits.NumObjects = numObjects;
1056 unsigned numObjects) {
1057 void *buffer = C.
Allocate(totalSizeToAlloc<CleanupObject>(numObjects),
1058 llvm::alignOf<ExprWithCleanups>());
1066 :
Expr(CXXUnresolvedConstructExprClass,
1067 Type->getType().getNonReferenceType(),
1068 (Type->getType()->isLValueReferenceType() ?
VK_LValue
1069 :Type->getType()->isRValueReferenceType()?
VK_XValue
1072 Type->getType()->isDependentType(),
true,
true,
1073 Type->getType()->containsUnexpandedParameterPack()),
1075 LParenLoc(LParenLoc),
1076 RParenLoc(RParenLoc),
1078 Expr **StoredArgs = getTrailingObjects<Expr *>();
1079 for (
unsigned I = 0;
I != Args.size(); ++
I) {
1081 ExprBits.ContainsUnexpandedParameterPack =
true;
1083 StoredArgs[
I] = Args[
I];
1093 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(Args.size()));
1099 Stmt::EmptyShell Empty;
1100 void *Mem = C.
Allocate(totalSizeToAlloc<Expr *>(NumArgs));
1108 CXXDependentScopeMemberExpr::CXXDependentScopeMemberExpr(
1114 :
Expr(CXXDependentScopeMemberExprClass, C.DependentTy,
VK_LValue,
1116 ((Base && Base->containsUnexpandedParameterPack()) ||
1118 QualifierLoc.getNestedNameSpecifier()
1119 ->containsUnexpandedParameterPack()) ||
1120 MemberNameInfo.containsUnexpandedParameterPack())),
1121 Base(Base), BaseType(BaseType), IsArrow(IsArrow),
1122 HasTemplateKWAndArgsInfo(TemplateArgs != nullptr ||
1123 TemplateKWLoc.isValid()),
1124 OperatorLoc(OperatorLoc), QualifierLoc(QualifierLoc),
1125 FirstQualifierFoundInScope(FirstQualifierFoundInScope),
1126 MemberNameInfo(MemberNameInfo) {
1128 bool Dependent =
true;
1129 bool InstantiationDependent =
true;
1130 bool ContainsUnexpandedParameterPack =
false;
1131 getTrailingObjects<ASTTemplateKWAndArgsInfo>()->initializeFrom(
1132 TemplateKWLoc, *TemplateArgs, getTrailingObjects<TemplateArgumentLoc>(),
1133 Dependent, InstantiationDependent, ContainsUnexpandedParameterPack);
1134 if (ContainsUnexpandedParameterPack)
1135 ExprBits.ContainsUnexpandedParameterPack =
true;
1136 }
else if (TemplateKWLoc.
isValid()) {
1137 getTrailingObjects<ASTTemplateKWAndArgsInfo>()->initializeFrom(
1151 bool HasTemplateKWAndArgsInfo = TemplateArgs || TemplateKWLoc.
isValid();
1152 unsigned NumTemplateArgs = TemplateArgs ? TemplateArgs->
size() : 0;
1154 totalSizeToAlloc<ASTTemplateKWAndArgsInfo, TemplateArgumentLoc>(
1155 HasTemplateKWAndArgsInfo, NumTemplateArgs);
1157 void *Mem = C.
Allocate(Size, llvm::alignOf<CXXDependentScopeMemberExpr>());
1159 IsArrow, OperatorLoc,
1162 FirstQualifierFoundInScope,
1163 MemberNameInfo, TemplateArgs);
1168 bool HasTemplateKWAndArgsInfo,
1169 unsigned NumTemplateArgs) {
1170 assert(NumTemplateArgs == 0 || HasTemplateKWAndArgsInfo);
1172 totalSizeToAlloc<ASTTemplateKWAndArgsInfo, TemplateArgumentLoc>(
1173 HasTemplateKWAndArgsInfo, NumTemplateArgs);
1174 void *Mem = C.
Allocate(Size, llvm::alignOf<CXXDependentScopeMemberExpr>());
1181 E->HasTemplateKWAndArgsInfo = HasTemplateKWAndArgsInfo;
1196 if (isa<UnresolvedUsingValueDecl>(decl))
1204 }
while (++begin != end);
1209 UnresolvedMemberExpr::UnresolvedMemberExpr(
const ASTContext &C,
1210 bool HasUnresolvedUsing,
1220 :
OverloadExpr(UnresolvedMemberExprClass, C, QualifierLoc, TemplateKWLoc,
1221 MemberNameInfo, TemplateArgs, Begin, End,
1223 ((Base && Base->isTypeDependent()) ||
1224 BaseType->isDependentType()),
1225 ((Base && Base->isInstantiationDependent()) ||
1226 BaseType->isInstantiationDependentType()),
1228 ((Base && Base->containsUnexpandedParameterPack()) ||
1229 BaseType->containsUnexpandedParameterPack())),
1230 IsArrow(IsArrow), HasUnresolvedUsing(HasUnresolvedUsing),
1231 Base(Base), BaseType(BaseType), OperatorLoc(OperatorLoc) {
1239 bool UnresolvedMemberExpr::isImplicitAccess()
const {
1255 totalSizeToAlloc<ASTTemplateKWAndArgsInfo, TemplateArgumentLoc>(
1258 void *Mem = C.
Allocate(Size, llvm::alignOf<UnresolvedMemberExpr>());
1260 C, HasUnresolvedUsing, Base, BaseType, IsArrow, OperatorLoc, QualifierLoc,
1261 TemplateKWLoc, MemberNameInfo, TemplateArgs, Begin, End);
1266 bool HasTemplateKWAndArgsInfo,
1267 unsigned NumTemplateArgs) {
1268 assert(NumTemplateArgs == 0 || HasTemplateKWAndArgsInfo);
1270 totalSizeToAlloc<ASTTemplateKWAndArgsInfo, TemplateArgumentLoc>(
1273 void *Mem = C.
Allocate(Size, llvm::alignOf<UnresolvedMemberExpr>());
1289 assert(T &&
"qualifier in member expression does not name type");
1291 assert(Record &&
"qualifier in member expression does not name record");
1298 assert(PT &&
"base of arrow member access is not pointer");
1303 assert(Record &&
"base of member expression does not name record");
1316 Context.
Allocate(totalSizeToAlloc<TemplateArgument>(PartialArgs.size()));
1318 PackLoc, RParenLoc,
Length, PartialArgs);
1322 unsigned NumPartialArgs) {
1324 Context.
Allocate(totalSizeToAlloc<TemplateArgument>(NumPartialArgs));
1325 return new (Storage)
SizeOfPackExpr(EmptyShell(), NumPartialArgs);
1328 SubstNonTypeTemplateParmPackExpr::
1335 Param(Param), Arguments(ArgPack.pack_begin()),
1336 NumArguments(ArgPack.pack_size()), NameLoc(NameLoc) { }
1348 ParamPack(ParamPack), NameLoc(NameLoc), NumParameters(NumParams) {
1350 std::uninitialized_copy(Params, Params + NumParams,
1351 getTrailingObjects<ParmVarDecl *>());
1358 return new (Context.
Allocate(totalSizeToAlloc<ParmVarDecl *>(Params.size())))
1364 unsigned NumParams) {
1365 return new (Context.
Allocate(totalSizeToAlloc<ParmVarDecl *>(NumParams)))
1370 unsigned ManglingNumber) {
1377 if (!
State.is<ExtraState *>()) {
1378 auto ES =
new (ExtendedBy->getASTContext()) ExtraState;
1383 auto ES =
State.get<ExtraState *>();
1384 ES->ExtendingDecl = ExtendedBy;
1385 ES->ManglingNumber = ManglingNumber;
1397 Loc(Loc), RParenLoc(RParenLoc)
1399 TypeTraitExprBits.Kind =
Kind;
1400 TypeTraitExprBits.Value =
Value;
1401 TypeTraitExprBits.NumArgs = Args.size();
1403 TypeSourceInfo **ToArgs = getTrailingObjects<TypeSourceInfo *>();
1405 for (
unsigned I = 0, N = Args.size();
I != N; ++
I) {
1413 ToArgs[
I] = Args[
I];
1423 void *Mem = C.
Allocate(totalSizeToAlloc<TypeSourceInfo *>(Args.size()));
1424 return new (Mem)
TypeTraitExpr(T, Loc, Kind, Args, RParenLoc, Value);
1429 void *Mem = C.
Allocate(totalSizeToAlloc<TypeSourceInfo *>(NumArgs));
1433 void ArrayTypeTraitExpr::anchor() { }
Raw form: operator "" X (const char *)
SourceRange getParenOrBraceRange() const
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.
operator "" X (long double)
CXXNewExpr(const ASTContext &C, bool globalNew, FunctionDecl *operatorNew, FunctionDecl *operatorDelete, bool usualArrayDeleteWantsSize, ArrayRef< Expr * > placementArgs, SourceRange typeIdParens, Expr *arraySize, InitializationStyle initializationStyle, Expr *initializer, QualType ty, TypeSourceInfo *AllocatedTypeInfo, SourceRange Range, SourceRange directInitRange)
SourceLocation getEnd() const
FunctionDecl - An instance of this class is created to represent a function declaration or definition...
bool isDerivedFrom(const CXXRecordDecl *Base) const
Determine whether this class is derived from the class Base.
PointerType - C99 6.7.5.1 - Pointer Declarators.
Stores the type being destroyed by a pseudo-destructor expression.
A (possibly-)qualified type.
bool containsUnexpandedParameterPack() const
Whether this expression contains an unexpanded parameter pack (for C++11 variadic templates)...
Expr * getArg(unsigned Arg)
getArg - Return the specified argument.
__SIZE_TYPE__ size_t
The unsigned integer type of the result of the sizeof operator.
static CXXDependentScopeMemberExpr * Create(const ASTContext &C, Expr *Base, QualType BaseType, bool IsArrow, SourceLocation OperatorLoc, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, NamedDecl *FirstQualifierFoundInScope, DeclarationNameInfo MemberNameInfo, const TemplateArgumentListInfo *TemplateArgs)
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
bool isInstantiationDependentType() const
Determine whether this type is an instantiation-dependent type, meaning that the type involves a temp...
static UnresolvedLookupExpr * Create(const ASTContext &C, CXXRecordDecl *NamingClass, NestedNameSpecifierLoc QualifierLoc, const DeclarationNameInfo &NameInfo, bool ADL, bool Overloaded, UnresolvedSetIterator Begin, UnresolvedSetIterator End)
bool isAnyCharacterType() const
Determine whether this type is any of the built-in character types.
LambdaCapture(SourceLocation Loc, bool Implicit, LambdaCaptureKind Kind, VarDecl *Var=nullptr, SourceLocation EllipsisLoc=SourceLocation())
Create a new capture of a variable or of this.
CanQualType getSizeType() const
Return the unique type for "size_t" (C99 7.17), defined in <stddef.h>.
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)
Microsoft's '__super' specifier, stored as a CXXRecordDecl* of the class it appeared in...
bool isRecordType() const
LambdaCaptureDefault
The default, if any, capture method for a lambda expression.
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Defines the C++ template declaration subclasses.
capture_range captures() const
Retrieve this lambda's captures.
The base class of the type hierarchy.
std::unique_ptr< llvm::MemoryBuffer > Buffer
Represents a call to a C++ constructor.
A container of type source information.
SourceLocation getLocStart() const LLVM_READONLY
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.
SourceLocation getLocEnd() const LLVM_READONLY
capture_iterator capture_begin() const
Retrieve an iterator pointing to the first lambda capture.
static CXXConstructExpr * Create(const ASTContext &C, QualType T, SourceLocation Loc, CXXConstructorDecl *Ctor, bool Elidable, ArrayRef< Expr * > Args, bool HadMultipleCandidates, bool ListInitialization, bool StdInitListInitialization, bool ZeroInitialization, ConstructionKind ConstructKind, SourceRange ParenOrBraceRange)
Expr *const * const_capture_init_iterator
Const iterator that walks over the capture initialization arguments.
SourceRange getSourceRange() const LLVM_READONLY
VarDecl - An instance of this class is created to represent a variable declaration or definition...
const Expr * getCallee() const
SourceLocation getLocEnd() const LLVM_READONLY
static FunctionParmPackExpr * CreateEmpty(const ASTContext &Context, unsigned NumParams)
static DependentScopeDeclRefExpr * CreateEmpty(const ASTContext &C, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
NamedDecl * getUnderlyingDecl()
Looks through UsingDecls and ObjCCompatibleAliasDecls for the underlying named decl.
Stores a list of template parameters for a TemplateDecl and its derived classes.
SourceLocation getOperatorLoc() const
Returns the location of the operator symbol in the expression.
void setContainsUnexpandedParameterPack(bool PP=true)
Set the bit that describes whether this expression contains an unexpanded parameter pack...
void initializeResults(const ASTContext &C, UnresolvedSetIterator Begin, UnresolvedSetIterator End)
Represents an expression – generally a full-expression – that introduces cleanups to be run at the en...
bool containsUnexpandedParameterPack() const
Whether this type is or contains an unexpanded parameter pack, used to support C++0x variadic templat...
ParmVarDecl - Represents a parameter to a function.
QualType getBaseType() const
Defines the clang::Expr interface and subclasses for C++ expressions.
The collection of all-type qualifiers we support.
A C++ static_cast expression (C++ [expr.static.cast]).
static CXXUnresolvedConstructExpr * Create(const ASTContext &C, TypeSourceInfo *Type, SourceLocation LParenLoc, ArrayRef< Expr * > Args, SourceLocation RParenLoc)
void AllocateArgsArray(const ASTContext &C, bool isArray, unsigned numPlaceArgs, bool hasInitializer)
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.
bool isImplicitCXXThis() const
Whether this expression is an implicit reference to 'this' in C++.
LambdaCaptureKind
The different capture forms in a lambda introducer.
FieldDecl - An instance of this class is created by Sema::ActOnField to represent a member of a struc...
bool isAnyPointerType() const
CXXRecordDecl * getNamingClass() const
Gets the naming class of this lookup, if any.
Expr * getImplicitObjectArgument() const
Retrieves the implicit object argument for the member call.
const internal::VariadicAllOfMatcher< Decl > decl
Matches declarations.
CXXTemporaryObjectExpr(const ASTContext &C, CXXConstructorDecl *Cons, TypeSourceInfo *Type, ArrayRef< Expr * > Args, SourceRange ParenOrBraceRange, bool HadMultipleCandidates, bool ListInitialization, bool StdInitListInitialization, bool ZeroInitialization)
The iterator over UnresolvedSets.
SourceRange getLocalSourceRange() const
Get the local source range.
bool isPotentiallyEvaluated() const
Determine whether this typeid has a type operand which is potentially evaluated, per C++11 [expr...
CXXMethodDecl * getCallOperator() const
Retrieve the function call operator associated with this lambda expression.
Represents a C++ member access expression for which lookup produced a set of overloaded functions...
QualType getTypeDeclType(const TypeDecl *Decl, const TypeDecl *PrevDecl=nullptr) const
Return the unique reference to the type for the specified type declaration.
SourceLocation getRParenLoc() const
An r-value expression (a pr-value in the C++11 taxonomy) produces a temporary value.
SourceLocation getBeginLoc() const
Get the begin source location.
bool isAlwaysNull() const
isAlwaysNull - Return whether the result of the dynamic_cast is proven to always be null...
< Capturing the *this object by copy
A convenient class for passing around template argument information.
ArrayRef< VarDecl * > getCaptureInitIndexVars(const_capture_init_iterator Iter) const
Retrieve the set of index variables used in the capture initializer of an array captured by copy...
capture_init_iterator capture_init_begin()
Retrieve the first initialization argument for this lambda expression (which initializes the first ca...
Expr * getInitializer()
The initializer of this new-expression.
An x-value expression is a reference to an object with independent storage but which can be "moved"...
Expr * getExprOperand() const
capture_iterator capture_end() const
Retrieve an iterator pointing past the end of the sequence of lambda captures.
A builtin binary operation expression such as "x + y" or "x <= y".
bool isValueDependent() const
isValueDependent - Determines whether this expression is value-dependent (C++ [temp.dep.constexpr]).
InitializationStyle getInitializationStyle() const
The kind of initializer this new-expression has.
New-expression has a C++98 paren-delimited initializer.
SourceLocation getLocEnd() const LLVM_READONLY
TypeSourceInfo * getTypeSourceInfo() const
VarDecl * getCapturedVar() const
Retrieve the declaration of the local variable being captured.
QualType getDestroyedType() const
Retrieve the type being destroyed.
Represents binding an expression to a temporary.
CompoundStmt * getBody() const
Retrieve the body of the lambda.
bool capturesVLAType() const
Determine whether this captures a variable length array bound expression.
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
QualType getTypeOperand(ASTContext &Context) const
Retrieves the type operand of this __uuidof() expression after various required adjustments (removing...
TypeSourceInfo * getTypeInfoAsWritten() const
getTypeInfoAsWritten - Returns the type source info for the type that this expression is casting to...
An ordinary object is located at an address in memory.
Represents a C++ member access expression where the actual member referenced could not be resolved be...
capture_iterator implicit_capture_end() const
Retrieve an iterator pointing past the end of the sequence of implicit lambda captures.
detail::InMemoryDirectory::const_iterator I
New-expression has no initializer as written.
TypeTrait
Names for traits that operate specifically on types.
SourceLocation getLocation() const
static LambdaExpr * CreateDeserialized(const ASTContext &C, unsigned NumCaptures, unsigned NumArrayIndexVars)
Construct a new lambda expression that will be deserialized from an external source.
ASTTemplateKWAndArgsInfo * getTrailingASTTemplateKWAndArgsInfo()
Return the optional template keyword and arguments info.
CompoundStmt - This represents a group of statements like { stmt stmt }.
Represents a prototype with parameter type info, e.g.
CXXMethodDecl * getMethodDecl() const
Retrieves the declaration of the called method.
CastKind
CastKind - The kind of operation required for a conversion.
bool isInstantiationDependent() const
Whether this expression is instantiation-dependent, meaning that it depends in some way on a template...
bool HasTemplateKWAndArgsInfo
Whether the name includes info for explicit template keyword and arguments.
QualType getPointeeType() const
If this is a pointer, ObjC object pointer, or block pointer, this returns the respective pointee...
PseudoDestructorTypeStorage()
bool isMutable() const
Determine whether the lambda is mutable, meaning that any captures values can be modified.
ValueDecl - Represent the declaration of a variable (in which case it is an lvalue) a function (in wh...
Expr - This represents one expression.
ExprValueKind
The categorization of expression values, currently following the C++11 scheme.
SourceLocation getLocStart() const LLVM_READONLY
A C++ const_cast expression (C++ [expr.const.cast]).
Represents a C++ destructor within a class.
New-expression has a C++11 list-initializer.
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)
bool isFloatingType() const
Represents an expression that computes the length of a parameter pack.
NonTypeTemplateParmDecl - Declares a non-type template parameter, e.g., "Size" in.
static DependentScopeDeclRefExpr * Create(const ASTContext &C, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, const DeclarationNameInfo &NameInfo, const TemplateArgumentListInfo *TemplateArgs)
Defines the clang::TypeLoc interface and its subclasses.
CXXRecordDecl * getNamingClass() const
Retrieve the naming class of this lookup.
bool isExplicit() const
Determine whether this was an explicit capture (written between the square brackets introducing the l...
Defines the clang::IdentifierInfo, clang::IdentifierTable, and clang::Selector interfaces.
bool shouldNullCheckAllocation(const ASTContext &Ctx) const
True if the allocation result needs to be null-checked.
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
CXXMethodDecl * getLambdaCallOperator() const
Retrieve the lambda call operator of the closure type if this is a closure type.
class LLVM_ALIGNAS(8) TemplateSpecializationType unsigned NumArgs
Represents a type template specialization; the template must be a class template, a type alias templa...
const Type * getAsType() const
Retrieve the type stored in this nested name specifier.
capture_iterator implicit_capture_begin() const
Retrieve an iterator pointing to the first implicit lambda capture.
SourceLocation getLocStart() const LLVM_READONLY
LambdaCaptureKind getCaptureKind() const
Determine the kind of capture.
Stmt * getBody(const FunctionDecl *&Definition) const
getBody - Retrieve the body (definition) of the function.
TypeLoc getTypeLoc() const
Return the TypeLoc wrapper for the type source info.
A C++ dynamic_cast expression (C++ [expr.dynamic.cast]).
SourceLocation getLocStart() const LLVM_READONLY
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...
operator "" X (const CharT *, size_t)
Raw form: operator "" X<cs...> ()
static CXXDynamicCastExpr * CreateEmpty(const ASTContext &Context, unsigned pathSize)
CXXRecordDecl * getRecordDecl() const
Retrieves the CXXRecordDecl for the underlying type of the implicit object argument.
Encodes a location in the source.
Represents a C++ temporary.
static CXXDependentScopeMemberExpr * CreateEmpty(const ASTContext &C, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
static CXXConstCastExpr * CreateEmpty(const ASTContext &Context)
bool isValid() const
Return true if this is a valid SourceLocation object.
static SizeOfPackExpr * Create(ASTContext &Context, SourceLocation OperatorLoc, NamedDecl *Pack, SourceLocation PackLoc, SourceLocation RParenLoc, Optional< unsigned > Length=None, ArrayRef< TemplateArgument > PartialArgs=None)
CXXConstructExpr(const ASTContext &C, StmtClass SC, QualType T, SourceLocation Loc, CXXConstructorDecl *Ctor, bool Elidable, ArrayRef< Expr * > Args, bool HadMultipleCandidates, bool ListInitialization, bool StdInitListInitialization, bool ZeroInitialization, ConstructionKind ConstructKind, SourceRange ParenOrBraceRange)
OverloadExpr(StmtClass K, const ASTContext &C, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, const DeclarationNameInfo &NameInfo, const TemplateArgumentListInfo *TemplateArgs, UnresolvedSetIterator Begin, UnresolvedSetIterator End, bool KnownDependent, bool KnownInstantiationDependent, bool KnownContainsUnexpandedParameterPack)
TemplateParameterList * getTemplateParameterList() const
If this is a generic lambda expression, retrieve the template parameter list associated with it...
TemplateArgument getArgumentPack() const
Retrieve the template argument pack containing the substituted template arguments.
Represents a static or instance method of a struct/union/class.
static ExprWithCleanups * Create(const ASTContext &C, EmptyShell empty, unsigned numObjects)
bool isImplicitAccess() const
True if this is an implicit access, i.e.
SourceLocation getLocStart() const LLVM_READONLY
bool isInitCapture(const LambdaCapture *Capture) const
Determine whether one of this lambda's captures is an init-capture.
LiteralOperatorKind getLiteralOperatorKind() const
Returns the kind of literal operator invocation which this expression represents. ...
capture_iterator explicit_capture_end() const
Retrieve an iterator pointing past the end of the sequence of explicit lambda captures.
SourceLocation getBegin() const
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.
const T * castAs() const
Member-template castAs<specific type>.
bool isArrow() const
Determine whether this member expression used the '->' operator; otherwise, it used the '...
static SizeOfPackExpr * CreateDeserialized(ASTContext &Context, unsigned NumPartialArgs)
QualType getType() const
Return the type wrapped by this type source info.
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)
QualType getPointeeType() const
A qualified reference to a name whose declaration cannot yet be resolved.
static bool hasOnlyNonStaticMemberFunctions(UnresolvedSetIterator begin, UnresolvedSetIterator end)
A POD class for pairing a NamedDecl* with an access specifier.
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 isInitCapture() const
Whether this variable is the implicit variable for a lambda init-capture.
if(T->getSizeExpr()) TRY_TO(TraverseStmt(T-> getSizeExpr()))
Represents a reference to a function parameter pack that has been substituted but not yet expanded...
Represents a template argument.
void setExtendingDecl(const ValueDecl *ExtendedBy, unsigned ManglingNumber)
QualType getTypeOperand(ASTContext &Context) const
Retrieves the type operand of this typeid() expression after various required adjustments (removing r...
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
SourceLocation getLocStart() const LLVM_READONLY
bool isDefaultArgument() const
Determine whether this expression is a default function argument.
A C++ reinterpret_cast expression (C++ [expr.reinterpret.cast]).
void setInstantiationDependent(bool ID)
Set whether this expression is instantiation-dependent or not.
bool isTypeOperand() const
detail::InMemoryDirectory::const_iterator E
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this call.
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspnd...
unsigned getNumArgs() const
SourceLocation getLocEnd() const LLVM_READONLY
QualType getNonReferenceType() const
If Type is a reference type (e.g., const int&), returns the type that the reference refers to ("const...
Capturing variable-length array type.
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.
llvm::iterator_range< capture_iterator > capture_range
An iterator over a range of lambda captures.
FunctionDecl * getOperatorNew() const
const T * getAs() const
Member-template getAs<specific type>'.
capture_iterator explicit_capture_begin() const
Retrieve an iterator pointing to the first explicit lambda capture.
static UnresolvedMemberExpr * CreateEmpty(const ASTContext &C, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
Expr * getArg(unsigned Arg)
Return the specified argument.
CanQualType BoundMemberTy
CXXRecordDecl * getAsCXXRecordDecl() const
Retrieves the CXXRecordDecl that this type refers to, either because the type is a RecordType or beca...
static CXXFunctionalCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize)
Capturing the *this object by reference.
Represents a base class of a C++ class.
TemplateParameterList * getGenericLambdaTemplateParameterList() const
Retrieve the generic lambda's template parameter list.
static FunctionParmPackExpr * Create(const ASTContext &Context, QualType T, ParmVarDecl *ParamPack, SourceLocation NameLoc, ArrayRef< ParmVarDecl * > Params)
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
static UnresolvedMemberExpr * Create(const ASTContext &C, bool HasUnresolvedUsing, Expr *Base, QualType BaseType, bool IsArrow, SourceLocation OperatorLoc, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, const DeclarationNameInfo &MemberNameInfo, const TemplateArgumentListInfo *TemplateArgs, UnresolvedSetIterator Begin, UnresolvedSetIterator End)
static UnresolvedLookupExpr * CreateEmpty(const ASTContext &C, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
capture_range explicit_captures() const
Retrieve this lambda's explicit captures.
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate.h) and friends (in DeclFriend.h).
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
OverloadedOperatorKind getOperator() const
Returns the kind of overloaded operator that this expression refers to.
const IdentifierInfo * getUDSuffix() const
Returns the ud-suffix specified for this literal.
void setEnd(SourceLocation e)
Represents a C++ struct/union/class.
static CXXStaticCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize)
SourceLocation getLocStart() const LLVM_READONLY
capture_range implicit_captures() const
Retrieve this lambda's implicit captures.
static CXXTemporary * Create(const ASTContext &C, const CXXDestructorDecl *Destructor)
static CXXUnresolvedConstructExpr * CreateEmpty(const ASTContext &C, unsigned NumArgs)
Represents an explicit C++ type conversion that uses "functional" notation (C++ [expr.type.conv]).
static TypeTraitExpr * Create(const ASTContext &C, QualType T, SourceLocation Loc, TypeTrait Kind, ArrayRef< TypeSourceInfo * > Args, SourceLocation RParenLoc, bool Value)
Create a new type trait expression.
static TypeTraitExpr * CreateDeserialized(const ASTContext &C, unsigned NumArgs)
void * Allocate(size_t Size, unsigned Align=8) const
bool isReservedGlobalPlacementOperator() const
Determines whether this operator new or delete is one of the reserved global placement operators: voi...
SourceLocation getLocEnd() const LLVM_READONLY
CXXPseudoDestructorExpr(const ASTContext &Context, Expr *Base, bool isArrow, SourceLocation OperatorLoc, NestedNameSpecifierLoc QualifierLoc, TypeSourceInfo *ScopeType, SourceLocation ColonColonLoc, SourceLocation TildeLoc, PseudoDestructorTypeStorage DestroyedType)
bool capturesThis() const
Determine whether this capture handles the C++ this pointer.
An l-value expression is a reference to an object with independent storage.
A trivial tuple used to represent a source range.
NamedDecl - This represents a decl with a name.
NestedNameSpecifier * getQualifier() const
Fetches the nested-name qualifier, if one was given.
QualType getDestroyedType() const
Retrieve the type being destroyed.
bool isTypeOperand() const
static LambdaExpr * Create(const ASTContext &C, CXXRecordDecl *Class, SourceRange IntroducerRange, LambdaCaptureDefault CaptureDefault, SourceLocation CaptureDefaultLoc, ArrayRef< LambdaCapture > Captures, bool ExplicitParams, bool ExplicitResultType, ArrayRef< Expr * > CaptureInits, ArrayRef< VarDecl * > ArrayIndexVars, ArrayRef< unsigned > ArrayIndexStarts, SourceLocation ClosingBrace, bool ContainsUnexpandedParameterPack)
Construct a new lambda expression.
CXXRecordDecl * getLambdaClass() const
Retrieve the class that corresponds to the lambda.
QualType getUnqualifiedArrayType(QualType T, Qualifiers &Quals)
Return this type as a completely-unqualified array type, capturing the qualifiers in Quals...
operator "" X (unsigned long long)
bool isIntegerType() const
isIntegerType() does not include complex integers (a GCC extension).
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.
bool capturesVariable() const
Determine whether this capture handles a variable.
bool hasInClassInitializer() const
hasInClassInitializer - Determine whether this member has a C++11 in-class initializer.
bool isPointerType() const