llvm::omp;
109template<
typenameDerived>
114 classForgetPartiallySubstitutedPackRAII {
122ForgetPartiallySubstitutedPackRAII(Derived &Self)
123: Self(Self), ResetPackSubstIndex(Self.getSema(), -1) {
124Old = Self.ForgetPartiallySubstitutedPack();
127~ForgetPartiallySubstitutedPackRAII() {
128Self.RememberPartiallySubstitutedPack(Old);
145Derived &
getDerived() {
return static_cast<Derived&
>(*this); }
149 return static_cast<constDerived&
>(*this);
214OldLocation = Self.getDerived().getBaseLocation();
215OldEntity = Self.getDerived().getBaseEntity();
218Self.getDerived().setBase(Location, Entity);
222Self.getDerived().setBase(OldLocation, OldEntity);
252 return E->isDefaultArgument();
295 bool&ShouldExpand,
bool&RetainExpansion,
296std::optional<unsigned> &NumExpansions) {
297ShouldExpand =
false;
412 const X##Attr *Transform##X##Attr(const X##Attr *R) { return R; } 413#include "clang/Basic/AttrList.inc" 423 const X##Attr *TransformStmt##X##Attr(const Stmt *, const Stmt *, \ 424 const X##Attr *A) { \ 425 return getDerived().Transform##X##Attr(A); \ 427#include "clang/Basic/AttrList.inc" 473 bool*ArgChanged =
nullptr);
482llvm::DenseMap<Decl *, Decl *>::iterator Known
485 returnKnown->second;
513assert(New.size() == 1 &&
514 "must override transformedLocalDecl if performing pack expansion");
552 NamedDecl*FirstQualifierInScope =
nullptr);
597 NamedDecl*FirstQualifierInScope =
nullptr,
598 boolAllowInjectedClassName =
false);
610 boolUneval =
false);
633 boolUneval =
false) {
652 template<
typenameInputIterator>
656 boolUneval =
false);
668#define ABSTRACT_TYPELOC(CLASS, PARENT) 669#define TYPELOC(CLASS, PARENT) \ 670 QualType Transform##CLASS##Type(TypeLocBuilder &TLB, CLASS##TypeLoc T); 671#include "clang/AST/TypeLocNodes.def" 675 boolSuppressObjCLifetime);
679 boolSuppressObjCLifetime);
681 template<
typenameFn>
734 return getDerived().TransformFunctionTypeParams(
735 Loc, Params, ParamTypes, ParamInfos, PTypes, PVars, PInfos,
nullptr);
753KWLoc, Params,
nullptr,
754 nullptr, PTypes, &TransParams, PInfos))
767std::optional<unsigned> NumExpansions,
768 boolExpectParameterPack);
795 boolIsAddressOfOperand,
803 boolIsAddressOfOperand);
811#define STMT(Node, Parent) \ 812 LLVM_ATTRIBUTE_NOINLINE \ 813 StmtResult Transform##Node(Node *S); 814#define VALUESTMT(Node, Parent) \ 815 LLVM_ATTRIBUTE_NOINLINE \ 816 StmtResult Transform##Node(Node *S, StmtDiscardKind SDK); 817#define EXPR(Node, Parent) \ 818 LLVM_ATTRIBUTE_NOINLINE \ 819 ExprResult Transform##Node(Node *E); 820#define ABSTRACT_STMT(Stmt) 821#include "clang/AST/StmtNodes.inc" 823#define GEN_CLANG_CLAUSE_CLASS 824#define CLAUSE_CLASS(Enum, Str, Class) \ 825 LLVM_ATTRIBUTE_NOINLINE \ 826 OMPClause *Transform##Class(Class *S); 827#include "llvm/Frontend/OpenMP/OMP.inc" 904 constllvm::APInt *Size,
Expr*SizeExpr,
905 unsignedIndexTypeQuals,
SourceRangeBracketsRange);
914 constllvm::APInt &Size,
Expr*SizeExpr,
915 unsignedIndexTypeQuals,
925 unsignedIndexTypeQuals,
935 unsignedIndexTypeQuals,
946 unsignedIndexTypeQuals,
984 unsignedNumColumns);
1001 Expr*AddrSpaceExpr,
1071 boolFullySubstituted,
1085TypeConstraintConcept,
1086TypeConstraintArgs);
1094Template, Deduced,
false);
1140 boolAllowInjectedClassName) {
1144SS.
Adopt(QualifierLoc);
1146SS, TemplateKWLoc, *Name, NameLoc,
QualType(),
nullptr,
1147AllowInjectedClassName);
1161 getDerived().RebuildTemplateSpecializationType(InstName, NameLoc, Args);
1178 boolDeducedTSTContext) {
1180SS.
Adopt(QualifierLoc);
1193*
Id, IdLoc, DeducedTSTContext);
1211 switch(
Result.getResultKind()) {
1222llvm_unreachable(
"Tag lookup cannot find non-tags");
1234 switch(
Result.getResultKind()) {
1240 SemaRef.
Diag(IdLoc, diag::err_tag_reference_non_tag)
1241<< SomeDecl << NTK << llvm::to_underlying(Kind);
1246 SemaRef.
Diag(IdLoc, diag::err_not_tag_in_scope)
1247<< llvm::to_underlying(Kind) <<
Id<< DC
1256 SemaRef.
Diag(KeywordLoc, diag::err_use_with_wrong_tag) <<
Id;
1257 SemaRef.
Diag(Tag->getLocation(), diag::note_previous_use);
1274std::optional<unsigned> NumExpansions) {
1319 boolAllowInjectedClassName);
1332 boolAllowInjectedClassName);
1342 Decl*AssociatedDecl,
unsignedIndex,
1345ArgPack, AssociatedDecl, Index, Final);
1423Then, ElseLoc, Else);
1477Inc, RParenLoc, Body);
1522 boolIsVolatile,
unsignedNumOutputs,
1529NumInputs, Names, Constraints, Exprs,
1530AsmString, Clobbers, NumLabels, RParenLoc);
1539StringRef AsmString,
1540 unsignedNumOutputs,
unsignedNumInputs,
1546NumOutputs, NumInputs,
1547Constraints, Clobbers, Exprs, EndLoc);
1576CoawaitLoc, Operand, OpCoawaitLookup);
1580Suspend.
get(),
true);
1681Kind, DirName, CancelRegion, Clauses, AStmt, StartLoc, EndLoc);
1693Kind, DirName, Clauses, AStmt, StartLoc, EndLoc);
1707NameModifier,
Condition, StartLoc, LParenLoc, NameModifierLoc, ColonLoc,
1818Kind, KindKwLoc, StartLoc, LParenLoc, EndLoc);
1831Kind, KindKwLoc, StartLoc, LParenLoc, EndLoc);
1844M1, M2, Kind, ChunkSize, StartLoc, LParenLoc, M1Loc, M2Loc, KindLoc,
1895VarList, LPKind, LPKindLoc, ColonLoc, StartLoc, LParenLoc, EndLoc);
1922VarList, Modifier, StartLoc, LParenLoc, ModifierLoc, ColonLoc, EndLoc,
1923ReductionIdScopeSpec, ReductionId, UnresolvedReductions);
1937VarList, StartLoc, LParenLoc, ColonLoc, EndLoc, ReductionIdScopeSpec,
1938ReductionId, UnresolvedReductions);
1953VarList, StartLoc, LParenLoc, ColonLoc, EndLoc, ReductionIdScopeSpec,
1954ReductionId, UnresolvedReductions);
1967VarList, Step, StartLoc, LParenLoc, Modifier, ModifierLoc, ColonLoc,
1968StepModifierLoc, EndLoc);
1981VarList, Alignment, StartLoc, LParenLoc, ColonLoc, EndLoc);
2041 Data, DepModifier, VarList, StartLoc, LParenLoc, EndLoc);
2054Modifier,
Device, StartLoc, LParenLoc, ModifierLoc, EndLoc);
2069IteratorModifier, MapTypeModifiers, MapTypeModifiersLoc,
2070MapperIdScopeSpec, MapperId, MapType, IsMapTypeImplicit, MapLoc,
2071ColonLoc, VarList, Locs,
2072 false, UnresolvedMappers);
2089Allocate, Alignment, FirstModifier, FirstModifierLoc, SecondModifier,
2090SecondModifierLoc, VarList, StartLoc, LParenLoc, ColonLoc, EndLoc);
2138Modifier,
Device, StartLoc, LParenLoc, ModifierLoc, EndLoc);
2151Modifier, NumTasks, StartLoc, LParenLoc, ModifierLoc, EndLoc);
2186Kind, ChunkSize, StartLoc, LParenLoc, KindLoc, CommaLoc, EndLoc);
2201MotionModifiers, MotionModifiersLoc, MapperIdScopeSpec, MapperId,
2202ColonLoc, VarList, Locs, UnresolvedMappers);
2217MotionModifiers, MotionModifiersLoc, MapperIdScopeSpec, MapperId,
2218ColonLoc, VarList, Locs, UnresolvedMappers);
2269M, Kind, StartLoc, LParenLoc, MLoc, KindLoc, EndLoc);
2316StartLoc, LParenLoc, EndLoc,
Data);
2329StartLoc, LParenLoc, ColonLoc, EndLoc, Modifier, Locators);
2341Modifier, Kind, StartLoc, LParenLoc, ModifierKwLoc, KindKwLoc, EndLoc);
2354InteropVar, InteropInfo, StartLoc, LParenLoc, VarLoc, EndLoc);
2365LParenLoc, VarLoc, EndLoc);
2377InteropVar, StartLoc, LParenLoc, VarLoc, EndLoc);
2516DepType, DepLoc, ColonLoc, VarList, StartLoc, LParenLoc, EndLoc);
2564ForLoc, Element, Collection, RParenLoc);
2582StartLoc, IdLoc,
Id);
2620 if(RangeStmt->isSingleDecl()) {
2621 if(
VarDecl*RangeVar = dyn_cast<VarDecl>(RangeStmt->getSingleDecl())) {
2622 if(RangeVar->isInvalidDecl())
2625 Expr*RangeExpr = RangeVar->getInit();
2632diag::err_objc_for_range_init_stmt)
2633<<
Init->getSourceRange();
2636ForLoc, LoopVar, RangeExpr, RParenLoc);
2643ForLoc, CoawaitLoc,
Init, ColonLoc,
Range,
Begin, End, Cond, Inc,
2657QualifierLoc, NameInfo, Nested);
2719SS.
Adopt(QualifierLoc);
2790 if(
Result.isInvalid())
2831 if(IsOMPArraySection)
2833 Base, LBracketLoc, LowerBound, ColonLocFirst, ColonLocSecond, Length,
2834Stride, RBracketLoc);
2836assert(Stride ==
nullptr&& !ColonLocSecond.
isValid() &&
2837 "Stride/second colon not allowed for OpenACC");
2840 Base, LBracketLoc, LowerBound, ColonLocFirst, Length, RBracketLoc);
2852 Base, LParenLoc, RParenLoc, Dims, BracketsRanges);
2864 nullptr, IteratorKwLoc, LLoc, RLoc,
Data);
2874 Expr*ExecConfig =
nullptr) {
2876 nullptr, Callee, LParenLoc, Args, RParenLoc, ExecConfig);
2883 nullptr, Callee, LParenLoc, Args, RParenLoc);
2901 if(!
Member->getDeclName()) {
2905assert(
Member->getType()->isRecordType() &&
2906 "unnamed member not of record type?");
2919 if(!isArrow &&
Base->isPRValue()) {
2928 Base, isArrow, OpLoc, EmptySS, cast<FieldDecl>(
Member),
2934SS.
Adopt(QualifierLoc);
2937 if(
Base->containsErrors())
2951 if(
getSema().isUnevaluatedContext() &&
Base->isImplicitCXXThis() &&
2952isa<FieldDecl, IndirectFieldDecl, MSPropertyDecl>(
Member)) {
2953 if(
auto*ThisClass = cast<CXXThisExpr>(
Base)
2956->getAsCXXRecordDecl()) {
2957 auto*
Class= cast<CXXRecordDecl>(
Member->getDeclContext());
2960 if(!ThisClass->Equals(
Class) && !ThisClass->isDerivedFrom(
Class))
2968FirstQualifierInScope,
2969R, ExplicitTemplateArgs,
3071 if(
Result.isInvalid())
3147 Expr*ControllingExpr,
3152ControllingExpr, Types, Exprs);
3167ControllingType, Types, Exprs);
3200 caseStmt::CXXStaticCastExprClass:
3201 return getDerived().RebuildCXXStaticCastExpr(OpLoc, LAngleLoc, TInfo,
3202RAngleLoc, LParenLoc,
3203SubExpr, RParenLoc);
3205 caseStmt::CXXDynamicCastExprClass:
3206 return getDerived().RebuildCXXDynamicCastExpr(OpLoc, LAngleLoc, TInfo,
3207RAngleLoc, LParenLoc,
3208SubExpr, RParenLoc);
3210 caseStmt::CXXReinterpretCastExprClass:
3211 return getDerived().RebuildCXXReinterpretCastExpr(OpLoc, LAngleLoc, TInfo,
3212RAngleLoc, LParenLoc,
3216 caseStmt::CXXConstCastExprClass:
3217 return getDerived().RebuildCXXConstCastExpr(OpLoc, LAngleLoc, TInfo,
3218RAngleLoc, LParenLoc,
3219SubExpr, RParenLoc);
3221 caseStmt::CXXAddrspaceCastExprClass:
3222 return getDerived().RebuildCXXAddrspaceCastExpr(
3223OpLoc, LAngleLoc, TInfo, RAngleLoc, LParenLoc, SubExpr, RParenLoc);
3226llvm_unreachable(
"Invalid C++ named cast");
3304OpLoc, tok::kw_addrspace_cast, TInfo, SubExpr,
3316 boolListInitialization) {
3320 if(
auto*PLE = dyn_cast<ParenListExpr>(Sub))
3322TInfo, LParenLoc,
MultiExprArg(PLE->getExprs(), PLE->getNumExprs()),
3323RParenLoc, ListInitialization);
3326ListInitialization);
3390 if(
getSema().CheckCXXThisType(ThisLoc, ThisType))
3400 boolIsThrownVariableInScope) {
3410 Expr*RewrittenExpr) {
3412RewrittenExpr,
getSema().CurContext);
3446std::optional<Expr *> ArraySize,
3465 boolIsGlobalDelete,
3516 boolIsAddressOfOperand,
3519SS.
Adopt(QualifierLoc);
3521 if(TemplateArgs || TemplateKWLoc.
isValid())
3523SS, TemplateKWLoc, NameInfo, TemplateArgs, IsAddressOfOperand);
3526SS, NameInfo, IsAddressOfOperand, RecoveryTSI);
3548 boolIsElidable,
MultiExprArgArgs,
boolHadMultipleCandidates,
3549 boolListInitialization,
boolStdInitListInitialization,
3555 if(Constructor->isInheritingConstructor())
3556FoundCtor = Constructor->getInheritedConstructor().getConstructor();
3559 if(
getSema().CompleteConstructorCall(FoundCtor,
T, Args,
Loc,
3566HadMultipleCandidates,
3568StdInitListInitialization,
3569RequiresZeroInit, ConstructKind,
3577 boolConstructsVBase,
3578 boolInheritedFromVBase) {
3580 Loc,
T, Constructor, ConstructsVBase, InheritedFromVBase);
3591 boolListInitialization) {
3593TSInfo, LParenOrBraceLoc, Args, RParenOrBraceLoc, ListInitialization);
3604 boolListInitialization) {
3606RParenLoc, ListInitialization);
3623SS.
Adopt(QualifierLoc);
3626OperatorLoc, IsArrow,
3628FirstQualifierInScope,
3630TemplateArgs,
nullptr);
3646SS.
Adopt(QualifierLoc);
3649OperatorLoc, IsArrow,
3651FirstQualifierInScope,
3652R, TemplateArgs,
nullptr);
3667std::optional<unsigned> Length,
3670RParenLoc, Length, PartialArgs);
3675 Expr*PackIdExpression,
Expr*IndexExpr,
3677 boolFullySubstituted =
false) {
3679IndexExpr, RSquareLoc, ExpandedExprs,
3716NamedConcept, TALI);
3717 if(
Result.isInvalid())
3734LocalParameters, RParenLoc, Requirements,
3788 Expr**Elements,
unsignedNumElements) {
3798RB,
Base, Key, getterMethod, setterMethod);
3830ReceiverTypeInfo, ReceiverTypeInfo->
getType(),
3845Sel, Method, LBracLoc,
3846SelectorLocs, RBracLoc, Args);
3860 nullptr, SuperType, SuperLoc, Sel, Method, LBracLoc,
3861SelectorLocs, RBracLoc, Args)
3863Sel, Method, LBracLoc,
3864SelectorLocs, RBracLoc, Args);
3873 boolIsArrow,
boolIsFreeIvar) {
3877BaseArg, BaseArg->
getType(),
3882 if(IsFreeIvar &&
Result.isUsable())
3883cast<ObjCIvarRefExpr>(
Result.get())->setIsFreeIvar(IsFreeIvar);
3919PropertyLoc,
Base));
3951assert(!Lookup.
empty() &&
"No __builtin_shufflevector?");
3960CK_BuiltinFnToFnPtr).
get();
3986std::optional<unsigned> NumExpansions) {
3991EllipsisLoc, NumExpansions);
3992 if(
Result.isInvalid())
4013llvm_unreachable(
"Pack expansion pattern has no parameter packs");
4034std::optional<unsigned> NumExpansions) {
4047std::optional<unsigned> NumExpansions) {
4049EllipsisLoc, RHS, RParenLoc,
4058 Init->containsUnexpandedParameterPack();
4059 else if(PVD->hasUninstantiatedDefaultArg())
4061PVD->getUninstantiatedDefaultArg()
4062->containsUnexpandedParameterPack();
4207Exprs.push_back(DevNumExpr);
4208Exprs.insert(Exprs.end(), QueueIdExprs.begin(), QueueIdExprs.end());
4211Exprs, RParenLoc, EndLoc, Clauses, {});
4246 boolDeducibleTSTContext);
4258template<
typenameDerived>
4263 switch(S->getStmtClass()) {
4268#define STMT(Node, Parent) \ 4269 case Stmt::Node##Class: return getDerived().Transform##Node(cast<Node>(S)); 4270#define VALUESTMT(Node, Parent) \ 4271 case Stmt::Node##Class: \ 4272 return getDerived().Transform##Node(cast<Node>(S), SDK); 4273#define ABSTRACT_STMT(Node) 4274#define EXPR(Node, Parent) 4275#include "clang/AST/StmtNodes.inc" 4278#define STMT(Node, Parent) 4279#define ABSTRACT_STMT(Stmt) 4280#define EXPR(Node, Parent) case Stmt::Node##Class: 4281#include "clang/AST/StmtNodes.inc" 4283 ExprResult E= getDerived().TransformExpr(cast<Expr>(S));
4285 if(SDK == SDK_StmtExprResult)
4286 E= getSema().ActOnStmtExprResult(
E);
4287 returngetSema().ActOnExprStmt(
E, SDK == SDK_Discarded);
4294template<
typenameDerived>
4299 switch(S->getClauseKind()) {
4302#define GEN_CLANG_CLAUSE_CLASS 4303#define CLAUSE_CLASS(Enum, Str, Class) \ 4305 return getDerived().Transform##Class(cast<Class>(S)); 4306#include "llvm/Frontend/OpenMP/OMP.inc" 4313template<
typenameDerived>
4320#define STMT(Node, Parent) case Stmt::Node##Class: break; 4321#define ABSTRACT_STMT(Stmt) 4322#define EXPR(Node, Parent) \ 4323 case Stmt::Node##Class: return getDerived().Transform##Node(cast<Node>(E)); 4324#include "clang/AST/StmtNodes.inc" 4330template<
typenameDerived>
4338 if(
auto*FE = dyn_cast<FullExpr>(
Init))
4339 Init= FE->getSubExpr();
4341 if(
auto*AIL = dyn_cast<ArrayInitLoopExpr>(
Init)) {
4347 Init= MTE->getSubExpr();
4350 Init= Binder->getSubExpr();
4353 Init= ICE->getSubExprAsWritten();
4356dyn_cast<CXXStdInitializerListExpr>(
Init))
4357 returnTransformInitializer(ILE->getSubExpr(), NotCopyInit);
4364 returngetDerived().TransformExpr(
Init);
4369 returngetDerived().RebuildParenListExpr(
Parens.getBegin(), {},
4374 if(isa<ImplicitValueInitExpr>(
Init))
4380 if(!Construct || isa<CXXTemporaryObjectExpr>(Construct))
4381 returngetDerived().TransformExpr(
Init);
4386 returnTransformInitializer(Construct->
getArg(0), NotCopyInit);
4393getSema().currentEvaluationContext().InLifetimeExtendingContext =
4394getSema().parentEvaluationContext().InLifetimeExtendingContext;
4395getSema().currentEvaluationContext().RebuildDefaultArgOrDefaultInit =
4396getSema().parentEvaluationContext().RebuildDefaultArgOrDefaultInit;
4398 boolArgChanged =
false;
4399 if(getDerived().TransformExprs(Construct->
getArgs(), Construct->
getNumArgs(),
4400 true, NewArgs, &ArgChanged))
4405 returngetDerived().RebuildInitList(Construct->
getBeginLoc(), NewArgs,
4410 if(
Parens.isInvalid()) {
4413assert(NewArgs.empty() &&
4414 "no parens or braces but have direct init with arguments?");
4417 returngetDerived().RebuildParenListExpr(
Parens.getBegin(), NewArgs,
4421template<
typenameDerived>
4427 for(
unsignedI = 0; I != NumInputs; ++I) {
4429 if(IsCall && getDerived().DropCallArgument(Inputs[I])) {
4431*ArgChanged =
true;
4437 Expr*Pattern = Expansion->getPattern();
4440getSema().collectUnexpandedParameterPacks(Pattern, Unexpanded);
4441assert(!Unexpanded.empty() &&
"Pack expansion without parameter packs?");
4445 boolExpand =
true;
4446 boolRetainExpansion =
false;
4447std::optional<unsigned> OrigNumExpansions = Expansion->getNumExpansions();
4448std::optional<unsigned> NumExpansions = OrigNumExpansions;
4449 if(getDerived().TryExpandParameterPacks(Expansion->getEllipsisLoc(),
4452Expand, RetainExpansion,
4461 ExprResultOutPattern = getDerived().TransformExpr(Pattern);
4465 ExprResultOut = getDerived().RebuildPackExpansion(OutPattern.
get(),
4466Expansion->getEllipsisLoc(),
4468 if(Out.isInvalid())
4472*ArgChanged =
true;
4473Outputs.push_back(Out.get());
4479 if(ArgChanged) *ArgChanged =
true;
4483 for(
unsignedI = 0; I != *NumExpansions; ++I) {
4485 ExprResultOut = getDerived().TransformExpr(Pattern);
4486 if(Out.isInvalid())
4489 if(Out.get()->containsUnexpandedParameterPack()) {
4490Out = getDerived().RebuildPackExpansion(
4491Out.get(), Expansion->getEllipsisLoc(), OrigNumExpansions);
4492 if(Out.isInvalid())
4496Outputs.push_back(Out.get());
4501 if(RetainExpansion) {
4502ForgetPartiallySubstitutedPackRAII Forget(getDerived());
4504 ExprResultOut = getDerived().TransformExpr(Pattern);
4505 if(Out.isInvalid())
4508Out = getDerived().RebuildPackExpansion(
4509Out.get(), Expansion->getEllipsisLoc(), OrigNumExpansions);
4510 if(Out.isInvalid())
4513Outputs.push_back(Out.get());
4520IsCall ? getDerived().TransformInitializer(Inputs[I],
false)
4521: getDerived().TransformExpr(Inputs[I]);
4522 if(
Result.isInvalid())
4525 if(
Result.get() != Inputs[I] && ArgChanged)
4526*ArgChanged =
true;
4528Outputs.push_back(
Result.get());
4534template<
typenameDerived>
4538 VarDecl*ConditionVar = cast_or_null<VarDecl>(
4539getDerived().TransformDefinition(Var->
getLocation(), Var));
4544 returngetSema().ActOnConditionVariable(ConditionVar,
Loc, Kind);
4553 returngetSema().ActOnCondition(
nullptr,
Loc, CondExpr.
get(), Kind,
4560template<
typenameDerived>
4568Qualifier = Qualifier.getPrefix())
4584SS, FirstQualifierInScope,
false))
4591cast_or_null<NamespaceDecl>(getDerived().TransformDecl(
4599cast_or_null<NamespaceAliasDecl>(getDerived().TransformDecl(
4614cast_or_null<CXXRecordDecl>(getDerived().TransformDecl(
4623FirstQualifierInScope, SS);
4633diag::warn_cxx98_compat_enum_nested_name_spec);
4636SS.
Adopt(ETL.getQualifierLoc());
4637TL = ETL.getNamedTypeLoc();
4648SemaRef.
Diag(TL.
getBeginLoc(), diag::err_nested_name_spec_non_tag)
4656FirstQualifierInScope =
nullptr;
4662!getDerived().AlwaysRebuild())
4675template<
typenameDerived>
4683 switch(Name.getNameKind()) {
4694 TemplateDecl*OldTemplate = Name.getCXXDeductionGuideTemplate();
4695 TemplateDecl*NewTemplate = cast_or_null<TemplateDecl>(
4696getDerived().TransformDecl(NameInfo.
getLoc(), OldTemplate));
4712NewTInfo = getDerived().TransformType(OldTInfo);
4718NewTInfo =
nullptr;
4720 QualTypeNewT = getDerived().TransformType(Name.getCXXNameType());
4730NewNameInfo.
setName(NewName);
4736llvm_unreachable(
"Unknown name kind.");
4739template<
typenameDerived>
4746 boolAllowInjectedClassName) {
4748 TemplateDecl*Template = QTN->getUnderlyingTemplate().getAsTemplateDecl();
4749assert(Template &&
"qualified template name must refer to a template");
4752= cast_or_null<TemplateDecl>(getDerived().TransformDecl(NameLoc,
4757 if(!getDerived().AlwaysRebuild() &&
4759TransTemplate == Template)
4762 returngetDerived().RebuildTemplateName(SS, QTN->hasTemplateKeyword(),
4770FirstQualifierInScope =
nullptr;
4773 if(!getDerived().AlwaysRebuild() &&
4781 if(DTN->isIdentifier()) {
4782 returngetDerived().RebuildTemplateName(SS,
4784*DTN->getIdentifier(),
4787FirstQualifierInScope,
4788AllowInjectedClassName);
4791 returngetDerived().RebuildTemplateName(SS, TemplateKWLoc,
4792DTN->getOperator(), NameLoc,
4793ObjectType, AllowInjectedClassName);
4797 if(
TemplateDecl*Template = Name.getAsTemplateDecl()) {
4799= cast_or_null<TemplateDecl>(getDerived().TransformDecl(NameLoc,
4804 returngetDerived().RebuildTemplateName(SS,
false,
4809= Name.getAsSubstTemplateTemplateParmPack()) {
4810 returngetDerived().RebuildTemplateName(
4811SubstPack->getArgumentPack(), SubstPack->getAssociatedDecl(),
4812SubstPack->getIndex(), SubstPack->getFinal());
4816llvm_unreachable(
"overloaded function decl survived to here");
4819template<
typenameDerived>
4823Output = getSema().getTrivialTemplateArgumentLoc(
4824Arg,
QualType(), getDerived().getBaseLocation());
4827template<
typenameDerived>
4835llvm_unreachable(
"Unexpected TemplateArgument");
4845 QualTypeNewT = getDerived().TransformType(
T);
4852 ValueDecl*NewD =
D? cast_or_null<ValueDecl>(getDerived().TransformDecl(
4853getDerived().getBaseLocation(),
D))
4858 if(NewT ==
T&&
D== NewD)
4875llvm_unreachable(
"unexpected template argument kind");
4885DI = getDerived().TransformType(DI);
4896QualifierLoc = getDerived().TransformNestedNameSpecifierLoc(QualifierLoc);
4902SS.
Adopt(QualifierLoc);
4903 TemplateNameTemplate = getDerived().TransformTemplateName(
4914llvm_unreachable(
"Caller should expand pack expansions");
4929 ExprResult E= getDerived().TransformExpr(InputExpr);
4931 if(
E.isInvalid())
4944template<
typenameDerived,
typenameInputIterator>
4952 typedef typenamestd::iterator_traits<InputIterator>::difference_type
4982Self.InventTemplateArgumentLoc(*
Iter,
Result);
4990 return X.Iter == Y.Iter;
4995 return X.Iter != Y.Iter;
4999template<
typenameDerived>
5000template<
typenameInputIterator>
5017 if(TransformTemplateArguments(PackLocIterator(*
this,
5018In.getArgument().pack_begin()),
5019PackLocIterator(*
this,
5020In.getArgument().pack_end()),
5027 if(In.getArgument().isPackExpansion()) {
5031std::optional<unsigned> OrigNumExpansions;
5033= getSema().getTemplateArgumentPackExpansionPattern(
5034In, Ellipsis, OrigNumExpansions);
5037getSema().collectUnexpandedParameterPacks(Pattern, Unexpanded);
5038assert(!Unexpanded.empty() &&
"Pack expansion without parameter packs?");
5042 boolExpand =
true;
5043 boolRetainExpansion =
false;
5044std::optional<unsigned> NumExpansions = OrigNumExpansions;
5045 if(getDerived().TryExpandParameterPacks(Ellipsis,
5059 if(getDerived().TransformTemplateArgument(Pattern, OutPattern, Uneval))
5062Out = getDerived().RebuildPackExpansion(OutPattern, Ellipsis,
5064 if(Out.getArgument().isNull())
5073 for(
unsignedI = 0; I != *NumExpansions; ++I) {
5076 if(getDerived().TransformTemplateArgument(Pattern, Out, Uneval))
5079 if(Out.getArgument().containsUnexpandedParameterPack()) {
5080Out = getDerived().RebuildPackExpansion(Out, Ellipsis,
5082 if(Out.getArgument().isNull())
5091 if(RetainExpansion) {
5092ForgetPartiallySubstitutedPackRAII Forget(getDerived());
5094 if(getDerived().TransformTemplateArgument(Pattern, Out, Uneval))
5097Out = getDerived().RebuildPackExpansion(Out, Ellipsis,
5099 if(Out.getArgument().isNull())
5109 if(getDerived().TransformTemplateArgument(In, Out, Uneval))
5123template<
typenameDerived>
5125 if(getDerived().AlreadyTransformed(
T))
5131getDerived().getBaseLocation());
5141template<
typenameDerived>
5145getDerived().getBaseEntity());
5146 if(getDerived().AlreadyTransformed(DI->
getType()))
5161template<
typenameDerived>
5164 switch(
T.getTypeLocClass()) {
5165#define ABSTRACT_TYPELOC(CLASS, PARENT) 5166#define TYPELOC(CLASS, PARENT) \ 5167 case TypeLoc::CLASS: \ 5168 return getDerived().Transform##CLASS##Type(TLB, \ 5169 T.castAs<CLASS##TypeLoc>()); 5170#include "clang/AST/TypeLocNodes.def" 5173llvm_unreachable(
"unhandled type loc!");
5176template<
typenameDerived>
5178 if(!isa<DependentNameType>(
T))
5179 returnTransformType(
T);
5181 if(getDerived().AlreadyTransformed(
T))
5184getDerived().getBaseLocation());
5185 TypeSourceInfo*NewDI = getDerived().TransformTypeWithDeducedTST(DI);
5189template<
typenameDerived>
5192 if(!isa<DependentNameType>(DI->
getType()))
5193 returnTransformType(DI);
5197getDerived().getBaseEntity());
5198 if(getDerived().AlreadyTransformed(DI->
getType()))
5218 Result= getDerived().RebuildQualifiedType(
Result, QTL);
5227template<
typenameDerived>
5232 TypeLocUnqualTL =
T.getUnqualifiedLoc();
5233 autoSuppressObjCLifetime =
5234 T.getType().getLocalQualifiers().hasObjCLifetime();
5236 Result= getDerived().TransformTemplateTypeParmType(TLB, TTP,
5237SuppressObjCLifetime);
5238}
else if(
autoSTTP = UnqualTL.
getAs<SubstTemplateTypeParmPackTypeLoc>()) {
5239 Result= getDerived().TransformSubstTemplateTypeParmPackType(
5240TLB, STTP, SuppressObjCLifetime);
5242 Result= getDerived().TransformType(TLB, UnqualTL);
5261template<
typenameDerived>
5271SemaRef.
Diag(
Loc, diag::err_address_space_mismatch_templ_inst)
5302 else if(
T.getObjCLifetime()) {
5307 if((AutoTy = dyn_cast<AutoType>(
T)) && AutoTy->
isDeduced()) {
5323SemaRef.
Diag(
Loc, diag::err_attr_objc_ownership_redundant) <<
T;
5332template<
typenameDerived>
5338 if(getDerived().AlreadyTransformed(TL.
getType()))
5342TransformTSIInObjectScope(TL, ObjectType, UnqualLookup, SS);
5348template<
typenameDerived>
5350TreeTransform<Derived>::TransformTypeInObjectScope(TypeSourceInfo *TSInfo,
5351QualType ObjectType,
5352NamedDecl *UnqualLookup,
5354 if(getDerived().AlreadyTransformed(TSInfo->getType()))
5357 returnTransformTSIInObjectScope(TSInfo->getTypeLoc(), ObjectType,
5361template<
typenameDerived>
5362TypeSourceInfo *TreeTransform<Derived>::TransformTSIInObjectScope(
5363TypeLoc TL, QualType ObjectType, NamedDecl *UnqualLookup,
5365QualType
T= TL.getType();
5366assert(!getDerived().AlreadyTransformed(
T));
5371 if(isa<TemplateSpecializationType>(
T)) {
5372TemplateSpecializationTypeLoc SpecTL =
5373TL.castAs<TemplateSpecializationTypeLoc>();
5375TemplateName Template = getDerived().TransformTemplateName(
5376SS, SpecTL.getTypePtr()->getTemplateName(), SpecTL.getTemplateNameLoc(),
5377ObjectType, UnqualLookup,
true);
5378 if(Template.isNull())
5381 Result= getDerived().TransformTemplateSpecializationType(TLB, SpecTL,
5383}
else if(isa<DependentTemplateSpecializationType>(
T)) {
5384DependentTemplateSpecializationTypeLoc SpecTL =
5385TL.castAs<DependentTemplateSpecializationTypeLoc>();
5387TemplateName Template
5388= getDerived().RebuildTemplateName(SS,
5389SpecTL.getTemplateKeywordLoc(),
5390*SpecTL.getTypePtr()->getIdentifier(),
5391SpecTL.getTemplateNameLoc(),
5392ObjectType, UnqualLookup,
5394 if(Template.isNull())
5397 Result= getDerived().TransformDependentTemplateSpecializationType(TLB,
5403 Result= getDerived().TransformType(TLB, TL);
5412template<
classTyLoc>
static inline 5414TyLoc NewT = TLB.
push<TyLoc>(
T.getType());
5415NewT.setNameLoc(
T.getNameLoc());
5416 return T.getType();
5419template<
typenameDerived>
5420QualType TreeTransform<Derived>::TransformBuiltinType(TypeLocBuilder &TLB,
5421BuiltinTypeLoc
T) {
5422BuiltinTypeLoc NewT = TLB.push<BuiltinTypeLoc>(
T.getType());
5423NewT.setBuiltinLoc(
T.getBuiltinLoc());
5424 if(
T.needsExtraLocalData())
5425NewT.getWrittenBuiltinSpecs() =
T.getWrittenBuiltinSpecs();
5426 return T.getType();
5429template<
typenameDerived>
5430QualType TreeTransform<Derived>::TransformComplexType(TypeLocBuilder &TLB,
5431ComplexTypeLoc
T) {
5436template<
typenameDerived>
5437QualType TreeTransform<Derived>::TransformAdjustedType(TypeLocBuilder &TLB,
5438AdjustedTypeLoc TL) {
5440 returngetDerived().TransformType(TLB, TL.getOriginalLoc());
5443template<
typenameDerived>
5444QualType TreeTransform<Derived>::TransformDecayedType(TypeLocBuilder &TLB,
5445DecayedTypeLoc TL) {
5446QualType OriginalType = getDerived().TransformType(TLB, TL.getOriginalLoc());
5447 if(OriginalType.isNull())
5450QualType
Result= TL.getType();
5451 if(getDerived().AlwaysRebuild() ||
5452OriginalType != TL.getOriginalLoc().getType())
5454TLB.push<DecayedTypeLoc>(
Result);
5459template<
typenameDerived>
5461TreeTransform<Derived>::TransformArrayParameterType(TypeLocBuilder &TLB,
5462ArrayParameterTypeLoc TL) {
5463QualType OriginalType = getDerived().TransformType(TLB, TL.getElementLoc());
5464 if(OriginalType.isNull())
5467QualType
Result= TL.getType();
5468 if(getDerived().AlwaysRebuild() ||
5469OriginalType != TL.getElementLoc().getType())
5471TLB.push<ArrayParameterTypeLoc>(
Result);
5476template<
typenameDerived>
5477QualType TreeTransform<Derived>::TransformPointerType(TypeLocBuilder &TLB,
5478PointerTypeLoc TL) {
5479QualType PointeeType
5480= getDerived().TransformType(TLB, TL.getPointeeLoc());
5481 if(PointeeType.isNull())
5484QualType
Result= TL.getType();
5485 if(PointeeType->getAs<ObjCObjectType>()) {
5492ObjCObjectPointerTypeLoc NewT = TLB.push<ObjCObjectPointerTypeLoc>(
Result);
5493NewT.setStarLoc(TL.getStarLoc());
5497 if(getDerived().AlwaysRebuild() ||
5498PointeeType != TL.getPointeeLoc().getType()) {
5499 Result= getDerived().RebuildPointerType(PointeeType, TL.getSigilLoc());
5506TLB.TypeWasModifiedSafely(
Result->getPointeeType());
5508PointerTypeLoc NewT = TLB.push<PointerTypeLoc>(
Result);
5509NewT.setSigilLoc(TL.getSigilLoc());
5513template<
typenameDerived>
5515TreeTransform<Derived>::TransformBlockPointerType(TypeLocBuilder &TLB,
5516BlockPointerTypeLoc TL) {
5517QualType PointeeType
5518= getDerived().TransformType(TLB, TL.getPointeeLoc());
5519 if(PointeeType.isNull())
5522QualType
Result= TL.getType();
5523 if(getDerived().AlwaysRebuild() ||
5524PointeeType != TL.getPointeeLoc().getType()) {
5525 Result= getDerived().RebuildBlockPointerType(PointeeType,
5531BlockPointerTypeLoc NewT = TLB.push<BlockPointerTypeLoc>(
Result);
5532NewT.setSigilLoc(TL.getSigilLoc());
5540template<
typenameDerived>
5548 if(PointeeType.
isNull())
5552 if(getDerived().AlwaysRebuild() ||
5553PointeeType !=
T->getPointeeTypeAsWritten()) {
5554 Result= getDerived().RebuildReferenceType(PointeeType,
5555 T->isSpelledAsLValue(),
5568 if(isa<LValueReferenceType>(
Result))
5577template<
typenameDerived>
5581 returnTransformReferenceType(TLB, TL);
5584template<
typenameDerived>
5586TreeTransform<Derived>::TransformRValueReferenceType(TypeLocBuilder &TLB,
5587RValueReferenceTypeLoc TL) {
5588 returnTransformReferenceType(TLB, TL);
5591template<
typenameDerived>
5593TreeTransform<Derived>::TransformMemberPointerType(TypeLocBuilder &TLB,
5594MemberPointerTypeLoc TL) {
5595QualType PointeeType = getDerived().TransformType(TLB, TL.getPointeeLoc());
5596 if(PointeeType.isNull())
5599TypeSourceInfo* OldClsTInfo = TL.getClassTInfo();
5600TypeSourceInfo *NewClsTInfo =
nullptr;
5602NewClsTInfo = getDerived().TransformType(OldClsTInfo);
5607 constMemberPointerType *
T= TL.getTypePtr();
5608QualType OldClsType = QualType(
T->getClass(), 0);
5609QualType NewClsType;
5611NewClsType = NewClsTInfo->getType();
5613NewClsType = getDerived().TransformType(OldClsType);
5614 if(NewClsType.isNull())
5618QualType
Result= TL.getType();
5619 if(getDerived().AlwaysRebuild() ||
5621NewClsType != OldClsType) {
5622 Result= getDerived().RebuildMemberPointerType(PointeeType, NewClsType,
5630 constMemberPointerType *MPT =
Result->getAs<MemberPointerType>();
5631 if(MPT && PointeeType != MPT->getPointeeType()) {
5632assert(isa<AdjustedType>(MPT->getPointeeType()));
5633TLB.push<AdjustedTypeLoc>(MPT->getPointeeType());
5636MemberPointerTypeLoc NewTL = TLB.push<MemberPointerTypeLoc>(
Result);
5637NewTL.setSigilLoc(TL.getSigilLoc());
5638NewTL.setClassTInfo(NewClsTInfo);
5643template<
typenameDerived>
5645TreeTransform<Derived>::TransformConstantArrayType(TypeLocBuilder &TLB,
5646ConstantArrayTypeLoc TL) {
5647 constConstantArrayType *
T= TL.getTypePtr();
5648QualType ElementType = getDerived().TransformType(TLB, TL.getElementLoc());
5649 if(ElementType.isNull())
5653Expr *
OldSize= TL.getSizeExpr();
5655 OldSize=
const_cast<Expr*
>(
T->getSizeExpr());
5656Expr *NewSize =
nullptr;
5660NewSize = getDerived().TransformExpr(
OldSize).template getAs<Expr>();
5664QualType
Result= TL.getType();
5665 if(getDerived().AlwaysRebuild() ||
5666ElementType !=
T->getElementType() ||
5667(
T->getSizeExpr() && NewSize !=
OldSize)) {
5668 Result= getDerived().RebuildConstantArrayType(ElementType,
5669 T->getSizeModifier(),
5670 T->getSize(), NewSize,
5671 T->getIndexTypeCVRQualifiers(),
5672TL.getBracketsRange());
5681ArrayTypeLoc NewTL = TLB.push<ArrayTypeLoc>(
Result);
5682NewTL.setLBracketLoc(TL.getLBracketLoc());
5683NewTL.setRBracketLoc(TL.getRBracketLoc());
5684NewTL.setSizeExpr(NewSize);
5689template<
typenameDerived>
5690QualType TreeTransform<Derived>::TransformIncompleteArrayType(
5691TypeLocBuilder &TLB,
5692IncompleteArrayTypeLoc TL) {
5693 constIncompleteArrayType *
T= TL.getTypePtr();
5694QualType ElementType = getDerived().TransformType(TLB, TL.getElementLoc());
5695 if(ElementType.isNull())
5698QualType
Result= TL.getType();
5699 if(getDerived().AlwaysRebuild() ||
5700ElementType !=
T->getElementType()) {
5701 Result= getDerived().RebuildIncompleteArrayType(ElementType,
5702 T->getSizeModifier(),
5703 T->getIndexTypeCVRQualifiers(),
5704TL.getBracketsRange());
5709IncompleteArrayTypeLoc NewTL = TLB.push<IncompleteArrayTypeLoc>(
Result);
5710NewTL.setLBracketLoc(TL.getLBracketLoc());
5711NewTL.setRBracketLoc(TL.getRBracketLoc());
5712NewTL.setSizeExpr(
nullptr);
5717template<
typenameDerived>
5719TreeTransform<Derived>::TransformVariableArrayType(TypeLocBuilder &TLB,
5720VariableArrayTypeLoc TL) {
5721 constVariableArrayType *
T= TL.getTypePtr();
5722QualType ElementType = getDerived().TransformType(TLB, TL.getElementLoc());
5723 if(ElementType.isNull())
5728EnterExpressionEvaluationContext Context(
5730SizeResult = getDerived().TransformExpr(
T->getSizeExpr());
5732 if(SizeResult.isInvalid())
5736 if(SizeResult.isInvalid())
5739Expr *
Size= SizeResult.get();
5741QualType
Result= TL.getType();
5742 if(getDerived().AlwaysRebuild() ||
5743ElementType !=
T->getElementType() ||
5744Size !=
T->getSizeExpr()) {
5745 Result= getDerived().RebuildVariableArrayType(ElementType,
5746 T->getSizeModifier(),
5748 T->getIndexTypeCVRQualifiers(),
5749TL.getBracketsRange());
5756ArrayTypeLoc NewTL = TLB.push<ArrayTypeLoc>(
Result);
5757NewTL.setLBracketLoc(TL.getLBracketLoc());
5758NewTL.setRBracketLoc(TL.getRBracketLoc());
5759NewTL.setSizeExpr(Size);
5764template<
typenameDerived>
5766TreeTransform<Derived>::TransformDependentSizedArrayType(TypeLocBuilder &TLB,
5767DependentSizedArrayTypeLoc TL) {
5768 constDependentSizedArrayType *
T= TL.getTypePtr();
5769QualType ElementType = getDerived().TransformType(TLB, TL.getElementLoc());
5770 if(ElementType.isNull())
5778SemaRef.
ExprEvalContexts.back().InConditionallyConstantEvaluateContext =
true;
5781Expr *origSize = TL.getSizeExpr();
5782 if(!origSize) origSize =
T->getSizeExpr();
5785= getDerived().TransformExpr(origSize);
5787 if(sizeResult.isInvalid())
5790Expr *size = sizeResult.get();
5792QualType
Result= TL.getType();
5793 if(getDerived().AlwaysRebuild() ||
5794ElementType !=
T->getElementType() ||
5796 Result= getDerived().RebuildDependentSizedArrayType(ElementType,
5797 T->getSizeModifier(),
5799 T->getIndexTypeCVRQualifiers(),
5800TL.getBracketsRange());
5807ArrayTypeLoc NewTL = TLB.push<ArrayTypeLoc>(
Result);
5808NewTL.setLBracketLoc(TL.getLBracketLoc());
5809NewTL.setRBracketLoc(TL.getRBracketLoc());
5810NewTL.setSizeExpr(size);
5815template<
typenameDerived>
5816QualType TreeTransform<Derived>::TransformDependentVectorType(
5817TypeLocBuilder &TLB, DependentVectorTypeLoc TL) {
5818 constDependentVectorType *
T= TL.getTypePtr();
5819QualType ElementType = getDerived().TransformType(TLB, TL.getElementLoc());
5820 if(ElementType.isNull())
5828 if(
Size.isInvalid())
5831QualType
Result= TL.getType();
5832 if(getDerived().AlwaysRebuild() || ElementType !=
T->getElementType() ||
5833 Size.get() !=
T->getSizeExpr()) {
5834 Result= getDerived().RebuildDependentVectorType(
5835ElementType,
Size.get(),
T->getAttributeLoc(),
T->getVectorKind());
5841 if(isa<DependentVectorType>(
Result)) {
5842DependentVectorTypeLoc NewTL =
5843TLB.push<DependentVectorTypeLoc>(
Result);
5844NewTL.setNameLoc(TL.getNameLoc());
5846VectorTypeLoc NewTL = TLB.push<VectorTypeLoc>(
Result);
5847NewTL.setNameLoc(TL.getNameLoc());
5853template<
typenameDerived>
5854QualType TreeTransform<Derived>::TransformDependentSizedExtVectorType(
5855TypeLocBuilder &TLB,
5856DependentSizedExtVectorTypeLoc TL) {
5857 constDependentSizedExtVectorType *
T= TL.getTypePtr();
5860QualType ElementType = getDerived().TransformType(TLB, TL.getElementLoc());
5861 if(ElementType.isNull())
5870 if(
Size.isInvalid())
5873QualType
Result= TL.getType();
5874 if(getDerived().AlwaysRebuild() ||
5875ElementType !=
T->getElementType() ||
5876 Size.get() !=
T->getSizeExpr()) {
5877 Result= getDerived().RebuildDependentSizedExtVectorType(ElementType,
5879 T->getAttributeLoc());
5885 if(isa<DependentSizedExtVectorType>(
Result)) {
5886DependentSizedExtVectorTypeLoc NewTL
5887= TLB.push<DependentSizedExtVectorTypeLoc>(
Result);
5888NewTL.setNameLoc(TL.getNameLoc());
5890ExtVectorTypeLoc NewTL = TLB.push<ExtVectorTypeLoc>(
Result);
5891NewTL.setNameLoc(TL.getNameLoc());
5897template<
typenameDerived>
5899TreeTransform<Derived>::TransformConstantMatrixType(TypeLocBuilder &TLB,
5900ConstantMatrixTypeLoc TL) {
5901 constConstantMatrixType *
T= TL.getTypePtr();
5902QualType ElementType = getDerived().TransformType(
T->getElementType());
5903 if(ElementType.isNull())
5906QualType
Result= TL.getType();
5907 if(getDerived().AlwaysRebuild() || ElementType !=
T->getElementType()) {
5908 Result= getDerived().RebuildConstantMatrixType(
5909ElementType,
T->getNumRows(),
T->getNumColumns());
5914ConstantMatrixTypeLoc NewTL = TLB.push<ConstantMatrixTypeLoc>(
Result);
5915NewTL.setAttrNameLoc(TL.getAttrNameLoc());
5916NewTL.setAttrOperandParensRange(TL.getAttrOperandParensRange());
5917NewTL.setAttrRowOperand(TL.getAttrRowOperand());
5918NewTL.setAttrColumnOperand(TL.getAttrColumnOperand());
5923template<
typenameDerived>
5924QualType TreeTransform<Derived>::TransformDependentSizedMatrixType(
5925TypeLocBuilder &TLB, DependentSizedMatrixTypeLoc TL) {
5926 constDependentSizedMatrixType *
T= TL.getTypePtr();
5928QualType ElementType = getDerived().TransformType(
T->getElementType());
5929 if(ElementType.isNull()) {
5937Expr *origRows = TL.getAttrRowOperand();
5939origRows =
T->getRowExpr();
5940Expr *origColumns = TL.getAttrColumnOperand();
5942origColumns =
T->getColumnExpr();
5944 ExprResultrowResult = getDerived().TransformExpr(origRows);
5946 if(rowResult.isInvalid())
5949 ExprResultcolumnResult = getDerived().TransformExpr(origColumns);
5951 if(columnResult.isInvalid())
5954Expr *rows = rowResult.get();
5955Expr *columns = columnResult.get();
5957QualType
Result= TL.getType();
5958 if(getDerived().AlwaysRebuild() || ElementType !=
T->getElementType() ||
5959rows != origRows || columns != origColumns) {
5960 Result= getDerived().RebuildDependentSizedMatrixType(
5961ElementType, rows, columns,
T->getAttributeLoc());
5969MatrixTypeLoc NewTL = TLB.push<MatrixTypeLoc>(
Result);
5970NewTL.setAttrNameLoc(TL.getAttrNameLoc());
5971NewTL.setAttrOperandParensRange(TL.getAttrOperandParensRange());
5972NewTL.setAttrRowOperand(rows);
5973NewTL.setAttrColumnOperand(columns);
5977template<
typenameDerived>
5978QualType TreeTransform<Derived>::TransformDependentAddressSpaceType(
5979TypeLocBuilder &TLB, DependentAddressSpaceTypeLoc TL) {
5980 constDependentAddressSpaceType *
T= TL.getTypePtr();
5982QualType pointeeType =
5983getDerived().TransformType(TLB, TL.getPointeeTypeLoc());
5985 if(pointeeType.isNull())
5992 ExprResultAddrSpace = getDerived().TransformExpr(
T->getAddrSpaceExpr());
5994 if(AddrSpace.isInvalid())
5997QualType
Result= TL.getType();
5998 if(getDerived().AlwaysRebuild() || pointeeType !=
T->
getPointeeType() ||
5999AddrSpace.get() !=
T->getAddrSpaceExpr()) {
6000 Result= getDerived().RebuildDependentAddressSpaceType(
6001pointeeType, AddrSpace.get(),
T->getAttributeLoc());
6007 if(isa<DependentAddressSpaceType>(
Result)) {
6008DependentAddressSpaceTypeLoc NewTL =
6009TLB.push<DependentAddressSpaceTypeLoc>(
Result);
6011NewTL.setAttrOperandParensRange(TL.getAttrOperandParensRange());
6012NewTL.setAttrExprOperand(TL.getAttrExprOperand());
6013NewTL.setAttrNameLoc(TL.getAttrNameLoc());
6016TLB.TypeWasModifiedSafely(
Result);
6022template<
typenameDerived>
6023QualType TreeTransform<Derived>::TransformVectorType(TypeLocBuilder &TLB,
6025 constVectorType *
T= TL.getTypePtr();
6026QualType ElementType = getDerived().TransformType(TLB, TL.getElementLoc());
6027 if(ElementType.isNull())
6030QualType
Result= TL.getType();
6031 if(getDerived().AlwaysRebuild() ||
6032ElementType !=
T->getElementType()) {
6033 Result= getDerived().RebuildVectorType(ElementType,
T->getNumElements(),
6034 T->getVectorKind());
6039VectorTypeLoc NewTL = TLB.push<VectorTypeLoc>(
Result);
6040NewTL.setNameLoc(TL.getNameLoc());
6045template<
typenameDerived>
6046QualType TreeTransform<Derived>::TransformExtVectorType(TypeLocBuilder &TLB,
6047ExtVectorTypeLoc TL) {
6048 constVectorType *
T= TL.getTypePtr();
6049QualType ElementType = getDerived().TransformType(TLB, TL.getElementLoc());
6050 if(ElementType.isNull())
6053QualType
Result= TL.getType();
6054 if(getDerived().AlwaysRebuild() ||
6055ElementType !=
T->getElementType()) {
6056 Result= getDerived().RebuildExtVectorType(ElementType,
6057 T->getNumElements(),
6063ExtVectorTypeLoc NewTL = TLB.push<ExtVectorTypeLoc>(
Result);
6064NewTL.setNameLoc(TL.getNameLoc());
6069template<
typenameDerived>
6072std::optional<unsigned> NumExpansions,
boolExpectParameterPack) {
6076 if(NumExpansions && isa<PackExpansionType>(OldDI->
getType())) {
6103NewDI = getDerived().TransformType(OldDI);
6107 if(NewDI == OldDI && indexAdjustment == 0)
6121transformedLocalDecl(OldParm, {newParm});
6125template<
typenameDerived>
6133 unsigned*LastParamTransformed) {
6134 intindexAdjustment = 0;
6136 unsignedNumParams = Params.size();
6137 for(
unsignedi = 0; i != NumParams; ++i) {
6138 if(LastParamTransformed)
6139*LastParamTransformed = i;
6141assert(OldParm->getFunctionScopeIndex() == i);
6143std::optional<unsigned> NumExpansions;
6145 if(OldParm->isParameterPack()) {
6150 TypeLocTL = OldParm->getTypeSourceInfo()->getTypeLoc();
6156 boolShouldExpand =
false;
6157 boolRetainExpansion =
false;
6158std::optional<unsigned> OrigNumExpansions;
6159 if(Unexpanded.size() > 0) {
6161NumExpansions = OrigNumExpansions;
6162 if(getDerived().TryExpandParameterPacks(ExpansionTL.
getEllipsisLoc(),
6163Pattern.getSourceRange(),
6175 "Could not find parameter packs or undeduced auto type!");
6182getDerived().ExpandingFunctionParameterPack(OldParm);
6183 for(
unsignedI = 0; I != *NumExpansions; ++I) {
6186= getDerived().TransformFunctionTypeParam(OldParm,
6194PInfos.
set(OutParamTypes.size(), ParamInfos[i]);
6195OutParamTypes.push_back(NewParm->
getType());
6197PVars->push_back(NewParm);
6202 if(RetainExpansion) {
6203ForgetPartiallySubstitutedPackRAII Forget(getDerived());
6205= getDerived().TransformFunctionTypeParam(OldParm,
6213PInfos.
set(OutParamTypes.size(), ParamInfos[i]);
6214OutParamTypes.push_back(NewParm->
getType());
6216PVars->push_back(NewParm);
6232NewParm = getDerived().TransformFunctionTypeParam(OldParm,
6237 "Parameter pack no longer a parameter pack after " 6238 "transformation.");
6240NewParm = getDerived().TransformFunctionTypeParam(
6241OldParm, indexAdjustment, std::nullopt,
6249PInfos.
set(OutParamTypes.size(), ParamInfos[i]);
6250OutParamTypes.push_back(NewParm->
getType());
6252PVars->push_back(NewParm);
6260 boolIsPackExpansion =
false;
6261std::optional<unsigned> NumExpansions;
6264= dyn_cast<PackExpansionType>(OldType)) {
6266 QualTypePattern = Expansion->getPattern();
6268getSema().collectUnexpandedParameterPacks(Pattern, Unexpanded);
6271 boolShouldExpand =
false;
6272 boolRetainExpansion =
false;
6284 for(
unsignedI = 0; I != *NumExpansions; ++I) {
6286 QualTypeNewType = getDerived().TransformType(Pattern);
6291NewType = getSema().getASTContext().getPackExpansionType(
6292NewType, std::nullopt);
6299PInfos.
set(OutParamTypes.size(), ParamInfos[i]);
6300OutParamTypes.push_back(NewType);
6302PVars->push_back(
nullptr);
6311 if(RetainExpansion) {
6312ForgetPartiallySubstitutedPackRAII Forget(getDerived());
6313 QualTypeNewType = getDerived().TransformType(Pattern);
6318PInfos.
set(OutParamTypes.size(), ParamInfos[i]);
6319OutParamTypes.push_back(NewType);
6321PVars->push_back(
nullptr);
6326OldType = Expansion->getPattern();
6327IsPackExpansion =
true;
6329NewType = getDerived().TransformType(OldType);
6331NewType = getDerived().TransformType(OldType);
6337 if(IsPackExpansion)
6338NewType = getSema().Context.getPackExpansionType(NewType,
6342PInfos.
set(OutParamTypes.size(), ParamInfos[i]);
6343OutParamTypes.push_back(NewType);
6345PVars->push_back(
nullptr);
6350 for(
unsignedi = 0, e = PVars->size(); i != e; ++i)
6352assert(parm->getFunctionScopeIndex() == i);
6359template<
typenameDerived>
6364 returngetDerived().TransformFunctionProtoType(
6367 returngetDerived().TransformExceptionSpec(TL.
getBeginLoc(), ESI,
6368ExceptionStorage, Changed);
6372template<
typenameDerived>
template<
typenameFn>
6375 QualifiersThisTypeQuals, Fn TransformExceptionSpec) {
6392 if(getDerived().TransformFunctionTypeParams(
6396ParamTypes, &ParamDecls, ExtParamInfos))
6408SemaRef, !ThisContext && RD ? RD : ThisContext, ThisTypeQuals);
6410ResultType = getDerived().TransformType(TLB, TL.
getReturnLoc());
6411 if(ResultType.
isNull())
6416ResultType = getDerived().TransformType(TLB, TL.
getReturnLoc());
6417 if(ResultType.
isNull())
6420 if(getDerived().TransformFunctionTypeParams(
6424ParamTypes, &ParamDecls, ExtParamInfos))
6430 boolEPIChanged =
false;
6431 if(TransformExceptionSpec(EPI.
ExceptionSpec, EPIChanged))
6435 if(
autoNewExtParamInfos =
6451std::optional<FunctionEffectSet> NewFX;
6460 ExprResultNewExpr = getDerived().TransformExpr(CondExpr);
6463std::optional<FunctionEffectMode> Mode =
6483 "FunctionEffectMode::None shouldn't be possible here");
6489NewFX->insert(NewEC, Errs);
6490assert(Errs.empty());
6498 if(getDerived().AlwaysRebuild() || ResultType !=
T->
getReturnType() ||
6500 Result= getDerived().RebuildFunctionProtoType(ResultType, ParamTypes, EPI);
6511 for(
unsignedi = 0, e = NewTL.
getNumParams(); i != e; ++i)
6512NewTL.
setParam(i, ParamDecls[i]);
6517template<
typenameDerived>
6527 auto*Method = dyn_cast_if_present<CXXMethodDecl>(ESI.
SourceTemplate);
6529SemaRef, Method ? Method->getParent() :
nullptr,
6530Method ? Method->getMethodQualifiers() :
Qualifiers{},
6531Method !=
nullptr);
6540getSema().ActOnNoexceptSpec(NoexceptExpr.
get(), EST);
6563assert(!Unexpanded.empty() &&
"Pack expansion without parameter packs?");
6568 boolExpand =
false;
6569 boolRetainExpansion =
false;
6570std::optional<unsigned> NumExpansions = PackExpansion->getNumExpansions();
6573 if(getDerived().TryExpandParameterPacks(
6575RetainExpansion, NumExpansions))
6583 QualType U= getDerived().TransformType(PackExpansion->getPattern());
6588Exceptions.push_back(
U);
6594 for(
unsignedArgIdx = 0; ArgIdx != *NumExpansions; ++ArgIdx) {
6597 QualType U= getDerived().TransformType(PackExpansion->getPattern());
6601Exceptions.push_back(
U);
6604 QualType U= getDerived().TransformType(
T);
6610Exceptions.push_back(
U);
6620template<
typenameDerived>
6626 if(ResultType.
isNull())
6630 if(getDerived().AlwaysRebuild() || ResultType !=
T->
getReturnType())
6631 Result= getDerived().RebuildFunctionNoProtoType(ResultType);
6642template<
typenameDerived>
6643QualType TreeTransform<Derived>::TransformUnresolvedUsingType(
6644TypeLocBuilder &TLB, UnresolvedUsingTypeLoc TL) {
6645 constUnresolvedUsingType *
T= TL.getTypePtr();
6646Decl *
D= getDerived().TransformDecl(TL.getNameLoc(),
T->getDecl());
6650QualType
Result= TL.getType();
6651 if(getDerived().AlwaysRebuild() ||
D!=
T->getDecl()) {
6652 Result= getDerived().RebuildUnresolvedUsingType(TL.getNameLoc(),
D);
6659TypeSpecTypeLoc NewTL = TLB.pushTypeSpec(
Result);
6660NewTL.setNameLoc(TL.getNameLoc());
6665template<
typenameDerived>
6666QualType TreeTransform<Derived>::TransformUsingType(TypeLocBuilder &TLB,
6668 constUsingType *
T= TL.getTypePtr();
6670 auto*
Found= cast_or_null<UsingShadowDecl>(getDerived().TransformDecl(
6671TL.getLocalSourceRange().getBegin(),
T->getFoundDecl()));
6675QualType Underlying = getDerived().TransformType(
T->
desugar());
6676 if(Underlying.isNull())
6679QualType
Result= TL.getType();
6680 if(getDerived().AlwaysRebuild() ||
Found!=
T->getFoundDecl() ||
6681Underlying !=
T->getUnderlyingType()) {
6682 Result= getDerived().RebuildUsingType(
Found, Underlying);
6687TLB.pushTypeSpec(
Result).setNameLoc(TL.getNameLoc());
6691template<
typenameDerived>
6692QualType TreeTransform<Derived>::TransformTypedefType(TypeLocBuilder &TLB,
6693TypedefTypeLoc TL) {
6694 constTypedefType *
T= TL.getTypePtr();
6695TypedefNameDecl *Typedef
6696= cast_or_null<TypedefNameDecl>(getDerived().TransformDecl(TL.getNameLoc(),
6701QualType
Result= TL.getType();
6702 if(getDerived().AlwaysRebuild() ||
6703Typedef !=
T->getDecl()) {
6704 Result= getDerived().RebuildTypedefType(Typedef);
6709TypedefTypeLoc NewTL = TLB.push<TypedefTypeLoc>(
Result);
6710NewTL.setNameLoc(TL.getNameLoc());
6715template<
typenameDerived>
6716QualType TreeTransform<Derived>::TransformTypeOfExprType(TypeLocBuilder &TLB,
6717TypeOfExprTypeLoc TL) {
6723 ExprResult E= getDerived().TransformExpr(TL.getUnderlyingExpr());
6724 if(
E.isInvalid())
6728 if(
E.isInvalid())
6731QualType
Result= TL.getType();
6733 if(getDerived().AlwaysRebuild() ||
E.get() != TL.getUnderlyingExpr()) {
6735getDerived().RebuildTypeOfExprType(
E.get(), TL.getTypeofLoc(), Kind);
6740TypeOfExprTypeLoc NewTL = TLB.push<TypeOfExprTypeLoc>(
Result);
6741NewTL.setTypeofLoc(TL.getTypeofLoc());
6742NewTL.setLParenLoc(TL.getLParenLoc());
6743NewTL.setRParenLoc(TL.getRParenLoc());
6748template<
typenameDerived>
6749QualType TreeTransform<Derived>::TransformTypeOfType(TypeLocBuilder &TLB,
6751TypeSourceInfo* Old_Under_TI = TL.getUnmodifiedTInfo();
6752TypeSourceInfo* New_Under_TI = getDerived().TransformType(Old_Under_TI);
6756QualType
Result= TL.getType();
6758 if(getDerived().AlwaysRebuild() || New_Under_TI != Old_Under_TI) {
6759 Result= getDerived().RebuildTypeOfType(New_Under_TI->getType(), Kind);
6764TypeOfTypeLoc NewTL = TLB.push<TypeOfTypeLoc>(
Result);
6765NewTL.setTypeofLoc(TL.getTypeofLoc());
6766NewTL.setLParenLoc(TL.getLParenLoc());
6767NewTL.setRParenLoc(TL.getRParenLoc());
6768NewTL.setUnmodifiedTInfo(New_Under_TI);
6773template<
typenameDerived>
6774QualType TreeTransform<Derived>::TransformDecltypeType(TypeLocBuilder &TLB,
6775DecltypeTypeLoc TL) {
6776 constDecltypeType *
T= TL.getTypePtr();
6783 ExprResult E= getDerived().TransformExpr(
T->getUnderlyingExpr());
6784 if(
E.isInvalid())
6787 E= getSema().ActOnDecltypeExpression(
E.get());
6788 if(
E.isInvalid())
6791QualType
Result= TL.getType();
6792 if(getDerived().AlwaysRebuild() ||
6793 E.get() !=
T->getUnderlyingExpr()) {
6794 Result= getDerived().RebuildDecltypeType(
E.get(), TL.getDecltypeLoc());
6800DecltypeTypeLoc NewTL = TLB.push<DecltypeTypeLoc>(
Result);
6801NewTL.setDecltypeLoc(TL.getDecltypeLoc());
6802NewTL.setRParenLoc(TL.getRParenLoc());
6806template<
typenameDerived>
6808TreeTransform<Derived>::TransformPackIndexingType(TypeLocBuilder &TLB,
6809PackIndexingTypeLoc TL) {
6813EnterExpressionEvaluationContext ConstantContext(
6816IndexExpr = getDerived().TransformExpr(TL.getIndexExpr());
6817 if(IndexExpr.isInvalid())
6820QualType Pattern = TL.getPattern();
6822 constPackIndexingType *PIT = TL.getTypePtr();
6826 boolNotYetExpanded = Types.empty();
6827 boolFullySubstituted =
true;
6829 if(Types.empty() && !PIT->expandsToEmptyPack())
6832 for(QualType
T: Types) {
6834QualType Transformed = getDerived().TransformType(
T);
6835 if(Transformed.isNull())
6837SubtitutedTypes.push_back(Transformed);
6842getSema().collectUnexpandedParameterPacks(
T, Unexpanded);
6843assert(!Unexpanded.empty() &&
"Pack expansion without parameter packs?");
6846 boolShouldExpand =
true;
6847 boolRetainExpansion =
false;
6848std::optional<unsigned> OrigNumExpansions;
6849std::optional<unsigned> NumExpansions = OrigNumExpansions;
6850 if(getDerived().TryExpandParameterPacks(TL.getEllipsisLoc(), SourceRange(),
6851Unexpanded, ShouldExpand,
6852RetainExpansion, NumExpansions))
6854 if(!ShouldExpand) {
6855Sema::ArgumentPackSubstitutionIndexRAII SubstIndex(getSema(), -1);
6858TypeSourceInfo *TI =
6860QualType Pack = getDerived().TransformType(TLB, TI->getTypeLoc());
6863 if(NotYetExpanded) {
6864FullySubstituted =
false;
6865QualType Out = getDerived().RebuildPackIndexingType(
6866Pack, IndexExpr.get(), SourceLocation(), TL.getEllipsisLoc(),
6871PackIndexingTypeLoc
Loc= TLB.push<PackIndexingTypeLoc>(Out);
6872 Loc.setEllipsisLoc(TL.getEllipsisLoc());
6875SubtitutedTypes.push_back(Pack);
6878 for(
unsignedI = 0; I != *NumExpansions; ++I) {
6879Sema::ArgumentPackSubstitutionIndexRAII SubstIndex(getSema(), I);
6880QualType Out = getDerived().TransformType(
T);
6883SubtitutedTypes.push_back(Out);
6884FullySubstituted &= !Out->containsUnexpandedParameterPack();
6888 if(RetainExpansion) {
6889FullySubstituted =
false;
6890ForgetPartiallySubstitutedPackRAII Forget(getDerived());
6891QualType Out = getDerived().TransformType(
T);
6894SubtitutedTypes.push_back(Out);
6901Sema::ArgumentPackSubstitutionIndexRAII SubstIndex(getSema(), -1);
6902QualType
Result= getDerived().TransformType(TLB, TL.getPatternLoc());
6904QualType Out = getDerived().RebuildPackIndexingType(
6905 Result, IndexExpr.get(), SourceLocation(), TL.getEllipsisLoc(),
6906FullySubstituted, SubtitutedTypes);
6910PackIndexingTypeLoc
Loc= TLB.push<PackIndexingTypeLoc>(Out);
6911 Loc.setEllipsisLoc(TL.getEllipsisLoc());
6915template<
typenameDerived>
6916QualType TreeTransform<Derived>::TransformUnaryTransformType(
6917TypeLocBuilder &TLB,
6918UnaryTransformTypeLoc TL) {
6919QualType
Result= TL.getType();
6920 if(
Result->isDependentType()) {
6921 constUnaryTransformType *
T= TL.getTypePtr();
6923TypeSourceInfo *NewBaseTSI =
6924getDerived().TransformType(TL.getUnderlyingTInfo());
6927QualType NewBase = NewBaseTSI->getType();
6929 Result= getDerived().RebuildUnaryTransformType(NewBase,
6936UnaryTransformTypeLoc NewTL = TLB.push<UnaryTransformTypeLoc>(
Result);
6937NewTL.setKWLoc(TL.getKWLoc());
6938NewTL.setParensRange(TL.getParensRange());
6939NewTL.setUnderlyingTInfo(TL.getUnderlyingTInfo());
6943template<
typenameDerived>
6944QualType TreeTransform<Derived>::TransformDeducedTemplateSpecializationType(
6945TypeLocBuilder &TLB, DeducedTemplateSpecializationTypeLoc TL) {
6946 constDeducedTemplateSpecializationType *
T= TL.getTypePtr();
6949TemplateName TemplateName = getDerived().TransformTemplateName(
6950SS,
T->getTemplateName(), TL.getTemplateNameLoc());
6951 if(TemplateName.isNull())
6954QualType OldDeduced =
T->getDeducedType();
6955QualType NewDeduced;
6956 if(!OldDeduced.isNull()) {
6957NewDeduced = getDerived().TransformType(OldDeduced);
6958 if(NewDeduced.isNull())
6962QualType
Result= getDerived().RebuildDeducedTemplateSpecializationType(
6963TemplateName, NewDeduced);
6967DeducedTemplateSpecializationTypeLoc NewTL =
6968TLB.push<DeducedTemplateSpecializationTypeLoc>(
Result);
6969NewTL.setTemplateNameLoc(TL.getTemplateNameLoc());
6974template<
typenameDerived>
6975QualType TreeTransform<Derived>::TransformRecordType(TypeLocBuilder &TLB,
6977 constRecordType *
T= TL.getTypePtr();
6979= cast_or_null<RecordDecl>(getDerived().TransformDecl(TL.getNameLoc(),
6984QualType
Result= TL.getType();
6985 if(getDerived().AlwaysRebuild() ||
6992RecordTypeLoc NewTL = TLB.push<RecordTypeLoc>(
Result);
6993NewTL.setNameLoc(TL.getNameLoc());
6998template<
typenameDerived>
6999QualType TreeTransform<Derived>::TransformEnumType(TypeLocBuilder &TLB,
7001 constEnumType *
T= TL.getTypePtr();
7003= cast_or_null<EnumDecl>(getDerived().TransformDecl(TL.getNameLoc(),
7008QualType
Result= TL.getType();
7009 if(getDerived().AlwaysRebuild() ||
7010 Enum!=
T->getDecl()) {
7011 Result= getDerived().RebuildEnumType(
Enum);
7016EnumTypeLoc NewTL = TLB.push<EnumTypeLoc>(
Result);
7017NewTL.setNameLoc(TL.getNameLoc());
7022template<
typenameDerived>
7023QualType TreeTransform<Derived>::TransformInjectedClassNameType(
7024TypeLocBuilder &TLB,
7025InjectedClassNameTypeLoc TL) {
7026 Decl*
D= getDerived().TransformDecl(TL.getNameLoc(),
7027TL.getTypePtr()->getDecl());
7028 if(!
D)
returnQualType();
7031TLB.pushTypeSpec(
T).setNameLoc(TL.getNameLoc());
7035template<
typenameDerived>
7039 returngetDerived().TransformTemplateTypeParmType(
7044template<
typenameDerived>
7050template<
typenameDerived>
7051QualType TreeTransform<Derived>::TransformSubstTemplateTypeParmType(
7052TypeLocBuilder &TLB,
7053SubstTemplateTypeParmTypeLoc TL) {
7054 constSubstTemplateTypeParmType *
T= TL.getTypePtr();
7057getDerived().TransformDecl(TL.getNameLoc(),
T->getAssociatedDecl());
7062TemporaryBase Rebase(*
this, TL.getNameLoc(), DeclarationName());
7063QualType Replacement = getDerived().TransformType(
T->getReplacementType());
7064 if(Replacement.isNull())
7068Replacement, NewReplaced,
T->getIndex(),
T->getPackIndex());
7071SubstTemplateTypeParmTypeLoc NewTL
7072= TLB.push<SubstTemplateTypeParmTypeLoc>(
Result);
7073NewTL.setNameLoc(TL.getNameLoc());
7078template<
typenameDerived>
7082 returngetDerived().TransformSubstTemplateTypeParmPackType(
7086template<
typenameDerived>
7092template<
typenameDerived>
7102= getDerived().TransformTemplateName(SS,
T->getTemplateName(),
7107 returngetDerived().TransformTemplateSpecializationType(TLB, TL, Template);
7110template<
typenameDerived>
7114 if(ValueType.
isNull())
7118 if(getDerived().AlwaysRebuild() ||
7120 Result= getDerived().RebuildAtomicType(ValueType, TL.
getKWLoc());
7125AtomicTypeLoc NewTL = TLB.
push<AtomicTypeLoc>(
Result);
7133template<
typenameDerived>
7134QualType TreeTransform<Derived>::TransformPipeType(TypeLocBuilder &TLB,
7136QualType ValueType = getDerived().TransformType(TLB, TL.getValueLoc());
7137 if(ValueType.isNull())
7140QualType
Result= TL.getType();
7141 if(getDerived().AlwaysRebuild() || ValueType != TL.getValueLoc().getType()) {
7142 constPipeType *PT =
Result->castAs<PipeType>();
7143 boolisReadPipe = PT->isReadOnly();
7144 Result= getDerived().RebuildPipeType(ValueType, TL.getKWLoc(), isReadPipe);
7149PipeTypeLoc NewTL = TLB.push<PipeTypeLoc>(
Result);
7150NewTL.setKWLoc(TL.getKWLoc());
7155template<
typenameDerived>
7156QualType TreeTransform<Derived>::TransformBitIntType(TypeLocBuilder &TLB,
7158 constBitIntType *EIT = TL.getTypePtr();
7159QualType
Result= TL.getType();
7161 if(getDerived().AlwaysRebuild()) {
7162 Result= getDerived().RebuildBitIntType(EIT->isUnsigned(),
7163EIT->getNumBits(), TL.getNameLoc());
7168BitIntTypeLoc NewTL = TLB.push<BitIntTypeLoc>(
Result);
7169NewTL.setNameLoc(TL.getNameLoc());
7173template<
typenameDerived>
7174QualType TreeTransform<Derived>::TransformDependentBitIntType(
7175TypeLocBuilder &TLB, DependentBitIntTypeLoc TL) {
7176 constDependentBitIntType *EIT = TL.getTypePtr();
7180 ExprResultBitsExpr = getDerived().TransformExpr(EIT->getNumBitsExpr());
7183 if(BitsExpr.isInvalid())
7186QualType
Result= TL.getType();
7188 if(getDerived().AlwaysRebuild() || BitsExpr.get() != EIT->getNumBitsExpr()) {
7189 Result= getDerived().RebuildDependentBitIntType(
7190EIT->isUnsigned(), BitsExpr.get(), TL.getNameLoc());
7196 if(isa<DependentBitIntType>(
Result)) {
7197DependentBitIntTypeLoc NewTL = TLB.push<DependentBitIntTypeLoc>(
Result);
7198NewTL.setNameLoc(TL.getNameLoc());
7200BitIntTypeLoc NewTL = TLB.push<BitIntTypeLoc>(
Result);
7201NewTL.setNameLoc(TL.getNameLoc());
7211 template<
typenameArgLocContainer>
7213ArgLocContainer *Container;
7238: Container(&Container), Index(Index) { }
7252 returnContainer->getArgLoc(Index);
7256 return pointer(Container->getArgLoc(Index));
7261 return X.Container == Y.Container &&
X.Index == Y.Index;
7270template<
typenameDerived>
7271QualType TreeTransform<Derived>::TransformAutoType(TypeLocBuilder &TLB,
7273 constAutoType *
T= TL.getTypePtr();
7274QualType OldDeduced =
T->getDeducedType();
7275QualType NewDeduced;
7276 if(!OldDeduced.isNull()) {
7277NewDeduced = getDerived().TransformType(OldDeduced);
7278 if(NewDeduced.isNull())
7282ConceptDecl *NewCD =
nullptr;
7283TemplateArgumentListInfo NewTemplateArgs;
7284NestedNameSpecifierLoc NewNestedNameSpec;
7285 if(
T->isConstrained()) {
7286assert(TL.getConceptReference());
7287NewCD = cast_or_null<ConceptDecl>(getDerived().TransformDecl(
7288TL.getConceptNameLoc(),
T->getTypeConstraintConcept()));
7290NewTemplateArgs.setLAngleLoc(TL.getLAngleLoc());
7291NewTemplateArgs.setRAngleLoc(TL.getRAngleLoc());
7292 typedefTemplateArgumentLocContainerIterator<AutoTypeLoc> ArgIterator;
7293 if(getDerived().TransformTemplateArguments(
7294ArgIterator(TL, 0), ArgIterator(TL, TL.getNumArgs()),
7298 if(TL.getNestedNameSpecifierLoc()) {
7300= getDerived().TransformNestedNameSpecifierLoc(
7301TL.getNestedNameSpecifierLoc());
7302 if(!NewNestedNameSpec)
7307QualType
Result= TL.getType();
7308 if(getDerived().AlwaysRebuild() || NewDeduced != OldDeduced ||
7312NewArgList.reserve(NewTemplateArgs.size());
7313 for(
const auto&ArgLoc : NewTemplateArgs.arguments())
7314NewArgList.push_back(ArgLoc.getArgument());
7315 Result= getDerived().RebuildAutoType(NewDeduced,
T->getKeyword(), NewCD,
7321AutoTypeLoc NewTL = TLB.push<AutoTypeLoc>(
Result);
7322NewTL.setNameLoc(TL.getNameLoc());
7323NewTL.setRParenLoc(TL.getRParenLoc());
7324NewTL.setConceptReference(
nullptr);
7326 if(
T->isConstrained()) {
7327DeclarationNameInfo DNI = DeclarationNameInfo(
7328TL.getTypePtr()->getTypeConstraintConcept()->getDeclName(),
7329TL.getConceptNameLoc(),
7330TL.getTypePtr()->getTypeConstraintConcept()->getDeclName());
7332SemaRef.
Context, NewNestedNameSpec, TL.getTemplateKWLoc(), DNI,
7333TL.getFoundDecl(), TL.getTypePtr()->getTypeConstraintConcept(),
7335NewTL.setConceptReference(CR);
7341template<
typenameDerived>
7343TypeLocBuilder &TLB,
7344TemplateSpecializationTypeLoc TL,
7345TemplateName Template) {
7346TemplateArgumentListInfo NewTemplateArgs;
7347NewTemplateArgs.setLAngleLoc(TL.getLAngleLoc());
7348NewTemplateArgs.setRAngleLoc(TL.getRAngleLoc());
7349 typedefTemplateArgumentLocContainerIterator<TemplateSpecializationTypeLoc>
7351 if(getDerived().TransformTemplateArguments(ArgIterator(TL, 0),
7352ArgIterator(TL, TL.getNumArgs()),
7361getDerived().RebuildTemplateSpecializationType(Template,
7362TL.getTemplateNameLoc(),
7365 if(!
Result.isNull()) {
7370 if(isa<DependentTemplateSpecializationType>(
Result)) {
7371DependentTemplateSpecializationTypeLoc NewTL
7372= TLB.push<DependentTemplateSpecializationTypeLoc>(
Result);
7373NewTL.setElaboratedKeywordLoc(SourceLocation());
7374NewTL.setQualifierLoc(NestedNameSpecifierLoc());
7375NewTL.setTemplateKeywordLoc(TL.getTemplateKeywordLoc());
7376NewTL.setTemplateNameLoc(TL.getTemplateNameLoc());
7377NewTL.setLAngleLoc(TL.getLAngleLoc());
7378NewTL.setRAngleLoc(TL.getRAngleLoc());
7379 for(
unsignedi = 0, e = NewTemplateArgs.size(); i != e; ++i)
7380NewTL.setArgLocInfo(i, NewTemplateArgs[i].getLocInfo());
7384TemplateSpecializationTypeLoc NewTL
7385= TLB.push<TemplateSpecializationTypeLoc>(
Result);
7386NewTL.setTemplateKeywordLoc(TL.getTemplateKeywordLoc());
7387NewTL.setTemplateNameLoc(TL.getTemplateNameLoc());
7388NewTL.setLAngleLoc(TL.getLAngleLoc());
7389NewTL.setRAngleLoc(TL.getRAngleLoc());
7390 for(
unsignedi = 0, e = NewTemplateArgs.size(); i != e; ++i)
7391NewTL.setArgLocInfo(i, NewTemplateArgs[i].getLocInfo());
7397template<
typenameDerived>
7408 if(getDerived().TransformTemplateArguments(ArgIterator(TL, 0),
7416 QualType Result= getSema().Context.getDependentTemplateSpecializationType(
7418DTN->getIdentifier(), NewTemplateArgs.
arguments());
7428 for(
unsignedi = 0, e = NewTemplateArgs.
size(); i != e; ++i)
7434= getDerived().RebuildTemplateSpecializationType(Template,
7438 if(!
Result.isNull()) {
7446 for(
unsignedi = 0, e = NewTemplateArgs.
size(); i != e; ++i)
7453template<
typenameDerived>
7463= getDerived().TransformNestedNameSpecifierLoc(TL.
getQualifierLoc());
7468QualType NamedT = getDerived().TransformType(TLB, TL.
getNamedTypeLoc());
7469 if(NamedT.isNull())
7478 if(
constTemplateSpecializationType *TST =
7479NamedT->getAs<TemplateSpecializationType>()) {
7480TemplateName Template = TST->getTemplateName();
7481 if(TypeAliasTemplateDecl *TAT = dyn_cast_or_null<TypeAliasTemplateDecl>(
7482Template.getAsTemplateDecl())) {
7484diag::err_tag_reference_non_tag)
7486<< llvm::to_underlying(
7488SemaRef.
Diag(TAT->getLocation(), diag::note_declared_at);
7494 if(getDerived().AlwaysRebuild() ||
7496NamedT !=
T->getNamedType()) {
7499QualifierLoc, NamedT);
7504ElaboratedTypeLoc NewTL = TLB.
push<ElaboratedTypeLoc>(
Result);
7506NewTL.setQualifierLoc(QualifierLoc);
7510template<
typenameDerived>
7511QualType TreeTransform<Derived>::TransformAttributedType(TypeLocBuilder &TLB,
7512AttributedTypeLoc TL) {
7514QualType modifiedType = getDerived().TransformType(TLB, TL.getModifiedLoc());
7515 if(modifiedType.isNull())
7519 constAttr *oldAttr = TL.getAttr();
7520 constAttr *newAttr = oldAttr ? getDerived().TransformAttr(oldAttr) :
nullptr;
7521 if(oldAttr && !newAttr)
7524QualType result = TL.getType();
7527 if(getDerived().AlwaysRebuild() ||
7528modifiedType != oldType->getModifiedType()) {
7541QualType equivalentType = modifiedType;
7542 if(TL.getModifiedLoc().getType() != TL.getEquivalentTypeLoc().getType()) {
7543TypeLocBuilder AuxiliaryTLB;
7544AuxiliaryTLB.reserve(TL.getFullDataSize());
7546getDerived().TransformType(AuxiliaryTLB, TL.getEquivalentTypeLoc());
7547 if(equivalentType.isNull())
7553 if(
autonullability = oldType->getImmediateNullability()) {
7554 if(!modifiedType->canHaveNullability()) {
7555SemaRef.
Diag((TL.getAttr() ? TL.getAttr()->getLocation()
7556: TL.getModifiedLoc().getBeginLoc()),
7557diag::err_nullability_nonpointer)
7569AttributedTypeLoc newTL = TLB.push<AttributedTypeLoc>(result);
7570newTL.setAttr(newAttr);
7574template<
typenameDerived>
7575QualType TreeTransform<Derived>::TransformCountAttributedType(
7576TypeLocBuilder &TLB, CountAttributedTypeLoc TL) {
7577 constCountAttributedType *OldTy = TL.
getTypePtr();
7578QualType InnerTy = getDerived().TransformType(TLB, TL.getInnerLoc());
7579 if(InnerTy.isNull())
7582Expr *OldCount = TL.getCountExpr();
7583Expr *NewCount =
nullptr;
7585 ExprResultCountResult = getDerived().TransformExpr(OldCount);
7586 if(CountResult.isInvalid())
7588NewCount = CountResult.get();
7591QualType
Result= TL.getType();
7592 if(getDerived().AlwaysRebuild() || InnerTy != OldTy->desugar() ||
7593OldCount != NewCount) {
7596InnerTy, NewCount, OldTy->isCountInBytes(), OldTy->isOrNull());
7599TLB.push<CountAttributedTypeLoc>(
Result);
7603template<
typenameDerived>
7604QualType TreeTransform<Derived>::TransformBTFTagAttributedType(
7605TypeLocBuilder &TLB, BTFTagAttributedTypeLoc TL) {
7607llvm_unreachable(
"Unexpected TreeTransform for BTFTagAttributedType");
7610template<
typenameDerived>
7611QualType TreeTransform<Derived>::TransformHLSLAttributedResourceType(
7612TypeLocBuilder &TLB, HLSLAttributedResourceTypeLoc TL) {
7614 constHLSLAttributedResourceType *oldType = TL.getTypePtr();
7616QualType WrappedTy = getDerived().TransformType(TLB, TL.getWrappedLoc());
7617 if(WrappedTy.isNull())
7620QualType ContainedTy = QualType();
7621QualType OldContainedTy = oldType->getContainedType();
7622 if(!OldContainedTy.isNull()) {
7623TypeSourceInfo *oldContainedTSI = TL.getContainedTypeSourceInfo();
7624 if(!oldContainedTSI)
7625oldContainedTSI = getSema().getASTContext().getTrivialTypeSourceInfo(
7626OldContainedTy, SourceLocation());
7627TypeSourceInfo *ContainedTSI = getDerived().TransformType(oldContainedTSI);
7630ContainedTy = ContainedTSI->getType();
7633QualType
Result= TL.getType();
7634 if(getDerived().AlwaysRebuild() || WrappedTy != oldType->getWrappedType() ||
7635ContainedTy != oldType->getContainedType()) {
7637WrappedTy, ContainedTy, oldType->getAttrs());
7640TLB.push<HLSLAttributedResourceTypeLoc>(
Result);
7644template<
typenameDerived>
7646TreeTransform<Derived>::TransformParenType(TypeLocBuilder &TLB,
7648QualType Inner = getDerived().TransformType(TLB, TL.getInnerLoc());
7652QualType
Result= TL.getType();
7653 if(getDerived().AlwaysRebuild() ||
7654Inner != TL.getInnerLoc().getType()) {
7655 Result= getDerived().RebuildParenType(Inner);
7660ParenTypeLoc NewTL = TLB.push<ParenTypeLoc>(
Result);
7661NewTL.setLParenLoc(TL.getLParenLoc());
7662NewTL.setRParenLoc(TL.getRParenLoc());
7666template<
typenameDerived>
7668TreeTransform<Derived>::TransformMacroQualifiedType(TypeLocBuilder &TLB,
7669MacroQualifiedTypeLoc TL) {
7670QualType Inner = getDerived().TransformType(TLB, TL.getInnerLoc());
7674QualType
Result= TL.getType();
7675 if(getDerived().AlwaysRebuild() || Inner != TL.getInnerLoc().getType()) {
7677getDerived().RebuildMacroQualifiedType(Inner, TL.getMacroIdentifier());
7682MacroQualifiedTypeLoc NewTL = TLB.push<MacroQualifiedTypeLoc>(
Result);
7683NewTL.setExpansionLoc(TL.getExpansionLoc());
7687template<
typenameDerived>
7688QualType TreeTransform<Derived>::TransformDependentNameType(
7689TypeLocBuilder &TLB, DependentNameTypeLoc TL) {
7690 returnTransformDependentNameType(TLB, TL,
false);
7693template<
typenameDerived>
7694QualType TreeTransform<Derived>::TransformDependentNameType(
7695TypeLocBuilder &TLB, DependentNameTypeLoc TL,
boolDeducedTSTContext) {
7696 constDependentNameType *
T= TL.getTypePtr();
7698NestedNameSpecifierLoc QualifierLoc
7699= getDerived().TransformNestedNameSpecifierLoc(TL.getQualifierLoc());
7704= getDerived().RebuildDependentNameType(
T->getKeyword(),
7705TL.getElaboratedKeywordLoc(),
7707 T->getIdentifier(),
7713 if(
constElaboratedType* ElabT =
Result->getAs<ElaboratedType>()) {
7714QualType NamedT = ElabT->getNamedType();
7715TLB.pushTypeSpec(NamedT).setNameLoc(TL.getNameLoc());
7717ElaboratedTypeLoc NewTL = TLB.push<ElaboratedTypeLoc>(
Result);
7718NewTL.setElaboratedKeywordLoc(TL.getElaboratedKeywordLoc());
7719NewTL.setQualifierLoc(QualifierLoc);
7721DependentNameTypeLoc NewTL = TLB.push<DependentNameTypeLoc>(
Result);
7722NewTL.setElaboratedKeywordLoc(TL.getElaboratedKeywordLoc());
7723NewTL.setQualifierLoc(QualifierLoc);
7724NewTL.setNameLoc(TL.getNameLoc());
7729template<
typenameDerived>
7732DependentTemplateSpecializationTypeLoc TL) {
7733NestedNameSpecifierLoc QualifierLoc;
7734 if(TL.getQualifierLoc()) {
7736= getDerived().TransformNestedNameSpecifierLoc(TL.getQualifierLoc());
7742.TransformDependentTemplateSpecializationType(TLB, TL, QualifierLoc);
7745template<
typenameDerived>
7758 if(getDerived().TransformTemplateArguments(ArgIterator(TL, 0),
7763 QualType Result= getDerived().RebuildDependentTemplateSpecializationType(
7771 QualTypeNamedT = ElabT->getNamedType();
7780 for(
unsignedI = 0,
E= NewTemplateArgs.
size(); I !=
E; ++I)
7781NamedTL.
setArgLocInfo(I, NewTemplateArgs[I].getLocInfo());
7787}
else if(isa<DependentTemplateSpecializationType>(
Result)) {
7796 for(
unsignedI = 0,
E= NewTemplateArgs.
size(); I !=
E; ++I)
7805 for(
unsignedI = 0,
E= NewTemplateArgs.
size(); I !=
E; ++I)
7811template<
typenameDerived>
7820 if(getDerived().AlwaysRebuild() ||
7822 Result= getDerived().RebuildPackExpansionType(Pattern,
7830PackExpansionTypeLoc NewT = TLB.
push<PackExpansionTypeLoc>(
Result);
7835template<
typenameDerived>
7837TreeTransform<Derived>::TransformObjCInterfaceType(TypeLocBuilder &TLB,
7838ObjCInterfaceTypeLoc TL) {
7840TLB.pushFullCopy(TL);
7841 returnTL.getType();
7844template<
typenameDerived>
7846TreeTransform<Derived>::TransformObjCTypeParamType(TypeLocBuilder &TLB,
7847ObjCTypeParamTypeLoc TL) {
7848 constObjCTypeParamType *
T= TL.getTypePtr();
7849ObjCTypeParamDecl *OTP = cast_or_null<ObjCTypeParamDecl>(
7850getDerived().TransformDecl(
T->getDecl()->getLocation(),
T->getDecl()));
7854QualType
Result= TL.getType();
7855 if(getDerived().AlwaysRebuild() ||
7856OTP !=
T->getDecl()) {
7857 Result= getDerived().RebuildObjCTypeParamType(
7858OTP, TL.getProtocolLAngleLoc(),
7859 llvm::ArrayRef(TL.getTypePtr()->qual_begin(), TL.getNumProtocols()),
7860TL.getProtocolLocs(), TL.getProtocolRAngleLoc());
7865ObjCTypeParamTypeLoc NewTL = TLB.push<ObjCTypeParamTypeLoc>(
Result);
7866 if(TL.getNumProtocols()) {
7867NewTL.setProtocolLAngleLoc(TL.getProtocolLAngleLoc());
7868 for(
unsignedi = 0, n = TL.getNumProtocols(); i != n; ++i)
7869NewTL.setProtocolLoc(i, TL.getProtocolLoc(i));
7870NewTL.setProtocolRAngleLoc(TL.getProtocolRAngleLoc());
7875template<
typenameDerived>
7877TreeTransform<Derived>::TransformObjCObjectType(TypeLocBuilder &TLB,
7878ObjCObjectTypeLoc TL) {
7880QualType BaseType = getDerived().TransformType(TLB, TL.getBaseLoc());
7881 if(BaseType.isNull())
7884 boolAnyChanged = BaseType != TL.getBaseLoc().getType();
7888 for(
unsignedi = 0, n = TL.getNumTypeArgs(); i != n; ++i) {
7889TypeSourceInfo *TypeArgInfo = TL.getTypeArgTInfo(i);
7890TypeLoc TypeArgLoc = TypeArgInfo->getTypeLoc();
7891QualType TypeArg = TypeArgInfo->getType();
7892 if(
autoPackExpansionLoc = TypeArgLoc.getAs<PackExpansionTypeLoc>()) {
7896 const auto*PackExpansion = PackExpansionLoc.getType()
7897->castAs<PackExpansionType>();
7901assert(!Unexpanded.empty() &&
"Pack expansion without parameter packs?");
7905TypeLoc PatternLoc = PackExpansionLoc.getPatternLoc();
7906 boolExpand =
false;
7907 boolRetainExpansion =
false;
7908std::optional<unsigned> NumExpansions = PackExpansion->getNumExpansions();
7909 if(getDerived().TryExpandParameterPacks(
7910PackExpansionLoc.getEllipsisLoc(), PatternLoc.getSourceRange(),
7911Unexpanded, Expand, RetainExpansion, NumExpansions))
7918Sema::ArgumentPackSubstitutionIndexRAII SubstIndex(getSema(), -1);
7920TypeLocBuilder TypeArgBuilder;
7921TypeArgBuilder.reserve(PatternLoc.getFullDataSize());
7922QualType NewPatternType = getDerived().TransformType(TypeArgBuilder,
7924 if(NewPatternType.isNull())
7928NewPatternType, NumExpansions);
7929 autoNewExpansionLoc = TLB.push<PackExpansionTypeLoc>(NewExpansionType);
7930NewExpansionLoc.setEllipsisLoc(PackExpansionLoc.getEllipsisLoc());
7931NewTypeArgInfos.push_back(
7932TypeArgBuilder.getTypeSourceInfo(SemaRef.
Context, NewExpansionType));
7938 for(
unsignedArgIdx = 0; ArgIdx != *NumExpansions; ++ArgIdx) {
7939Sema::ArgumentPackSubstitutionIndexRAII SubstIndex(getSema(), ArgIdx);
7941TypeLocBuilder TypeArgBuilder;
7942TypeArgBuilder.reserve(PatternLoc.getFullDataSize());
7944QualType NewTypeArg = getDerived().TransformType(TypeArgBuilder,
7946 if(NewTypeArg.isNull())
7949NewTypeArgInfos.push_back(
7950TypeArgBuilder.getTypeSourceInfo(SemaRef.
Context, NewTypeArg));
7956TypeLocBuilder TypeArgBuilder;
7957TypeArgBuilder.reserve(TypeArgLoc.getFullDataSize());
7958QualType NewTypeArg =
7959getDerived().TransformType(TypeArgBuilder, TypeArgLoc);
7960 if(NewTypeArg.isNull())
7964 if(NewTypeArg == TypeArg) {
7965NewTypeArgInfos.push_back(TypeArgInfo);
7969NewTypeArgInfos.push_back(
7970TypeArgBuilder.getTypeSourceInfo(SemaRef.
Context, NewTypeArg));
7974QualType
Result= TL.getType();
7975 if(getDerived().AlwaysRebuild() || AnyChanged) {
7977 Result= getDerived().RebuildObjCObjectType(
7978BaseType, TL.getBeginLoc(), TL.getTypeArgsLAngleLoc(), NewTypeArgInfos,
7979TL.getTypeArgsRAngleLoc(), TL.getProtocolLAngleLoc(),
7980 llvm::ArrayRef(TL.getTypePtr()->qual_begin(), TL.getNumProtocols()),
7981TL.getProtocolLocs(), TL.getProtocolRAngleLoc());
7987ObjCObjectTypeLoc NewT = TLB.push<ObjCObjectTypeLoc>(
Result);
7988NewT.setHasBaseTypeAsWritten(
true);
7989NewT.setTypeArgsLAngleLoc(TL.getTypeArgsLAngleLoc());
7990 for(
unsignedi = 0, n = TL.getNumTypeArgs(); i != n; ++i)
7991NewT.setTypeArgTInfo(i, NewTypeArgInfos[i]);
7992NewT.setTypeArgsRAngleLoc(TL.getTypeArgsRAngleLoc());
7993NewT.setProtocolLAngleLoc(TL.getProtocolLAngleLoc());
7994 for(
unsignedi = 0, n = TL.getNumProtocols(); i != n; ++i)
7995NewT.setProtocolLoc(i, TL.getProtocolLoc(i));
7996NewT.setProtocolRAngleLoc(TL.getProtocolRAngleLoc());
8000template<
typenameDerived>
8002TreeTransform<Derived>::TransformObjCObjectPointerType(TypeLocBuilder &TLB,
8003ObjCObjectPointerTypeLoc TL) {
8004QualType PointeeType = getDerived().TransformType(TLB, TL.getPointeeLoc());
8005 if(PointeeType.isNull())
8008QualType
Result= TL.getType();
8009 if(getDerived().AlwaysRebuild() ||
8010PointeeType != TL.getPointeeLoc().getType()) {
8011 Result= getDerived().RebuildObjCObjectPointerType(PointeeType,
8017ObjCObjectPointerTypeLoc NewT = TLB.push<ObjCObjectPointerTypeLoc>(
Result);
8018NewT.setStarLoc(TL.getStarLoc());
8025template<
typenameDerived>
8027TreeTransform<Derived>::TransformNullStmt(NullStmt *S) {
8031template<
typenameDerived>
8034 returngetDerived().TransformCompoundStmt(S,
false);
8037template<
typenameDerived>
8043 if(S->hasStoredFPFeatures())
8044getSema().resetFPOptions(
8045S->getStoredFPFeatures().applyOverrides(getSema().getLangOpts()));
8048 boolSubStmtInvalid =
false;
8049 boolSubStmtChanged =
false;
8051 for(
auto*B : S->body()) {
8053B, IsStmtExpr && B ==
ExprResult? SDK_StmtExprResult : SDK_Discarded);
8055 if(
Result.isInvalid()) {
8058 if(isa<DeclStmt>(B))
8062SubStmtInvalid =
true;
8066SubStmtChanged = SubStmtChanged ||
Result.get() != B;
8067Statements.push_back(
Result.getAs<Stmt>());
8073 if(!getDerived().AlwaysRebuild() &&
8077 returngetDerived().RebuildCompoundStmt(S->getLBracLoc(),
8083template<
typenameDerived>
8085TreeTransform<Derived>::TransformCaseStmt(CaseStmt *S) {
8092LHS = getDerived().TransformExpr(S->getLHS());
8094 if(LHS.isInvalid())
8098RHS = getDerived().TransformExpr(S->getRHS());
8100 if(RHS.isInvalid())
8107 StmtResultCase = getDerived().RebuildCaseStmt(S->getCaseLoc(),
8109S->getEllipsisLoc(),
8112 if(Case.isInvalid())
8117getDerived().TransformStmt(S->getSubStmt());
8118 if(SubStmt.isInvalid())
8122 returngetDerived().RebuildCaseStmtBody(Case.get(), SubStmt.get());
8125template<
typenameDerived>
8126StmtResultTreeTransform<Derived>::TransformDefaultStmt(DefaultStmt *S) {
8129getDerived().TransformStmt(S->getSubStmt());
8130 if(SubStmt.isInvalid())
8134 returngetDerived().RebuildDefaultStmt(S->getDefaultLoc(), S->getColonLoc(),
8138template<
typenameDerived>
8140TreeTransform<Derived>::TransformLabelStmt(LabelStmt *S, StmtDiscardKind SDK) {
8141 StmtResultSubStmt = getDerived().TransformStmt(S->getSubStmt(), SDK);
8142 if(SubStmt.isInvalid())
8145 Decl*LD = getDerived().TransformDecl(S->getDecl()->getLocation(),
8153 if(LD == S->getDecl())
8154S->getDecl()->setStmt(
nullptr);
8157 returngetDerived().RebuildLabelStmt(S->getIdentLoc(),
8158cast<LabelDecl>(LD), SourceLocation(),
8162template<
typenameDerived>
8171 return getDerived().Transform##X##Attr(cast<X##Attr>(R)); 8172#include "clang/Basic/AttrList.inc" 8177template<
typenameDerived>
8188 return getDerived().TransformStmt##X##Attr(OrigS, InstS, cast<X##Attr>(R)); 8189#include "clang/Basic/AttrList.inc" 8191 returnTransformAttr(R);
8194template<
typenameDerived>
8197StmtDiscardKind SDK) {
8198 StmtResultSubStmt = getDerived().TransformStmt(S->getSubStmt(), SDK);
8202 boolAttrsChanged =
false;
8206 for(
const auto*I : S->getAttrs()) {
8208getDerived().TransformStmtAttr(S->getSubStmt(), SubStmt.
get(), I);
8209AttrsChanged |= (I != R);
8214 if(SubStmt.
get() == S->getSubStmt() && !AttrsChanged)
8222 returngetDerived().RebuildAttributedStmt(S->
getAttrLoc(), Attrs,
8226template<
typenameDerived>
8228TreeTransform<Derived>::TransformIfStmt(IfStmt *S) {
8231 if(
Init.isInvalid())
8234Sema::ConditionResult Cond;
8235 if(!S->isConsteval()) {
8237Cond = getDerived().TransformCondition(
8238S->getIfLoc(), S->getConditionVariable(), S->getCond(),
8241 if(Cond.isInvalid())
8246std::optional<bool> ConstexprConditionValue;
8247 if(S->isConstexpr())
8248ConstexprConditionValue = Cond.getKnownValue();
8252 if(!ConstexprConditionValue || *ConstexprConditionValue) {
8253EnterExpressionEvaluationContext Ctx(
8256S->isNonNegatedConsteval());
8258Then = getDerived().TransformStmt(S->getThen());
8259 if(Then.isInvalid())
8265Then =
new(getSema().Context)
8266CompoundStmt(S->getThen()->getBeginLoc(), S->getThen()->getEndLoc());
8271 if(!ConstexprConditionValue || !*ConstexprConditionValue) {
8272EnterExpressionEvaluationContext Ctx(
8275S->isNegatedConsteval());
8277Else = getDerived().TransformStmt(S->getElse());
8278 if(Else.isInvalid())
8280}
else if(S->getElse() && ConstexprConditionValue &&
8281*ConstexprConditionValue) {
8285Else =
new(getSema().Context)
8286CompoundStmt(S->getElse()->getBeginLoc(), S->getElse()->getEndLoc());
8289 if(!getDerived().AlwaysRebuild() &&
8290 Init.get() == S->getInit() &&
8291Cond.get() == std::make_pair(S->getConditionVariable(), S->getCond()) &&
8292Then.get() == S->getThen() &&
8293Else.get() == S->getElse())
8296 returngetDerived().RebuildIfStmt(
8297S->getIfLoc(), S->getStatementKind(), S->getLParenLoc(), Cond,
8298S->getRParenLoc(),
Init.get(), Then.get(), S->getElseLoc(), Else.get());
8301template<
typenameDerived>
8303TreeTransform<Derived>::TransformSwitchStmt(SwitchStmt *S) {
8306 if(
Init.isInvalid())
8310Sema::ConditionResult Cond = getDerived().TransformCondition(
8311S->getSwitchLoc(), S->getConditionVariable(), S->getCond(),
8313 if(Cond.isInvalid())
8318getDerived().RebuildSwitchStmtStart(S->getSwitchLoc(), S->getLParenLoc(),
8319 Init.get(), Cond, S->getRParenLoc());
8320 if(
Switch.isInvalid())
8324 StmtResultBody = getDerived().TransformStmt(S->getBody());
8325 if(Body.isInvalid())
8329 returngetDerived().RebuildSwitchStmtBody(S->getSwitchLoc(),
Switch.get(),
8333template<
typenameDerived>
8335TreeTransform<Derived>::TransformWhileStmt(WhileStmt *S) {
8337Sema::ConditionResult Cond = getDerived().TransformCondition(
8338S->getWhileLoc(), S->getConditionVariable(), S->getCond(),
8340 if(Cond.isInvalid())
8345SemaOpenACC::LoopInConstructRAII LCR{SemaRef.
OpenACC()};
8349 StmtResultBody = getDerived().TransformStmt(S->getBody());
8350 if(Body.isInvalid())
8353 if(!getDerived().AlwaysRebuild() &&
8354Cond.get() == std::make_pair(S->getConditionVariable(), S->getCond()) &&
8355Body.get() == S->getBody())
8358 returngetDerived().RebuildWhileStmt(S->getWhileLoc(), S->getLParenLoc(),
8359Cond, S->getRParenLoc(), Body.get());
8362template<
typenameDerived>
8364TreeTransform<Derived>::TransformDoStmt(DoStmt *S) {
8367SemaOpenACC::LoopInConstructRAII LCR{SemaRef.
OpenACC()};
8371 StmtResultBody = getDerived().TransformStmt(S->getBody());
8372 if(Body.isInvalid())
8376 ExprResultCond = getDerived().TransformExpr(S->getCond());
8377 if(Cond.isInvalid())
8380 if(!getDerived().AlwaysRebuild() &&
8381Cond.get() == S->getCond() &&
8382Body.get() == S->getBody())
8385 returngetDerived().RebuildDoStmt(S->getDoLoc(), Body.get(), S->getWhileLoc(),
8386S->getWhileLoc(), Cond.get(),
8390template<
typenameDerived>
8392TreeTransform<Derived>::TransformForStmt(ForStmt *S) {
8393 if(getSema().getLangOpts().OpenMP)
8394getSema().OpenMP().startOpenMPLoop();
8398 if(
Init.isInvalid())
8403 if(getSema().getLangOpts().OpenMP &&
Init.isUsable())
8404getSema().OpenMP().ActOnOpenMPLoopInitialization(S->getForLoc(),
8408Sema::ConditionResult Cond = getDerived().TransformCondition(
8409S->getForLoc(), S->getConditionVariable(), S->getCond(),
8411 if(Cond.isInvalid())
8416 if(
Inc.isInvalid())
8419Sema::FullExprArg FullInc(getSema().MakeFullDiscardedValueExpr(
Inc.get()));
8420 if(S->getInc() && !FullInc.get())
8425SemaOpenACC::LoopInConstructRAII LCR{SemaRef.
OpenACC()};
8427S->getBeginLoc(), S->getInit(),
Init.get(), S->getCond(),
8428Cond.get().second, S->getInc(),
Inc.get());
8431 StmtResultBody = getDerived().TransformStmt(S->getBody());
8432 if(Body.isInvalid())
8437 if(!getDerived().AlwaysRebuild() &&
8438 Init.get() == S->getInit() &&
8439Cond.get() == std::make_pair(S->getConditionVariable(), S->getCond()) &&
8440 Inc.get() == S->getInc() &&
8441Body.get() == S->getBody())
8444 returngetDerived().RebuildForStmt(S->getForLoc(), S->getLParenLoc(),
8445 Init.get(), Cond, FullInc,
8446S->getRParenLoc(), Body.get());
8449template<
typenameDerived>
8451TreeTransform<Derived>::TransformGotoStmt(GotoStmt *S) {
8452 Decl*LD = getDerived().TransformDecl(S->getLabel()->getLocation(),
8458 returngetDerived().RebuildGotoStmt(S->getGotoLoc(), S->getLabelLoc(),
8459cast<LabelDecl>(LD));
8462template<
typenameDerived>
8464TreeTransform<Derived>::TransformIndirectGotoStmt(IndirectGotoStmt *S) {
8466 if(
Target.isInvalid())
8470 if(!getDerived().AlwaysRebuild() &&
8471 Target.get() == S->getTarget())
8474 returngetDerived().RebuildIndirectGotoStmt(S->getGotoLoc(), S->getStarLoc(),
8478template<
typenameDerived>
8480TreeTransform<Derived>::TransformContinueStmt(ContinueStmt *S) {
8484template<
typenameDerived>
8486TreeTransform<Derived>::TransformBreakStmt(BreakStmt *S) {
8490template<
typenameDerived>
8492TreeTransform<Derived>::TransformReturnStmt(ReturnStmt *S) {
8495 if(
Result.isInvalid())
8500 returngetDerived().RebuildReturnStmt(S->getReturnLoc(),
Result.get());
8503template<
typenameDerived>
8505TreeTransform<Derived>::TransformDeclStmt(DeclStmt *S) {
8506 boolDeclChanged =
false;
8508LambdaScopeInfo *LSI = getSema().getCurLambda();
8509 for(
auto*
D: S->decls()) {
8514 if(Transformed !=
D)
8515DeclChanged =
true;
8518 if(
auto*TD = dyn_cast<TypeDecl>(Transformed))
8519LSI->ContainsUnexpandedParameterPack |=
8522.getTypeDeclType(TD)
8523.getSingleStepDesugaredType(getSema().getASTContext())
8524->containsUnexpandedParameterPack();
8526 if(
auto*VD = dyn_cast<VarDecl>(Transformed))
8527LSI->ContainsUnexpandedParameterPack |=
8528VD->getType()->containsUnexpandedParameterPack();
8531Decls.push_back(Transformed);
8534 if(!getDerived().AlwaysRebuild() && !DeclChanged)
8537 returngetDerived().RebuildDeclStmt(Decls, S->getBeginLoc(), S->getEndLoc());
8540template<
typenameDerived>
8542TreeTransform<Derived>::TransformGCCAsmStmt(GCCAsmStmt *S) {
8551 boolExprsChanged =
false;
8554 for(
unsignedI = 0,
E= S->getNumOutputs(); I !=
E; ++I) {
8555Names.push_back(S->getOutputIdentifier(I));
8558Constraints.push_back(S->getOutputConstraintLiteral(I));
8561Expr *OutputExpr = S->getOutputExpr(I);
8563 if(
Result.isInvalid())
8566ExprsChanged |=
Result.get() != OutputExpr;
8568Exprs.push_back(
Result.get());
8572 for(
unsignedI = 0,
E= S->getNumInputs(); I !=
E; ++I) {
8573Names.push_back(S->getInputIdentifier(I));
8576Constraints.push_back(S->getInputConstraintLiteral(I));
8579Expr *InputExpr = S->getInputExpr(I);
8581 if(
Result.isInvalid())
8584ExprsChanged |=
Result.get() != InputExpr;
8586Exprs.push_back(
Result.get());
8590 for(
unsignedI = 0,
E= S->getNumLabels(); I !=
E; ++I) {
8591Names.push_back(S->getLabelIdentifier(I));
8594 if(
Result.isInvalid())
8596ExprsChanged |=
Result.get() != S->getLabelExpr(I);
8597Exprs.push_back(
Result.get());
8599 if(!getDerived().AlwaysRebuild() && !ExprsChanged)
8603 for(
unsignedI = 0,
E= S->getNumClobbers(); I !=
E; ++I)
8604Clobbers.push_back(S->getClobberStringLiteral(I));
8607AsmString = S->getAsmString();
8608 returngetDerived().RebuildGCCAsmStmt(S->getAsmLoc(), S->isSimple(),
8609S->isVolatile(), S->getNumOutputs(),
8610S->getNumInputs(), Names.data(),
8611Constraints, Exprs, AsmString.get(),
8612Clobbers, S->getNumLabels(),
8616template<
typenameDerived>
8618TreeTransform<Derived>::TransformMSAsmStmt(MSAsmStmt *S) {
8621 boolHadError =
false, HadChange =
false;
8625TransformedExprs.reserve(SrcExprs.size());
8626 for(
unsignedi = 0, e = SrcExprs.size(); i != e; ++i) {
8628 if(!
Result.isUsable()) {
8631HadChange |= (
Result.get() != SrcExprs[i]);
8632TransformedExprs.push_back(
Result.get());
8637 if(!HadChange && !getDerived().AlwaysRebuild())
8640 returngetDerived().RebuildMSAsmStmt(S->getAsmLoc(), S->getLBraceLoc(),
8641AsmToks, S->getAsmString(),
8642S->getNumOutputs(), S->getNumInputs(),
8643S->getAllConstraints(), S->getClobbers(),
8644TransformedExprs, S->getEndLoc());
8648template<
typenameDerived>
8650TreeTransform<Derived>::TransformCoroutineBodyStmt(CoroutineBodyStmt *S) {
8652 auto*FD = cast<FunctionDecl>(SemaRef.
CurContext);
8653assert(FD && ScopeInfo && !ScopeInfo->CoroutinePromise &&
8654ScopeInfo->NeedsCoroutineSuspends &&
8655ScopeInfo->CoroutineSuspends.first ==
nullptr&&
8656ScopeInfo->CoroutineSuspends.second ==
nullptr&&
8657 "expected clean scope info");
8661ScopeInfo->setNeedsCoroutineSuspends(
false);
8674getDerived().transformedLocalDecl(S->getPromiseDecl(), {Promise});
8675ScopeInfo->CoroutinePromise = Promise;
8680 StmtResultInitSuspend = getDerived().TransformStmt(S->getInitSuspendStmt());
8681 if(InitSuspend.isInvalid())
8684getDerived().TransformStmt(S->getFinalSuspendStmt());
8685 if(FinalSuspend.isInvalid() ||
8688ScopeInfo->setCoroutineSuspends(InitSuspend.get(), FinalSuspend.get());
8689assert(isa<Expr>(InitSuspend.get()) && isa<Expr>(FinalSuspend.get()));
8691 StmtResultBodyRes = getDerived().TransformStmt(S->getBody());
8692 if(BodyRes.isInvalid())
8695CoroutineStmtBuilder Builder(SemaRef, *FD, *ScopeInfo, BodyRes.get());
8696 if(Builder.isInvalid())
8699Expr *ReturnObject = S->getReturnValueInit();
8700assert(ReturnObject &&
"the return object is expected to be valid");
8701 ExprResultRes = getDerived().TransformInitializer(ReturnObject,
8703 if(Res.isInvalid())
8705Builder.ReturnValue = Res.get();
8710 if(S->hasDependentPromiseType()) {
8713 if(!Promise->getType()->isDependentType()) {
8714assert(!S->getFallthroughHandler() && !S->getExceptionHandler() &&
8715!S->getReturnStmtOnAllocFailure() && !S->getDeallocate() &&
8716 "these nodes should not have been built yet");
8717 if(!Builder.buildDependentStatements())
8721 if(
auto*OnFallthrough = S->getFallthroughHandler()) {
8722 StmtResultRes = getDerived().TransformStmt(OnFallthrough);
8723 if(Res.isInvalid())
8725Builder.OnFallthrough = Res.get();
8728 if(
auto*OnException = S->getExceptionHandler()) {
8729 StmtResultRes = getDerived().TransformStmt(OnException);
8730 if(Res.isInvalid())
8732Builder.OnException = Res.get();
8735 if(
auto*OnAllocFailure = S->getReturnStmtOnAllocFailure()) {
8736 StmtResultRes = getDerived().TransformStmt(OnAllocFailure);
8737 if(Res.isInvalid())
8739Builder.ReturnStmtOnAllocFailure = Res.get();
8743assert(S->getAllocate() && S->getDeallocate() &&
8744 "allocation and deallocation calls must already be built");
8745 ExprResultAllocRes = getDerived().TransformExpr(S->getAllocate());
8746 if(AllocRes.isInvalid())
8748Builder.Allocate = AllocRes.get();
8750 ExprResultDeallocRes = getDerived().TransformExpr(S->getDeallocate());
8751 if(DeallocRes.isInvalid())
8753Builder.Deallocate = DeallocRes.get();
8755 if(
auto*ResultDecl = S->getResultDecl()) {
8756 StmtResultRes = getDerived().TransformStmt(ResultDecl);
8757 if(Res.isInvalid())
8759Builder.ResultDecl = Res.get();
8762 if(
auto*ReturnStmt = S->getReturnStmt()) {
8763 StmtResultRes = getDerived().TransformStmt(ReturnStmt);
8764 if(Res.isInvalid())
8766Builder.ReturnStmt = Res.get();
8770 returngetDerived().RebuildCoroutineBodyStmt(Builder);
8773template<
typenameDerived>
8775TreeTransform<Derived>::TransformCoreturnStmt(CoreturnStmt *S) {
8778 if(
Result.isInvalid())
8783 returngetDerived().RebuildCoreturnStmt(S->getKeywordLoc(),
Result.get(),
8787template<
typenameDerived>
8788ExprResultTreeTransform<Derived>::TransformCoawaitExpr(CoawaitExpr *
E) {
8800 ExprResultLookup = getSema().BuildOperatorCoawaitLookupExpr(
8801getSema().getCurScope(),
E->getKeywordLoc());
8805 returngetDerived().RebuildCoawaitExpr(
8806 E->getKeywordLoc(),
Operand.get(),
8807cast<UnresolvedLookupExpr>(Lookup.get()),
E->isImplicit());
8810template<
typenameDerived>
8812TreeTransform<Derived>::TransformDependentCoawaitExpr(DependentCoawaitExpr *
E) {
8813 ExprResultOperandResult = getDerived().TransformInitializer(
E->getOperand(),
8815 if(OperandResult.isInvalid())
8818 ExprResultLookupResult = getDerived().TransformUnresolvedLookupExpr(
8819 E->getOperatorCoawaitLookup());
8821 if(LookupResult.isInvalid())
8826 returngetDerived().RebuildDependentCoawaitExpr(
8827 E->getKeywordLoc(), OperandResult.get(),
8828cast<UnresolvedLookupExpr>(LookupResult.get()));
8831template<
typenameDerived>
8833TreeTransform<Derived>::TransformCoyieldExpr(CoyieldExpr *
E) {
8836 if(
Result.isInvalid())
8841 returngetDerived().RebuildCoyieldExpr(
E->getKeywordLoc(),
Result.get());
8846template<
typenameDerived>
8848TreeTransform<Derived>::TransformObjCAtTryStmt(ObjCAtTryStmt *S) {
8850 StmtResultTryBody = getDerived().TransformStmt(S->getTryBody());
8851 if(TryBody.isInvalid())
8855 boolAnyCatchChanged =
false;
8857 for(
unsignedI = 0, N = S->getNumCatchStmts(); I != N; ++I) {
8858 StmtResultCatch = getDerived().TransformStmt(S->getCatchStmt(I));
8859 if(Catch.isInvalid())
8861 if(Catch.get() != S->getCatchStmt(I))
8862AnyCatchChanged =
true;
8863CatchStmts.push_back(Catch.get());
8868 if(S->getFinallyStmt()) {
8869Finally = getDerived().TransformStmt(S->getFinallyStmt());
8870 if(Finally.isInvalid())
8875 if(!getDerived().AlwaysRebuild() &&
8876TryBody.get() == S->getTryBody() &&
8878Finally.get() == S->getFinallyStmt())
8882 returngetDerived().RebuildObjCAtTryStmt(S->getAtTryLoc(), TryBody.get(),
8883CatchStmts, Finally.get());
8886template<
typenameDerived>
8888TreeTransform<Derived>::TransformObjCAtCatchStmt(ObjCAtCatchStmt *S) {
8890VarDecl *Var =
nullptr;
8891 if(VarDecl *FromVar = S->getCatchParamDecl()) {
8892TypeSourceInfo *TSInfo =
nullptr;
8893 if(FromVar->getTypeSourceInfo()) {
8894TSInfo = getDerived().TransformType(FromVar->getTypeSourceInfo());
8901 T= TSInfo->getType();
8903 T= getDerived().TransformType(FromVar->getType());
8908Var = getDerived().RebuildObjCExceptionDecl(FromVar, TSInfo,
T);
8913 StmtResultBody = getDerived().TransformStmt(S->getCatchBody());
8914 if(Body.isInvalid())
8917 returngetDerived().RebuildObjCAtCatchStmt(S->getAtCatchLoc(),
8922template<
typenameDerived>
8924TreeTransform<Derived>::TransformObjCAtFinallyStmt(ObjCAtFinallyStmt *S) {
8926 StmtResultBody = getDerived().TransformStmt(S->getFinallyBody());
8927 if(Body.isInvalid())
8931 if(!getDerived().AlwaysRebuild() &&
8932Body.get() == S->getFinallyBody())
8936 returngetDerived().RebuildObjCAtFinallyStmt(S->getAtFinallyLoc(),
8940template<
typenameDerived>
8942TreeTransform<Derived>::TransformObjCAtThrowStmt(ObjCAtThrowStmt *S) {
8944 if(S->getThrowExpr()) {
8945 Operand= getDerived().TransformExpr(S->getThrowExpr());
8950 if(!getDerived().AlwaysRebuild() &&
8951 Operand.get() == S->getThrowExpr())
8954 returngetDerived().RebuildObjCAtThrowStmt(S->getThrowLoc(),
Operand.get());
8957template<
typenameDerived>
8959TreeTransform<Derived>::TransformObjCAtSynchronizedStmt(
8960ObjCAtSynchronizedStmt *S) {
8963 if(
Object.isInvalid())
8966getDerived().RebuildObjCAtSynchronizedOperand(S->getAtSynchronizedLoc(),
8968 if(
Object.isInvalid())
8972 StmtResultBody = getDerived().TransformStmt(S->getSynchBody());
8973 if(Body.isInvalid())
8977 if(!getDerived().AlwaysRebuild() &&
8978 Object.get() == S->getSynchExpr() &&
8979Body.get() == S->getSynchBody())
8983 returngetDerived().RebuildObjCAtSynchronizedStmt(S->getAtSynchronizedLoc(),
8984 Object.get(), Body.get());
8987template<
typenameDerived>
8989TreeTransform<Derived>::TransformObjCAutoreleasePoolStmt(
8990ObjCAutoreleasePoolStmt *S) {
8992 StmtResultBody = getDerived().TransformStmt(S->getSubStmt());
8993 if(Body.isInvalid())
8997 if(!getDerived().AlwaysRebuild() &&
8998Body.get() == S->getSubStmt())
9002 returngetDerived().RebuildObjCAutoreleasePoolStmt(
9003S->getAtLoc(), Body.get());
9006template<
typenameDerived>
9008TreeTransform<Derived>::TransformObjCForCollectionStmt(
9009ObjCForCollectionStmt *S) {
9012getDerived().TransformStmt(S->getElement(), SDK_NotDiscarded);
9013 if(Element.isInvalid())
9017 ExprResultCollection = getDerived().TransformExpr(S->getCollection());
9018 if(Collection.isInvalid())
9022 StmtResultBody = getDerived().TransformStmt(S->getBody());
9023 if(Body.isInvalid())
9027 if(!getDerived().AlwaysRebuild() &&
9028Element.get() == S->getElement() &&
9029Collection.get() == S->getCollection() &&
9030Body.get() == S->getBody())
9034 returngetDerived().RebuildObjCForCollectionStmt(S->getForLoc(),
9041template<
typenameDerived>
9042StmtResultTreeTransform<Derived>::TransformCXXCatchStmt(CXXCatchStmt *S) {
9044VarDecl *Var =
nullptr;
9045 if(VarDecl *ExceptionDecl = S->getExceptionDecl()) {
9046TypeSourceInfo *
T=
9047getDerived().TransformType(ExceptionDecl->getTypeSourceInfo());
9051Var = getDerived().RebuildExceptionDecl(
9052ExceptionDecl,
T, ExceptionDecl->getInnerLocStart(),
9053ExceptionDecl->getLocation(), ExceptionDecl->getIdentifier());
9054 if(!Var || Var->isInvalidDecl())
9059 StmtResultHandler = getDerived().TransformStmt(S->getHandlerBlock());
9060 if(Handler.isInvalid())
9063 if(!getDerived().AlwaysRebuild() && !Var &&
9064Handler.get() == S->getHandlerBlock())
9067 returngetDerived().RebuildCXXCatchStmt(S->getCatchLoc(), Var, Handler.get());
9070template<
typenameDerived>
9071StmtResultTreeTransform<Derived>::TransformCXXTryStmt(CXXTryStmt *S) {
9073 StmtResultTryBlock = getDerived().TransformCompoundStmt(S->getTryBlock());
9074 if(TryBlock.isInvalid())
9078 boolHandlerChanged =
false;
9080 for(
unsignedI = 0, N = S->getNumHandlers(); I != N; ++I) {
9081 StmtResultHandler = getDerived().TransformCXXCatchStmt(S->getHandler(I));
9082 if(Handler.isInvalid())
9085HandlerChanged = HandlerChanged || Handler.get() != S->getHandler(I);
9086Handlers.push_back(Handler.getAs<Stmt>());
9089 if(!getDerived().AlwaysRebuild() && TryBlock.get() == S->getTryBlock() &&
9093 returngetDerived().RebuildCXXTryStmt(S->getTryLoc(), TryBlock.get(),
9097template<
typenameDerived>
9099TreeTransform<Derived>::TransformCXXForRangeStmt(CXXForRangeStmt *S) {
9100EnterExpressionEvaluationContext ForRangeInitContext(
9108 auto&LastRecord = getSema().currentEvaluationContext();
9109LastRecord.InLifetimeExtendingContext =
true;
9110LastRecord.RebuildDefaultArgOrDefaultInit =
true;
9113S->getInit() ? getDerived().TransformStmt(S->getInit()) :
StmtResult();
9114 if(
Init.isInvalid())
9123getSema().ExprEvalContexts.back().ForRangeLifetimeExtendTemps.empty());
9124 autoForRangeLifetimeExtendTemps =
9125getSema().ExprEvalContexts.back().ForRangeLifetimeExtendTemps;
9130 StmtResultEnd = getDerived().TransformStmt(S->getEndStmt());
9131 if(End.isInvalid())
9134 ExprResultCond = getDerived().TransformExpr(S->getCond());
9135 if(Cond.isInvalid())
9139 if(Cond.isInvalid())
9145 if(
Inc.isInvalid())
9150 StmtResultLoopVar = getDerived().TransformStmt(S->getLoopVarStmt());
9151 if(LoopVar.isInvalid())
9155 if(getDerived().AlwaysRebuild() ||
9156 Init.get() != S->getInit() ||
9157 Range.get() != S->getRangeStmt() ||
9158 Begin.get() != S->getBeginStmt() ||
9159End.get() != S->getEndStmt() ||
9160Cond.get() != S->getCond() ||
9161 Inc.get() != S->getInc() ||
9162LoopVar.get() != S->getLoopVarStmt()) {
9163NewStmt = getDerived().RebuildCXXForRangeStmt(
9164S->getForLoc(), S->getCoawaitLoc(),
Init.get(), S->getColonLoc(),
9165 Range.get(),
Begin.get(), End.get(), Cond.get(),
Inc.get(),
9166LoopVar.get(), S->getRParenLoc(), ForRangeLifetimeExtendTemps);
9167 if(NewStmt.isInvalid() && LoopVar.get() != S->getLoopVarStmt()) {
9170cast<DeclStmt>(LoopVar.get())->getSingleDecl());
9177SemaOpenACC::LoopInConstructRAII LCR{SemaRef.
OpenACC()};
9180 StmtResultBody = getDerived().TransformStmt(S->getBody());
9181 if(Body.isInvalid())
9188 if(Body.get() != S->getBody() && NewStmt.get() == S) {
9189NewStmt = getDerived().RebuildCXXForRangeStmt(
9190S->getForLoc(), S->getCoawaitLoc(),
Init.get(), S->getColonLoc(),
9191 Range.get(),
Begin.get(), End.get(), Cond.get(),
Inc.get(),
9192LoopVar.get(), S->getRParenLoc(), ForRangeLifetimeExtendTemps);
9193 if(NewStmt.isInvalid())
9197 if(NewStmt.get() == S)
9200 returnFinishCXXForRangeStmt(NewStmt.get(), Body.get());
9203template<
typenameDerived>
9205TreeTransform<Derived>::TransformMSDependentExistsStmt(
9206MSDependentExistsStmt *S) {
9208NestedNameSpecifierLoc QualifierLoc;
9209 if(S->getQualifierLoc()) {
9211= getDerived().TransformNestedNameSpecifierLoc(S->getQualifierLoc());
9217DeclarationNameInfo NameInfo = S->getNameInfo();
9218 if(NameInfo.getName()) {
9219NameInfo = getDerived().TransformDeclarationNameInfo(NameInfo);
9220 if(!NameInfo.getName())
9225 if(!getDerived().AlwaysRebuild() &&
9226QualifierLoc == S->getQualifierLoc() &&
9227NameInfo.getName() == S->getNameInfo().getName())
9232SS.Adopt(QualifierLoc);
9234 switch(getSema().CheckMicrosoftIfExistsSymbol(
nullptr, SS, NameInfo)) {
9236 if(S->isIfExists())
9239 return new(getSema().Context) NullStmt(S->getKeywordLoc());
9242 if(S->isIfNotExists())
9245 return new(getSema().Context) NullStmt(S->getKeywordLoc());
9256 StmtResultSubStmt = getDerived().TransformCompoundStmt(S->getSubStmt());
9257 if(SubStmt.isInvalid())
9265 returngetDerived().RebuildMSDependentExistsStmt(S->getKeywordLoc(),
9272template<
typenameDerived>
9274TreeTransform<Derived>::TransformMSPropertyRefExpr(MSPropertyRefExpr *
E) {
9275NestedNameSpecifierLoc QualifierLoc;
9276 if(
E->getQualifierLoc()) {
9278= getDerived().TransformNestedNameSpecifierLoc(
E->getQualifierLoc());
9283MSPropertyDecl *PD = cast_or_null<MSPropertyDecl>(
9284getDerived().TransformDecl(
E->getMemberLoc(),
E->getPropertyDecl()));
9289 if(
Base.isInvalid())
9293MSPropertyRefExpr(
Base.get(), PD,
E->isArrow(),
9295QualifierLoc,
E->getMemberLoc());
9298template<
typenameDerived>
9299ExprResultTreeTransform<Derived>::TransformMSPropertySubscriptExpr(
9300MSPropertySubscriptExpr *
E) {
9301 autoBaseRes = getDerived().TransformExpr(
E->getBase());
9302 if(BaseRes.isInvalid())
9304 autoIdxRes = getDerived().TransformExpr(
E->getIdx());
9305 if(IdxRes.isInvalid())
9308 if(!getDerived().AlwaysRebuild() &&
9309BaseRes.get() ==
E->getBase() &&
9310IdxRes.get() ==
E->getIdx())
9313 returngetDerived().RebuildArraySubscriptExpr(
9314BaseRes.get(), SourceLocation(), IdxRes.get(),
E->getRBracketLoc());
9317template<
typenameDerived>
9318StmtResultTreeTransform<Derived>::TransformSEHTryStmt(SEHTryStmt *S) {
9319 StmtResultTryBlock = getDerived().TransformCompoundStmt(S->getTryBlock());
9320 if(TryBlock.isInvalid())
9323 StmtResultHandler = getDerived().TransformSEHHandler(S->getHandler());
9324 if(Handler.isInvalid())
9327 if(!getDerived().AlwaysRebuild() && TryBlock.get() == S->getTryBlock() &&
9328Handler.get() == S->getHandler())
9331 returngetDerived().RebuildSEHTryStmt(S->getIsCXXTry(), S->getTryLoc(),
9332TryBlock.get(), Handler.get());
9335template<
typenameDerived>
9336StmtResultTreeTransform<Derived>::TransformSEHFinallyStmt(SEHFinallyStmt *S) {
9338 if(
Block.isInvalid())
9341 returngetDerived().RebuildSEHFinallyStmt(S->getFinallyLoc(),
Block.get());
9344template<
typenameDerived>
9345StmtResultTreeTransform<Derived>::TransformSEHExceptStmt(SEHExceptStmt *S) {
9346 ExprResultFilterExpr = getDerived().TransformExpr(S->getFilterExpr());
9347 if(FilterExpr.isInvalid())
9351 if(
Block.isInvalid())
9354 returngetDerived().RebuildSEHExceptStmt(S->getExceptLoc(), FilterExpr.get(),
9358template<
typenameDerived>
9360 if(isa<SEHFinallyStmt>(Handler))
9361 returngetDerived().TransformSEHFinallyStmt(cast<SEHFinallyStmt>(Handler));
9363 returngetDerived().TransformSEHExceptStmt(cast<SEHExceptStmt>(Handler));
9366template<
typenameDerived>
9376template<
typenameDerived>
9378TreeTransform<Derived>::TransformOMPCanonicalLoop(OMPCanonicalLoop *L) {
9382 returngetDerived().TransformStmt(L->getLoopStmt());
9385template<
typenameDerived>
9392TClauses.reserve(Clauses.size());
9396getDerived().getSema().OpenMP().StartOpenMPClause((*I)->getClauseKind());
9397 OMPClause*Clause = getDerived().TransformOMPClause(*I);
9398getDerived().getSema().OpenMP().EndOpenMPClause();
9400TClauses.push_back(Clause);
9402TClauses.push_back(
nullptr);
9406 if(
D->hasAssociatedStmt() &&
D->getAssociatedStmt()) {
9407getDerived().getSema().OpenMP().ActOnOpenMPRegionStart(
9408 D->getDirectiveKind(),
9414 if(
D->getDirectiveKind() == OMPD_atomic ||
9415 D->getDirectiveKind() == OMPD_critical ||
9416 D->getDirectiveKind() == OMPD_section ||
9417 D->getDirectiveKind() == OMPD_master)
9418CS =
D->getAssociatedStmt();
9420CS =
D->getRawStmt();
9421Body = getDerived().TransformStmt(CS);
9423getSema().getLangOpts().OpenMPIRBuilder)
9424Body = getDerived().RebuildOMPCanonicalLoop(Body.
get());
9427getDerived().getSema().OpenMP().ActOnOpenMPRegionEnd(Body, TClauses);
9432 if(TClauses.size() != Clauses.size()) {
9438 if(
D->getDirectiveKind() == OMPD_critical) {
9439DirName = cast<OMPCriticalDirective>(
D)->getDirectiveName();
9440DirName = getDerived().TransformDeclarationNameInfo(DirName);
9443 if(
D->getDirectiveKind() == OMPD_cancellation_point) {
9444CancelRegion = cast<OMPCancellationPointDirective>(
D)->getCancelRegion();
9445}
else if(
D->getDirectiveKind() == OMPD_cancel) {
9446CancelRegion = cast<OMPCancelDirective>(
D)->getCancelRegion();
9449 returngetDerived().RebuildOMPExecutableDirective(
9450 D->getDirectiveKind(), DirName, CancelRegion, TClauses,
9459template<
typenameDerived>
9466TClauses.reserve(Clauses.size());
9469getDerived().getSema().OpenMP().StartOpenMPClause(
C->getClauseKind());
9470 OMPClause*Clause = getDerived().TransformOMPClause(
C);
9471getDerived().getSema().OpenMP().EndOpenMPClause();
9473TClauses.push_back(Clause);
9475TClauses.push_back(
nullptr);
9479 if(
D->hasAssociatedStmt() &&
D->getAssociatedStmt()) {
9480getDerived().getSema().OpenMP().ActOnOpenMPRegionStart(
9481 D->getDirectiveKind(),
9486assert(
D->getDirectiveKind() == OMPD_assume &&
9487 "Unexpected informational directive");
9488 Stmt*CS =
D->getAssociatedStmt();
9489Body = getDerived().TransformStmt(CS);
9492getDerived().getSema().OpenMP().ActOnOpenMPRegionEnd(Body, TClauses);
9496 if(TClauses.size() != Clauses.size())
9501 returngetDerived().RebuildOMPInformationalDirective(
9502 D->getDirectiveKind(), DirName, TClauses, AssociatedStmt.
get(),
9506template<
typenameDerived>
9510SemaRef.
Diag(
D->
getBeginLoc(), diag::err_omp_instantiation_not_supported)
9511<< getOpenMPDirectiveName(
D->getDirectiveKind());
9515template<
typenameDerived>
9517TreeTransform<Derived>::TransformOMPParallelDirective(OMPParallelDirective *
D) {
9518DeclarationNameInfo DirName;
9519getDerived().getSema().OpenMP().StartOpenMPDSABlock(
9520OMPD_parallel, DirName,
nullptr,
D->
getBeginLoc());
9521 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
9522getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
9526template<
typenameDerived>
9528TreeTransform<Derived>::TransformOMPSimdDirective(OMPSimdDirective *
D) {
9529DeclarationNameInfo DirName;
9530getDerived().getSema().OpenMP().StartOpenMPDSABlock(
9532 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
9533getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
9537template<
typenameDerived>
9539TreeTransform<Derived>::TransformOMPTileDirective(OMPTileDirective *
D) {
9540DeclarationNameInfo DirName;
9541getDerived().getSema().OpenMP().StartOpenMPDSABlock(
9542 D->getDirectiveKind(), DirName,
nullptr,
D->
getBeginLoc());
9543 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
9544getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
9548template<
typenameDerived>
9550TreeTransform<Derived>::TransformOMPUnrollDirective(OMPUnrollDirective *
D) {
9551DeclarationNameInfo DirName;
9552getDerived().getSema().OpenMP().StartOpenMPDSABlock(
9553 D->getDirectiveKind(), DirName,
nullptr,
D->
getBeginLoc());
9554 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
9555getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
9559template<
typenameDerived>
9561TreeTransform<Derived>::TransformOMPReverseDirective(OMPReverseDirective *
D) {
9562DeclarationNameInfo DirName;
9563getDerived().getSema().OpenMP().StartOpenMPDSABlock(
9564 D->getDirectiveKind(), DirName,
nullptr,
D->
getBeginLoc());
9565 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
9566getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
9570template<
typenameDerived>
9571StmtResultTreeTransform<Derived>::TransformOMPInterchangeDirective(
9572OMPInterchangeDirective *
D) {
9573DeclarationNameInfo DirName;
9574getDerived().getSema().OpenMP().StartOpenMPDSABlock(
9575 D->getDirectiveKind(), DirName,
nullptr,
D->
getBeginLoc());
9576 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
9577getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
9581template<
typenameDerived>
9583TreeTransform<Derived>::TransformOMPForDirective(OMPForDirective *
D) {
9584DeclarationNameInfo DirName;
9585getDerived().getSema().OpenMP().StartOpenMPDSABlock(
9587 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
9588getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
9592template<
typenameDerived>
9594TreeTransform<Derived>::TransformOMPForSimdDirective(OMPForSimdDirective *
D) {
9595DeclarationNameInfo DirName;
9596getDerived().getSema().OpenMP().StartOpenMPDSABlock(
9597OMPD_for_simd, DirName,
nullptr,
D->
getBeginLoc());
9598 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
9599getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
9603template<
typenameDerived>
9605TreeTransform<Derived>::TransformOMPSectionsDirective(OMPSectionsDirective *
D) {
9606DeclarationNameInfo DirName;
9607getDerived().getSema().OpenMP().StartOpenMPDSABlock(
9608OMPD_sections, DirName,
nullptr,
D->
getBeginLoc());
9609 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
9610getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
9614template<
typenameDerived>
9616TreeTransform<Derived>::TransformOMPSectionDirective(OMPSectionDirective *
D) {
9617DeclarationNameInfo DirName;
9618getDerived().getSema().OpenMP().StartOpenMPDSABlock(
9620 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
9621getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
9625template<
typenameDerived>
9627TreeTransform<Derived>::TransformOMPScopeDirective(OMPScopeDirective *
D) {
9628DeclarationNameInfo DirName;
9629getDerived().getSema().OpenMP().StartOpenMPDSABlock(
9631 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
9632getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
9636template<
typenameDerived>
9638TreeTransform<Derived>::TransformOMPSingleDirective(OMPSingleDirective *
D) {
9639DeclarationNameInfo DirName;
9640getDerived().getSema().OpenMP().StartOpenMPDSABlock(
9642 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
9643getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
9647template<
typenameDerived>
9649TreeTransform<Derived>::TransformOMPMasterDirective(OMPMasterDirective *
D) {
9650DeclarationNameInfo DirName;
9651getDerived().getSema().OpenMP().StartOpenMPDSABlock(
9653 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
9654getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
9658template<
typenameDerived>
9660TreeTransform<Derived>::TransformOMPCriticalDirective(OMPCriticalDirective *
D) {
9661getDerived().getSema().OpenMP().StartOpenMPDSABlock(
9662OMPD_critical,
D->getDirectiveName(),
nullptr,
D->
getBeginLoc());
9663 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
9664getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
9668template<
typenameDerived>
9669StmtResultTreeTransform<Derived>::TransformOMPParallelForDirective(
9670OMPParallelForDirective *
D) {
9671DeclarationNameInfo DirName;
9672getDerived().getSema().OpenMP().StartOpenMPDSABlock(
9673OMPD_parallel_for, DirName,
nullptr,
D->
getBeginLoc());
9674 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
9675getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
9679template<
typenameDerived>
9680StmtResultTreeTransform<Derived>::TransformOMPParallelForSimdDirective(
9681OMPParallelForSimdDirective *
D) {
9682DeclarationNameInfo DirName;
9683getDerived().getSema().OpenMP().StartOpenMPDSABlock(
9684OMPD_parallel_for_simd, DirName,
nullptr,
D->
getBeginLoc());
9685 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
9686getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
9690template<
typenameDerived>
9691StmtResultTreeTransform<Derived>::TransformOMPParallelMasterDirective(
9692OMPParallelMasterDirective *
D) {
9693DeclarationNameInfo DirName;
9694getDerived().getSema().OpenMP().StartOpenMPDSABlock(
9695OMPD_parallel_master, DirName,
nullptr,
D->
getBeginLoc());
9696 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
9697getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
9701template<
typenameDerived>
9702StmtResultTreeTransform<Derived>::TransformOMPParallelMaskedDirective(
9703OMPParallelMaskedDirective *
D) {
9704DeclarationNameInfo DirName;
9705getDerived().getSema().OpenMP().StartOpenMPDSABlock(
9706OMPD_parallel_masked, DirName,
nullptr,
D->
getBeginLoc());
9707 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
9708getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
9712template<
typenameDerived>
9713StmtResultTreeTransform<Derived>::TransformOMPParallelSectionsDirective(
9714OMPParallelSectionsDirective *
D) {
9715DeclarationNameInfo DirName;
9716getDerived().getSema().OpenMP().StartOpenMPDSABlock(
9717OMPD_parallel_sections, DirName,
nullptr,
D->
getBeginLoc());
9718 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
9719getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
9723template<
typenameDerived>
9725TreeTransform<Derived>::TransformOMPTaskDirective(OMPTaskDirective *
D) {
9726DeclarationNameInfo DirName;
9727getDerived().getSema().OpenMP().StartOpenMPDSABlock(
9729 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
9730getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
9734template<
typenameDerived>
9735StmtResultTreeTransform<Derived>::TransformOMPTaskyieldDirective(
9736OMPTaskyieldDirective *
D) {
9737DeclarationNameInfo DirName;
9738getDerived().getSema().OpenMP().StartOpenMPDSABlock(
9739OMPD_taskyield, DirName,
nullptr,
D->
getBeginLoc());
9740 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
9741getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
9745template<
typenameDerived>
9747TreeTransform<Derived>::TransformOMPBarrierDirective(OMPBarrierDirective *
D) {
9748DeclarationNameInfo DirName;
9749getDerived().getSema().OpenMP().StartOpenMPDSABlock(
9751 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
9752getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
9756template<
typenameDerived>
9758TreeTransform<Derived>::TransformOMPTaskwaitDirective(OMPTaskwaitDirective *
D) {
9759DeclarationNameInfo DirName;
9760getDerived().getSema().OpenMP().StartOpenMPDSABlock(
9761OMPD_taskwait, DirName,
nullptr,
D->
getBeginLoc());
9762 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
9763getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
9767template<
typenameDerived>
9769TreeTransform<Derived>::TransformOMPAssumeDirective(OMPAssumeDirective *
D) {
9770DeclarationNameInfo DirName;
9771getDerived().getSema().OpenMP().StartOpenMPDSABlock(
9773 StmtResultRes = getDerived().TransformOMPInformationalDirective(
D);
9774getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
9778template<
typenameDerived>
9780TreeTransform<Derived>::TransformOMPErrorDirective(OMPErrorDirective *
D) {
9781DeclarationNameInfo DirName;
9782getDerived().getSema().OpenMP().StartOpenMPDSABlock(
9784 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
9785getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
9789template<
typenameDerived>
9790StmtResultTreeTransform<Derived>::TransformOMPTaskgroupDirective(
9791OMPTaskgroupDirective *
D) {
9792DeclarationNameInfo DirName;
9793getDerived().getSema().OpenMP().StartOpenMPDSABlock(
9794OMPD_taskgroup, DirName,
nullptr,
D->
getBeginLoc());
9795 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
9796getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
9800template<
typenameDerived>
9802TreeTransform<Derived>::TransformOMPFlushDirective(OMPFlushDirective *
D) {
9803DeclarationNameInfo DirName;
9804getDerived().getSema().OpenMP().StartOpenMPDSABlock(
9806 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
9807getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
9811template<
typenameDerived>
9813TreeTransform<Derived>::TransformOMPDepobjDirective(OMPDepobjDirective *
D) {
9814DeclarationNameInfo DirName;
9815getDerived().getSema().OpenMP().StartOpenMPDSABlock(
9817 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
9818getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
9822template<
typenameDerived>
9824TreeTransform<Derived>::TransformOMPScanDirective(OMPScanDirective *
D) {
9825DeclarationNameInfo DirName;
9826getDerived().getSema().OpenMP().StartOpenMPDSABlock(
9828 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
9829getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
9833template<
typenameDerived>
9835TreeTransform<Derived>::TransformOMPOrderedDirective(OMPOrderedDirective *
D) {
9836DeclarationNameInfo DirName;
9837getDerived().getSema().OpenMP().StartOpenMPDSABlock(
9839 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
9840getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
9844template<
typenameDerived>
9846TreeTransform<Derived>::TransformOMPAtomicDirective(OMPAtomicDirective *
D) {
9847DeclarationNameInfo DirName;
9848getDerived().getSema().OpenMP().StartOpenMPDSABlock(
9850 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
9851getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
9855template<
typenameDerived>
9857TreeTransform<Derived>::TransformOMPTargetDirective(OMPTargetDirective *
D) {
9858DeclarationNameInfo DirName;
9859getDerived().getSema().OpenMP().StartOpenMPDSABlock(
9861 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
9862getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
9866template<
typenameDerived>
9867StmtResultTreeTransform<Derived>::TransformOMPTargetDataDirective(
9868OMPTargetDataDirective *
D) {
9869DeclarationNameInfo DirName;
9870getDerived().getSema().OpenMP().StartOpenMPDSABlock(
9871OMPD_target_data, DirName,
nullptr,
D->
getBeginLoc());
9872 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
9873getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
9877template<
typenameDerived>
9878StmtResultTreeTransform<Derived>::TransformOMPTargetEnterDataDirective(
9879OMPTargetEnterDataDirective *
D) {
9880DeclarationNameInfo DirName;
9881getDerived().getSema().OpenMP().StartOpenMPDSABlock(
9882OMPD_target_enter_data, DirName,
nullptr,
D->
getBeginLoc());
9883 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
9884getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
9888template<
typenameDerived>
9889StmtResultTreeTransform<Derived>::TransformOMPTargetExitDataDirective(
9890OMPTargetExitDataDirective *
D) {
9891DeclarationNameInfo DirName;
9892getDerived().getSema().OpenMP().StartOpenMPDSABlock(
9893OMPD_target_exit_data, DirName,
nullptr,
D->
getBeginLoc());
9894 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
9895getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
9899template<
typenameDerived>
9900StmtResultTreeTransform<Derived>::TransformOMPTargetParallelDirective(
9901OMPTargetParallelDirective *
D) {
9902DeclarationNameInfo DirName;
9903getDerived().getSema().OpenMP().StartOpenMPDSABlock(
9904OMPD_target_parallel, DirName,
nullptr,
D->
getBeginLoc());
9905 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
9906getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
9910template<
typenameDerived>
9911StmtResultTreeTransform<Derived>::TransformOMPTargetParallelForDirective(
9912OMPTargetParallelForDirective *
D) {
9913DeclarationNameInfo DirName;
9914getDerived().getSema().OpenMP().StartOpenMPDSABlock(
9915OMPD_target_parallel_for, DirName,
nullptr,
D->
getBeginLoc());
9916 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
9917getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
9921template<
typenameDerived>
9922StmtResultTreeTransform<Derived>::TransformOMPTargetUpdateDirective(
9923OMPTargetUpdateDirective *
D) {
9924DeclarationNameInfo DirName;
9925getDerived().getSema().OpenMP().StartOpenMPDSABlock(
9926OMPD_target_update, DirName,
nullptr,
D->
getBeginLoc());
9927 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
9928getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
9932template<
typenameDerived>
9934TreeTransform<Derived>::TransformOMPTeamsDirective(OMPTeamsDirective *
D) {
9935DeclarationNameInfo DirName;
9936getDerived().getSema().OpenMP().StartOpenMPDSABlock(
9938 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
9939getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
9943template<
typenameDerived>
9944StmtResultTreeTransform<Derived>::TransformOMPCancellationPointDirective(
9945OMPCancellationPointDirective *
D) {
9946DeclarationNameInfo DirName;
9947getDerived().getSema().OpenMP().StartOpenMPDSABlock(
9948OMPD_cancellation_point, DirName,
nullptr,
D->
getBeginLoc());
9949 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
9950getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
9954template<
typenameDerived>
9956TreeTransform<Derived>::TransformOMPCancelDirective(OMPCancelDirective *
D) {
9957DeclarationNameInfo DirName;
9958getDerived().getSema().OpenMP().StartOpenMPDSABlock(
9960 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
9961getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
9965template<
typenameDerived>
9967TreeTransform<Derived>::TransformOMPTaskLoopDirective(OMPTaskLoopDirective *
D) {
9968DeclarationNameInfo DirName;
9969getDerived().getSema().OpenMP().StartOpenMPDSABlock(
9970OMPD_taskloop, DirName,
nullptr,
D->
getBeginLoc());
9971 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
9972getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
9976template<
typenameDerived>
9977StmtResultTreeTransform<Derived>::TransformOMPTaskLoopSimdDirective(
9978OMPTaskLoopSimdDirective *
D) {
9979DeclarationNameInfo DirName;
9980getDerived().getSema().OpenMP().StartOpenMPDSABlock(
9981OMPD_taskloop_simd, DirName,
nullptr,
D->
getBeginLoc());
9982 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
9983getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
9987template<
typenameDerived>
9988StmtResultTreeTransform<Derived>::TransformOMPMasterTaskLoopDirective(
9989OMPMasterTaskLoopDirective *
D) {
9990DeclarationNameInfo DirName;
9991getDerived().getSema().OpenMP().StartOpenMPDSABlock(
9992OMPD_master_taskloop, DirName,
nullptr,
D->
getBeginLoc());
9993 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
9994getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
9998template<
typenameDerived>
9999StmtResultTreeTransform<Derived>::TransformOMPMaskedTaskLoopDirective(
10000OMPMaskedTaskLoopDirective *
D) {
10001DeclarationNameInfo DirName;
10002getDerived().getSema().OpenMP().StartOpenMPDSABlock(
10003OMPD_masked_taskloop, DirName,
nullptr,
D->
getBeginLoc());
10004 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
10005getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
10009template<
typenameDerived>
10010StmtResultTreeTransform<Derived>::TransformOMPMasterTaskLoopSimdDirective(
10011OMPMasterTaskLoopSimdDirective *
D) {
10012DeclarationNameInfo DirName;
10013getDerived().getSema().OpenMP().StartOpenMPDSABlock(
10014OMPD_master_taskloop_simd, DirName,
nullptr,
D->
getBeginLoc());
10015 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
10016getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
10020template<
typenameDerived>
10021StmtResultTreeTransform<Derived>::TransformOMPMaskedTaskLoopSimdDirective(
10022OMPMaskedTaskLoopSimdDirective *
D) {
10023DeclarationNameInfo DirName;
10024getDerived().getSema().OpenMP().StartOpenMPDSABlock(
10025OMPD_masked_taskloop_simd, DirName,
nullptr,
D->
getBeginLoc());
10026 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
10027getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
10031template<
typenameDerived>
10032StmtResultTreeTransform<Derived>::TransformOMPParallelMasterTaskLoopDirective(
10033OMPParallelMasterTaskLoopDirective *
D) {
10034DeclarationNameInfo DirName;
10035getDerived().getSema().OpenMP().StartOpenMPDSABlock(
10036OMPD_parallel_master_taskloop, DirName,
nullptr,
D->
getBeginLoc());
10037 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
10038getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
10042template<
typenameDerived>
10043StmtResultTreeTransform<Derived>::TransformOMPParallelMaskedTaskLoopDirective(
10044OMPParallelMaskedTaskLoopDirective *
D) {
10045DeclarationNameInfo DirName;
10046getDerived().getSema().OpenMP().StartOpenMPDSABlock(
10047OMPD_parallel_masked_taskloop, DirName,
nullptr,
D->
getBeginLoc());
10048 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
10049getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
10053template<
typenameDerived>
10055TreeTransform<Derived>::TransformOMPParallelMasterTaskLoopSimdDirective(
10056OMPParallelMasterTaskLoopSimdDirective *
D) {
10057DeclarationNameInfo DirName;
10058getDerived().getSema().OpenMP().StartOpenMPDSABlock(
10059OMPD_parallel_master_taskloop_simd, DirName,
nullptr,
D->
getBeginLoc());
10060 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
10061getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
10065template<
typenameDerived>
10067TreeTransform<Derived>::TransformOMPParallelMaskedTaskLoopSimdDirective(
10068OMPParallelMaskedTaskLoopSimdDirective *
D) {
10069DeclarationNameInfo DirName;
10070getDerived().getSema().OpenMP().StartOpenMPDSABlock(
10071OMPD_parallel_masked_taskloop_simd, DirName,
nullptr,
D->
getBeginLoc());
10072 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
10073getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
10077template<
typenameDerived>
10078StmtResultTreeTransform<Derived>::TransformOMPDistributeDirective(
10079OMPDistributeDirective *
D) {
10080DeclarationNameInfo DirName;
10081getDerived().getSema().OpenMP().StartOpenMPDSABlock(
10082OMPD_distribute, DirName,
nullptr,
D->
getBeginLoc());
10083 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
10084getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
10088template<
typenameDerived>
10089StmtResultTreeTransform<Derived>::TransformOMPDistributeParallelForDirective(
10090OMPDistributeParallelForDirective *
D) {
10091DeclarationNameInfo DirName;
10092getDerived().getSema().OpenMP().StartOpenMPDSABlock(
10093OMPD_distribute_parallel_for, DirName,
nullptr,
D->
getBeginLoc());
10094 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
10095getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
10099template<
typenameDerived>
10101TreeTransform<Derived>::TransformOMPDistributeParallelForSimdDirective(
10102OMPDistributeParallelForSimdDirective *
D) {
10103DeclarationNameInfo DirName;
10104getDerived().getSema().OpenMP().StartOpenMPDSABlock(
10105OMPD_distribute_parallel_for_simd, DirName,
nullptr,
D->
getBeginLoc());
10106 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
10107getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
10111template<
typenameDerived>
10112StmtResultTreeTransform<Derived>::TransformOMPDistributeSimdDirective(
10113OMPDistributeSimdDirective *
D) {
10114DeclarationNameInfo DirName;
10115getDerived().getSema().OpenMP().StartOpenMPDSABlock(
10116OMPD_distribute_simd, DirName,
nullptr,
D->
getBeginLoc());
10117 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
10118getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
10122template<
typenameDerived>
10123StmtResultTreeTransform<Derived>::TransformOMPTargetParallelForSimdDirective(
10124OMPTargetParallelForSimdDirective *
D) {
10125DeclarationNameInfo DirName;
10126getDerived().getSema().OpenMP().StartOpenMPDSABlock(
10127OMPD_target_parallel_for_simd, DirName,
nullptr,
D->
getBeginLoc());
10128 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
10129getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
10133template<
typenameDerived>
10134StmtResultTreeTransform<Derived>::TransformOMPTargetSimdDirective(
10135OMPTargetSimdDirective *
D) {
10136DeclarationNameInfo DirName;
10137getDerived().getSema().OpenMP().StartOpenMPDSABlock(
10138OMPD_target_simd, DirName,
nullptr,
D->
getBeginLoc());
10139 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
10140getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
10144template<
typenameDerived>
10145StmtResultTreeTransform<Derived>::TransformOMPTeamsDistributeDirective(
10146OMPTeamsDistributeDirective *
D) {
10147DeclarationNameInfo DirName;
10148getDerived().getSema().OpenMP().StartOpenMPDSABlock(
10149OMPD_teams_distribute, DirName,
nullptr,
D->
getBeginLoc());
10150 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
10151getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
10155template<
typenameDerived>
10156StmtResultTreeTransform<Derived>::TransformOMPTeamsDistributeSimdDirective(
10157OMPTeamsDistributeSimdDirective *
D) {
10158DeclarationNameInfo DirName;
10159getDerived().getSema().OpenMP().StartOpenMPDSABlock(
10160OMPD_teams_distribute_simd, DirName,
nullptr,
D->
getBeginLoc());
10161 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
10162getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
10166template<
typenameDerived>
10167StmtResultTreeTransform<Derived>::TransformOMPTeamsDistributeParallelForSimdDirective(
10168OMPTeamsDistributeParallelForSimdDirective *
D) {
10169DeclarationNameInfo DirName;
10170getDerived().getSema().OpenMP().StartOpenMPDSABlock(
10171OMPD_teams_distribute_parallel_for_simd, DirName,
nullptr,
10173 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
10174getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
10178template<
typenameDerived>
10179StmtResultTreeTransform<Derived>::TransformOMPTeamsDistributeParallelForDirective(
10180OMPTeamsDistributeParallelForDirective *
D) {
10181DeclarationNameInfo DirName;
10182getDerived().getSema().OpenMP().StartOpenMPDSABlock(
10183OMPD_teams_distribute_parallel_for, DirName,
nullptr,
D->
getBeginLoc());
10184 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
10185getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
10189template<
typenameDerived>
10190StmtResultTreeTransform<Derived>::TransformOMPTargetTeamsDirective(
10191OMPTargetTeamsDirective *
D) {
10192DeclarationNameInfo DirName;
10193getDerived().getSema().OpenMP().StartOpenMPDSABlock(
10194OMPD_target_teams, DirName,
nullptr,
D->
getBeginLoc());
10195 autoRes = getDerived().TransformOMPExecutableDirective(
D);
10196getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
10200template<
typenameDerived>
10201StmtResultTreeTransform<Derived>::TransformOMPTargetTeamsDistributeDirective(
10202OMPTargetTeamsDistributeDirective *
D) {
10203DeclarationNameInfo DirName;
10204getDerived().getSema().OpenMP().StartOpenMPDSABlock(
10205OMPD_target_teams_distribute, DirName,
nullptr,
D->
getBeginLoc());
10206 autoRes = getDerived().TransformOMPExecutableDirective(
D);
10207getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
10211template<
typenameDerived>
10213TreeTransform<Derived>::TransformOMPTargetTeamsDistributeParallelForDirective(
10214OMPTargetTeamsDistributeParallelForDirective *
D) {
10215DeclarationNameInfo DirName;
10216getDerived().getSema().OpenMP().StartOpenMPDSABlock(
10217OMPD_target_teams_distribute_parallel_for, DirName,
nullptr,
10219 autoRes = getDerived().TransformOMPExecutableDirective(
D);
10220getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
10224template<
typenameDerived>
10226TransformOMPTargetTeamsDistributeParallelForSimdDirective(
10227OMPTargetTeamsDistributeParallelForSimdDirective *
D) {
10228DeclarationNameInfo DirName;
10229getDerived().getSema().OpenMP().StartOpenMPDSABlock(
10230OMPD_target_teams_distribute_parallel_for_simd, DirName,
nullptr,
10232 autoRes = getDerived().TransformOMPExecutableDirective(
D);
10233getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
10237template<
typenameDerived>
10239TreeTransform<Derived>::TransformOMPTargetTeamsDistributeSimdDirective(
10240OMPTargetTeamsDistributeSimdDirective *
D) {
10241DeclarationNameInfo DirName;
10242getDerived().getSema().OpenMP().StartOpenMPDSABlock(
10243OMPD_target_teams_distribute_simd, DirName,
nullptr,
D->
getBeginLoc());
10244 autoRes = getDerived().TransformOMPExecutableDirective(
D);
10245getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
10249template<
typenameDerived>
10251TreeTransform<Derived>::TransformOMPInteropDirective(OMPInteropDirective *
D) {
10252DeclarationNameInfo DirName;
10253getDerived().getSema().OpenMP().StartOpenMPDSABlock(
10254OMPD_interop, DirName,
nullptr,
D->
getBeginLoc());
10255 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
10256getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
10260template<
typenameDerived>
10262TreeTransform<Derived>::TransformOMPDispatchDirective(OMPDispatchDirective *
D) {
10263DeclarationNameInfo DirName;
10264getDerived().getSema().OpenMP().StartOpenMPDSABlock(
10265OMPD_dispatch, DirName,
nullptr,
D->
getBeginLoc());
10266 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
10267getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
10271template<
typenameDerived>
10273TreeTransform<Derived>::TransformOMPMaskedDirective(OMPMaskedDirective *
D) {
10274DeclarationNameInfo DirName;
10275getDerived().getSema().OpenMP().StartOpenMPDSABlock(
10277 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
10278getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
10282template<
typenameDerived>
10283StmtResultTreeTransform<Derived>::TransformOMPGenericLoopDirective(
10284OMPGenericLoopDirective *
D) {
10285DeclarationNameInfo DirName;
10286getDerived().getSema().OpenMP().StartOpenMPDSABlock(
10288 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
10289getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
10293template<
typenameDerived>
10294StmtResultTreeTransform<Derived>::TransformOMPTeamsGenericLoopDirective(
10295OMPTeamsGenericLoopDirective *
D) {
10296DeclarationNameInfo DirName;
10297getDerived().getSema().OpenMP().StartOpenMPDSABlock(
10298OMPD_teams_loop, DirName,
nullptr,
D->
getBeginLoc());
10299 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
10300getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
10304template<
typenameDerived>
10305StmtResultTreeTransform<Derived>::TransformOMPTargetTeamsGenericLoopDirective(
10306OMPTargetTeamsGenericLoopDirective *
D) {
10307DeclarationNameInfo DirName;
10308getDerived().getSema().OpenMP().StartOpenMPDSABlock(
10309OMPD_target_teams_loop, DirName,
nullptr,
D->
getBeginLoc());
10310 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
10311getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
10315template<
typenameDerived>
10316StmtResultTreeTransform<Derived>::TransformOMPParallelGenericLoopDirective(
10317OMPParallelGenericLoopDirective *
D) {
10318DeclarationNameInfo DirName;
10319getDerived().getSema().OpenMP().StartOpenMPDSABlock(
10320OMPD_parallel_loop, DirName,
nullptr,
D->
getBeginLoc());
10321 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
10322getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
10326template<
typenameDerived>
10328TreeTransform<Derived>::TransformOMPTargetParallelGenericLoopDirective(
10329OMPTargetParallelGenericLoopDirective *
D) {
10330DeclarationNameInfo DirName;
10331getDerived().getSema().OpenMP().StartOpenMPDSABlock(
10332OMPD_target_parallel_loop, DirName,
nullptr,
D->
getBeginLoc());
10333 StmtResultRes = getDerived().TransformOMPExecutableDirective(
D);
10334getDerived().getSema().OpenMP().EndOpenMPDSABlock(Res.get());
10341template<
typenameDerived>
10342OMPClause *TreeTransform<Derived>::TransformOMPIfClause(OMPIfClause *
C) {
10343 ExprResultCond = getDerived().TransformExpr(
C->getCondition());
10344 if(Cond.isInvalid())
10346 returngetDerived().RebuildOMPIfClause(
10347 C->getNameModifier(), Cond.get(),
C->getBeginLoc(),
C->getLParenLoc(),
10348 C->getNameModifierLoc(),
C->getColonLoc(),
C->getEndLoc());
10351template<
typenameDerived>
10352OMPClause *TreeTransform<Derived>::TransformOMPFinalClause(OMPFinalClause *
C) {
10353 ExprResultCond = getDerived().TransformExpr(
C->getCondition());
10354 if(Cond.isInvalid())
10356 returngetDerived().RebuildOMPFinalClause(Cond.get(),
C->getBeginLoc(),
10357 C->getLParenLoc(),
C->getEndLoc());
10360template<
typenameDerived>
10362TreeTransform<Derived>::TransformOMPNumThreadsClause(OMPNumThreadsClause *
C) {
10363 ExprResultNumThreads = getDerived().TransformExpr(
C->getNumThreads());
10364 if(NumThreads.isInvalid())
10366 returngetDerived().RebuildOMPNumThreadsClause(
10367NumThreads.get(),
C->getBeginLoc(),
C->getLParenLoc(),
C->getEndLoc());
10370template<
typenameDerived>
10372TreeTransform<Derived>::TransformOMPSafelenClause(OMPSafelenClause *
C) {
10373 ExprResult E= getDerived().TransformExpr(
C->getSafelen());
10374 if(
E.isInvalid())
10376 returngetDerived().RebuildOMPSafelenClause(
10377 E.get(),
C->getBeginLoc(),
C->getLParenLoc(),
C->getEndLoc());
10380template<
typenameDerived>
10382TreeTransform<Derived>::TransformOMPAllocatorClause(OMPAllocatorClause *
C) {
10383 ExprResult E= getDerived().TransformExpr(
C->getAllocator());
10384 if(
E.isInvalid())
10386 returngetDerived().RebuildOMPAllocatorClause(
10387 E.get(),
C->getBeginLoc(),
C->getLParenLoc(),
C->getEndLoc());
10390template<
typenameDerived>
10392TreeTransform<Derived>::TransformOMPSimdlenClause(OMPSimdlenClause *
C) {
10393 ExprResult E= getDerived().TransformExpr(
C->getSimdlen());
10394 if(
E.isInvalid())
10396 returngetDerived().RebuildOMPSimdlenClause(
10397 E.get(),
C->getBeginLoc(),
C->getLParenLoc(),
C->getEndLoc());
10400template<
typenameDerived>
10401OMPClause *TreeTransform<Derived>::TransformOMPSizesClause(OMPSizesClause *
C) {
10403TransformedSizes.reserve(
C->getNumSizes());
10405 for(Expr *
E:
C->getSizesRefs()) {
10407TransformedSizes.push_back(
nullptr);
10412 if(
T.isInvalid())
10414 if(
E!=
T.get())
10416TransformedSizes.push_back(
T.get());
10419 if(!Changed && !getDerived().AlwaysRebuild())
10421 returnRebuildOMPSizesClause(TransformedSizes,
C->getBeginLoc(),
10422 C->getLParenLoc(),
C->getEndLoc());
10425template<
typenameDerived>
10427TreeTransform<Derived>::TransformOMPPermutationClause(OMPPermutationClause *
C) {
10429TransformedArgs.reserve(
C->getNumLoops());
10431 for(Expr *
E:
C->getArgsRefs()) {
10433TransformedArgs.push_back(
nullptr);
10438 if(
T.isInvalid())
10440 if(
E!=
T.get())
10442TransformedArgs.push_back(
T.get());
10445 if(!Changed && !getDerived().AlwaysRebuild())
10447 returnRebuildOMPPermutationClause(TransformedArgs,
C->getBeginLoc(),
10448 C->getLParenLoc(),
C->getEndLoc());
10451template<
typenameDerived>
10452OMPClause *TreeTransform<Derived>::TransformOMPFullClause(OMPFullClause *
C) {
10453 if(!getDerived().AlwaysRebuild())
10455 returnRebuildOMPFullClause(
C->getBeginLoc(),
C->getEndLoc());
10458template<
typenameDerived>
10460TreeTransform<Derived>::TransformOMPPartialClause(OMPPartialClause *
C) {
10461 ExprResult T= getDerived().TransformExpr(
C->getFactor());
10462 if(
T.isInvalid())
10464Expr *Factor =
T.get();
10465 bool Changed= Factor !=
C->getFactor();
10467 if(!Changed && !getDerived().AlwaysRebuild())
10469 returnRebuildOMPPartialClause(Factor,
C->getBeginLoc(),
C->getLParenLoc(),
10473template<
typenameDerived>
10475TreeTransform<Derived>::TransformOMPCollapseClause(OMPCollapseClause *
C) {
10476 ExprResult E= getDerived().TransformExpr(
C->getNumForLoops());
10477 if(
E.isInvalid())
10479 returngetDerived().RebuildOMPCollapseClause(
10480 E.get(),
C->getBeginLoc(),
C->getLParenLoc(),
C->getEndLoc());
10483template<
typenameDerived>
10485TreeTransform<Derived>::TransformOMPDefaultClause(OMPDefaultClause *
C) {
10486 returngetDerived().RebuildOMPDefaultClause(
10487 C->getDefaultKind(),
C->getDefaultKindKwLoc(),
C->getBeginLoc(),
10488 C->getLParenLoc(),
C->getEndLoc());
10491template<
typenameDerived>
10493TreeTransform<Derived>::TransformOMPProcBindClause(OMPProcBindClause *
C) {
10494 returngetDerived().RebuildOMPProcBindClause(
10495 C->getProcBindKind(),
C->getProcBindKindKwLoc(),
C->getBeginLoc(),
10496 C->getLParenLoc(),
C->getEndLoc());
10499template<
typenameDerived>
10501TreeTransform<Derived>::TransformOMPScheduleClause(OMPScheduleClause *
C) {
10502 ExprResult E= getDerived().TransformExpr(
C->getChunkSize());
10503 if(
E.isInvalid())
10505 returngetDerived().RebuildOMPScheduleClause(
10506 C->getFirstScheduleModifier(),
C->getSecondScheduleModifier(),
10507 C->getScheduleKind(),
E.get(),
C->getBeginLoc(),
C->getLParenLoc(),
10508 C->getFirstScheduleModifierLoc(),
C->getSecondScheduleModifierLoc(),
10509 C->getScheduleKindLoc(),
C->getCommaLoc(),
C->getEndLoc());
10512template<
typenameDerived>
10514TreeTransform<Derived>::TransformOMPOrderedClause(OMPOrderedClause *
C) {
10516 if(
auto*
Num=
C->getNumForLoops()) {
10517 E= getDerived().TransformExpr(
Num);
10518 if(
E.isInvalid())
10521 returngetDerived().RebuildOMPOrderedClause(
C->getBeginLoc(),
C->getEndLoc(),
10522 C->getLParenLoc(),
E.get());
10525template<
typenameDerived>
10527TreeTransform<Derived>::TransformOMPDetachClause(OMPDetachClause *
C) {
10529 if(Expr *Evt =
C->getEventHandler()) {
10530 E= getDerived().TransformExpr(Evt);
10531 if(
E.isInvalid())
10534 returngetDerived().RebuildOMPDetachClause(
E.get(),
C->getBeginLoc(),
10535 C->getLParenLoc(),
C->getEndLoc());
10538template<
typenameDerived>
10540TreeTransform<Derived>::TransformOMPNowaitClause(OMPNowaitClause *
C) {
10545template<
typenameDerived>
10547TreeTransform<Derived>::TransformOMPUntiedClause(OMPUntiedClause *
C) {
10552template<
typenameDerived>
10554TreeTransform<Derived>::TransformOMPMergeableClause(OMPMergeableClause *
C) {
10559template<
typenameDerived>
10560OMPClause *TreeTransform<Derived>::TransformOMPReadClause(OMPReadClause *
C) {
10565template<
typenameDerived>
10566OMPClause *TreeTransform<Derived>::TransformOMPWriteClause(OMPWriteClause *
C) {
10571template<
typenameDerived>
10573TreeTransform<Derived>::TransformOMPUpdateClause(OMPUpdateClause *
C) {
10578template<
typenameDerived>
10580TreeTransform<Derived>::TransformOMPCaptureClause(OMPCaptureClause *
C) {
10585template<
typenameDerived>
10587TreeTransform<Derived>::TransformOMPCompareClause(OMPCompareClause *
C) {
10592template<
typenameDerived>
10593OMPClause *TreeTransform<Derived>::TransformOMPFailClause(OMPFailClause *
C) {
10598template<
typenameDerived>
10600TreeTransform<Derived>::TransformOMPAbsentClause(OMPAbsentClause *
C) {
10604template<
typenameDerived>
10605OMPClause *TreeTransform<Derived>::TransformOMPHoldsClause(OMPHoldsClause *
C) {
10606 ExprResult E= getDerived().TransformExpr(
C->getExpr());
10607 if(
E.isInvalid())
10609 returngetDerived().RebuildOMPHoldsClause(
E.get(),
C->getBeginLoc(),
10610 C->getLParenLoc(),
C->getEndLoc());
10613template<
typenameDerived>
10615TreeTransform<Derived>::TransformOMPContainsClause(OMPContainsClause *
C) {
10619template<
typenameDerived>
10621TreeTransform<Derived>::TransformOMPNoOpenMPClause(OMPNoOpenMPClause *
C) {
10624template<
typenameDerived>
10625OMPClause *TreeTransform<Derived>::TransformOMPNoOpenMPRoutinesClause(
10626OMPNoOpenMPRoutinesClause *
C) {
10629template<
typenameDerived>
10630OMPClause *TreeTransform<Derived>::TransformOMPNoParallelismClause(
10631OMPNoParallelismClause *
C) {
10635template<
typenameDerived>
10637TreeTransform<Derived>::TransformOMPSeqCstClause(OMPSeqCstClause *
C) {
10642template<
typenameDerived>
10644TreeTransform<Derived>::TransformOMPAcqRelClause(OMPAcqRelClause *
C) {
10649template<
typenameDerived>
10651TreeTransform<Derived>::TransformOMPAcquireClause(OMPAcquireClause *
C) {
10656template<
typenameDerived>
10658TreeTransform<Derived>::TransformOMPReleaseClause(OMPReleaseClause *
C) {
10663template<
typenameDerived>
10665TreeTransform<Derived>::TransformOMPRelaxedClause(OMPRelaxedClause *
C) {
10670template<
typenameDerived>
10671OMPClause *TreeTransform<Derived>::TransformOMPWeakClause(OMPWeakClause *
C) {
10676template<
typenameDerived>
10678TreeTransform<Derived>::TransformOMPThreadsClause(OMPThreadsClause *
C) {
10683template<
typenameDerived>
10684OMPClause *TreeTransform<Derived>::TransformOMPSIMDClause(OMPSIMDClause *
C) {
10689template<
typenameDerived>
10691TreeTransform<Derived>::TransformOMPNogroupClause(OMPNogroupClause *
C) {
10696template<
typenameDerived>
10697OMPClause *TreeTransform<Derived>::TransformOMPInitClause(OMPInitClause *
C) {
10698 ExprResultIVR = getDerived().TransformExpr(
C->getInteropVar());
10699 if(IVR.isInvalid())
10702OMPInteropInfo InteropInfo(
C->getIsTarget(),
C->getIsTargetSync());
10703InteropInfo.PreferTypes.reserve(
C->varlist_size() - 1);
10704 for(Expr *
E: llvm::drop_begin(
C->varlist())) {
10705 ExprResultER = getDerived().TransformExpr(cast<Expr>(
E));
10706 if(ER.isInvalid())
10708InteropInfo.PreferTypes.push_back(ER.get());
10710 returngetDerived().RebuildOMPInitClause(IVR.get(), InteropInfo,
10711 C->getBeginLoc(),
C->getLParenLoc(),
10712 C->getVarLoc(),
C->getEndLoc());
10715template<
typenameDerived>
10716OMPClause *TreeTransform<Derived>::TransformOMPUseClause(OMPUseClause *
C) {
10717 ExprResultER = getDerived().TransformExpr(
C->getInteropVar());
10718 if(ER.isInvalid())
10720 returngetDerived().RebuildOMPUseClause(ER.get(),
C->getBeginLoc(),
10721 C->getLParenLoc(),
C->getVarLoc(),
10725template<
typenameDerived>
10727TreeTransform<Derived>::TransformOMPDestroyClause(OMPDestroyClause *
C) {
10729 if(Expr *IV =
C->getInteropVar()) {
10730ER = getDerived().TransformExpr(IV);
10731 if(ER.isInvalid())
10734 returngetDerived().RebuildOMPDestroyClause(ER.get(),
C->getBeginLoc(),
10735 C->getLParenLoc(),
C->getVarLoc(),
10739template<
typenameDerived>
10741TreeTransform<Derived>::TransformOMPNovariantsClause(OMPNovariantsClause *
C) {
10742 ExprResultCond = getDerived().TransformExpr(
C->getCondition());
10743 if(Cond.isInvalid())
10745 returngetDerived().RebuildOMPNovariantsClause(
10746Cond.get(),
C->getBeginLoc(),
C->getLParenLoc(),
C->getEndLoc());
10749template<
typenameDerived>
10751TreeTransform<Derived>::TransformOMPNocontextClause(OMPNocontextClause *
C) {
10752 ExprResultCond = getDerived().TransformExpr(
C->getCondition());
10753 if(Cond.isInvalid())
10755 returngetDerived().RebuildOMPNocontextClause(
10756Cond.get(),
C->getBeginLoc(),
C->getLParenLoc(),
C->getEndLoc());
10759template<
typenameDerived>
10761TreeTransform<Derived>::TransformOMPFilterClause(OMPFilterClause *
C) {
10762 ExprResultThreadID = getDerived().TransformExpr(
C->getThreadID());
10763 if(ThreadID.isInvalid())
10765 returngetDerived().RebuildOMPFilterClause(ThreadID.get(),
C->getBeginLoc(),
10766 C->getLParenLoc(),
C->getEndLoc());
10769template<
typenameDerived>
10770OMPClause *TreeTransform<Derived>::TransformOMPAlignClause(OMPAlignClause *
C) {
10771 ExprResult E= getDerived().TransformExpr(
C->getAlignment());
10772 if(
E.isInvalid())
10774 returngetDerived().RebuildOMPAlignClause(
E.get(),
C->getBeginLoc(),
10775 C->getLParenLoc(),
C->getEndLoc());
10778template<
typenameDerived>
10779OMPClause *TreeTransform<Derived>::TransformOMPUnifiedAddressClause(
10780OMPUnifiedAddressClause *
C) {
10781llvm_unreachable(
"unified_address clause cannot appear in dependent context");
10784template<
typenameDerived>
10785OMPClause *TreeTransform<Derived>::TransformOMPUnifiedSharedMemoryClause(
10786OMPUnifiedSharedMemoryClause *
C) {
10788 "unified_shared_memory clause cannot appear in dependent context");
10791template<
typenameDerived>
10792OMPClause *TreeTransform<Derived>::TransformOMPReverseOffloadClause(
10793OMPReverseOffloadClause *
C) {
10794llvm_unreachable(
"reverse_offload clause cannot appear in dependent context");
10797template<
typenameDerived>
10798OMPClause *TreeTransform<Derived>::TransformOMPDynamicAllocatorsClause(
10799OMPDynamicAllocatorsClause *
C) {
10801 "dynamic_allocators clause cannot appear in dependent context");
10804template<
typenameDerived>
10805OMPClause *TreeTransform<Derived>::TransformOMPAtomicDefaultMemOrderClause(
10806OMPAtomicDefaultMemOrderClause *
C) {
10808 "atomic_default_mem_order clause cannot appear in dependent context");
10811template<
typenameDerived>
10812OMPClause *TreeTransform<Derived>::TransformOMPAtClause(OMPAtClause *
C) {
10813 returngetDerived().RebuildOMPAtClause(
C->getAtKind(),
C->getAtKindKwLoc(),
10814 C->getBeginLoc(),
C->getLParenLoc(),
10818template<
typenameDerived>
10820TreeTransform<Derived>::TransformOMPSeverityClause(OMPSeverityClause *
C) {
10821 returngetDerived().RebuildOMPSeverityClause(
10822 C->getSeverityKind(),
C->getSeverityKindKwLoc(),
C->getBeginLoc(),
10823 C->getLParenLoc(),
C->getEndLoc());
10826template<
typenameDerived>
10828TreeTransform<Derived>::TransformOMPMessageClause(OMPMessageClause *
C) {
10829 ExprResult E= getDerived().TransformExpr(
C->getMessageString());
10830 if(
E.isInvalid())
10832 returngetDerived().RebuildOMPMessageClause(
10833 C->getMessageString(),
C->getBeginLoc(),
C->getLParenLoc(),
10837template<
typenameDerived>
10839TreeTransform<Derived>::TransformOMPPrivateClause(OMPPrivateClause *
C) {
10841Vars.reserve(
C->varlist_size());
10842 for(
auto*VE :
C->varlist()) {
10843 ExprResultEVar = getDerived().TransformExpr(cast<Expr>(VE));
10844 if(EVar.isInvalid())
10846Vars.push_back(EVar.get());
10848 returngetDerived().RebuildOMPPrivateClause(
10849Vars,
C->getBeginLoc(),
C->getLParenLoc(),
C->getEndLoc());
10852template<
typenameDerived>
10853OMPClause *TreeTransform<Derived>::TransformOMPFirstprivateClause(
10854OMPFirstprivateClause *
C) {
10856Vars.reserve(
C->varlist_size());
10857 for(
auto*VE :
C->varlist()) {
10858 ExprResultEVar = getDerived().TransformExpr(cast<Expr>(VE));
10859 if(EVar.isInvalid())
10861Vars.push_back(EVar.get());
10863 returngetDerived().RebuildOMPFirstprivateClause(
10864Vars,
C->getBeginLoc(),
C->getLParenLoc(),
C->getEndLoc());
10867template<
typenameDerived>
10869TreeTransform<Derived>::TransformOMPLastprivateClause(OMPLastprivateClause *
C) {
10871Vars.reserve(
C->varlist_size());
10872 for(
auto*VE :
C->varlist()) {
10873 ExprResultEVar = getDerived().TransformExpr(cast<Expr>(VE));
10874 if(EVar.isInvalid())
10876Vars.push_back(EVar.get());
10878 returngetDerived().RebuildOMPLastprivateClause(
10879Vars,
C->getKind(),
C->getKindLoc(),
C->getColonLoc(),
C->getBeginLoc(),
10880 C->getLParenLoc(),
C->getEndLoc());
10883template<
typenameDerived>
10885TreeTransform<Derived>::TransformOMPSharedClause(OMPSharedClause *
C) {
10887Vars.reserve(
C->varlist_size());
10888 for(
auto*VE :
C->varlist()) {
10889 ExprResultEVar = getDerived().TransformExpr(cast<Expr>(VE));
10890 if(EVar.isInvalid())
10892Vars.push_back(EVar.get());
10894 returngetDerived().RebuildOMPSharedClause(Vars,
C->getBeginLoc(),
10895 C->getLParenLoc(),
C->getEndLoc());
10898template<
typenameDerived>
10900TreeTransform<Derived>::TransformOMPReductionClause(OMPReductionClause *
C) {
10902Vars.reserve(
C->varlist_size());
10903 for(
auto*VE :
C->varlist()) {
10904 ExprResultEVar = getDerived().TransformExpr(cast<Expr>(VE));
10905 if(EVar.isInvalid())
10907Vars.push_back(EVar.get());
10909CXXScopeSpec ReductionIdScopeSpec;
10910ReductionIdScopeSpec.Adopt(
C->getQualifierLoc());
10912DeclarationNameInfo NameInfo =
C->getNameInfo();
10913 if(NameInfo.getName()) {
10914NameInfo = getDerived().TransformDeclarationNameInfo(NameInfo);
10915 if(!NameInfo.getName())
10921 for(
auto*
E:
C->reduction_ops()) {
10924 auto*ULE = cast<UnresolvedLookupExpr>(
E);
10925UnresolvedSet<8> Decls;
10926 for(
auto*
D: ULE->decls()) {
10928cast<NamedDecl>(getDerived().TransformDecl(
E->
getExprLoc(),
D));
10929Decls.addDecl(InstD, InstD->getAccess());
10933ReductionIdScopeSpec.getWithLocInContext(SemaRef.
Context), NameInfo,
10934 true, Decls.begin(), Decls.end(),
10937UnresolvedReductions.push_back(
nullptr);
10939 returngetDerived().RebuildOMPReductionClause(
10940Vars,
C->getModifier(),
C->getBeginLoc(),
C->getLParenLoc(),
10941 C->getModifierLoc(),
C->getColonLoc(),
C->getEndLoc(),
10942ReductionIdScopeSpec, NameInfo, UnresolvedReductions);
10945template<
typenameDerived>
10946OMPClause *TreeTransform<Derived>::TransformOMPTaskReductionClause(
10947OMPTaskReductionClause *
C) {
10949Vars.reserve(
C->varlist_size());
10950 for(
auto*VE :
C->varlist()) {
10951 ExprResultEVar = getDerived().TransformExpr(cast<Expr>(VE));
10952 if(EVar.isInvalid())
10954Vars.push_back(EVar.get());
10956CXXScopeSpec ReductionIdScopeSpec;
10957ReductionIdScopeSpec.Adopt(
C->getQualifierLoc());
10959DeclarationNameInfo NameInfo =
C->getNameInfo();
10960 if(NameInfo.getName()) {
10961NameInfo = getDerived().TransformDeclarationNameInfo(NameInfo);
10962 if(!NameInfo.getName())
10968 for(
auto*
E:
C->reduction_ops()) {
10971 auto*ULE = cast<UnresolvedLookupExpr>(
E);
10972UnresolvedSet<8> Decls;
10973 for(
auto*
D: ULE->decls()) {
10975cast<NamedDecl>(getDerived().TransformDecl(
E->
getExprLoc(),
D));
10976Decls.addDecl(InstD, InstD->getAccess());
10980ReductionIdScopeSpec.getWithLocInContext(SemaRef.
Context), NameInfo,
10981 true, Decls.begin(), Decls.end(),
10984UnresolvedReductions.push_back(
nullptr);
10986 returngetDerived().RebuildOMPTaskReductionClause(
10987Vars,
C->getBeginLoc(),
C->getLParenLoc(),
C->getColonLoc(),
10988 C->getEndLoc(), ReductionIdScopeSpec, NameInfo, UnresolvedReductions);
10991template<
typenameDerived>
10993TreeTransform<Derived>::TransformOMPInReductionClause(OMPInReductionClause *
C) {
10995Vars.reserve(
C->varlist_size());
10996 for(
auto*VE :
C->varlist()) {
10997 ExprResultEVar = getDerived().TransformExpr(cast<Expr>(VE));
10998 if(EVar.isInvalid())
11000Vars.push_back(EVar.get());
11002CXXScopeSpec ReductionIdScopeSpec;
11003ReductionIdScopeSpec.Adopt(
C->getQualifierLoc());
11005DeclarationNameInfo NameInfo =
C->getNameInfo();
11006 if(NameInfo.getName()) {
11007NameInfo = getDerived().TransformDeclarationNameInfo(NameInfo);
11008 if(!NameInfo.getName())
11014 for(
auto*
E:
C->reduction_ops()) {
11017 auto*ULE = cast<UnresolvedLookupExpr>(
E);
11018UnresolvedSet<8> Decls;
11019 for(
auto*
D: ULE->decls()) {
11021cast<NamedDecl>(getDerived().TransformDecl(
E->
getExprLoc(),
D));
11022Decls.addDecl(InstD, InstD->getAccess());
11026ReductionIdScopeSpec.getWithLocInContext(SemaRef.
Context), NameInfo,
11027 true, Decls.begin(), Decls.end(),
11030UnresolvedReductions.push_back(
nullptr);
11032 returngetDerived().RebuildOMPInReductionClause(
11033Vars,
C->getBeginLoc(),
C->getLParenLoc(),
C->getColonLoc(),
11034 C->getEndLoc(), ReductionIdScopeSpec, NameInfo, UnresolvedReductions);
11037template<
typenameDerived>
11039TreeTransform<Derived>::TransformOMPLinearClause(OMPLinearClause *
C) {
11041Vars.reserve(
C->varlist_size());
11042 for(
auto*VE :
C->varlist()) {
11043 ExprResultEVar = getDerived().TransformExpr(cast<Expr>(VE));
11044 if(EVar.isInvalid())
11046Vars.push_back(EVar.get());
11048 ExprResultStep = getDerived().TransformExpr(
C->getStep());
11049 if(Step.isInvalid())
11051 returngetDerived().RebuildOMPLinearClause(
11052Vars, Step.get(),
C->getBeginLoc(),
C->getLParenLoc(),
C->getModifier(),
11053 C->getModifierLoc(),
C->getColonLoc(),
C->getStepModifierLoc(),
11057template<
typenameDerived>
11059TreeTransform<Derived>::TransformOMPAlignedClause(OMPAlignedClause *
C) {
11061Vars.reserve(
C->varlist_size());
11062 for(
auto*VE :
C->varlist()) {
11063 ExprResultEVar = getDerived().TransformExpr(cast<Expr>(VE));
11064 if(EVar.isInvalid())
11066Vars.push_back(EVar.get());
11068 ExprResultAlignment = getDerived().TransformExpr(
C->getAlignment());
11069 if(Alignment.isInvalid())
11071 returngetDerived().RebuildOMPAlignedClause(
11072Vars, Alignment.get(),
C->getBeginLoc(),
C->getLParenLoc(),
11073 C->getColonLoc(),
C->getEndLoc());
11076template<
typenameDerived>
11078TreeTransform<Derived>::TransformOMPCopyinClause(OMPCopyinClause *
C) {
11080Vars.reserve(
C->varlist_size());
11081 for(
auto*VE :
C->varlist()) {
11082 ExprResultEVar = getDerived().TransformExpr(cast<Expr>(VE));
11083 if(EVar.isInvalid())
11085Vars.push_back(EVar.get());
11087 returngetDerived().RebuildOMPCopyinClause(Vars,
C->getBeginLoc(),
11088 C->getLParenLoc(),
C->getEndLoc());
11091template<
typenameDerived>
11093TreeTransform<Derived>::TransformOMPCopyprivateClause(OMPCopyprivateClause *
C) {
11095Vars.reserve(
C->varlist_size());
11096 for(
auto*VE :
C->varlist()) {
11097 ExprResultEVar = getDerived().TransformExpr(cast<Expr>(VE));
11098 if(EVar.isInvalid())
11100Vars.push_back(EVar.get());
11102 returngetDerived().RebuildOMPCopyprivateClause(
11103Vars,
C->getBeginLoc(),
C->getLParenLoc(),
C->getEndLoc());
11106template<
typenameDerived>
11107OMPClause *TreeTransform<Derived>::TransformOMPFlushClause(OMPFlushClause *
C) {
11109Vars.reserve(
C->varlist_size());
11110 for(
auto*VE :
C->varlist()) {
11111 ExprResultEVar = getDerived().TransformExpr(cast<Expr>(VE));
11112 if(EVar.isInvalid())
11114Vars.push_back(EVar.get());
11116 returngetDerived().RebuildOMPFlushClause(Vars,
C->getBeginLoc(),
11117 C->getLParenLoc(),
C->getEndLoc());
11120template<
typenameDerived>
11122TreeTransform<Derived>::TransformOMPDepobjClause(OMPDepobjClause *
C) {
11123 ExprResult E= getDerived().TransformExpr(
C->getDepobj());
11124 if(
E.isInvalid())
11126 returngetDerived().RebuildOMPDepobjClause(
E.get(),
C->getBeginLoc(),
11127 C->getLParenLoc(),
C->getEndLoc());
11130template<
typenameDerived>
11132TreeTransform<Derived>::TransformOMPDependClause(OMPDependClause *
C) {
11134Expr *DepModifier =
C->getModifier();
11136 ExprResultDepModRes = getDerived().TransformExpr(DepModifier);
11137 if(DepModRes.isInvalid())
11139DepModifier = DepModRes.
get();
11141Vars.reserve(
C->varlist_size());
11142 for(
auto*VE :
C->varlist()) {
11143 ExprResultEVar = getDerived().TransformExpr(cast<Expr>(VE));
11144 if(EVar.isInvalid())
11146Vars.push_back(EVar.get());
11148 returngetDerived().RebuildOMPDependClause(
11149{
C->getDependencyKind(),
C->getDependencyLoc(),
C->getColonLoc(),
11150 C->getOmpAllMemoryLoc()},
11151DepModifier, Vars,
C->getBeginLoc(),
C->getLParenLoc(),
C->getEndLoc());
11154template<
typenameDerived>
11156TreeTransform<Derived>::TransformOMPDeviceClause(OMPDeviceClause *
C) {
11157 ExprResult E= getDerived().TransformExpr(
C->getDevice());
11158 if(
E.isInvalid())
11160 returngetDerived().RebuildOMPDeviceClause(
11161 C->getModifier(),
E.get(),
C->getBeginLoc(),
C->getLParenLoc(),
11162 C->getModifierLoc(),
C->getEndLoc());
11165template<
typenameDerived,
classT>
11172Vars.reserve(
C->varlist_size());
11173 for(
auto*VE :
C->varlist()) {
11177Vars.push_back(EVar.
get());
11181 if(
C->getMapperQualifierLoc()) {
11182QualifierLoc = TT.
getDerived().TransformNestedNameSpecifierLoc(
11183 C->getMapperQualifierLoc());
11187MapperIdScopeSpec.
Adopt(QualifierLoc);
11188MapperIdInfo =
C->getMapperIdInfo();
11189 if(MapperIdInfo.
getName()) {
11190MapperIdInfo = TT.
getDerived().TransformDeclarationNameInfo(MapperIdInfo);
11191 if(!MapperIdInfo.
getName())
11196 for(
auto*
E:
C->mapperlists()) {
11199 auto*ULE = cast<UnresolvedLookupExpr>(
E);
11201 for(
auto*
D: ULE->decls()) {
11209MapperIdInfo,
true, Decls.
begin(), Decls.
end(),
11212UnresolvedMappers.push_back(
nullptr);
11218template<
typenameDerived>
11219OMPClause *TreeTransform<Derived>::TransformOMPMapClause(OMPMapClause *
C) {
11220OMPVarListLocTy Locs(
C->getBeginLoc(),
C->getLParenLoc(),
C->getEndLoc());
11222Expr *IteratorModifier =
C->getIteratorModifier();
11223 if(IteratorModifier) {
11224 ExprResultMapModRes = getDerived().TransformExpr(IteratorModifier);
11225 if(MapModRes.isInvalid())
11227IteratorModifier = MapModRes.
get();
11229CXXScopeSpec MapperIdScopeSpec;
11230DeclarationNameInfo MapperIdInfo;
11232 if(transformOMPMappableExprListClause<Derived, OMPMapClause>(
11233*
this,
C, Vars, MapperIdScopeSpec, MapperIdInfo, UnresolvedMappers))
11235 returngetDerived().RebuildOMPMapClause(
11236IteratorModifier,
C->getMapTypeModifiers(),
C->getMapTypeModifiersLoc(),
11237MapperIdScopeSpec, MapperIdInfo,
C->getMapType(),
C->isImplicitMapType(),
11238 C->getMapLoc(),
C->getColonLoc(), Vars, Locs, UnresolvedMappers);
11241template<
typenameDerived>
11243TreeTransform<Derived>::TransformOMPAllocateClause(OMPAllocateClause *
C) {
11244Expr *Allocator =
C->getAllocator();
11246 ExprResultAllocatorRes = getDerived().TransformExpr(Allocator);
11247 if(AllocatorRes.isInvalid())
11249Allocator = AllocatorRes.get();
11251Expr *Alignment =
C->getAlignment();
11253 ExprResultAlignmentRes = getDerived().TransformExpr(Alignment);
11254 if(AlignmentRes.isInvalid())
11256Alignment = AlignmentRes.
get();
11259Vars.reserve(
C->varlist_size());
11260 for(
auto*VE :
C->varlist()) {
11261 ExprResultEVar = getDerived().TransformExpr(cast<Expr>(VE));
11262 if(EVar.isInvalid())
11264Vars.push_back(EVar.get());
11266 returngetDerived().RebuildOMPAllocateClause(
11267Allocator, Alignment,
C->getFirstAllocateModifier(),
11268 C->getFirstAllocateModifierLoc(),
C->getSecondAllocateModifier(),
11269 C->getSecondAllocateModifierLoc(), Vars,
C->getBeginLoc(),
11270 C->getLParenLoc(),
C->getColonLoc(),
C->getEndLoc());
11273template<
typenameDerived>
11275TreeTransform<Derived>::TransformOMPNumTeamsClause(OMPNumTeamsClause *
C) {
11277Vars.reserve(
C->varlist_size());
11278 for(
auto*VE :
C->varlist()) {
11279 ExprResultEVar = getDerived().TransformExpr(cast<Expr>(VE));
11280 if(EVar.isInvalid())
11282Vars.push_back(EVar.get());
11284 returngetDerived().RebuildOMPNumTeamsClause(
11285Vars,
C->getBeginLoc(),
C->getLParenLoc(),
C->getEndLoc());
11288template<
typenameDerived>
11290TreeTransform<Derived>::TransformOMPThreadLimitClause(OMPThreadLimitClause *
C) {
11292Vars.reserve(
C->varlist_size());
11293 for(
auto*VE :
C->varlist()) {
11294 ExprResultEVar = getDerived().TransformExpr(cast<Expr>(VE));
11295 if(EVar.isInvalid())
11297Vars.push_back(EVar.get());
11299 returngetDerived().RebuildOMPThreadLimitClause(
11300Vars,
C->getBeginLoc(),
C->getLParenLoc(),
C->getEndLoc());
11303template<
typenameDerived>
11305TreeTransform<Derived>::TransformOMPPriorityClause(OMPPriorityClause *
C) {
11306 ExprResult E= getDerived().TransformExpr(
C->getPriority());
11307 if(
E.isInvalid())
11309 returngetDerived().RebuildOMPPriorityClause(
11310 E.get(),
C->getBeginLoc(),
C->getLParenLoc(),
C->getEndLoc());
11313template<
typenameDerived>
11315TreeTransform<Derived>::TransformOMPGrainsizeClause(OMPGrainsizeClause *
C) {
11316 ExprResult E= getDerived().TransformExpr(
C->getGrainsize());
11317 if(
E.isInvalid())
11319 returngetDerived().RebuildOMPGrainsizeClause(
11320 C->getModifier(),
E.get(),
C->getBeginLoc(),
C->getLParenLoc(),
11321 C->getModifierLoc(),
C->getEndLoc());
11324template<
typenameDerived>
11326TreeTransform<Derived>::TransformOMPNumTasksClause(OMPNumTasksClause *
C) {
11327 ExprResult E= getDerived().TransformExpr(
C->getNumTasks());
11328 if(
E.isInvalid())
11330 returngetDerived().RebuildOMPNumTasksClause(
11331 C->getModifier(),
E.get(),
C->getBeginLoc(),
C->getLParenLoc(),
11332 C->getModifierLoc(),
C->getEndLoc());
11335template<
typenameDerived>
11336OMPClause *TreeTransform<Derived>::TransformOMPHintClause(OMPHintClause *
C) {
11337 ExprResult E= getDerived().TransformExpr(
C->getHint());
11338 if(
E.isInvalid())
11340 returngetDerived().RebuildOMPHintClause(
E.get(),
C->getBeginLoc(),
11341 C->getLParenLoc(),
C->getEndLoc());
11344template<
typenameDerived>
11345OMPClause *TreeTransform<Derived>::TransformOMPDistScheduleClause(
11346OMPDistScheduleClause *
C) {
11347 ExprResult E= getDerived().TransformExpr(
C->getChunkSize());
11348 if(
E.isInvalid())
11350 returngetDerived().RebuildOMPDistScheduleClause(
11351 C->getDistScheduleKind(),
E.get(),
C->getBeginLoc(),
C->getLParenLoc(),
11352 C->getDistScheduleKindLoc(),
C->getCommaLoc(),
C->getEndLoc());
11355template<
typenameDerived>
11357TreeTransform<Derived>::TransformOMPDefaultmapClause(OMPDefaultmapClause *
C) {
11360 returngetDerived().RebuildOMPDefaultmapClause(
C->getDefaultmapModifier(),
11361 C->getDefaultmapKind(),
11363 C->getLParenLoc(),
11364 C->getDefaultmapModifierLoc(),
11365 C->getDefaultmapKindLoc(),
11369template<
typenameDerived>
11370OMPClause *TreeTransform<Derived>::TransformOMPToClause(OMPToClause *
C) {
11371OMPVarListLocTy Locs(
C->getBeginLoc(),
C->getLParenLoc(),
C->getEndLoc());
11373CXXScopeSpec MapperIdScopeSpec;
11374DeclarationNameInfo MapperIdInfo;
11376 if(transformOMPMappableExprListClause<Derived, OMPToClause>(
11377*
this,
C, Vars, MapperIdScopeSpec, MapperIdInfo, UnresolvedMappers))
11379 returngetDerived().RebuildOMPToClause(
11380 C->getMotionModifiers(),
C->getMotionModifiersLoc(), MapperIdScopeSpec,
11381MapperIdInfo,
C->getColonLoc(), Vars, Locs, UnresolvedMappers);
11384template<
typenameDerived>
11385OMPClause *TreeTransform<Derived>::TransformOMPFromClause(OMPFromClause *
C) {
11386OMPVarListLocTy Locs(
C->getBeginLoc(),
C->getLParenLoc(),
C->getEndLoc());
11388CXXScopeSpec MapperIdScopeSpec;
11389DeclarationNameInfo MapperIdInfo;
11391 if(transformOMPMappableExprListClause<Derived, OMPFromClause>(
11392*
this,
C, Vars, MapperIdScopeSpec, MapperIdInfo, UnresolvedMappers))
11394 returngetDerived().RebuildOMPFromClause(
11395 C->getMotionModifiers(),
C->getMotionModifiersLoc(), MapperIdScopeSpec,
11396MapperIdInfo,
C->getColonLoc(), Vars, Locs, UnresolvedMappers);
11399template<
typenameDerived>
11400OMPClause *TreeTransform<Derived>::TransformOMPUseDevicePtrClause(
11401OMPUseDevicePtrClause *
C) {
11403Vars.reserve(
C->varlist_size());
11404 for(
auto*VE :
C->varlist()) {
11405 ExprResultEVar = getDerived().TransformExpr(cast<Expr>(VE));
11406 if(EVar.isInvalid())
11408Vars.push_back(EVar.get());
11410OMPVarListLocTy Locs(
C->getBeginLoc(),
C->getLParenLoc(),
C->getEndLoc());
11411 returngetDerived().RebuildOMPUseDevicePtrClause(Vars, Locs);
11414template<
typenameDerived>
11415OMPClause *TreeTransform<Derived>::TransformOMPUseDeviceAddrClause(
11416OMPUseDeviceAddrClause *
C) {
11418Vars.reserve(
C->varlist_size());
11419 for(
auto*VE :
C->varlist()) {
11420 ExprResultEVar = getDerived().TransformExpr(cast<Expr>(VE));
11421 if(EVar.isInvalid())
11423Vars.push_back(EVar.get());
11425OMPVarListLocTy Locs(
C->getBeginLoc(),
C->getLParenLoc(),
C->getEndLoc());
11426 returngetDerived().RebuildOMPUseDeviceAddrClause(Vars, Locs);
11429template<
typenameDerived>
11431TreeTransform<Derived>::TransformOMPIsDevicePtrClause(OMPIsDevicePtrClause *
C) {
11433Vars.reserve(
C->varlist_size());
11434 for(
auto*VE :
C->varlist()) {
11435 ExprResultEVar = getDerived().TransformExpr(cast<Expr>(VE));
11436 if(EVar.isInvalid())
11438Vars.push_back(EVar.get());
11440OMPVarListLocTy Locs(
C->getBeginLoc(),
C->getLParenLoc(),
C->getEndLoc());
11441 returngetDerived().RebuildOMPIsDevicePtrClause(Vars, Locs);
11444template<
typenameDerived>
11445OMPClause *TreeTransform<Derived>::TransformOMPHasDeviceAddrClause(
11446OMPHasDeviceAddrClause *
C) {
11448Vars.reserve(
C->varlist_size());
11449 for(
auto*VE :
C->varlist()) {
11450 ExprResultEVar = getDerived().TransformExpr(cast<Expr>(VE));
11451 if(EVar.isInvalid())
11453Vars.push_back(EVar.get());
11455OMPVarListLocTy Locs(
C->getBeginLoc(),
C->getLParenLoc(),
C->getEndLoc());
11456 returngetDerived().RebuildOMPHasDeviceAddrClause(Vars, Locs);
11459template<
typenameDerived>
11461TreeTransform<Derived>::TransformOMPNontemporalClause(OMPNontemporalClause *
C) {
11463Vars.reserve(
C->varlist_size());
11464 for(
auto*VE :
C->varlist()) {
11465 ExprResultEVar = getDerived().TransformExpr(cast<Expr>(VE));
11466 if(EVar.isInvalid())
11468Vars.push_back(EVar.get());
11470 returngetDerived().RebuildOMPNontemporalClause(
11471Vars,
C->getBeginLoc(),
C->getLParenLoc(),
C->getEndLoc());
11474template<
typenameDerived>
11476TreeTransform<Derived>::TransformOMPInclusiveClause(OMPInclusiveClause *
C) {
11478Vars.reserve(
C->varlist_size());
11479 for(
auto*VE :
C->varlist()) {
11480 ExprResultEVar = getDerived().TransformExpr(cast<Expr>(VE));
11481 if(EVar.isInvalid())
11483Vars.push_back(EVar.get());
11485 returngetDerived().RebuildOMPInclusiveClause(
11486Vars,
C->getBeginLoc(),
C->getLParenLoc(),
C->getEndLoc());
11489template<
typenameDerived>
11491TreeTransform<Derived>::TransformOMPExclusiveClause(OMPExclusiveClause *
C) {
11493Vars.reserve(
C->varlist_size());
11494 for(
auto*VE :
C->varlist()) {
11495 ExprResultEVar = getDerived().TransformExpr(cast<Expr>(VE));
11496 if(EVar.isInvalid())
11498Vars.push_back(EVar.get());
11500 returngetDerived().RebuildOMPExclusiveClause(
11501Vars,
C->getBeginLoc(),
C->getLParenLoc(),
C->getEndLoc());
11504template<
typenameDerived>
11505OMPClause *TreeTransform<Derived>::TransformOMPUsesAllocatorsClause(
11506OMPUsesAllocatorsClause *
C) {
11508 Data.reserve(
C->getNumberOfAllocators());
11509 for(
unsignedI = 0,
E=
C->getNumberOfAllocators(); I <
E; ++I) {
11510OMPUsesAllocatorsClause::Data
D=
C->getAllocatorData(I);
11511 ExprResultAllocator = getDerived().TransformExpr(
D.Allocator);
11512 if(Allocator.isInvalid())
11515 if(Expr *AT =
D.AllocatorTraits) {
11516AllocatorTraits = getDerived().TransformExpr(AT);
11517 if(AllocatorTraits.isInvalid())
11520SemaOpenMP::UsesAllocatorsData &NewD =
Data.emplace_back();
11521NewD.Allocator = Allocator.get();
11522NewD.AllocatorTraits = AllocatorTraits.get();
11523NewD.LParenLoc =
D.LParenLoc;
11524NewD.RParenLoc =
D.RParenLoc;
11526 returngetDerived().RebuildOMPUsesAllocatorsClause(
11527 Data,
C->getBeginLoc(),
C->getLParenLoc(),
C->getEndLoc());
11530template<
typenameDerived>
11532TreeTransform<Derived>::TransformOMPAffinityClause(OMPAffinityClause *
C) {
11534Locators.reserve(
C->varlist_size());
11536 if(Expr *Modifier =
C->getModifier()) {
11537ModifierRes = getDerived().TransformExpr(Modifier);
11538 if(ModifierRes.isInvalid())
11541 for(Expr *
E:
C->varlist()) {
11542 ExprResultLocator = getDerived().TransformExpr(
E);
11543 if(Locator.isInvalid())
11545Locators.push_back(Locator.get());
11547 returngetDerived().RebuildOMPAffinityClause(
11548 C->getBeginLoc(),
C->getLParenLoc(),
C->getColonLoc(),
C->getEndLoc(),
11549ModifierRes.get(), Locators);
11552template<
typenameDerived>
11553OMPClause *TreeTransform<Derived>::TransformOMPOrderClause(OMPOrderClause *
C) {
11554 returngetDerived().RebuildOMPOrderClause(
11555 C->getKind(),
C->getKindKwLoc(),
C->getBeginLoc(),
C->getLParenLoc(),
11556 C->getEndLoc(),
C->getModifier(),
C->getModifierKwLoc());
11559template<
typenameDerived>
11560OMPClause *TreeTransform<Derived>::TransformOMPBindClause(OMPBindClause *
C) {
11561 returngetDerived().RebuildOMPBindClause(
11562 C->getBindKind(),
C->getBindKindLoc(),
C->getBeginLoc(),
11563 C->getLParenLoc(),
C->getEndLoc());
11566template<
typenameDerived>
11567OMPClause *TreeTransform<Derived>::TransformOMPXDynCGroupMemClause(
11568OMPXDynCGroupMemClause *
C) {
11570 if(
Size.isInvalid())
11572 returngetDerived().RebuildOMPXDynCGroupMemClause(
11573 Size.get(),
C->getBeginLoc(),
C->getLParenLoc(),
C->getEndLoc());
11576template<
typenameDerived>
11578TreeTransform<Derived>::TransformOMPDoacrossClause(OMPDoacrossClause *
C) {
11580Vars.reserve(
C->varlist_size());
11581 for(
auto*VE :
C->varlist()) {
11582 ExprResultEVar = getDerived().TransformExpr(cast<Expr>(VE));
11583 if(EVar.isInvalid())
11585Vars.push_back(EVar.get());
11587 returngetDerived().RebuildOMPDoacrossClause(
11588 C->getDependenceType(),
C->getDependenceLoc(),
C->getColonLoc(), Vars,
11589 C->getBeginLoc(),
C->getLParenLoc(),
C->getEndLoc());
11592template<
typenameDerived>
11594TreeTransform<Derived>::TransformOMPXAttributeClause(OMPXAttributeClause *
C) {
11596 for(
auto*A :
C->getAttrs())
11597NewAttrs.push_back(getDerived().TransformAttr(A));
11598 returngetDerived().RebuildOMPXAttributeClause(
11599NewAttrs,
C->getBeginLoc(),
C->getLParenLoc(),
C->getEndLoc());
11602template<
typenameDerived>
11603OMPClause *TreeTransform<Derived>::TransformOMPXBareClause(OMPXBareClause *
C) {
11604 returngetDerived().RebuildOMPXBareClause(
C->getBeginLoc(),
C->getEndLoc());
11611template<
typenameDerived>
11612classOpenACCClauseTransform final
11613:
publicOpenACCClauseVisitor<OpenACCClauseTransform<Derived>> {
11614TreeTransform<Derived> &Self;
11616SemaOpenACC::OpenACCParsedClause &ParsedClause;
11617OpenACCClause *NewClause =
nullptr;
11621 for(Expr *CurVar : VarList) {
11622 ExprResultRes = Self.TransformExpr(CurVar);
11624 if(!Res.isUsable())
11627Res = Self.getSema().OpenACC().ActOnVar(ParsedClause.getClauseKind(),
11630 if(Res.isUsable())
11631InstantiatedVarList.push_back(Res.get());
11634 returnInstantiatedVarList;
11638OpenACCClauseTransform(TreeTransform<Derived> &Self,
11640SemaOpenACC::OpenACCParsedClause &PC)
11641: Self(Self), ExistingClauses(ExistingClauses), ParsedClause(PC) {}
11643OpenACCClause *CreatedClause()
const{
returnNewClause; }
11645#define VISIT_CLAUSE(CLAUSE_NAME) \ 11646 void Visit##CLAUSE_NAME##Clause(const OpenACC##CLAUSE_NAME##Clause &Clause); 11647#include "clang/Basic/OpenACCClauses.def" 11650template<
typenameDerived>
11651voidOpenACCClauseTransform<Derived>::VisitDefaultClause(
11652 constOpenACCDefaultClause &
C) {
11661template<
typenameDerived>
11662voidOpenACCClauseTransform<Derived>::VisitIfClause(
constOpenACCIfClause &
C) {
11663Expr *Cond =
const_cast<Expr *
>(
C.getConditionExpr());
11664assert(Cond &&
"If constructed with invalid Condition");
11665Sema::ConditionResult Res =
Self.TransformCondition(
11668 if(Res.isInvalid() || !Res.get().second)
11679template<
typenameDerived>
11680voidOpenACCClauseTransform<Derived>::VisitSelfClause(
11681 constOpenACCSelfClause &
C) {
11686 for(Expr *CurVar :
C.getVarList()) {
11689 if(!Res.isUsable())
11695 if(Res.isUsable())
11696InstantiatedVarList.push_back(Res.get());
11708 if(
C.hasConditionExpr()) {
11709Expr *Cond =
const_cast<Expr *
>(
C.getConditionExpr());
11710Sema::ConditionResult Res =
11711 Self.TransformCondition(Cond->getExprLoc(),
nullptr, Cond,
11714 if(Res.isInvalid() || !Res.get().second)
11727template<
typenameDerived>
11728voidOpenACCClauseTransform<Derived>::VisitNumGangsClause(
11729 constOpenACCNumGangsClause &
C) {
11732 for(Expr *CurIntExpr :
C.getIntExprs()) {
11735 if(!Res.isUsable())
11739 C.getClauseKind(),
11740 C.getBeginLoc(), Res.get());
11741 if(!Res.isUsable())
11744InstantiatedIntExprs.push_back(Res.get());
11754template<
typenameDerived>
11755voidOpenACCClauseTransform<Derived>::VisitPrivateClause(
11756 constOpenACCPrivateClause &
C) {
11766template<
typenameDerived>
11767voidOpenACCClauseTransform<Derived>::VisitHostClause(
11768 constOpenACCHostClause &
C) {
11778template<
typenameDerived>
11779voidOpenACCClauseTransform<Derived>::VisitDeviceClause(
11780 constOpenACCDeviceClause &
C) {
11790template<
typenameDerived>
11791voidOpenACCClauseTransform<Derived>::VisitFirstPrivateClause(
11792 constOpenACCFirstPrivateClause &
C) {
11802template<
typenameDerived>
11803voidOpenACCClauseTransform<Derived>::VisitNoCreateClause(
11804 constOpenACCNoCreateClause &
C) {
11814template<
typenameDerived>
11815voidOpenACCClauseTransform<Derived>::VisitPresentClause(
11816 constOpenACCPresentClause &
C) {
11826template<
typenameDerived>
11827voidOpenACCClauseTransform<Derived>::VisitCopyClause(
11828 constOpenACCCopyClause &
C) {
11838template<
typenameDerived>
11839voidOpenACCClauseTransform<Derived>::VisitCopyInClause(
11840 constOpenACCCopyInClause &
C) {
11851template<
typenameDerived>
11852voidOpenACCClauseTransform<Derived>::VisitCopyOutClause(
11853 constOpenACCCopyOutClause &
C) {
11855 false,
C.isZero());
11864template<
typenameDerived>
11865voidOpenACCClauseTransform<Derived>::VisitCreateClause(
11866 constOpenACCCreateClause &
C) {
11868 false,
C.isZero());
11876template<
typenameDerived>
11877voidOpenACCClauseTransform<Derived>::VisitAttachClause(
11878 constOpenACCAttachClause &
C) {
11882VarList.erase(std::remove_if(VarList.begin(), VarList.end(), [&](Expr *
E) {
11883return Self.getSema().OpenACC().CheckVarIsPointerType(
11884OpenACCClauseKind::Attach, E);
11885}), VarList.end());
11895template<
typenameDerived>
11896voidOpenACCClauseTransform<Derived>::VisitDetachClause(
11897 constOpenACCDetachClause &
C) {
11902std::remove_if(VarList.begin(), VarList.end(),
11904return Self.getSema().OpenACC().CheckVarIsPointerType(
11905OpenACCClauseKind::Detach, E);
11917template<
typenameDerived>
11918voidOpenACCClauseTransform<Derived>::VisitDeleteClause(
11919 constOpenACCDeleteClause &
C) {
11928template<
typenameDerived>
11929voidOpenACCClauseTransform<Derived>::VisitUseDeviceClause(
11930 constOpenACCUseDeviceClause &
C) {
11939template<
typenameDerived>
11940voidOpenACCClauseTransform<Derived>::VisitDevicePtrClause(
11941 constOpenACCDevicePtrClause &
C) {
11945VarList.erase(std::remove_if(VarList.begin(), VarList.end(), [&](Expr *
E) {
11946return Self.getSema().OpenACC().CheckVarIsPointerType(
11947OpenACCClauseKind::DevicePtr, E);
11948}), VarList.end());
11958template<
typenameDerived>
11959voidOpenACCClauseTransform<Derived>::VisitNumWorkersClause(
11960 constOpenACCNumWorkersClause &
C) {
11961Expr *IntExpr =
const_cast<Expr *
>(
C.getIntExpr());
11962assert(IntExpr &&
"num_workers clause constructed with invalid int expr");
11965 if(!Res.isUsable())
11969 C.getClauseKind(),
11970 C.getBeginLoc(), Res.get());
11971 if(!Res.isUsable())
11981template<
typenameDerived>
11982voidOpenACCClauseTransform<Derived>::VisitDeviceNumClause (
11983 constOpenACCDeviceNumClause &
C) {
11984Expr *IntExpr =
const_cast<Expr *
>(
C.getIntExpr());
11985assert(IntExpr &&
"device_num clause constructed with invalid int expr");
11988 if(!Res.isUsable())
11992 C.getClauseKind(),
11993 C.getBeginLoc(), Res.get());
11994 if(!Res.isUsable())
12004template<
typenameDerived>
12005voidOpenACCClauseTransform<Derived>::VisitDefaultAsyncClause(
12006 constOpenACCDefaultAsyncClause &
C) {
12007Expr *IntExpr =
const_cast<Expr *
>(
C.getIntExpr());
12008assert(IntExpr &&
"default_async clause constructed with invalid int expr");
12011 if(!Res.isUsable())
12015 C.getClauseKind(),
12016 C.getBeginLoc(), Res.get());
12017 if(!Res.isUsable())
12027template<
typenameDerived>
12028voidOpenACCClauseTransform<Derived>::VisitVectorLengthClause(
12029 constOpenACCVectorLengthClause &
C) {
12030Expr *IntExpr =
const_cast<Expr *
>(
C.getIntExpr());
12031assert(IntExpr &&
"vector_length clause constructed with invalid int expr");
12034 if(!Res.isUsable())
12038 C.getClauseKind(),
12039 C.getBeginLoc(), Res.get());
12040 if(!Res.isUsable())
12050template<
typenameDerived>
12051voidOpenACCClauseTransform<Derived>::VisitAsyncClause(
12052 constOpenACCAsyncClause &
C) {
12053 if(
C.hasIntExpr()) {
12054 ExprResultRes =
Self.TransformExpr(
const_cast<Expr *
>(
C.getIntExpr()));
12055 if(!Res.isUsable())
12059 C.getClauseKind(),
12060 C.getBeginLoc(), Res.get());
12061 if(!Res.isUsable())
12074template<
typenameDerived>
12075voidOpenACCClauseTransform<Derived>::VisitWorkerClause(
12076 constOpenACCWorkerClause &
C) {
12077 if(
C.hasIntExpr()) {
12081 ExprResultRes =
Self.TransformExpr(
const_cast<Expr *
>(
C.getIntExpr()));
12082 if(!Res.isUsable())
12086 C.getClauseKind(),
12087 C.getBeginLoc(), Res.get());
12088 if(!Res.isUsable())
12101template<
typenameDerived>
12102voidOpenACCClauseTransform<Derived>::VisitVectorClause(
12103 constOpenACCVectorClause &
C) {
12104 if(
C.hasIntExpr()) {
12108 ExprResultRes =
Self.TransformExpr(
const_cast<Expr *
>(
C.getIntExpr()));
12109 if(!Res.isUsable())
12113 C.getClauseKind(),
12114 C.getBeginLoc(), Res.get());
12115 if(!Res.isUsable())
12128template<
typenameDerived>
12129voidOpenACCClauseTransform<Derived>::VisitWaitClause(
12130 constOpenACCWaitClause &
C) {
12131 if(!
C.getLParenLoc().isInvalid()) {
12132Expr *DevNumExpr =
nullptr;
12136 if(
C.getDevNumExpr()) {
12138 if(!Res.isUsable())
12141 C.getClauseKind(),
12142 C.getBeginLoc(), Res.get());
12143 if(!Res.isUsable())
12146DevNumExpr = Res.get();
12150 for(Expr *CurQueueIdExpr :
C.getQueueIdExprs()) {
12152 if(!Res.isUsable())
12155 C.getClauseKind(),
12156 C.getBeginLoc(), Res.get());
12157 if(!Res.isUsable())
12160InstantiatedQueueIdExprs.push_back(Res.get());
12164std::move(InstantiatedQueueIdExprs));
12174template<
typenameDerived>
12175voidOpenACCClauseTransform<Derived>::VisitDeviceTypeClause(
12176 constOpenACCDeviceTypeClause &
C) {
12179 Self.getSema().getASTContext(),
C.getClauseKind(),
12181 C.getArchitectures(), ParsedClause.
getEndLoc());
12184template<
typenameDerived>
12185voidOpenACCClauseTransform<Derived>::VisitAutoClause(
12186 constOpenACCAutoClause &
C) {
12193template<
typenameDerived>
12194voidOpenACCClauseTransform<Derived>::VisitIndependentClause(
12195 constOpenACCIndependentClause &
C) {
12201template<
typenameDerived>
12202voidOpenACCClauseTransform<Derived>::VisitSeqClause(
12203 constOpenACCSeqClause &
C) {
12208template<
typenameDerived>
12209voidOpenACCClauseTransform<Derived>::VisitFinalizeClause(
12210 constOpenACCFinalizeClause &
C) {
12216template<
typenameDerived>
12217voidOpenACCClauseTransform<Derived>::VisitIfPresentClause(
12218 constOpenACCIfPresentClause &
C) {
12224template<
typenameDerived>
12225voidOpenACCClauseTransform<Derived>::VisitReductionClause(
12226 constOpenACCReductionClause &
C) {
12230 for(Expr *Var : TransformedVars) {
12233 if(Res.isUsable())
12234ValidVars.push_back(Res.get());
12237NewClause =
Self.getSema().OpenACC().CheckReductionClause(
12240 C.getReductionOp(), ValidVars, ParsedClause.
getEndLoc());
12243template<
typenameDerived>
12244voidOpenACCClauseTransform<Derived>::VisitCollapseClause(
12245 constOpenACCCollapseClause &
C) {
12246Expr *LoopCount =
const_cast<Expr *
>(
C.getLoopCount());
12247assert(LoopCount &&
"collapse clause constructed with invalid loop count");
12251NewLoopCount =
Self.getSema().OpenACC().ActOnIntExpr(
12253NewLoopCount.get()->getBeginLoc(), NewLoopCount.get());
12256 Self.getSema().OpenACC().CheckCollapseLoopCount(NewLoopCount.get());
12258 if(!NewLoopCount.isUsable())
12268template<
typenameDerived>
12269voidOpenACCClauseTransform<Derived>::VisitTileClause(
12270 constOpenACCTileClause &
C) {
12274 for(Expr *
E:
C.getSizeExprs()) {
12277 if(!NewSizeExpr.isUsable())
12280NewSizeExpr =
Self.getSema().OpenACC().ActOnIntExpr(
12282NewSizeExpr.get()->getBeginLoc(), NewSizeExpr.get());
12284NewSizeExpr =
Self.getSema().OpenACC().CheckTileSizeExpr(NewSizeExpr.get());
12286 if(!NewSizeExpr.isUsable())
12288TransformedExprs.push_back(NewSizeExpr.get());
12297template<
typenameDerived>
12298voidOpenACCClauseTransform<Derived>::VisitGangClause(
12299 constOpenACCGangClause &
C) {
12303 for(
unsignedI = 0; I <
C.getNumExprs(); ++I) {
12304 ExprResultER =
Self.TransformExpr(
const_cast<Expr *
>(
C.getExpr(I).second));
12305 if(!ER.isUsable())
12308ER =
Self.getSema().OpenACC().CheckGangExpr(ExistingClauses,
12310 C.getExpr(I).first, ER.get());
12311 if(!ER.isUsable())
12313TransformedGangKinds.push_back(
C.getExpr(I).first);
12314TransformedIntExprs.push_back(ER.get());
12317NewClause =
Self.getSema().OpenACC().CheckGangClause(
12320TransformedGangKinds, TransformedIntExprs, ParsedClause.
getEndLoc());
12323template<
typenameDerived>
12324OpenACCClause *TreeTransform<Derived>::TransformOpenACCClause(
12328SemaOpenACC::OpenACCParsedClause ParsedClause(
12329DirKind, OldClause->getClauseKind(), OldClause->getBeginLoc());
12330ParsedClause.
setEndLoc(OldClause->getEndLoc());
12332 if(
const auto*WithParms = dyn_cast<OpenACCClauseWithParams>(OldClause))
12333ParsedClause.
setLParenLoc(WithParms->getLParenLoc());
12335OpenACCClauseTransform<Derived> Transform{*
this, ExistingClauses,
12337Transform.Visit(OldClause);
12339 returnTransform.CreatedClause();
12342template<
typenameDerived>
12344TreeTransform<Derived>::TransformOpenACCClauseList(
12347 for(
const auto*Clause : OldClauses) {
12348 if(OpenACCClause *TransformedClause = getDerived().TransformOpenACCClause(
12349TransformedClauses, DirKind, Clause))
12350TransformedClauses.push_back(TransformedClause);
12352 returnTransformedClauses;
12355template<
typenameDerived>
12356StmtResultTreeTransform<Derived>::TransformOpenACCComputeConstruct(
12357OpenACCComputeConstruct *
C) {
12358getSema().OpenACC().ActOnConstruct(
C->getDirectiveKind(),
C->getBeginLoc());
12361getDerived().TransformOpenACCClauseList(
C->getDirectiveKind(),
12364 if(getSema().OpenACC().ActOnStartStmtDirective(
12365 C->getDirectiveKind(),
C->getBeginLoc(), TransformedClauses))
12369SemaOpenACC::AssociatedStmtRAII AssocStmtRAII(
12370getSema().OpenACC(),
C->getDirectiveKind(),
C->getDirectiveLoc(),
12371 C->clauses(), TransformedClauses);
12372 StmtResultStrBlock = getDerived().TransformStmt(
C->getStructuredBlock());
12373StrBlock = getSema().OpenACC().ActOnAssociatedStmt(
12374 C->getBeginLoc(),
C->getDirectiveKind(), TransformedClauses, StrBlock);
12376 returngetDerived().RebuildOpenACCComputeConstruct(
12377 C->getDirectiveKind(),
C->getBeginLoc(),
C->getDirectiveLoc(),
12378 C->getEndLoc(), TransformedClauses, StrBlock);
12381template<
typenameDerived>
12383TreeTransform<Derived>::TransformOpenACCLoopConstruct(OpenACCLoopConstruct *
C) {
12385getSema().OpenACC().ActOnConstruct(
C->getDirectiveKind(),
C->getBeginLoc());
12388getDerived().TransformOpenACCClauseList(
C->getDirectiveKind(),
12391 if(getSema().OpenACC().ActOnStartStmtDirective(
12392 C->getDirectiveKind(),
C->getBeginLoc(), TransformedClauses))
12396SemaOpenACC::AssociatedStmtRAII AssocStmtRAII(
12397getSema().OpenACC(),
C->getDirectiveKind(),
C->getDirectiveLoc(),
12398 C->clauses(), TransformedClauses);
12400 Loop= getSema().OpenACC().ActOnAssociatedStmt(
12401 C->getBeginLoc(),
C->getDirectiveKind(), TransformedClauses,
Loop);
12403 returngetDerived().RebuildOpenACCLoopConstruct(
12404 C->getBeginLoc(),
C->getDirectiveLoc(),
C->getEndLoc(),
12405TransformedClauses,
Loop);
12408template<
typenameDerived>
12409StmtResultTreeTransform<Derived>::TransformOpenACCCombinedConstruct(
12410OpenACCCombinedConstruct *
C) {
12411getSema().OpenACC().ActOnConstruct(
C->getDirectiveKind(),
C->getBeginLoc());
12414getDerived().TransformOpenACCClauseList(
C->getDirectiveKind(),
12417 if(getSema().OpenACC().ActOnStartStmtDirective(
12418 C->getDirectiveKind(),
C->getBeginLoc(), TransformedClauses))
12422SemaOpenACC::AssociatedStmtRAII AssocStmtRAII(
12423getSema().OpenACC(),
C->getDirectiveKind(),
C->getDirectiveLoc(),
12424 C->clauses(), TransformedClauses);
12426 Loop= getSema().OpenACC().ActOnAssociatedStmt(
12427 C->getBeginLoc(),
C->getDirectiveKind(), TransformedClauses,
Loop);
12429 returngetDerived().RebuildOpenACCCombinedConstruct(
12430 C->getDirectiveKind(),
C->getBeginLoc(),
C->getDirectiveLoc(),
12431 C->getEndLoc(), TransformedClauses,
Loop);
12434template<
typenameDerived>
12436TreeTransform<Derived>::TransformOpenACCDataConstruct(OpenACCDataConstruct *
C) {
12437getSema().OpenACC().ActOnConstruct(
C->getDirectiveKind(),
C->getBeginLoc());
12440getDerived().TransformOpenACCClauseList(
C->getDirectiveKind(),
12442 if(getSema().OpenACC().ActOnStartStmtDirective(
12443 C->getDirectiveKind(),
C->getBeginLoc(), TransformedClauses))
12446SemaOpenACC::AssociatedStmtRAII AssocStmtRAII(
12447getSema().OpenACC(),
C->getDirectiveKind(),
C->getDirectiveLoc(),
12448 C->clauses(), TransformedClauses);
12449 StmtResultStrBlock = getDerived().TransformStmt(
C->getStructuredBlock());
12450StrBlock = getSema().OpenACC().ActOnAssociatedStmt(
12451 C->getBeginLoc(),
C->getDirectiveKind(), TransformedClauses, StrBlock);
12453 returngetDerived().RebuildOpenACCDataConstruct(
12454 C->getBeginLoc(),
C->getDirectiveLoc(),
C->getEndLoc(),
12455TransformedClauses, StrBlock);
12458template<
typenameDerived>
12459StmtResultTreeTransform<Derived>::TransformOpenACCEnterDataConstruct(
12460OpenACCEnterDataConstruct *
C) {
12461getSema().OpenACC().ActOnConstruct(
C->getDirectiveKind(),
C->getBeginLoc());
12464getDerived().TransformOpenACCClauseList(
C->getDirectiveKind(),
12466 if(getSema().OpenACC().ActOnStartStmtDirective(
12467 C->getDirectiveKind(),
C->getBeginLoc(), TransformedClauses))
12470 returngetDerived().RebuildOpenACCEnterDataConstruct(
12471 C->getBeginLoc(),
C->getDirectiveLoc(),
C->getEndLoc(),
12472TransformedClauses);
12475template<
typenameDerived>
12476StmtResultTreeTransform<Derived>::TransformOpenACCExitDataConstruct(
12477OpenACCExitDataConstruct *
C) {
12478getSema().OpenACC().ActOnConstruct(
C->getDirectiveKind(),
C->getBeginLoc());
12481getDerived().TransformOpenACCClauseList(
C->getDirectiveKind(),
12483 if(getSema().OpenACC().ActOnStartStmtDirective(
12484 C->getDirectiveKind(),
C->getBeginLoc(), TransformedClauses))
12487 returngetDerived().RebuildOpenACCExitDataConstruct(
12488 C->getBeginLoc(),
C->getDirectiveLoc(),
C->getEndLoc(),
12489TransformedClauses);
12492template<
typenameDerived>
12493StmtResultTreeTransform<Derived>::TransformOpenACCHostDataConstruct(
12494OpenACCHostDataConstruct *
C) {
12495getSema().OpenACC().ActOnConstruct(
C->getDirectiveKind(),
C->getBeginLoc());
12498getDerived().TransformOpenACCClauseList(
C->getDirectiveKind(),
12500 if(getSema().OpenACC().ActOnStartStmtDirective(
12501 C->getDirectiveKind(),
C->getBeginLoc(), TransformedClauses))
12504SemaOpenACC::AssociatedStmtRAII AssocStmtRAII(
12505getSema().OpenACC(),
C->getDirectiveKind(),
C->getDirectiveLoc(),
12506 C->clauses(), TransformedClauses);
12507 StmtResultStrBlock = getDerived().TransformStmt(
C->getStructuredBlock());
12508StrBlock = getSema().OpenACC().ActOnAssociatedStmt(
12509 C->getBeginLoc(),
C->getDirectiveKind(), TransformedClauses, StrBlock);
12511 returngetDerived().RebuildOpenACCHostDataConstruct(
12512 C->getBeginLoc(),
C->getDirectiveLoc(),
C->getEndLoc(),
12513TransformedClauses, StrBlock);
12516template<
typenameDerived>
12518TreeTransform<Derived>::TransformOpenACCInitConstruct(OpenACCInitConstruct *
C) {
12519getSema().OpenACC().ActOnConstruct(
C->getDirectiveKind(),
C->getBeginLoc());
12522getDerived().TransformOpenACCClauseList(
C->getDirectiveKind(),
12524 if(getSema().OpenACC().ActOnStartStmtDirective(
12525 C->getDirectiveKind(),
C->getBeginLoc(), TransformedClauses))
12528 returngetDerived().RebuildOpenACCInitConstruct(
12529 C->getBeginLoc(),
C->getDirectiveLoc(),
C->getEndLoc(),
12530TransformedClauses);
12533template<
typenameDerived>
12534StmtResultTreeTransform<Derived>::TransformOpenACCShutdownConstruct(
12535OpenACCShutdownConstruct *
C) {
12536getSema().OpenACC().ActOnConstruct(
C->getDirectiveKind(),
C->getBeginLoc());
12539getDerived().TransformOpenACCClauseList(
C->getDirectiveKind(),
12541 if(getSema().OpenACC().ActOnStartStmtDirective(
12542 C->getDirectiveKind(),
C->getBeginLoc(), TransformedClauses))
12545 returngetDerived().RebuildOpenACCShutdownConstruct(
12546 C->getBeginLoc(),
C->getDirectiveLoc(),
C->getEndLoc(),
12547TransformedClauses);
12549template<
typenameDerived>
12551TreeTransform<Derived>::TransformOpenACCSetConstruct(OpenACCSetConstruct *
C) {
12552getSema().OpenACC().ActOnConstruct(
C->getDirectiveKind(),
C->getBeginLoc());
12555getDerived().TransformOpenACCClauseList(
C->getDirectiveKind(),
12557 if(getSema().OpenACC().ActOnStartStmtDirective(
12558 C->getDirectiveKind(),
C->getBeginLoc(), TransformedClauses))
12561 returngetDerived().RebuildOpenACCSetConstruct(
12562 C->getBeginLoc(),
C->getDirectiveLoc(),
C->getEndLoc(),
12563TransformedClauses);
12566template<
typenameDerived>
12567StmtResultTreeTransform<Derived>::TransformOpenACCUpdateConstruct(
12568OpenACCUpdateConstruct *
C) {
12569getSema().OpenACC().ActOnConstruct(
C->getDirectiveKind(),
C->getBeginLoc());
12572getDerived().TransformOpenACCClauseList(
C->getDirectiveKind(),
12574 if(getSema().OpenACC().ActOnStartStmtDirective(
12575 C->getDirectiveKind(),
C->getBeginLoc(), TransformedClauses))
12578 returngetDerived().RebuildOpenACCUpdateConstruct(
12579 C->getBeginLoc(),
C->getDirectiveLoc(),
C->getEndLoc(),
12580TransformedClauses);
12583template<
typenameDerived>
12585TreeTransform<Derived>::TransformOpenACCWaitConstruct(OpenACCWaitConstruct *
C) {
12586getSema().OpenACC().ActOnConstruct(
C->getDirectiveKind(),
C->getBeginLoc());
12589 if(
C->hasDevNumExpr()) {
12590DevNumExpr = getDerived().TransformExpr(
C->getDevNumExpr());
12592 if(DevNumExpr.isUsable())
12593DevNumExpr = getSema().OpenACC().ActOnIntExpr(
12595 C->getBeginLoc(), DevNumExpr.get());
12600 for(Expr *QE :
C->getQueueIdExprs()) {
12601assert(QE &&
"Null queue id expr?");
12602 ExprResultNewEQ = getDerived().TransformExpr(QE);
12604 if(!NewEQ.isUsable())
12608 C->getBeginLoc(), NewEQ.get());
12609 if(NewEQ.isUsable())
12610QueueIdExprs.push_back(NewEQ.get());
12614getDerived().TransformOpenACCClauseList(
C->getDirectiveKind(),
12617 if(getSema().OpenACC().ActOnStartStmtDirective(
12618 C->getDirectiveKind(),
C->getBeginLoc(), TransformedClauses))
12621 returngetDerived().RebuildOpenACCWaitConstruct(
12622 C->getBeginLoc(),
C->getDirectiveLoc(),
C->getLParenLoc(),
12623DevNumExpr.isUsable() ? DevNumExpr.get() :
nullptr,
C->getQueuesLoc(),
12624QueueIdExprs,
C->getRParenLoc(),
C->getEndLoc(), TransformedClauses);
12627template<
typenameDerived>
12628StmtResultTreeTransform<Derived>::TransformOpenACCAtomicConstruct(
12629OpenACCAtomicConstruct *
C) {
12630getSema().OpenACC().ActOnConstruct(
C->getDirectiveKind(),
C->getBeginLoc());
12632 if(getSema().OpenACC().ActOnStartStmtDirective(
C->getDirectiveKind(),
12633 C->getBeginLoc(), {}))
12637SemaOpenACC::AssociatedStmtRAII AssocStmtRAII(
12638getSema().OpenACC(),
C->getDirectiveKind(),
C->getDirectiveLoc(), {}, {});
12640 StmtResultAssocStmt = getDerived().TransformStmt(
C->getAssociatedStmt());
12641AssocStmt = getSema().OpenACC().ActOnAssociatedStmt(
12642 C->getBeginLoc(),
C->getDirectiveKind(),
C->getAtomicKind(), {},
12645 returngetDerived().RebuildOpenACCAtomicConstruct(
12646 C->getBeginLoc(),
C->getDirectiveLoc(),
C->getAtomicKind(),
12647 C->getEndLoc(), AssocStmt);
12650template<
typenameDerived>
12651ExprResultTreeTransform<Derived>::TransformOpenACCAsteriskSizeExpr(
12652OpenACCAsteriskSizeExpr *
E) {
12653 if(getDerived().AlwaysRebuild())
12654 returngetDerived().RebuildOpenACCAsteriskSizeExpr(
E->getLocation());
12662template<
typenameDerived>
12664TreeTransform<Derived>::TransformConstantExpr(ConstantExpr *
E) {
12665 returnTransformExpr(
E->getSubExpr());
12668template<
typenameDerived>
12669ExprResultTreeTransform<Derived>::TransformSYCLUniqueStableNameExpr(
12670SYCLUniqueStableNameExpr *
E) {
12674TypeSourceInfo *NewT = getDerived().TransformType(
E->getTypeSourceInfo());
12679 if(!getDerived().AlwaysRebuild() &&
E->getTypeSourceInfo() == NewT)
12682 returngetDerived().RebuildSYCLUniqueStableNameExpr(
12683 E->getLocation(),
E->getLParenLocation(),
E->getRParenLocation(), NewT);
12686template<
typenameDerived>
12688TreeTransform<Derived>::TransformPredefinedExpr(PredefinedExpr *
E) {
12692 returngetDerived().RebuildPredefinedExpr(
E->getLocation(),
12693 E->getIdentKind());
12696template<
typenameDerived>
12698TreeTransform<Derived>::TransformDeclRefExpr(DeclRefExpr *
E) {
12699NestedNameSpecifierLoc QualifierLoc;
12700 if(
E->getQualifierLoc()) {
12702= getDerived().TransformNestedNameSpecifierLoc(
E->getQualifierLoc());
12708= cast_or_null<ValueDecl>(getDerived().TransformDecl(
E->getLocation(),
12713NamedDecl *
Found= ND;
12714 if(
E->getFoundDecl() !=
E->getDecl()) {
12715 Found= cast_or_null<NamedDecl>(
12716getDerived().TransformDecl(
E->getLocation(),
E->getFoundDecl()));
12721DeclarationNameInfo NameInfo =
E->getNameInfo();
12722 if(NameInfo.getName()) {
12723NameInfo = getDerived().TransformDeclarationNameInfo(NameInfo);
12724 if(!NameInfo.getName())
12728 if(!getDerived().AlwaysRebuild() &&
12729!
E->isCapturedByCopyInLambdaWithExplicitObjectParameter() &&
12730QualifierLoc ==
E->getQualifierLoc() && ND ==
E->getDecl() &&
12731 Found==
E->getFoundDecl() &&
12732NameInfo.getName() ==
E->getDecl()->getDeclName() &&
12733!
E->hasExplicitTemplateArgs()) {
12742TemplateArgumentListInfo TransArgs, *TemplateArgs =
nullptr;
12743 if(
E->hasExplicitTemplateArgs()) {
12744TemplateArgs = &TransArgs;
12745TransArgs.setLAngleLoc(
E->getLAngleLoc());
12746TransArgs.setRAngleLoc(
E->getRAngleLoc());
12747 if(getDerived().TransformTemplateArguments(
E->getTemplateArgs(),
12748 E->getNumTemplateArgs(),
12753 returngetDerived().RebuildDeclRefExpr(QualifierLoc, ND, NameInfo,
12754 Found, TemplateArgs);
12757template<
typenameDerived>
12759TreeTransform<Derived>::TransformIntegerLiteral(IntegerLiteral *
E) {
12763template<
typenameDerived>
12764ExprResultTreeTransform<Derived>::TransformFixedPointLiteral(
12765FixedPointLiteral *
E) {
12769template<
typenameDerived>
12771TreeTransform<Derived>::TransformFloatingLiteral(FloatingLiteral *
E) {
12775template<
typenameDerived>
12777TreeTransform<Derived>::TransformImaginaryLiteral(ImaginaryLiteral *
E) {
12781template<
typenameDerived>
12783TreeTransform<Derived>::TransformStringLiteral(StringLiteral *
E) {
12787template<
typenameDerived>
12789TreeTransform<Derived>::TransformCharacterLiteral(CharacterLiteral *
E) {
12793template<
typenameDerived>
12795TreeTransform<Derived>::TransformUserDefinedLiteral(UserDefinedLiteral *
E) {
12796 returngetDerived().TransformCallExpr(
E);
12799template<
typenameDerived>
12801TreeTransform<Derived>::TransformGenericSelectionExpr(GenericSelectionExpr *
E) {
12803TypeSourceInfo *ControllingType =
nullptr;
12804 if(
E->isExprPredicate())
12805ControllingExpr = getDerived().TransformExpr(
E->getControllingExpr());
12807ControllingType = getDerived().TransformType(
E->getControllingType());
12809 if(ControllingExpr.isInvalid() && !ControllingType)
12815TypeSourceInfo *TSI = Assoc.getTypeSourceInfo();
12817TypeSourceInfo *AssocType = getDerived().TransformType(TSI);
12820AssocTypes.push_back(AssocType);
12822AssocTypes.push_back(
nullptr);
12826getDerived().TransformExpr(Assoc.getAssociationExpr());
12827 if(AssocExpr.isInvalid())
12829AssocExprs.push_back(AssocExpr.get());
12832 if(!ControllingType)
12833 returngetDerived().RebuildGenericSelectionExpr(
E->getGenericLoc(),
12834 E->getDefaultLoc(),
12835 E->getRParenLoc(),
12836ControllingExpr.get(),
12839 returngetDerived().RebuildGenericSelectionExpr(
12840 E->getGenericLoc(),
E->getDefaultLoc(),
E->getRParenLoc(),
12841ControllingType, AssocTypes, AssocExprs);
12844template<
typenameDerived>
12846TreeTransform<Derived>::TransformParenExpr(ParenExpr *
E) {
12847 ExprResultSubExpr = getDerived().TransformExpr(
E->getSubExpr());
12848 if(SubExpr.isInvalid())
12851 if(!getDerived().AlwaysRebuild() && SubExpr.get() ==
E->getSubExpr())
12854 returngetDerived().RebuildParenExpr(SubExpr.get(),
E->getLParen(),
12861template<
typenameDerived>
12865 returngetDerived().TransformDependentScopeDeclRefExpr(
12866DRE,
true,
nullptr);
12868 returngetDerived().TransformUnresolvedLookupExpr(
12871 returngetDerived().TransformExpr(
E);
12874template<
typenameDerived>
12878 if(
E->getOpcode() == UO_AddrOf)
12879SubExpr = TransformAddressOfOperand(
E->getSubExpr());
12881SubExpr = TransformExpr(
E->getSubExpr());
12885 if(!getDerived().AlwaysRebuild() && SubExpr.
get() ==
E->getSubExpr())
12888 returngetDerived().RebuildUnaryOperator(
E->getOperatorLoc(),
12893template<
typenameDerived>
12895TreeTransform<Derived>::TransformOffsetOfExpr(OffsetOfExpr *
E) {
12897TypeSourceInfo *
Type= getDerived().TransformType(
E->getTypeSourceInfo());
12907 boolExprChanged =
false;
12908 typedefSema::OffsetOfComponent Component;
12910 for(
unsignedI = 0, N =
E->getNumComponents(); I != N; ++I) {
12911 constOffsetOfNode &ON =
E->getComponent(I);
12913Comp.isBrackets =
true;
12914Comp.LocStart = ON.getSourceRange().getBegin();
12915Comp.LocEnd = ON.getSourceRange().getEnd();
12916 switch(ON.getKind()) {
12918Expr *FromIndex =
E->getIndexExpr(ON.getArrayExprIndex());
12919 ExprResultIndex = getDerived().TransformExpr(FromIndex);
12920 if(Index.isInvalid())
12923ExprChanged = ExprChanged || Index.get() != FromIndex;
12924Comp.isBrackets =
true;
12925Comp.U.E = Index.get();
12931 Comp.isBrackets =
false;
12932 Comp.U.IdentInfo = ON.getFieldName();
12933 if(!
Comp.U.IdentInfo)
12943Components.push_back(Comp);
12947 if(!getDerived().AlwaysRebuild() &&
12948Type ==
E->getTypeSourceInfo() &&
12953 returngetDerived().RebuildOffsetOfExpr(
E->getOperatorLoc(), Type,
12954Components,
E->getRParenLoc());
12957template<
typenameDerived>
12959TreeTransform<Derived>::TransformOpaqueValueExpr(OpaqueValueExpr *
E) {
12960assert((!
E->getSourceExpr() || getDerived().AlreadyTransformed(
E->
getType())) &&
12961 "opaque value expression requires transformation");
12965template<
typenameDerived>
12967TreeTransform<Derived>::TransformTypoExpr(TypoExpr *
E) {
12971template<
typenameDerived>
12972ExprResultTreeTransform<Derived>::TransformRecoveryExpr(RecoveryExpr *
E) {
12975 for(Expr *
C:
E->subExpressions()) {
12976 ExprResultNewC = getDerived().TransformExpr(
C);
12977 if(NewC.isInvalid())
12979Children.push_back(NewC.get());
12983 if(!getDerived().AlwaysRebuild() && !Changed)
12989template<
typenameDerived>
12991TreeTransform<Derived>::TransformPseudoObjectExpr(PseudoObjectExpr *
E) {
12999 ExprResultresult = getDerived().TransformExpr(newSyntacticForm);
13000 if(result.isInvalid())
return ExprError();
13005 if(result.get()->hasPlaceholderType(BuiltinType::PseudoObject))
13011template<
typenameDerived>
13013TreeTransform<Derived>::TransformUnaryExprOrTypeTraitExpr(
13014UnaryExprOrTypeTraitExpr *
E) {
13015 if(
E->isArgumentType()) {
13016TypeSourceInfo *OldT =
E->getArgumentTypeInfo();
13018TypeSourceInfo *NewT = getDerived().TransformType(OldT);
13022 if(!getDerived().AlwaysRebuild() && OldT == NewT)
13025 returngetDerived().RebuildUnaryExprOrTypeTrait(NewT,
E->getOperatorLoc(),
13039TypeSourceInfo *RecoveryTSI =
nullptr;
13041 auto*PE = dyn_cast<ParenExpr>(
E->getArgumentExpr());
13043PE ? dyn_cast<DependentScopeDeclRefExpr>(PE->getSubExpr()) :
nullptr)
13044SubExpr = getDerived().TransformParenDependentScopeDeclRefExpr(
13045PE, DRE,
false, &RecoveryTSI);
13047SubExpr = getDerived().TransformExpr(
E->getArgumentExpr());
13050 returngetDerived().RebuildUnaryExprOrTypeTrait(
13052}
else if(SubExpr.isInvalid())
13055 if(!getDerived().AlwaysRebuild() && SubExpr.get() ==
E->getArgumentExpr())
13058 returngetDerived().RebuildUnaryExprOrTypeTrait(SubExpr.get(),
13059 E->getOperatorLoc(),
13064template<
typenameDerived>
13066TreeTransform<Derived>::TransformArraySubscriptExpr(ArraySubscriptExpr *
E) {
13067 ExprResultLHS = getDerived().TransformExpr(
E->getLHS());
13068 if(LHS.isInvalid())
13071 ExprResultRHS = getDerived().TransformExpr(
E->getRHS());
13072 if(RHS.isInvalid())
13076 if(!getDerived().AlwaysRebuild() &&
13077LHS.get() ==
E->getLHS() &&
13078RHS.get() ==
E->getRHS())
13081 returngetDerived().RebuildArraySubscriptExpr(
13083 E->getLHS()->
getBeginLoc(), RHS.get(),
E->getRBracketLoc());
13086template<
typenameDerived>
13088TreeTransform<Derived>::TransformMatrixSubscriptExpr(MatrixSubscriptExpr *
E) {
13090 if(
Base.isInvalid())
13093 ExprResultRowIdx = getDerived().TransformExpr(
E->getRowIdx());
13094 if(RowIdx.isInvalid())
13097 ExprResultColumnIdx = getDerived().TransformExpr(
E->getColumnIdx());
13098 if(ColumnIdx.isInvalid())
13101 if(!getDerived().AlwaysRebuild() &&
Base.get() ==
E->getBase() &&
13102RowIdx.get() ==
E->getRowIdx() && ColumnIdx.get() ==
E->getColumnIdx())
13105 returngetDerived().RebuildMatrixSubscriptExpr(
13106 Base.get(), RowIdx.get(), ColumnIdx.get(),
E->getRBracketLoc());
13109template<
typenameDerived>
13111TreeTransform<Derived>::TransformArraySectionExpr(ArraySectionExpr *
E) {
13113 if(
Base.isInvalid())
13117 if(
E->getLowerBound()) {
13118LowerBound = getDerived().TransformExpr(
E->getLowerBound());
13119 if(LowerBound.isInvalid())
13124 if(
E->getLength()) {
13125Length = getDerived().TransformExpr(
E->getLength());
13126 if(Length.isInvalid())
13131 if(
E->isOMPArraySection()) {
13132 if(Expr *Str =
E->getStride()) {
13133Stride = getDerived().TransformExpr(Str);
13134 if(Stride.isInvalid())
13139 if(!getDerived().AlwaysRebuild() &&
Base.get() ==
E->getBase() &&
13140LowerBound.get() ==
E->getLowerBound() &&
13141Length.get() ==
E->getLength() &&
13142(
E->isOpenACCArraySection() || Stride.get() ==
E->getStride()))
13145 returngetDerived().RebuildArraySectionExpr(
13147LowerBound.get(),
E->getColonLocFirst(),
13148 E->isOMPArraySection() ?
E->getColonLocSecond() : SourceLocation{},
13149Length.get(), Stride.get(),
E->getRBracketLoc());
13152template<
typenameDerived>
13154TreeTransform<Derived>::TransformOMPArrayShapingExpr(OMPArrayShapingExpr *
E) {
13156 if(
Base.isInvalid())
13160 boolErrorFound =
false;
13161 for(Expr *
Dim:
E->getDimensions()) {
13163 if(DimRes.isInvalid()) {
13164ErrorFound =
true;
13167Dims.push_back(DimRes.get());
13172 returngetDerived().RebuildOMPArrayShapingExpr(
Base.get(),
E->getLParenLoc(),
13173 E->getRParenLoc(), Dims,
13174 E->getBracketsRanges());
13177template<
typenameDerived>
13179TreeTransform<Derived>::TransformOMPIteratorExpr(OMPIteratorExpr *
E) {
13180 unsignedNumIterators =
E->numOfIterators();
13183 boolErrorFound =
false;
13184 boolNeedToRebuild = getDerived().AlwaysRebuild();
13185 for(
unsignedI = 0; I < NumIterators; ++I) {
13186 auto*
D= cast<VarDecl>(
E->getIteratorDecl(I));
13187 Data[I].DeclIdent =
D->getIdentifier();
13191 "Implicit type must be int.");
13193TypeSourceInfo *TSI = getDerived().TransformType(
D->getTypeSourceInfo());
13194QualType
DeclTy= getDerived().TransformType(
D->getType());
13197OMPIteratorExpr::IteratorRange
Range=
E->getIteratorRange(I);
13201ErrorFound = ErrorFound ||
13202!(!
D->getTypeSourceInfo() || (
Data[I].Type.getAsOpaquePtr() &&
13203!
Data[I].Type.get().isNull())) ||
13208 Data[I].Range.End = End.get();
13209 Data[I].Range.Step = Step.get();
13210 Data[I].AssignLoc =
E->getAssignLoc(I);
13211 Data[I].ColonLoc =
E->getColonLoc(I);
13212 Data[I].SecColonLoc =
E->getSecondColonLoc(I);
13215(
D->getTypeSourceInfo() &&
Data[I].Type.get().getTypePtrOrNull() !=
13216 D->getType().getTypePtrOrNull()) ||
13222 if(!NeedToRebuild)
13225 ExprResultRes = getDerived().RebuildOMPIteratorExpr(
13226 E->getIteratorKwLoc(),
E->getLParenLoc(),
E->getRParenLoc(),
Data);
13227 if(!Res.isUsable())
13229 auto*IE = cast<OMPIteratorExpr>(Res.get());
13230 for(
unsignedI = 0; I < NumIterators; ++I)
13231getDerived().transformedLocalDecl(
E->getIteratorDecl(I),
13232IE->getIteratorDecl(I));
13236template<
typenameDerived>
13238TreeTransform<Derived>::TransformCallExpr(CallExpr *
E) {
13241 if(
Callee.isInvalid())
13245 boolArgChanged =
false;
13247 if(getDerived().TransformExprs(
E->getArgs(),
E->getNumArgs(),
true, Args,
13251 if(!getDerived().AlwaysRebuild() &&
13252 Callee.get() ==
E->getCallee() &&
13257SourceLocation FakeLParenLoc
13260Sema::FPFeaturesStateRAII FPFeaturesState(getSema());
13261 if(
E->hasStoredFPFeatures()) {
13262FPOptionsOverride NewOverrides =
E->getFPFeatures();
13263getSema().CurFPFeatures =
13264NewOverrides.applyOverrides(getSema().getLangOpts());
13265getSema().FpPragmaStack.CurrentValue = NewOverrides;
13268 returngetDerived().RebuildCallExpr(
Callee.get(), FakeLParenLoc,
13270 E->getRParenLoc());
13273template<
typenameDerived>
13275TreeTransform<Derived>::TransformMemberExpr(MemberExpr *
E) {
13277 if(
Base.isInvalid())
13280NestedNameSpecifierLoc QualifierLoc;
13281 if(
E->hasQualifier()) {
13283= getDerived().TransformNestedNameSpecifierLoc(
E->getQualifierLoc());
13288SourceLocation TemplateKWLoc =
E->getTemplateKeywordLoc();
13291= cast_or_null<ValueDecl>(getDerived().TransformDecl(
E->getMemberLoc(),
13292 E->getMemberDecl()));
13296NamedDecl *FoundDecl =
E->getFoundDecl();
13297 if(FoundDecl ==
E->getMemberDecl()) {
13300FoundDecl = cast_or_null<NamedDecl>(
13301getDerived().TransformDecl(
E->getMemberLoc(), FoundDecl));
13306 if(!getDerived().AlwaysRebuild() &&
13307 Base.get() ==
E->getBase() &&
13308QualifierLoc ==
E->getQualifierLoc() &&
13309 Member==
E->getMemberDecl() &&
13310FoundDecl ==
E->getFoundDecl() &&
13311!
E->hasExplicitTemplateArgs()) {
13315 if(!(isa<CXXThisExpr>(
E->getBase()) &&
13316getSema().OpenMP().isOpenMPRebuildMemberExpr(
13317cast<ValueDecl>(
Member)))) {
13325TemplateArgumentListInfo TransArgs;
13326 if(
E->hasExplicitTemplateArgs()) {
13327TransArgs.setLAngleLoc(
E->getLAngleLoc());
13328TransArgs.setRAngleLoc(
E->getRAngleLoc());
13329 if(getDerived().TransformTemplateArguments(
E->getTemplateArgs(),
13330 E->getNumTemplateArgs(),
13336SourceLocation FakeOperatorLoc =
13343NamedDecl *FirstQualifierInScope =
nullptr;
13344DeclarationNameInfo MemberNameInfo =
E->getMemberNameInfo();
13345 if(MemberNameInfo.getName()) {
13346MemberNameInfo = getDerived().TransformDeclarationNameInfo(MemberNameInfo);
13347 if(!MemberNameInfo.getName())
13351 returngetDerived().RebuildMemberExpr(
Base.get(), FakeOperatorLoc,
13358(
E->hasExplicitTemplateArgs()
13359? &TransArgs :
nullptr),
13360FirstQualifierInScope);
13363template<
typenameDerived>
13365TreeTransform<Derived>::TransformBinaryOperator(BinaryOperator *
E) {
13366 ExprResultLHS = getDerived().TransformExpr(
E->getLHS());
13367 if(LHS.isInvalid())
13371getDerived().TransformInitializer(
E->getRHS(),
false);
13372 if(RHS.isInvalid())
13375 if(!getDerived().AlwaysRebuild() &&
13376LHS.get() ==
E->getLHS() &&
13377RHS.get() ==
E->getRHS())
13380 if(
E->isCompoundAssignmentOp())
13382 returngetDerived().RebuildBinaryOperator(
13383 E->getOperatorLoc(),
E->getOpcode(), LHS.get(), RHS.get());
13384Sema::FPFeaturesStateRAII FPFeaturesState(getSema());
13385FPOptionsOverride NewOverrides(
E->getFPFeatures());
13386getSema().CurFPFeatures =
13387NewOverrides.applyOverrides(getSema().getLangOpts());
13388getSema().FpPragmaStack.CurrentValue = NewOverrides;
13389 returngetDerived().RebuildBinaryOperator(
E->getOperatorLoc(),
E->getOpcode(),
13390LHS.get(), RHS.get());
13393template<
typenameDerived>
13394ExprResultTreeTransform<Derived>::TransformCXXRewrittenBinaryOperator(
13395CXXRewrittenBinaryOperator *
E) {
13396CXXRewrittenBinaryOperator::DecomposedForm Decomp =
E->getDecomposedForm();
13398 ExprResultLHS = getDerived().TransformExpr(
const_cast<Expr*
>(Decomp.LHS));
13399 if(LHS.isInvalid())
13402 ExprResultRHS = getDerived().TransformExpr(
const_cast<Expr*
>(Decomp.RHS));
13403 if(RHS.isInvalid())
13408UnresolvedSet<2> UnqualLookups;
13409 boolChangedAnyLookups =
false;
13410Expr *PossibleBinOps[] = {
E->getSemanticForm(),
13411 const_cast<Expr *
>(Decomp.InnerBinOp)};
13412 for(Expr *PossibleBinOp : PossibleBinOps) {
13413 auto*Op = dyn_cast<CXXOperatorCallExpr>(PossibleBinOp->IgnoreImplicit());
13416 auto*
Callee= dyn_cast<DeclRefExpr>(Op->getCallee()->IgnoreImplicit());
13417 if(!Callee || isa<CXXMethodDecl>(
Callee->getDecl()))
13422NamedDecl *
Found= cast_or_null<NamedDecl>(getDerived().TransformDecl(
13423 E->getOperatorLoc(),
Callee->getFoundDecl()));
13427ChangedAnyLookups =
true;
13428UnqualLookups.addDecl(
Found);
13431 if(!getDerived().AlwaysRebuild() && !ChangedAnyLookups &&
13432LHS.get() == Decomp.LHS && RHS.get() == Decomp.RHS) {
13438 constExpr *StopAt[] = {Decomp.LHS, Decomp.RHS};
13443 returngetDerived().RebuildCXXRewrittenBinaryOperator(
13444 E->getOperatorLoc(), Decomp.Opcode, UnqualLookups, LHS.get(), RHS.get());
13447template<
typenameDerived>
13449TreeTransform<Derived>::TransformCompoundAssignOperator(
13450CompoundAssignOperator *
E) {
13451Sema::FPFeaturesStateRAII FPFeaturesState(getSema());
13452FPOptionsOverride NewOverrides(
E->getFPFeatures());
13453getSema().CurFPFeatures =
13454NewOverrides.applyOverrides(getSema().getLangOpts());
13455getSema().FpPragmaStack.CurrentValue = NewOverrides;
13456 returngetDerived().TransformBinaryOperator(
E);
13459template<
typenameDerived>
13461TransformBinaryConditionalOperator(BinaryConditionalOperator *e) {
13465 ExprResultcommonExpr = getDerived().TransformExpr(e->getCommon());
13466 if(commonExpr.isInvalid())
13469 ExprResultrhs = getDerived().TransformExpr(e->getFalseExpr());
13470 if(rhs.isInvalid())
13473 if(!getDerived().AlwaysRebuild() &&
13474commonExpr.get() == e->getCommon() &&
13475rhs.get() == e->getFalseExpr())
13478 returngetDerived().RebuildConditionalOperator(commonExpr.get(),
13479e->getQuestionLoc(),
13485template<
typenameDerived>
13487TreeTransform<Derived>::TransformConditionalOperator(ConditionalOperator *
E) {
13488 ExprResultCond = getDerived().TransformExpr(
E->getCond());
13489 if(Cond.isInvalid())
13492 ExprResultLHS = getDerived().TransformExpr(
E->getLHS());
13493 if(LHS.isInvalid())
13496 ExprResultRHS = getDerived().TransformExpr(
E->getRHS());
13497 if(RHS.isInvalid())
13500 if(!getDerived().AlwaysRebuild() &&
13501Cond.get() ==
E->getCond() &&
13502LHS.get() ==
E->getLHS() &&
13503RHS.get() ==
E->getRHS())
13506 returngetDerived().RebuildConditionalOperator(Cond.get(),
13507 E->getQuestionLoc(),
13513template<
typenameDerived>
13515TreeTransform<Derived>::TransformImplicitCastExpr(ImplicitCastExpr *
E) {
13518 returngetDerived().TransformExpr(
E->getSubExprAsWritten());
13521template<
typenameDerived>
13523TreeTransform<Derived>::TransformCStyleCastExpr(CStyleCastExpr *
E) {
13524TypeSourceInfo *
Type= getDerived().TransformType(
E->getTypeInfoAsWritten());
13529= getDerived().TransformExpr(
E->getSubExprAsWritten());
13530 if(SubExpr.isInvalid())
13533 if(!getDerived().AlwaysRebuild() &&
13534Type ==
E->getTypeInfoAsWritten() &&
13535SubExpr.get() ==
E->getSubExpr())
13538 returngetDerived().RebuildCStyleCastExpr(
E->getLParenLoc(),
13540 E->getRParenLoc(),
13544template<
typenameDerived>
13546TreeTransform<Derived>::TransformCompoundLiteralExpr(CompoundLiteralExpr *
E) {
13547TypeSourceInfo *OldT =
E->getTypeSourceInfo();
13548TypeSourceInfo *NewT = getDerived().TransformType(OldT);
13553 if(
Init.isInvalid())
13556 if(!getDerived().AlwaysRebuild() &&
13558 Init.get() ==
E->getInitializer())
13565 returngetDerived().RebuildCompoundLiteralExpr(
13566 E->getLParenLoc(), NewT,
13570template<
typenameDerived>
13572TreeTransform<Derived>::TransformExtVectorElementExpr(ExtVectorElementExpr *
E) {
13574 if(
Base.isInvalid())
13577 if(!getDerived().AlwaysRebuild() &&
13578 Base.get() ==
E->getBase())
13582SourceLocation FakeOperatorLoc =
13584 returngetDerived().RebuildExtVectorElementExpr(
13585 Base.get(), FakeOperatorLoc,
E->isArrow(),
E->getAccessorLoc(),
13586 E->getAccessor());
13589template<
typenameDerived>
13591TreeTransform<Derived>::TransformInitListExpr(InitListExpr *
E) {
13592 if(InitListExpr *Syntactic =
E->getSyntacticForm())
13595 boolInitChanged =
false;
13597EnterExpressionEvaluationContext Context(
13601 if(getDerived().TransformExprs(
E->getInits(),
E->getNumInits(),
false,
13602Inits, &InitChanged))
13605 if(!getDerived().AlwaysRebuild() && !InitChanged) {
13612 returngetDerived().RebuildInitList(
E->getLBraceLoc(), Inits,
13613 E->getRBraceLoc());
13616template<
typenameDerived>
13618TreeTransform<Derived>::TransformDesignatedInitExpr(DesignatedInitExpr *
E) {
13623 if(
Init.isInvalid())
13628 boolExprChanged =
false;
13629 for(
constDesignatedInitExpr::Designator &
D:
E->designators()) {
13630 if(
D.isFieldDesignator()) {
13631 if(
D.getFieldDecl()) {
13632FieldDecl *
Field= cast_or_null<FieldDecl>(
13633getDerived().TransformDecl(
D.getFieldLoc(),
D.getFieldDecl()));
13634 if(Field !=
D.getFieldDecl())
13637ExprChanged =
true;
13638 if(
Field->isAnonymousStructOrUnion())
13644ExprChanged =
true;
13647 D.getFieldName(),
D.getDotLoc(),
D.getFieldLoc()));
13651 if(
D.isArrayDesignator()) {
13652 ExprResultIndex = getDerived().TransformExpr(
E->getArrayIndex(
D));
13653 if(Index.isInvalid())
13656Desig.AddDesignator(
13659ExprChanged = ExprChanged ||
Init.get() !=
E->getArrayIndex(
D);
13660ArrayExprs.push_back(Index.get());
13664assert(
D.isArrayRangeDesignator() &&
"New kind of designator?");
13666= getDerived().TransformExpr(
E->getArrayRangeStart(
D));
13667 if(Start.isInvalid())
13670 ExprResultEnd = getDerived().TransformExpr(
E->getArrayRangeEnd(
D));
13671 if(End.isInvalid())
13675Start.get(), End.get(),
D.getLBracketLoc(),
D.getEllipsisLoc()));
13677ExprChanged = ExprChanged || Start.get() !=
E->getArrayRangeStart(
D) ||
13678End.get() !=
E->getArrayRangeEnd(
D);
13680ArrayExprs.push_back(Start.get());
13681ArrayExprs.push_back(End.get());
13684 if(!getDerived().AlwaysRebuild() &&
13685 Init.get() ==
E->getInit() &&
13689 returngetDerived().RebuildDesignatedInitExpr(Desig, ArrayExprs,
13690 E->getEqualOrColonLoc(),
13691 E->usesGNUSyntax(),
Init.get());
13696template<
typenameDerived>
13698TreeTransform<Derived>::TransformDesignatedInitUpdateExpr(
13699DesignatedInitUpdateExpr *
E) {
13700llvm_unreachable(
"Unexpected DesignatedInitUpdateExpr in syntactic form of " 13705template<
typenameDerived>
13707TreeTransform<Derived>::TransformNoInitExpr(
13709llvm_unreachable(
"Unexpected NoInitExpr in syntactic form of initializer");
13713template<
typenameDerived>
13715TreeTransform<Derived>::TransformArrayInitLoopExpr(ArrayInitLoopExpr *
E) {
13716llvm_unreachable(
"Unexpected ArrayInitLoopExpr outside of initializer");
13720template<
typenameDerived>
13722TreeTransform<Derived>::TransformArrayInitIndexExpr(ArrayInitIndexExpr *
E) {
13723llvm_unreachable(
"Unexpected ArrayInitIndexExpr outside of initializer");
13727template<
typenameDerived>
13729TreeTransform<Derived>::TransformImplicitValueInitExpr(
13730ImplicitValueInitExpr *
E) {
13731TemporaryBase Rebase(*
this,
E->
getBeginLoc(), DeclarationName());
13735QualType
T= getDerived().TransformType(
E->
getType());
13739 if(!getDerived().AlwaysRebuild() &&
13743 returngetDerived().RebuildImplicitValueInitExpr(
T);
13746template<
typenameDerived>
13748TreeTransform<Derived>::TransformVAArgExpr(VAArgExpr *
E) {
13749TypeSourceInfo *TInfo = getDerived().TransformType(
E->getWrittenTypeInfo());
13753 ExprResultSubExpr = getDerived().TransformExpr(
E->getSubExpr());
13754 if(SubExpr.isInvalid())
13757 if(!getDerived().AlwaysRebuild() &&
13758TInfo ==
E->getWrittenTypeInfo() &&
13759SubExpr.get() ==
E->getSubExpr())
13762 returngetDerived().RebuildVAArgExpr(
E->getBuiltinLoc(), SubExpr.get(),
13763TInfo,
E->getRParenLoc());
13766template<
typenameDerived>
13768TreeTransform<Derived>::TransformParenListExpr(ParenListExpr *
E) {
13769 boolArgumentChanged =
false;
13771 if(TransformExprs(
E->getExprs(),
E->getNumExprs(),
true, Inits,
13775 returngetDerived().RebuildParenListExpr(
E->getLParenLoc(),
13777 E->getRParenLoc());
13785template<
typenameDerived>
13787TreeTransform<Derived>::TransformAddrLabelExpr(AddrLabelExpr *
E) {
13788 Decl*LD = getDerived().TransformDecl(
E->getLabel()->getLocation(),
13793 returngetDerived().RebuildAddrLabelExpr(
E->getAmpAmpLoc(),
E->getLabelLoc(),
13794cast<LabelDecl>(LD));
13797template<
typenameDerived>
13799TreeTransform<Derived>::TransformStmtExpr(StmtExpr *
E) {
13802= getDerived().TransformCompoundStmt(
E->getSubStmt(),
true);
13803 if(SubStmt.isInvalid()) {
13808 unsignedOldDepth =
E->getTemplateDepth();
13809 unsignedNewDepth = getDerived().TransformTemplateDepth(OldDepth);
13811 if(!getDerived().AlwaysRebuild() && OldDepth == NewDepth &&
13812SubStmt.get() ==
E->getSubStmt()) {
13818 returngetDerived().RebuildStmtExpr(
E->getLParenLoc(), SubStmt.get(),
13819 E->getRParenLoc(), NewDepth);
13822template<
typenameDerived>
13824TreeTransform<Derived>::TransformChooseExpr(ChooseExpr *
E) {
13825 ExprResultCond = getDerived().TransformExpr(
E->getCond());
13826 if(Cond.isInvalid())
13829 ExprResultLHS = getDerived().TransformExpr(
E->getLHS());
13830 if(LHS.isInvalid())
13833 ExprResultRHS = getDerived().TransformExpr(
E->getRHS());
13834 if(RHS.isInvalid())
13837 if(!getDerived().AlwaysRebuild() &&
13838Cond.get() ==
E->getCond() &&
13839LHS.get() ==
E->getLHS() &&
13840RHS.get() ==
E->getRHS())
13843 returngetDerived().RebuildChooseExpr(
E->getBuiltinLoc(),
13844Cond.get(), LHS.get(), RHS.get(),
13845 E->getRParenLoc());
13848template<
typenameDerived>
13850TreeTransform<Derived>::TransformGNUNullExpr(GNUNullExpr *
E) {
13854template<
typenameDerived>
13856TreeTransform<Derived>::TransformCXXOperatorCallExpr(CXXOperatorCallExpr *
E) {
13857 switch(
E->getOperator()) {
13861 caseOO_Array_Delete:
13862llvm_unreachable(
"new and delete operators cannot use CXXOperatorCallExpr");
13867assert(
E->getNumArgs() >= 1 &&
"Object call is missing arguments");
13871 if(
Object.isInvalid())
13876 static_cast<Expr *
>(
Object.get())->getEndLoc());
13880 if(getDerived().TransformExprs(
E->getArgs() + 1,
E->getNumArgs() - 1,
true,
13884 if(
E->getOperator() == OO_Subscript)
13885 returngetDerived().RebuildCxxSubscriptExpr(
Object.get(), FakeLParenLoc,
13888 returngetDerived().RebuildCallExpr(
Object.get(), FakeLParenLoc, Args,
13892#define OVERLOADED_OPERATOR(Name, Spelling, Token, Unary, Binary, MemberOnly) \ 13896#define OVERLOADED_OPERATOR_MULTI(Name,Spelling,Unary,Binary,MemberOnly) 13897#include "clang/Basic/OperatorKinds.def" 13899 caseOO_Conditional:
13900llvm_unreachable(
"conditional operator is not actually overloadable");
13904llvm_unreachable(
"not an overloaded operator?");
13908 if(
E->getNumArgs() == 1 &&
E->getOperator() == OO_Amp)
13909 First= getDerived().TransformAddressOfOperand(
E->getArg(0));
13911 First= getDerived().TransformExpr(
E->getArg(0));
13912 if(
First.isInvalid())
13916 if(
E->getNumArgs() == 2) {
13918getDerived().TransformInitializer(
E->getArg(1),
false);
13919 if(Second.isInvalid())
13923Sema::FPFeaturesStateRAII FPFeaturesState(getSema());
13924FPOptionsOverride NewOverrides(
E->getFPFeatures());
13925getSema().CurFPFeatures =
13926NewOverrides.applyOverrides(getSema().getLangOpts());
13927getSema().FpPragmaStack.CurrentValue = NewOverrides;
13929Expr *
Callee=
E->getCallee();
13930 if(UnresolvedLookupExpr *ULE = dyn_cast<UnresolvedLookupExpr>(Callee)) {
13931LookupResult R(SemaRef, ULE->getName(), ULE->getNameLoc(),
13933 if(getDerived().TransformOverloadExprDecls(ULE, ULE->requiresADL(), R))
13936 returngetDerived().RebuildCXXOperatorCallExpr(
13937 E->getOperator(),
E->getOperatorLoc(),
Callee->getBeginLoc(),
13938ULE->requiresADL(), R.asUnresolvedSet(),
First.get(), Second.get());
13941UnresolvedSet<1> Functions;
13942 if(ImplicitCastExpr *ICE = dyn_cast<ImplicitCastExpr>(Callee))
13943 Callee= ICE->getSubExprAsWritten();
13944NamedDecl *DR = cast<DeclRefExpr>(Callee)->getDecl();
13945ValueDecl *VD = cast_or_null<ValueDecl>(
13946getDerived().TransformDecl(DR->getLocation(), DR));
13950 if(!isa<CXXMethodDecl>(VD))
13951Functions.addDecl(VD);
13953 returngetDerived().RebuildCXXOperatorCallExpr(
13954 E->getOperator(),
E->getOperatorLoc(),
Callee->getBeginLoc(),
13955 false, Functions,
First.get(), Second.get());
13958template<
typenameDerived>
13960TreeTransform<Derived>::TransformCXXMemberCallExpr(CXXMemberCallExpr *
E) {
13961 returngetDerived().TransformCallExpr(
E);
13964template<
typenameDerived>
13965ExprResultTreeTransform<Derived>::TransformSourceLocExpr(SourceLocExpr *
E) {
13967getSema().CurContext !=
E->getParentContext();
13969 if(!getDerived().AlwaysRebuild() && !NeedRebuildFunc)
13972 returngetDerived().RebuildSourceLocExpr(
E->getIdentKind(),
E->
getType(),
13974getSema().CurContext);
13977template<
typenameDerived>
13978ExprResultTreeTransform<Derived>::TransformEmbedExpr(EmbedExpr *
E) {
13982template<
typenameDerived>
13984TreeTransform<Derived>::TransformCUDAKernelCallExpr(CUDAKernelCallExpr *
E) {
13987 if(
Callee.isInvalid())
13991 ExprResultEC = getDerived().TransformCallExpr(
E->getConfig());
13992 if(EC.isInvalid())
13996 boolArgChanged =
false;
13998 if(getDerived().TransformExprs(
E->getArgs(),
E->getNumArgs(),
true, Args,
14002 if(!getDerived().AlwaysRebuild() &&
14003 Callee.get() ==
E->getCallee() &&
14008SourceLocation FakeLParenLoc
14010 returngetDerived().RebuildCallExpr(
Callee.get(), FakeLParenLoc,
14012 E->getRParenLoc(), EC.get());
14015template<
typenameDerived>
14023= getDerived().TransformExpr(
E->getSubExprAsWritten());
14027 if(!getDerived().AlwaysRebuild() &&
14028 Type==
E->getTypeInfoAsWritten() &&
14029SubExpr.
get() ==
E->getSubExpr())
14031 returngetDerived().RebuildCXXNamedCastExpr(
14032 E->getOperatorLoc(),
E->
getStmtClass(),
E->getAngleBrackets().getBegin(),
14033 Type,
E->getAngleBrackets().getEnd(),
14035 E->getAngleBrackets().getEnd(), SubExpr.
get(),
E->getRParenLoc());
14038template<
typenameDerived>
14047 if(Sub.isInvalid())
14050 returngetDerived().RebuildBuiltinBitCastExpr(BCE->
getBeginLoc(), TSI,
14054template<
typenameDerived>
14056TreeTransform<Derived>::TransformCXXStaticCastExpr(CXXStaticCastExpr *
E) {
14057 returngetDerived().TransformCXXNamedCastExpr(
E);
14060template<
typenameDerived>
14062TreeTransform<Derived>::TransformCXXDynamicCastExpr(CXXDynamicCastExpr *
E) {
14063 returngetDerived().TransformCXXNamedCastExpr(
E);
14066template<
typenameDerived>
14068TreeTransform<Derived>::TransformCXXReinterpretCastExpr(
14069CXXReinterpretCastExpr *
E) {
14070 returngetDerived().TransformCXXNamedCastExpr(
E);
14073template<
typenameDerived>
14075TreeTransform<Derived>::TransformCXXConstCastExpr(CXXConstCastExpr *
E) {
14076 returngetDerived().TransformCXXNamedCastExpr(
E);
14079template<
typenameDerived>
14081TreeTransform<Derived>::TransformCXXAddrspaceCastExpr(CXXAddrspaceCastExpr *
E) {
14082 returngetDerived().TransformCXXNamedCastExpr(
E);
14085template<
typenameDerived>
14087TreeTransform<Derived>::TransformCXXFunctionalCastExpr(
14088CXXFunctionalCastExpr *
E) {
14089TypeSourceInfo *
Type=
14090getDerived().TransformTypeWithDeducedTST(
E->getTypeInfoAsWritten());
14095= getDerived().TransformExpr(
E->getSubExprAsWritten());
14096 if(SubExpr.isInvalid())
14099 if(!getDerived().AlwaysRebuild() &&
14100Type ==
E->getTypeInfoAsWritten() &&
14101SubExpr.get() ==
E->getSubExpr())
14104 returngetDerived().RebuildCXXFunctionalCastExpr(Type,
14105 E->getLParenLoc(),
14107 E->getRParenLoc(),
14108 E->isListInitialization());
14111template<
typenameDerived>
14113TreeTransform<Derived>::TransformCXXTypeidExpr(CXXTypeidExpr *
E) {
14114 if(
E->isTypeOperand()) {
14115TypeSourceInfo *TInfo
14116= getDerived().TransformType(
E->getTypeOperandSourceInfo());
14120 if(!getDerived().AlwaysRebuild() &&
14121TInfo ==
E->getTypeOperandSourceInfo())
14131Expr *Op =
E->getExprOperand();
14134 if(
auto*RecordT = Op->getType()->getAs<RecordType>())
14135 if(cast<CXXRecordDecl>(RecordT->getDecl())->isPolymorphic())
14138EnterExpressionEvaluationContext
Unevaluated(SemaRef, EvalCtx,
14141 ExprResultSubExpr = getDerived().TransformExpr(Op);
14142 if(SubExpr.isInvalid())
14145 if(!getDerived().AlwaysRebuild() &&
14146SubExpr.get() ==
E->getExprOperand())
14153template<
typenameDerived>
14155TreeTransform<Derived>::TransformCXXUuidofExpr(CXXUuidofExpr *
E) {
14156 if(
E->isTypeOperand()) {
14157TypeSourceInfo *TInfo
14158= getDerived().TransformType(
E->getTypeOperandSourceInfo());
14162 if(!getDerived().AlwaysRebuild() &&
14163TInfo ==
E->getTypeOperandSourceInfo())
14173 ExprResultSubExpr = getDerived().TransformExpr(
E->getExprOperand());
14174 if(SubExpr.isInvalid())
14177 if(!getDerived().AlwaysRebuild() &&
14178SubExpr.get() ==
E->getExprOperand())
14185template<
typenameDerived>
14187TreeTransform<Derived>::TransformCXXBoolLiteralExpr(CXXBoolLiteralExpr *
E) {
14191template<
typenameDerived>
14193TreeTransform<Derived>::TransformCXXNullPtrLiteralExpr(
14194CXXNullPtrLiteralExpr *
E) {
14198template<
typenameDerived>
14200TreeTransform<Derived>::TransformCXXThisExpr(CXXThisExpr *
E) {
14211QualType
T= [&]() {
14212 auto&S = getSema();
14213 if(
E->isCapturedByCopyInLambdaWithExplicitObjectParameter())
14216 returngetDerived().TransformType(
E->
getType());
14220 if(!getDerived().AlwaysRebuild() &&
T==
E->
getType()) {
14223getSema().MarkThisReferenced(
E);
14227 returngetDerived().RebuildCXXThisExpr(
E->
getBeginLoc(),
T,
E->isImplicit());
14230template<
typenameDerived>
14232TreeTransform<Derived>::TransformCXXThrowExpr(CXXThrowExpr *
E) {
14233 ExprResultSubExpr = getDerived().TransformExpr(
E->getSubExpr());
14234 if(SubExpr.isInvalid())
14237 if(!getDerived().AlwaysRebuild() &&
14238SubExpr.get() ==
E->getSubExpr())
14241 returngetDerived().RebuildCXXThrowExpr(
E->getThrowLoc(), SubExpr.get(),
14242 E->isThrownVariableInScope());
14245template<
typenameDerived>
14247TreeTransform<Derived>::TransformCXXDefaultArgExpr(CXXDefaultArgExpr *
E) {
14248ParmVarDecl *Param = cast_or_null<ParmVarDecl>(
14249getDerived().TransformDecl(
E->
getBeginLoc(),
E->getParam()));
14254 if(
E->hasRewrittenInit()) {
14255InitRes = getDerived().TransformExpr(
E->getRewrittenExpr());
14256 if(InitRes.isInvalid())
14260 if(!getDerived().AlwaysRebuild() && Param ==
E->getParam() &&
14262InitRes.get() ==
E->getRewrittenExpr())
14265 returngetDerived().RebuildCXXDefaultArgExpr(
E->getUsedLocation(), Param,
14269template<
typenameDerived>
14271TreeTransform<Derived>::TransformCXXDefaultInitExpr(CXXDefaultInitExpr *
E) {
14272FieldDecl *
Field= cast_or_null<FieldDecl>(
14273getDerived().TransformDecl(
E->
getBeginLoc(),
E->getField()));
14277 if(!getDerived().AlwaysRebuild() && Field ==
E->getField() &&
14281 returngetDerived().RebuildCXXDefaultInitExpr(
E->
getExprLoc(), Field);
14284template<
typenameDerived>
14286TreeTransform<Derived>::TransformCXXScalarValueInitExpr(
14287CXXScalarValueInitExpr *
E) {
14288TypeSourceInfo *
T= getDerived().TransformType(
E->getTypeSourceInfo());
14292 if(!getDerived().AlwaysRebuild() &&
14293 T==
E->getTypeSourceInfo())
14296 returngetDerived().RebuildCXXScalarValueInitExpr(
T,
14297 T->getTypeLoc().getEndLoc(),
14298 E->getRParenLoc());
14301template<
typenameDerived>
14303TreeTransform<Derived>::TransformCXXNewExpr(CXXNewExpr *
E) {
14305TypeSourceInfo *AllocTypeInfo =
14306getDerived().TransformTypeWithDeducedTST(
E->getAllocatedTypeSourceInfo());
14307 if(!AllocTypeInfo)
14311std::optional<Expr *> ArraySize;
14312 if(
E->isArray()) {
14314 if(std::optional<Expr *> OldArraySize =
E->getArraySize()) {
14315NewArraySize = getDerived().TransformExpr(*OldArraySize);
14316 if(NewArraySize.isInvalid())
14319ArraySize = NewArraySize.get();
14323 boolArgumentChanged =
false;
14325 if(getDerived().TransformExprs(
E->getPlacementArgs(),
14326 E->getNumPlacementArgs(),
true,
14327PlacementArgs, &ArgumentChanged))
14331Expr *OldInit =
E->getInitializer();
14334NewInit = getDerived().TransformInitializer(OldInit,
true);
14335 if(NewInit.isInvalid())
14339FunctionDecl *OperatorNew =
nullptr;
14340 if(
E->getOperatorNew()) {
14341OperatorNew = cast_or_null<FunctionDecl>(
14342getDerived().TransformDecl(
E->
getBeginLoc(),
E->getOperatorNew()));
14347FunctionDecl *OperatorDelete =
nullptr;
14348 if(
E->getOperatorDelete()) {
14349OperatorDelete = cast_or_null<FunctionDecl>(
14350getDerived().TransformDecl(
E->
getBeginLoc(),
E->getOperatorDelete()));
14351 if(!OperatorDelete)
14355 if(!getDerived().AlwaysRebuild() &&
14356AllocTypeInfo ==
E->getAllocatedTypeSourceInfo() &&
14357ArraySize ==
E->getArraySize() &&
14358NewInit.get() == OldInit &&
14359OperatorNew ==
E->getOperatorNew() &&
14360OperatorDelete ==
E->getOperatorDelete() &&
14361!ArgumentChanged) {
14366 if(OperatorDelete)
14369 if(
E->isArray() && !
E->getAllocatedType()->isDependentType()) {
14370QualType ElementType
14372 if(
constRecordType *RecordT = ElementType->getAs<RecordType>()) {
14373CXXRecordDecl *
Record= cast<CXXRecordDecl>(RecordT->getDecl());
14383QualType AllocType = AllocTypeInfo->
getType();
14393}
else if(
constConstantArrayType *ConsArrayT
14394= dyn_cast<ConstantArrayType>(ArrayT)) {
14398AllocType = ConsArrayT->getElementType();
14399}
else if(
constDependentSizedArrayType *DepArrayT
14400= dyn_cast<DependentSizedArrayType>(ArrayT)) {
14401 if(DepArrayT->getSizeExpr()) {
14402ArraySize = DepArrayT->getSizeExpr();
14403AllocType = DepArrayT->getElementType();
14408 returngetDerived().RebuildCXXNewExpr(
14412AllocTypeInfo, ArraySize,
E->getDirectInitRange(), NewInit.get());
14415template<
typenameDerived>
14417TreeTransform<Derived>::TransformCXXDeleteExpr(CXXDeleteExpr *
E) {
14423FunctionDecl *OperatorDelete =
nullptr;
14424 if(
E->getOperatorDelete()) {
14425OperatorDelete = cast_or_null<FunctionDecl>(
14426getDerived().TransformDecl(
E->
getBeginLoc(),
E->getOperatorDelete()));
14427 if(!OperatorDelete)
14431 if(!getDerived().AlwaysRebuild() &&
14432 Operand.get() ==
E->getArgument() &&
14433OperatorDelete ==
E->getOperatorDelete()) {
14436 if(OperatorDelete)
14441 E->getDestroyedType());
14442 if(
constRecordType *DestroyedRec = Destroyed->getAs<RecordType>()) {
14443CXXRecordDecl *
Record= cast<CXXRecordDecl>(DestroyedRec->getDecl());
14452 returngetDerived().RebuildCXXDeleteExpr(
14456template<
typenameDerived>
14458TreeTransform<Derived>::TransformCXXPseudoDestructorExpr(
14459CXXPseudoDestructorExpr *
E) {
14461 if(
Base.isInvalid())
14465 boolMayBePseudoDestructor =
false;
14467 E->getOperatorLoc(),
14468 E->isArrow()? tok::arrow : tok::period,
14470MayBePseudoDestructor);
14471 if(
Base.isInvalid())
14474QualType ObjectType = ObjectTypePtr.get();
14475NestedNameSpecifierLoc QualifierLoc =
E->getQualifierLoc();
14476 if(QualifierLoc) {
14478= getDerived().TransformNestedNameSpecifierLoc(QualifierLoc, ObjectType);
14483SS.Adopt(QualifierLoc);
14485PseudoDestructorTypeStorage Destroyed;
14486 if(
E->getDestroyedTypeInfo()) {
14487TypeSourceInfo *DestroyedTypeInfo
14488= getDerived().TransformTypeInObjectScope(
E->getDestroyedTypeInfo(),
14489ObjectType,
nullptr, SS);
14490 if(!DestroyedTypeInfo)
14492Destroyed = DestroyedTypeInfo;
14493}
else if(!ObjectType.isNull() && ObjectType->isDependentType()) {
14496Destroyed = PseudoDestructorTypeStorage(
E->getDestroyedTypeIdentifier(),
14497 E->getDestroyedTypeLoc());
14501*
E->getDestroyedTypeIdentifier(),
E->getDestroyedTypeLoc(),
14502 nullptr, SS, ObjectTypePtr,
false);
14508 E->getDestroyedTypeLoc());
14511TypeSourceInfo *ScopeTypeInfo =
nullptr;
14512 if(
E->getScopeTypeInfo()) {
14513CXXScopeSpec EmptySS;
14514ScopeTypeInfo = getDerived().TransformTypeInObjectScope(
14515 E->getScopeTypeInfo(), ObjectType,
nullptr, EmptySS);
14516 if(!ScopeTypeInfo)
14520 returngetDerived().RebuildCXXPseudoDestructorExpr(
Base.get(),
14521 E->getOperatorLoc(),
14525 E->getColonColonLoc(),
14530template<
typenameDerived>
14535 boolAllEmptyPacks =
true;
14536 for(
auto*OldD : Old->
decls()) {
14537 Decl*InstD = getDerived().TransformDecl(Old->
getNameLoc(), OldD);
14541 if(isa<UsingShadowDecl>(OldD))
14550 NamedDecl*SingleDecl = cast<NamedDecl>(InstD);
14552 if(
auto*UPD = dyn_cast<UsingPackDecl>(InstD))
14553Decls = UPD->expansions();
14556 for(
auto*
D: Decls) {
14557 if(
auto*UD = dyn_cast<UsingDecl>(
D)) {
14558 for(
auto*SD : UD->shadows())
14565AllEmptyPacks &= Decls.empty();
14574 if(AllEmptyPacks && !RequiresADL) {
14575getSema().Diag(Old->
getNameLoc(), diag::err_using_pack_expansion_empty)
14576<< isa<UnresolvedMemberExpr>(Old) << Old->
getName();
14586getSema().FilterAcceptableTemplateNames(R,
14593diag::err_template_kw_refers_to_non_template)
14597diag::note_template_kw_refers_to_non_template)
14606template<
typenameDerived>
14609 returnTransformUnresolvedLookupExpr(Old,
false);
14612template<
typenameDerived>
14615 boolIsAddressOfOperand) {
14620 if(TransformOverloadExprDecls(Old, Old->
requiresADL(), R))
14627= getDerived().TransformNestedNameSpecifierLoc(Old->
getQualifierLoc());
14631SS.
Adopt(QualifierLoc);
14635CXXRecordDecl *NamingClass
14636= cast_or_null<CXXRecordDecl>(getDerived().TransformDecl(
14639 if(!NamingClass) {
14644R.setNamingClass(NamingClass);
14665SS, TemplateKWLoc, R,
14672 returngetDerived().RebuildDeclarationNameExpr(SS, R, Old->
requiresADL());
14675 returngetDerived().RebuildTemplateIdExpr(SS, TemplateKWLoc, R,
14679template<
typenameDerived>
14681TreeTransform<Derived>::TransformTypeTraitExpr(TypeTraitExpr *
E) {
14682 boolArgChanged =
false;
14684 for(
unsignedI = 0, N =
E->getNumArgs(); I != N; ++I) {
14685TypeSourceInfo *From =
E->getArg(I);
14686TypeLoc FromTL = From->getTypeLoc();
14687 if(!FromTL.getAs<PackExpansionTypeLoc>()) {
14688TypeLocBuilder TLB;
14689TLB.reserve(FromTL.getFullDataSize());
14690QualType To = getDerived().TransformType(TLB, FromTL);
14694 if(To == From->getType())
14695Args.push_back(From);
14697Args.push_back(TLB.getTypeSourceInfo(SemaRef.
Context, To));
14698ArgChanged =
true;
14703ArgChanged =
true;
14706PackExpansionTypeLoc ExpansionTL = FromTL.castAs<PackExpansionTypeLoc>();
14707TypeLoc PatternTL = ExpansionTL.getPatternLoc();
14713 boolExpand =
true;
14714 boolRetainExpansion =
false;
14715std::optional<unsigned> OrigNumExpansions =
14716ExpansionTL.getTypePtr()->getNumExpansions();
14717std::optional<unsigned> NumExpansions = OrigNumExpansions;
14718 if(getDerived().TryExpandParameterPacks(ExpansionTL.getEllipsisLoc(),
14719PatternTL.getSourceRange(),
14721Expand, RetainExpansion,
14729Sema::ArgumentPackSubstitutionIndexRAII SubstIndex(getSema(), -1);
14731TypeLocBuilder TLB;
14732TLB.reserve(From->getTypeLoc().getFullDataSize());
14734QualType To = getDerived().TransformType(TLB, PatternTL);
14738To = getDerived().RebuildPackExpansionType(To,
14739PatternTL.getSourceRange(),
14740ExpansionTL.getEllipsisLoc(),
14745PackExpansionTypeLoc ToExpansionTL
14746= TLB.push<PackExpansionTypeLoc>(To);
14747ToExpansionTL.setEllipsisLoc(ExpansionTL.getEllipsisLoc());
14748Args.push_back(TLB.getTypeSourceInfo(SemaRef.
Context, To));
14754 for(
unsignedI = 0; I != *NumExpansions; ++I) {
14755Sema::ArgumentPackSubstitutionIndexRAII SubstIndex(SemaRef, I);
14756TypeLocBuilder TLB;
14757TLB.reserve(PatternTL.getFullDataSize());
14758QualType To = getDerived().TransformType(TLB, PatternTL);
14762 if(To->containsUnexpandedParameterPack()) {
14763To = getDerived().RebuildPackExpansionType(To,
14764PatternTL.getSourceRange(),
14765ExpansionTL.getEllipsisLoc(),
14770PackExpansionTypeLoc ToExpansionTL
14771= TLB.push<PackExpansionTypeLoc>(To);
14772ToExpansionTL.setEllipsisLoc(ExpansionTL.getEllipsisLoc());
14775Args.push_back(TLB.getTypeSourceInfo(SemaRef.
Context, To));
14778 if(!RetainExpansion)
14783ForgetPartiallySubstitutedPackRAII Forget(getDerived());
14785TypeLocBuilder TLB;
14786TLB.reserve(From->getTypeLoc().getFullDataSize());
14788QualType To = getDerived().TransformType(TLB, PatternTL);
14792To = getDerived().RebuildPackExpansionType(To,
14793PatternTL.getSourceRange(),
14794ExpansionTL.getEllipsisLoc(),
14799PackExpansionTypeLoc ToExpansionTL
14800= TLB.push<PackExpansionTypeLoc>(To);
14801ToExpansionTL.setEllipsisLoc(ExpansionTL.getEllipsisLoc());
14802Args.push_back(TLB.getTypeSourceInfo(SemaRef.
Context, To));
14805 if(!getDerived().AlwaysRebuild() && !ArgChanged)
14808 returngetDerived().RebuildTypeTrait(
E->getTrait(),
E->
getBeginLoc(), Args,
14812template<
typenameDerived>
14814TreeTransform<Derived>::TransformConceptSpecializationExpr(
14815ConceptSpecializationExpr *
E) {
14816 constASTTemplateArgumentListInfo *Old =
E->getTemplateArgsAsWritten();
14817TemplateArgumentListInfo TransArgs(Old->LAngleLoc, Old->RAngleLoc);
14818 if(getDerived().TransformTemplateArguments(Old->getTemplateArgs(),
14819Old->NumTemplateArgs, TransArgs))
14822 returngetDerived().RebuildConceptSpecializationExpr(
14823 E->getNestedNameSpecifierLoc(),
E->getTemplateKWLoc(),
14824 E->getConceptNameInfo(),
E->getFoundDecl(),
E->getNamedConcept(),
14828template<
typenameDerived>
14830TreeTransform<Derived>::TransformRequiresExpr(RequiresExpr *
E) {
14833Sema::ExtParameterInfoBuilder ExtParamInfos;
14837EnterExpressionEvaluationContext Ctx(
14842getSema().Context, getSema().CurContext,
14845Sema::ContextRAII SavedContext(getSema(), Body,
false);
14847 ExprResultTypeParamResult = getDerived().TransformRequiresTypeParams(
14848 E->getRequiresKWLoc(),
E->getRBraceLoc(),
E, Body,
14849 E->getLocalParameters(), TransParamTypes, TransParams, ExtParamInfos);
14851 for(ParmVarDecl *Param : TransParams)
14853Param->setDeclContext(Body);
14859 if(!TypeParamResult.isUnset())
14860 returnTypeParamResult;
14863 if(getDerived().TransformRequiresExprRequirements(
E->getRequirements(),
14867 for(concepts::Requirement *Req : TransReqs) {
14868 if(
auto*ER = dyn_cast<concepts::ExprRequirement>(Req)) {
14869 if(ER->getReturnTypeRequirement().isTypeConstraint()) {
14870ER->getReturnTypeRequirement()
14871.getTypeConstraintTemplateParameterList()->getParam(0)
14872->setDeclContext(Body);
14877 returngetDerived().RebuildRequiresExpr(
14878 E->getRequiresKWLoc(), Body,
E->getLParenLoc(), TransParams,
14879 E->getRParenLoc(), TransReqs,
E->getRBraceLoc());
14882template<
typenameDerived>
14888 if(
auto*TypeReq = dyn_cast<concepts::TypeRequirement>(Req))
14889TransReq = getDerived().TransformTypeRequirement(TypeReq);
14890 else if(
auto*ExprReq = dyn_cast<concepts::ExprRequirement>(Req))
14891TransReq = getDerived().TransformExprRequirement(ExprReq);
14893TransReq = getDerived().TransformNestedRequirement(
14894cast<concepts::NestedRequirement>(Req));
14897Transformed.push_back(TransReq);
14902template<
typenameDerived>
14907 if(getDerived().AlwaysRebuild())
14908 returngetDerived().RebuildTypeRequirement(
14915 returngetDerived().RebuildTypeRequirement(TransType);
14918template<
typenameDerived>
14921llvm::PointerUnion<Expr *, concepts::Requirement::SubstitutionDiagnostic *> TransExpr;
14930TransExpr = TransExprRes.
get();
14933std::optional<concepts::ExprRequirement::ReturnTypeRequirement> TransRetReq;
14935 if(RetReq.isEmpty())
14936TransRetReq.emplace();
14937 else if(RetReq.isSubstitutionFailure())
14938TransRetReq.emplace(RetReq.getSubstitutionDiagnostic());
14939 else if(RetReq.isTypeConstraint()) {
14941RetReq.getTypeConstraintTemplateParameterList();
14943getDerived().TransformTemplateParameterList(OrigTPL);
14946TransRetReq.emplace(TPL);
14948assert(TransRetReq &&
"All code paths leading here must set TransRetReq");
14949 if(
Expr*
E= dyn_cast<Expr *>(TransExpr))
14950 returngetDerived().RebuildExprRequirement(
E, Req->
isSimple(),
14952std::move(*TransRetReq));
14953 returngetDerived().RebuildExprRequirement(
14954cast<concepts::Requirement::SubstitutionDiagnostic *>(TransExpr),
14958template<
typenameDerived>
14963 if(getDerived().AlwaysRebuild())
14964 returngetDerived().RebuildNestedRequirement(
14972 returngetDerived().RebuildNestedRequirement(TransConstraint.
get());
14975template<
typenameDerived>
14978 TypeSourceInfo*
T= getDerived().TransformType(
E->getQueriedTypeSourceInfo());
14982 if(!getDerived().AlwaysRebuild() &&
14983 T==
E->getQueriedTypeSourceInfo())
14990SubExpr = getDerived().TransformExpr(
E->getDimensionExpression());
14995 returngetDerived().RebuildArrayTypeTrait(
E->getTrait(),
E->
getBeginLoc(),
T,
14999template<
typenameDerived>
15001TreeTransform<Derived>::TransformExpressionTraitExpr(ExpressionTraitExpr *
E) {
15006SubExpr = getDerived().TransformExpr(
E->getQueriedExpression());
15007 if(SubExpr.isInvalid())
15010 if(!getDerived().AlwaysRebuild() && SubExpr.get() ==
E->getQueriedExpression())
15014 returngetDerived().RebuildExpressionTrait(
E->getTrait(),
E->
getBeginLoc(),
15018template<
typenameDerived>
15022 ExprResultNewDRE = getDerived().TransformDependentScopeDeclRefExpr(
15023DRE, AddrTaken, RecoveryTSI);
15030 if(!getDerived().AlwaysRebuild() && NewDRE.
get() == DRE)
15032 returngetDerived().RebuildParenExpr(NewDRE.
get(), PE->
getLParen(),
15036template<
typenameDerived>
15039 returnTransformDependentScopeDeclRefExpr(
E,
false,
15043template<
typenameDerived>
15047assert(
E->getQualifierLoc());
15049getDerived().TransformNestedNameSpecifierLoc(
E->getQualifierLoc());
15059getDerived().TransformDeclarationNameInfo(
E->getNameInfo());
15063 if(!
E->hasExplicitTemplateArgs()) {
15064 if(!getDerived().AlwaysRebuild() && QualifierLoc ==
E->getQualifierLoc() &&
15067NameInfo.
getName() ==
E->getDeclName())
15070 returngetDerived().RebuildDependentScopeDeclRefExpr(
15071QualifierLoc, TemplateKWLoc, NameInfo,
nullptr,
15072IsAddressOfOperand, RecoveryTSI);
15075TemplateArgumentListInfo TransArgs(
E->getLAngleLoc(),
E->getRAngleLoc());
15076 if(getDerived().TransformTemplateArguments(
15077 E->getTemplateArgs(),
E->getNumTemplateArgs(), TransArgs))
15080 returngetDerived().RebuildDependentScopeDeclRefExpr(
15081QualifierLoc, TemplateKWLoc, NameInfo, &TransArgs, IsAddressOfOperand,
15085template<
typenameDerived>
15087TreeTransform<Derived>::TransformCXXConstructExpr(CXXConstructExpr *
E) {
15091 if(getDerived().AllowSkippingCXXConstructExpr() &&
15092((
E->getNumArgs() == 1 ||
15093(
E->getNumArgs() > 1 && getDerived().DropCallArgument(
E->getArg(1)))) &&
15094(!getDerived().DropCallArgument(
E->getArg(0))) &&
15095!
E->isListInitialization()))
15096 returngetDerived().TransformInitializer(
E->getArg(0),
15099TemporaryBase Rebase(*
this,
E->
getBeginLoc(), DeclarationName());
15101QualType
T= getDerived().TransformType(
E->
getType());
15105CXXConstructorDecl *
Constructor= cast_or_null<CXXConstructorDecl>(
15106getDerived().TransformDecl(
E->
getBeginLoc(),
E->getConstructor()));
15110 boolArgumentChanged =
false;
15113EnterExpressionEvaluationContext Context(
15115 E->isListInitialization());
15116 if(getDerived().TransformExprs(
E->getArgs(),
E->getNumArgs(),
true, Args,
15121 if(!getDerived().AlwaysRebuild() &&
15123Constructor ==
E->getConstructor() &&
15124!ArgumentChanged) {
15131 returngetDerived().RebuildCXXConstructExpr(
15133 E->hadMultipleCandidates(),
E->isListInitialization(),
15134 E->isStdInitListInitialization(),
E->requiresZeroInitialization(),
15135 E->getConstructionKind(),
E->getParenOrBraceRange());
15138template<
typenameDerived>
15139ExprResultTreeTransform<Derived>::TransformCXXInheritedCtorInitExpr(
15140CXXInheritedCtorInitExpr *
E) {
15141QualType
T= getDerived().TransformType(
E->
getType());
15145CXXConstructorDecl *
Constructor= cast_or_null<CXXConstructorDecl>(
15146getDerived().TransformDecl(
E->
getBeginLoc(),
E->getConstructor()));
15150 if(!getDerived().AlwaysRebuild() &&
15152Constructor ==
E->getConstructor()) {
15159 returngetDerived().RebuildCXXInheritedCtorInitExpr(
15160 T,
E->getLocation(), Constructor,
15161 E->constructsVBase(),
E->inheritedFromVBase());
15168template<
typenameDerived>
15170TreeTransform<Derived>::TransformCXXBindTemporaryExpr(CXXBindTemporaryExpr *
E) {
15171 if(
auto*Dtor =
E->getTemporary()->getDestructor())
15173 const_cast<CXXDestructorDecl *
>(Dtor));
15174 returngetDerived().TransformExpr(
E->getSubExpr());
15182template<
typenameDerived>
15184TreeTransform<Derived>::TransformExprWithCleanups(ExprWithCleanups *
E) {
15185 returngetDerived().TransformExpr(
E->getSubExpr());
15188template<
typenameDerived>
15190TreeTransform<Derived>::TransformCXXTemporaryObjectExpr(
15191CXXTemporaryObjectExpr *
E) {
15192TypeSourceInfo *
T=
15193getDerived().TransformTypeWithDeducedTST(
E->getTypeSourceInfo());
15197CXXConstructorDecl *
Constructor= cast_or_null<CXXConstructorDecl>(
15198getDerived().TransformDecl(
E->
getBeginLoc(),
E->getConstructor()));
15202 boolArgumentChanged =
false;
15204Args.reserve(
E->getNumArgs());
15206EnterExpressionEvaluationContext Context(
15208 E->isListInitialization());
15209 if(TransformExprs(
E->getArgs(),
E->getNumArgs(),
true, Args,
15213 if(
E->isListInitialization() && !
E->isStdInitListInitialization()) {
15215 if(Res.isInvalid())
15217Args = {Res.get()};
15221 if(!getDerived().AlwaysRebuild() &&
15222 T==
E->getTypeSourceInfo() &&
15223Constructor ==
E->getConstructor() &&
15224!ArgumentChanged) {
15230SourceLocation LParenLoc =
T->getTypeLoc().getEndLoc();
15231 returngetDerived().RebuildCXXTemporaryObjectExpr(
15232 T, LParenLoc, Args,
E->
getEndLoc(),
E->isListInitialization());
15235template<
typenameDerived>
15237TreeTransform<Derived>::TransformLambdaExpr(LambdaExpr *
E) {
15240 typedefstd::pair<ExprResult, QualType> InitCaptureInfoTy;
15241 structTransformedInitCapture {
15243SourceLocation EllipsisLoc;
15248InitCaptures.resize(
E->explicit_capture_end() -
E->explicit_capture_begin());
15250CEnd =
E->capture_end();
15251 C!= CEnd; ++
C) {
15252 if(!
E->isInitCapture(
C))
15255TransformedInitCapture &
Result= InitCaptures[
C-
E->capture_begin()];
15256 auto*OldVD = cast<VarDecl>(
C->getCapturedVar());
15258 autoSubstInitCapture = [&](SourceLocation EllipsisLoc,
15259std::optional<unsigned> NumExpansions) {
15260 ExprResultNewExprInitResult = getDerived().TransformInitializer(
15263 if(NewExprInitResult.isInvalid()) {
15264 Result.Expansions.push_back(InitCaptureInfoTy(
ExprError(), QualType()));
15267Expr *NewExprInit = NewExprInitResult.get();
15269QualType NewInitCaptureType =
15270getSema().buildLambdaInitCaptureInitialization(
15271 C->getLocation(),
C->getCaptureKind() ==
LCK_ByRef,
15272EllipsisLoc, NumExpansions, OldVD->getIdentifier(),
15273cast<VarDecl>(
C->getCapturedVar())->getInitStyle() !=
15276 Result.Expansions.push_back(
15277InitCaptureInfoTy(NewExprInit, NewInitCaptureType));
15281 if(OldVD->isParameterPack()) {
15282PackExpansionTypeLoc ExpansionTL = OldVD->getTypeSourceInfo()
15284.castAs<PackExpansionTypeLoc>();
15290 boolExpand =
true;
15291 boolRetainExpansion =
false;
15292std::optional<unsigned> OrigNumExpansions =
15293ExpansionTL.getTypePtr()->getNumExpansions();
15294std::optional<unsigned> NumExpansions = OrigNumExpansions;
15295 if(getDerived().TryExpandParameterPacks(
15296ExpansionTL.getEllipsisLoc(),
15297OldVD->getInit()->getSourceRange(), Unexpanded, Expand,
15298RetainExpansion, NumExpansions))
15300assert(!RetainExpansion &&
"Should not need to retain expansion after a " 15301 "capture since it cannot be extended");
15303 for(
unsignedI = 0; I != *NumExpansions; ++I) {
15304Sema::ArgumentPackSubstitutionIndexRAII SubstIndex(getSema(), I);
15305SubstInitCapture(SourceLocation(), std::nullopt);
15308SubstInitCapture(ExpansionTL.getEllipsisLoc(), NumExpansions);
15309 Result.EllipsisLoc = ExpansionTL.getEllipsisLoc();
15312SubstInitCapture(SourceLocation(), std::nullopt);
15316LambdaScopeInfo *LSI = getSema().PushLambdaScope();
15317Sema::FunctionScopeRAII FuncScopeCleanup(getSema());
15328DeclContext *DC = getSema().CurContext;
15346 while(DC->isRequiresExprBody())
15347DC = DC->getParent();
15348 if((getSema().isUnevaluatedContext() ||
15349getSema().isConstantEvaluatedContext()) &&
15350(DC->isFileContext() || !DC->getParent()->isDependentContext()))
15353CXXRecordDecl *OldClass =
E->getLambdaClass();
15354CXXRecordDecl *
Class= getSema().createLambdaClosureType(
15355 E->getIntroducerRange(),
nullptr, DependencyKind,
15356 E->getCaptureDefault());
15357getDerived().transformedLocalDecl(OldClass, {
Class});
15359CXXMethodDecl *NewCallOperator =
15360getSema().CreateLambdaCallOperator(
E->getIntroducerRange(),
Class);
15363getSema().buildLambdaScope(LSI, NewCallOperator,
E->getIntroducerRange(),
15364 E->getCaptureDefault(),
E->getCaptureDefaultLoc(),
15365 E->hasExplicitParameters(),
E->isMutable());
15368Sema::ContextRAII SavedContext(getSema(), NewCallOperator,
15375CEnd =
E->capture_end();
15376 C!= CEnd; ++
C) {
15379 if(
C->isImplicit())
15383 if(
C->capturesThis()) {
15389Sema::CXXThisScopeRAII ThisScope(
15391dyn_cast_if_present<CXXRecordDecl>(
15392getSema().getFunctionLevelDeclContext()),
15394getSema().CheckCXXThisCapture(
C->getLocation(),
C->isExplicit(),
15401 if(
C->capturesVLAType())
15405 if(
E->isInitCapture(
C)) {
15406TransformedInitCapture &NewC = InitCaptures[
C-
E->capture_begin()];
15408 auto*OldVD = cast<VarDecl>(
C->getCapturedVar());
15411 for(InitCaptureInfoTy &Info : NewC.Expansions) {
15413QualType InitQualType = Info.second;
15414 if(
Init.isInvalid() || InitQualType.isNull()) {
15418VarDecl *NewVD = getSema().createLambdaInitCaptureVarDecl(
15419OldVD->getLocation(), InitQualType, NewC.EllipsisLoc,
15420OldVD->getIdentifier(), OldVD->getInitStyle(),
Init.get(),
15421getSema().CurContext);
15426NewVDs.push_back(NewVD);
15427getSema().addInitCapture(LSI, NewVD,
C->getCaptureKind() ==
LCK_ByRef);
15432 if(NewC.EllipsisLoc.isInvalid())
15433LSI->ContainsUnexpandedParameterPack |=
15434 Init.get()->containsUnexpandedParameterPack();
15440getDerived().transformedLocalDecl(OldVD, NewVDs);
15444assert(
C->capturesVariable() &&
"unexpected kind of lambda capture");
15452SourceLocation EllipsisLoc;
15453 if(
C->isPackExpansion()) {
15455 boolShouldExpand =
false;
15456 boolRetainExpansion =
false;
15457std::optional<unsigned> NumExpansions;
15458 if(getDerived().TryExpandParameterPacks(
C->getEllipsisLoc(),
15461ShouldExpand, RetainExpansion,
15467 if(ShouldExpand) {
15471 auto*Pack = cast<ValueDecl>(
C->getCapturedVar());
15472 for(
unsignedI = 0; I != *NumExpansions; ++I) {
15473Sema::ArgumentPackSubstitutionIndexRAII SubstIndex(getSema(), I);
15474ValueDecl *CapturedVar = cast_if_present<ValueDecl>(
15475getDerived().TransformDecl(
C->getLocation(), Pack));
15476 if(!CapturedVar) {
15482getSema().tryCaptureVariable(CapturedVar,
C->getLocation(), Kind);
15490EllipsisLoc =
C->getEllipsisLoc();
15494 auto*CapturedVar = cast_or_null<ValueDecl>(
15495getDerived().TransformDecl(
C->getLocation(),
C->getCapturedVar()));
15496 if(!CapturedVar || CapturedVar->isInvalidDecl()) {
15503 if(
auto*VD = dyn_cast<VarDecl>(CapturedVar); VD && !
C->isPackExpansion())
15504LSI->ContainsUnexpandedParameterPack |= VD->isParameterPack();
15507getSema().tryCaptureVariable(CapturedVar,
C->getLocation(), Kind,
15510getSema().finishLambdaExplicitCaptures(LSI);
15514 autoTPL = getDerived().TransformTemplateParameterList(
15515 E->getTemplateParameterList());
15516LSI->GLTemplateParameterList = TPL;
15518getSema().AddTemplateParametersToLambdaCallOperator(NewCallOperator,
Class,
15520LSI->ContainsUnexpandedParameterPack |=
15521TPL->containsUnexpandedParameterPack();
15524TypeLocBuilder NewCallOpTLBuilder;
15525TypeLoc OldCallOpTypeLoc =
15526 E->getCallOperator()->getTypeSourceInfo()->getTypeLoc();
15527QualType NewCallOpType =
15528getDerived().TransformType(NewCallOpTLBuilder, OldCallOpTypeLoc);
15529 if(NewCallOpType.isNull())
15531LSI->ContainsUnexpandedParameterPack |=
15532NewCallOpType->containsUnexpandedParameterPack();
15533TypeSourceInfo *NewCallOpTSI =
15534NewCallOpTLBuilder.getTypeSourceInfo(getSema().Context, NewCallOpType);
15538 autoFPTL = NewCallOpTSI->getTypeLoc().getAsAdjusted<FunctionProtoTypeLoc>();
15539assert(FPTL &&
"Not a FunctionProtoType?");
15541getSema().CompleteLambdaCallOperator(
15542NewCallOperator,
E->getCallOperator()->getLocation(),
15543 E->getCallOperator()->getInnerLocStart(),
15544 E->getCallOperator()->getTrailingRequiresClause(), NewCallOpTSI,
15545 E->getCallOperator()->getConstexprKind(),
15546 E->getCallOperator()->getStorageClass(), FPTL.getParams(),
15547 E->hasExplicitResultType());
15549getDerived().transformAttrs(
E->getCallOperator(), NewCallOperator);
15550getDerived().transformedLocalDecl(
E->getCallOperator(), {NewCallOperator});
15554Sema::ContextRAII ManglingContext(getSema(),
Class->getDeclContext());
15556std::optional<CXXRecordDecl::LambdaNumbering> Numbering;
15557 if(getDerived().ReplacingOriginal()) {
15558Numbering = OldClass->getLambdaNumbering();
15561getSema().handleLambdaNumbering(
Class, NewCallOperator, Numbering);
15566getSema().PushExpressionEvaluationContext(
15567 E->getCallOperator()->isConsteval() ?
15570getSema().currentEvaluationContext().InImmediateEscalatingFunctionContext =
15571getSema().getLangOpts().CPlusPlus20 &&
15572 E->getCallOperator()->isImmediateEscalating();
15574Sema::CodeSynthesisContext
C;
15577getSema().pushCodeSynthesisContext(
C);
15583getSema().popCodeSynthesisContext();
15586FuncScopeCleanup.disable();
15588 if(Body.isInvalid()) {
15589SavedContext.pop();
15590getSema().ActOnLambdaError(
E->
getBeginLoc(),
nullptr,
15598 autoLSICopy = *LSI;
15599getSema().ActOnFinishFunctionBody(NewCallOperator, Body.get(),
15601SavedContext.pop();
15636DependencyKind = getDerived().ComputeLambdaDependency(&LSICopy);
15637 Class->setLambdaDependencyKind(DependencyKind);
15640 Class->setTypeForDecl(
nullptr);
15641getSema().Context.getTypeDeclType(
Class);
15643 returngetDerived().RebuildLambdaExpr(
E->
getBeginLoc(),
15644Body.get()->getEndLoc(), &LSICopy);
15647template<
typenameDerived>
15650 returnTransformStmt(S);
15653template<
typenameDerived>
15658CEnd =
E->capture_end();
15659 C!= CEnd; ++
C) {
15662 if(!
C->isImplicit())
15666 if(
C->capturesThis()) {
15667getSema().CheckCXXThisCapture(
C->getLocation(),
C->isExplicit(),
15674 if(
C->capturesVLAType())
15677assert(
C->capturesVariable() &&
"unexpected kind of lambda capture");
15678assert(!
E->isInitCapture(
C) &&
"implicit init-capture?");
15681 VarDecl*CapturedVar = cast_or_null<VarDecl>(
15682getDerived().TransformDecl(
C->getLocation(),
C->getCapturedVar()));
15687getSema().tryCaptureVariable(CapturedVar,
C->getLocation());
15693template<
typenameDerived>
15698getDerived().TransformTypeWithDeducedTST(
E->getTypeSourceInfo());
15702 boolArgumentChanged =
false;
15704Args.reserve(
E->getNumArgs());
15708 E->isListInitialization());
15709 if(getDerived().TransformExprs(
E->arg_begin(),
E->getNumArgs(),
true, Args,
15714 if(!getDerived().AlwaysRebuild() &&
15715 T==
E->getTypeSourceInfo() &&
15720 returngetDerived().RebuildCXXUnresolvedConstructExpr(
15721 T,
E->getLParenLoc(), Args,
E->getRParenLoc(),
E->isListInitialization());
15724template<
typenameDerived>
15726TreeTransform<Derived>::TransformCXXDependentScopeMemberExpr(
15727CXXDependentScopeMemberExpr *
E) {
15732QualType ObjectType;
15733 if(!
E->isImplicitAccess()) {
15734OldBase =
E->getBase();
15735 Base= getDerived().TransformExpr(OldBase);
15736 if(
Base.isInvalid())
15741 boolMayBePseudoDestructor =
false;
15743 E->getOperatorLoc(),
15744 E->isArrow()? tok::arrow : tok::period,
15746MayBePseudoDestructor);
15747 if(
Base.isInvalid())
15750ObjectType = ObjectTy.get();
15751BaseType = ((Expr*)
Base.get())->getType();
15753OldBase =
nullptr;
15754BaseType = getDerived().TransformType(
E->getBaseType());
15755ObjectType = BaseType->castAs<PointerType>()->
getPointeeType();
15760NamedDecl *FirstQualifierInScope
15761= getDerived().TransformFirstQualifierInScope(
15762 E->getFirstQualifierFoundInScope(),
15765NestedNameSpecifierLoc QualifierLoc;
15766 if(
E->getQualifier()) {
15768= getDerived().TransformNestedNameSpecifierLoc(
E->getQualifierLoc(),
15770FirstQualifierInScope);
15775SourceLocation TemplateKWLoc =
E->getTemplateKeywordLoc();
15781DeclarationNameInfo NameInfo
15782= getDerived().TransformDeclarationNameInfo(
E->getMemberNameInfo());
15783 if(!NameInfo.getName())
15786 if(!
E->hasExplicitTemplateArgs()) {
15789 if(!getDerived().AlwaysRebuild() &&
15790 Base.get() == OldBase &&
15791BaseType ==
E->getBaseType() &&
15792QualifierLoc ==
E->getQualifierLoc() &&
15793NameInfo.getName() ==
E->getMember() &&
15794FirstQualifierInScope ==
E->getFirstQualifierFoundInScope())
15797 returngetDerived().RebuildCXXDependentScopeMemberExpr(
Base.get(),
15800 E->getOperatorLoc(),
15803FirstQualifierInScope,
15808TemplateArgumentListInfo TransArgs(
E->getLAngleLoc(),
E->getRAngleLoc());
15809 if(getDerived().TransformTemplateArguments(
E->getTemplateArgs(),
15810 E->getNumTemplateArgs(),
15814 returngetDerived().RebuildCXXDependentScopeMemberExpr(
Base.get(),
15817 E->getOperatorLoc(),
15820FirstQualifierInScope,
15825template<
typenameDerived>
15826ExprResultTreeTransform<Derived>::TransformUnresolvedMemberExpr(
15827UnresolvedMemberExpr *Old) {
15831 if(!Old->isImplicitAccess()) {
15832 Base= getDerived().TransformExpr(Old->getBase());
15833 if(
Base.isInvalid())
15836getSema().PerformMemberExprBaseConversion(
Base.get(), Old->isArrow());
15837 if(
Base.isInvalid())
15839BaseType =
Base.get()->getType();
15841BaseType = getDerived().TransformType(Old->getBaseType());
15844NestedNameSpecifierLoc QualifierLoc;
15845 if(Old->getQualifierLoc()) {
15847getDerived().TransformNestedNameSpecifierLoc(Old->getQualifierLoc());
15852SourceLocation TemplateKWLoc = Old->getTemplateKeywordLoc();
15857 if(TransformOverloadExprDecls(Old,
false, R))
15861 if(Old->getNamingClass()) {
15862CXXRecordDecl *NamingClass = cast_or_null<CXXRecordDecl>(
15863getDerived().TransformDecl(Old->getMemberLoc(), Old->getNamingClass()));
15867R.setNamingClass(NamingClass);
15870TemplateArgumentListInfo TransArgs;
15871 if(Old->hasExplicitTemplateArgs()) {
15872TransArgs.setLAngleLoc(Old->getLAngleLoc());
15873TransArgs.setRAngleLoc(Old->getRAngleLoc());
15874 if(getDerived().TransformTemplateArguments(
15875Old->getTemplateArgs(), Old->getNumTemplateArgs(), TransArgs))
15883NamedDecl *FirstQualifierInScope =
nullptr;
15885 returngetDerived().RebuildUnresolvedMemberExpr(
15886 Base.get(), BaseType, Old->getOperatorLoc(), Old->isArrow(), QualifierLoc,
15887TemplateKWLoc, FirstQualifierInScope, R,
15888(Old->hasExplicitTemplateArgs() ? &TransArgs :
nullptr));
15891template<
typenameDerived>
15893TreeTransform<Derived>::TransformCXXNoexceptExpr(CXXNoexceptExpr *
E) {
15896 ExprResultSubExpr = getDerived().TransformExpr(
E->getOperand());
15897 if(SubExpr.isInvalid())
15900 if(!getDerived().AlwaysRebuild() && SubExpr.get() ==
E->getOperand())
15903 returngetDerived().RebuildCXXNoexceptExpr(
E->
getSourceRange(),SubExpr.get());
15906template<
typenameDerived>
15908TreeTransform<Derived>::TransformPackExpansionExpr(PackExpansionExpr *
E) {
15909 ExprResultPattern = getDerived().TransformExpr(
E->getPattern());
15910 if(Pattern.isInvalid())
15913 if(!getDerived().AlwaysRebuild() && Pattern.get() ==
E->getPattern())
15916 returngetDerived().RebuildPackExpansion(Pattern.get(),
E->getEllipsisLoc(),
15917 E->getNumExpansions());
15920template<
typenameDerived>
15922TreeTransform<Derived>::TransformSizeOfPackExpr(SizeOfPackExpr *
E) {
15932TemplateArgument ArgStorage;
15935 if(
E->isPartiallySubstituted()) {
15936PackArgs =
E->getPartialArguments();
15939 boolShouldExpand =
false;
15940 boolRetainExpansion =
false;
15941std::optional<unsigned> NumExpansions;
15942 if(getDerived().TryExpandParameterPacks(
E->getOperatorLoc(),
E->getPackLoc(),
15944ShouldExpand, RetainExpansion,
15950 if(ShouldExpand) {
15951 auto*Pack =
E->getPack();
15952 if(
auto*TTPD = dyn_cast<TemplateTypeParmDecl>(Pack)) {
15953ArgStorage = getSema().Context.getPackExpansionType(
15955}
else if(
auto*TTPD = dyn_cast<TemplateTemplateParmDecl>(Pack)) {
15956ArgStorage = TemplateArgument(TemplateName(TTPD), std::nullopt);
15958 auto*VD = cast<ValueDecl>(Pack);
15959 ExprResultDRE = getSema().BuildDeclRefExpr(
15960VD, VD->getType().getNonLValueExprType(getSema().Context),
15963 if(DRE.isInvalid())
15965ArgStorage =
new(getSema().Context)
15966PackExpansionExpr(getSema().Context.DependentTy, DRE.get(),
15967 E->getPackLoc(), std::nullopt);
15969PackArgs = ArgStorage;
15974 if(!PackArgs.size()) {
15975 auto*Pack = cast_or_null<NamedDecl>(
15976getDerived().TransformDecl(
E->getPackLoc(),
E->getPack()));
15979 returngetDerived().RebuildSizeOfPackExpr(
15980 E->getOperatorLoc(), Pack,
E->getPackLoc(),
E->getRParenLoc(),
15985std::optional<unsigned>
Result= 0;
15986 for(
constTemplateArgument &Arg : PackArgs) {
15987 if(!Arg.isPackExpansion()) {
15992TemplateArgumentLoc ArgLoc;
15993InventTemplateArgumentLoc(Arg, ArgLoc);
15996SourceLocation Ellipsis;
15997std::optional<unsigned> OrigNumExpansions;
15998TemplateArgumentLoc Pattern =
15999getSema().getTemplateArgumentPackExpansionPattern(ArgLoc, Ellipsis,
16000OrigNumExpansions);
16003TemplateArgumentLoc OutPattern;
16004Sema::ArgumentPackSubstitutionIndexRAII SubstIndex(getSema(), -1);
16005 if(getDerived().TransformTemplateArgument(Pattern, OutPattern,
16010std::optional<unsigned> NumExpansions =
16011getSema().getFullyPackExpandedSize(OutPattern.getArgument());
16012 if(!NumExpansions) {
16025 returngetDerived().RebuildSizeOfPackExpr(
E->getOperatorLoc(),
E->getPack(),
16027 E->getRParenLoc(), *
Result, {});
16029TemplateArgumentListInfo TransformedPackArgs(
E->getPackLoc(),
16032TemporaryBase Rebase(*
this,
E->getPackLoc(), getBaseEntity());
16033 typedefTemplateArgumentLocInventIterator<
16034Derived,
constTemplateArgument*> PackLocIterator;
16035 if(TransformTemplateArguments(PackLocIterator(*
this, PackArgs.begin()),
16036PackLocIterator(*
this, PackArgs.end()),
16037TransformedPackArgs,
true))
16044 boolPartialSubstitution =
false;
16045 for(
auto&
Loc: TransformedPackArgs.arguments()) {
16046Args.push_back(
Loc.getArgument());
16047 if(
Loc.getArgument().isPackExpansion())
16048PartialSubstitution =
true;
16051 if(PartialSubstitution)
16052 returngetDerived().RebuildSizeOfPackExpr(
16053 E->getOperatorLoc(),
E->getPack(),
E->getPackLoc(),
E->getRParenLoc(),
16054std::nullopt, Args);
16056 returngetDerived().RebuildSizeOfPackExpr(
E->getOperatorLoc(),
E->getPack(),
16057 E->getPackLoc(),
E->getRParenLoc(),
16061template<
typenameDerived>
16063TreeTransform<Derived>::TransformPackIndexingExpr(PackIndexingExpr *
E) {
16070EnterExpressionEvaluationContext ConstantContext(
16072IndexExpr = getDerived().TransformExpr(
E->getIndexExpr());
16073 if(IndexExpr.isInvalid())
16078 boolFullySubstituted =
true;
16079 if(!
E->expandsToEmptyPack() &&
E->getExpressions().empty()) {
16080Expr *Pattern =
E->getPackIdExpression();
16082getSema().collectUnexpandedParameterPacks(
E->getPackIdExpression(),
16084assert(!Unexpanded.empty() &&
"Pack expansion without parameter packs?");
16088 boolShouldExpand =
true;
16089 boolRetainExpansion =
false;
16090std::optional<unsigned> OrigNumExpansions;
16091std::optional<unsigned> NumExpansions = OrigNumExpansions;
16092 if(getDerived().TryExpandParameterPacks(
16094ShouldExpand, RetainExpansion, NumExpansions))
16096 if(!ShouldExpand) {
16097Sema::ArgumentPackSubstitutionIndexRAII SubstIndex(getSema(), -1);
16098 ExprResultPack = getDerived().TransformExpr(Pattern);
16099 if(Pack.isInvalid())
16101 returngetDerived().RebuildPackIndexingExpr(
16102 E->getEllipsisLoc(),
E->getRSquareLoc(), Pack.get(), IndexExpr.get(),
16105 for(
unsignedI = 0; I != *NumExpansions; ++I) {
16106Sema::ArgumentPackSubstitutionIndexRAII SubstIndex(getSema(), I);
16107 ExprResultOut = getDerived().TransformExpr(Pattern);
16108 if(Out.isInvalid())
16110 if(Out.get()->containsUnexpandedParameterPack()) {
16111Out = getDerived().RebuildPackExpansion(Out.get(),
E->getEllipsisLoc(),
16112OrigNumExpansions);
16113 if(Out.isInvalid())
16115FullySubstituted =
false;
16117ExpandedExprs.push_back(Out.get());
16121 if(RetainExpansion) {
16122ForgetPartiallySubstitutedPackRAII Forget(getDerived());
16124 ExprResultOut = getDerived().TransformExpr(Pattern);
16125 if(Out.isInvalid())
16128Out = getDerived().RebuildPackExpansion(Out.get(),
E->getEllipsisLoc(),
16129OrigNumExpansions);
16130 if(Out.isInvalid())
16132FullySubstituted =
false;
16133ExpandedExprs.push_back(Out.get());
16135}
else if(!
E->expandsToEmptyPack()) {
16136 if(getDerived().TransformExprs(
E->getExpressions().data(),
16137 E->getExpressions().size(),
false,
16142 returngetDerived().RebuildPackIndexingExpr(
16143 E->getEllipsisLoc(),
E->getRSquareLoc(),
E->getPackIdExpression(),
16144IndexExpr.get(), ExpandedExprs, FullySubstituted);
16147template<
typenameDerived>
16149TreeTransform<Derived>::TransformSubstNonTypeTemplateParmPackExpr(
16150SubstNonTypeTemplateParmPackExpr *
E) {
16155template<
typenameDerived>
16157TreeTransform<Derived>::TransformSubstNonTypeTemplateParmExpr(
16158SubstNonTypeTemplateParmExpr *
E) {
16163template<
typenameDerived>
16165TreeTransform<Derived>::TransformFunctionParmPackExpr(FunctionParmPackExpr *
E) {
16170template<
typenameDerived>
16171ExprResultTreeTransform<Derived>::TransformResolvedUnexpandedPackExpr(
16172ResolvedUnexpandedPackExpr *
E) {
16173 boolArgumentChanged =
false;
16175 if(TransformExprs(
E->getExprs().begin(),
E->getNumExprs(),
16176 false, NewExprs, &ArgumentChanged))
16179 if(!AlwaysRebuild() && !ArgumentChanged)
16188template<
typenameDerived>
16190TreeTransform<Derived>::TransformMaterializeTemporaryExpr(
16191MaterializeTemporaryExpr *
E) {
16192 returngetDerived().TransformExpr(
E->getSubExpr());
16195template<
typenameDerived>
16197TreeTransform<Derived>::TransformCXXFoldExpr(CXXFoldExpr *
E) {
16198UnresolvedLookupExpr *
Callee=
nullptr;
16199 if(Expr *OldCallee =
E->getCallee()) {
16200 ExprResultCalleeResult = getDerived().TransformExpr(OldCallee);
16201 if(CalleeResult.isInvalid())
16203 Callee= cast<UnresolvedLookupExpr>(CalleeResult.get());
16206Expr *Pattern =
E->getPattern();
16209getSema().collectUnexpandedParameterPacks(Pattern, Unexpanded);
16210assert(!Unexpanded.empty() &&
"Pack expansion without parameter packs?");
16214 boolExpand =
true;
16215 boolRetainExpansion =
false;
16216std::optional<unsigned> OrigNumExpansions =
E->getNumExpansions(),
16217NumExpansions = OrigNumExpansions;
16218 if(getDerived().TryExpandParameterPacks(
E->getEllipsisLoc(),
16221Expand, RetainExpansion,
16228Sema::ArgumentPackSubstitutionIndexRAII SubstIndex(getSema(), -1);
16231 E->getLHS() ? getDerived().TransformExpr(
E->getLHS()) :
ExprResult();
16232 if(LHS.isInvalid())
16236 E->getRHS() ? getDerived().TransformExpr(
E->getRHS()) :
ExprResult();
16237 if(RHS.isInvalid())
16240 if(!getDerived().AlwaysRebuild() &&
16241LHS.get() ==
E->getLHS() && RHS.get() ==
E->getRHS())
16244 returngetDerived().RebuildCXXFoldExpr(
16246 E->getEllipsisLoc(), RHS.get(),
E->
getEndLoc(), NumExpansions);
16252 if(NumExpansions && SemaRef.
getLangOpts().BracketDepth < NumExpansions) {
16253SemaRef.
Diag(
E->getEllipsisLoc(),
16254clang::diag::err_fold_expression_limit_exceeded)
16255<< *NumExpansions << SemaRef.
getLangOpts().BracketDepth
16257SemaRef.
Diag(
E->getEllipsisLoc(), diag::note_bracket_depth);
16264 if(
Result.isInvalid())
16266 boolLeftFold =
E->isLeftFold();
16270 if(!LeftFold && RetainExpansion) {
16271ForgetPartiallySubstitutedPackRAII Forget(getDerived());
16273 ExprResultOut = getDerived().TransformExpr(Pattern);
16274 if(Out.isInvalid())
16277 Result= getDerived().RebuildCXXFoldExpr(
16280 if(
Result.isInvalid())
16284 for(
unsignedI = 0; I != *NumExpansions; ++I) {
16285Sema::ArgumentPackSubstitutionIndexRAII SubstIndex(
16286getSema(), LeftFold ? I : *NumExpansions - I - 1);
16287 ExprResultOut = getDerived().TransformExpr(Pattern);
16288 if(Out.isInvalid())
16291 if(Out.get()->containsUnexpandedParameterPack()) {
16293 Result= getDerived().RebuildCXXFoldExpr(
16295 E->getOperator(),
E->getEllipsisLoc(),
16297OrigNumExpansions);
16298}
else if(
Result.isUsable()) {
16300Expr *LHS = LeftFold ?
Result.get() : Out.get();
16301Expr *RHS = LeftFold ? Out.get() :
Result.get();
16303UnresolvedSet<16> Functions;
16304Functions.append(
Callee->decls_begin(),
Callee->decls_end());
16305 Result= getDerived().RebuildCXXOperatorCallExpr(
16307 E->getEllipsisLoc(),
Callee->getBeginLoc(),
Callee->requiresADL(),
16308Functions, LHS, RHS);
16310 Result= getDerived().RebuildBinaryOperator(
E->getEllipsisLoc(),
16311 E->getOperator(), LHS, RHS);
16316 if(
Result.isInvalid())
16322 if(LeftFold && RetainExpansion) {
16323ForgetPartiallySubstitutedPackRAII Forget(getDerived());
16325 ExprResultOut = getDerived().TransformExpr(Pattern);
16326 if(Out.isInvalid())
16329 Result= getDerived().RebuildCXXFoldExpr(
16331 E->getEllipsisLoc(), Out.get(),
E->
getEndLoc(), OrigNumExpansions);
16332 if(
Result.isInvalid())
16336 if(ParenExpr *PE = dyn_cast_or_null<ParenExpr>(
Result.get()))
16337PE->setIsProducedByFoldExpansion();
16342 returngetDerived().RebuildEmptyCXXFoldExpr(
E->getEllipsisLoc(),
16343 E->getOperator());
16347template<
typenameDerived>
16349TreeTransform<Derived>::TransformCXXParenListInitExpr(CXXParenListInitExpr *
E) {
16352 if(TransformExprs(InitExprs.data(), InitExprs.size(),
true,
16356 returngetDerived().RebuildParenListExpr(
E->
getBeginLoc(), TransformedInits,
16360template<
typenameDerived>
16362TreeTransform<Derived>::TransformCXXStdInitializerListExpr(
16363CXXStdInitializerListExpr *
E) {
16364 returngetDerived().TransformExpr(
E->getSubExpr());
16367template<
typenameDerived>
16369TreeTransform<Derived>::TransformObjCStringLiteral(ObjCStringLiteral *
E) {
16373template<
typenameDerived>
16375TreeTransform<Derived>::TransformObjCBoolLiteralExpr(ObjCBoolLiteralExpr *
E) {
16379template<
typenameDerived>
16381TreeTransform<Derived>::TransformObjCBoxedExpr(ObjCBoxedExpr *
E) {
16382 ExprResultSubExpr = getDerived().TransformExpr(
E->getSubExpr());
16383 if(SubExpr.isInvalid())
16386 if(!getDerived().AlwaysRebuild() &&
16387SubExpr.get() ==
E->getSubExpr())
16390 returngetDerived().RebuildObjCBoxedExpr(
E->
getSourceRange(), SubExpr.get());
16393template<
typenameDerived>
16395TreeTransform<Derived>::TransformObjCArrayLiteral(ObjCArrayLiteral *
E) {
16398 boolArgChanged =
false;
16399 if(getDerived().TransformExprs(
E->getElements(),
E->getNumElements(),
16400 false, Elements, &ArgChanged))
16403 if(!getDerived().AlwaysRebuild() && !ArgChanged)
16411template<
typenameDerived>
16413TreeTransform<Derived>::TransformObjCDictionaryLiteral(
16414ObjCDictionaryLiteral *
E) {
16417 boolArgChanged =
false;
16418 for(
unsignedI = 0, N =
E->getNumElements(); I != N; ++I) {
16419ObjCDictionaryElement OrigElement =
E->getKeyValueElement(I);
16421 if(OrigElement.isPackExpansion()) {
16424getSema().collectUnexpandedParameterPacks(OrigElement.Key, Unexpanded);
16425getSema().collectUnexpandedParameterPacks(OrigElement.Value, Unexpanded);
16426assert(!Unexpanded.empty() &&
"Pack expansion without parameter packs?");
16430 boolExpand =
true;
16431 boolRetainExpansion =
false;
16432std::optional<unsigned> OrigNumExpansions = OrigElement.NumExpansions;
16433std::optional<unsigned> NumExpansions = OrigNumExpansions;
16434SourceRange PatternRange(OrigElement.Key->getBeginLoc(),
16435OrigElement.Value->getEndLoc());
16436 if(getDerived().TryExpandParameterPacks(OrigElement.EllipsisLoc,
16437PatternRange, Unexpanded, Expand,
16438RetainExpansion, NumExpansions))
16445Sema::ArgumentPackSubstitutionIndexRAII SubstIndex(getSema(), -1);
16446 ExprResultKey = getDerived().TransformExpr(OrigElement.Key);
16447 if(Key.isInvalid())
16450 if(Key.get() != OrigElement.Key)
16451ArgChanged =
true;
16454 if(
Value.isInvalid())
16457 if(
Value.get() != OrigElement.Value)
16458ArgChanged =
true;
16460ObjCDictionaryElement Expansion = {
16461Key.get(),
Value.get(), OrigElement.EllipsisLoc, NumExpansions
16463Elements.push_back(Expansion);
16469ArgChanged =
true;
16473 for(
unsignedI = 0; I != *NumExpansions; ++I) {
16474Sema::ArgumentPackSubstitutionIndexRAII SubstIndex(getSema(), I);
16475 ExprResultKey = getDerived().TransformExpr(OrigElement.Key);
16476 if(Key.isInvalid())
16480 if(
Value.isInvalid())
16483ObjCDictionaryElement Element = {
16484Key.get(),
Value.get(), SourceLocation(), NumExpansions
16490 if(Key.get()->containsUnexpandedParameterPack() ||
16491 Value.get()->containsUnexpandedParameterPack())
16492Element.EllipsisLoc = OrigElement.EllipsisLoc;
16494Elements.push_back(Element);
16504 ExprResultKey = getDerived().TransformExpr(OrigElement.Key);
16505 if(Key.isInvalid())
16508 if(Key.get() != OrigElement.Key)
16509ArgChanged =
true;
16513= getDerived().TransformExpr(OrigElement.Value);
16514 if(
Value.isInvalid())
16517 if(
Value.get() != OrigElement.Value)
16518ArgChanged =
true;
16520ObjCDictionaryElement Element = {Key.get(),
Value.get(), SourceLocation(),
16522Elements.push_back(Element);
16525 if(!getDerived().AlwaysRebuild() && !ArgChanged)
16528 returngetDerived().RebuildObjCDictionaryLiteral(
E->
getSourceRange(),
16532template<
typenameDerived>
16534TreeTransform<Derived>::TransformObjCEncodeExpr(ObjCEncodeExpr *
E) {
16535TypeSourceInfo *EncodedTypeInfo
16536= getDerived().TransformType(
E->getEncodedTypeSourceInfo());
16537 if(!EncodedTypeInfo)
16540 if(!getDerived().AlwaysRebuild() &&
16541EncodedTypeInfo ==
E->getEncodedTypeSourceInfo())
16544 returngetDerived().RebuildObjCEncodeExpr(
E->getAtLoc(),
16546 E->getRParenLoc());
16549template<
typenameDerived>
16551TransformObjCIndirectCopyRestoreExpr(ObjCIndirectCopyRestoreExpr *
E) {
16556 returngetDerived().TransformExpr(
E->getSubExpr());
16559template<
typenameDerived>
16561TransformObjCBridgedCastExpr(ObjCBridgedCastExpr *
E) {
16562TypeSourceInfo *TSInfo
16563= getDerived().TransformType(
E->getTypeInfoAsWritten());
16568 if(
Result.isInvalid())
16571 if(!getDerived().AlwaysRebuild() &&
16572TSInfo ==
E->getTypeInfoAsWritten() &&
16573 Result.get() ==
E->getSubExpr())
16577 E->getLParenLoc(),
E->getBridgeKind(),
E->getBridgeKeywordLoc(), TSInfo,
16581template<
typenameDerived>
16582ExprResultTreeTransform<Derived>::TransformObjCAvailabilityCheckExpr(
16583ObjCAvailabilityCheckExpr *
E) {
16587template<
typenameDerived>
16589TreeTransform<Derived>::TransformObjCMessageExpr(ObjCMessageExpr *
E) {
16591 boolArgChanged =
false;
16593Args.reserve(
E->getNumArgs());
16594 if(getDerived().TransformExprs(
E->getArgs(),
E->getNumArgs(),
false, Args,
16600TypeSourceInfo *ReceiverTypeInfo
16601= getDerived().TransformType(
E->getClassReceiverTypeInfo());
16602 if(!ReceiverTypeInfo)
16606 if(!getDerived().AlwaysRebuild() &&
16607ReceiverTypeInfo ==
E->getClassReceiverTypeInfo() && !ArgChanged)
16612 E->getSelectorLocs(SelLocs);
16613 returngetDerived().RebuildObjCMessageExpr(ReceiverTypeInfo,
16616 E->getMethodDecl(),
16619 E->getRightLoc());
16623 if(!
E->getMethodDecl())
16628 E->getSelectorLocs(SelLocs);
16629 returngetDerived().RebuildObjCMessageExpr(
E->getSuperLoc(),
16632 E->getReceiverType(),
16633 E->getMethodDecl(),
16636 E->getRightLoc());
16641 "Only class and instance messages may be instantiated");
16643= getDerived().TransformExpr(
E->getInstanceReceiver());
16644 if(Receiver.isInvalid())
16648 if(!getDerived().AlwaysRebuild() &&
16649Receiver.get() ==
E->getInstanceReceiver() && !ArgChanged)
16654 E->getSelectorLocs(SelLocs);
16655 returngetDerived().RebuildObjCMessageExpr(Receiver.get(),
16658 E->getMethodDecl(),
16661 E->getRightLoc());
16664template<
typenameDerived>
16666TreeTransform<Derived>::TransformObjCSelectorExpr(ObjCSelectorExpr *
E) {
16670template<
typenameDerived>
16672TreeTransform<Derived>::TransformObjCProtocolExpr(ObjCProtocolExpr *
E) {
16676template<
typenameDerived>
16678TreeTransform<Derived>::TransformObjCIvarRefExpr(ObjCIvarRefExpr *
E) {
16681 if(
Base.isInvalid())
16687 if(!getDerived().AlwaysRebuild() &&
16688 Base.get() ==
E->getBase())
16691 returngetDerived().RebuildObjCIvarRefExpr(
Base.get(),
E->getDecl(),
16693 E->isArrow(),
E->isFreeIvar());
16696template<
typenameDerived>
16698TreeTransform<Derived>::TransformObjCPropertyRefExpr(ObjCPropertyRefExpr *
E) {
16701 if(!
E->isObjectReceiver())
16706 if(
Base.isInvalid())
16712 if(!getDerived().AlwaysRebuild() &&
16713 Base.get() ==
E->getBase())
16716 if(
E->isExplicitProperty())
16717 returngetDerived().RebuildObjCPropertyRefExpr(
Base.get(),
16718 E->getExplicitProperty(),
16719 E->getLocation());
16721 returngetDerived().RebuildObjCPropertyRefExpr(
Base.get(),
16723 E->getImplicitPropertyGetter(),
16724 E->getImplicitPropertySetter(),
16725 E->getLocation());
16728template<
typenameDerived>
16730TreeTransform<Derived>::TransformObjCSubscriptRefExpr(ObjCSubscriptRefExpr *
E) {
16733 if(
Base.isInvalid())
16737 ExprResultKey = getDerived().TransformExpr(
E->getKeyExpr());
16738 if(Key.isInvalid())
16742 if(!getDerived().AlwaysRebuild() &&
16743Key.get() ==
E->getKeyExpr() &&
Base.get() ==
E->getBaseExpr())
16746 returngetDerived().RebuildObjCSubscriptRefExpr(
E->getRBracket(),
16747 Base.get(), Key.get(),
16748 E->getAtIndexMethodDecl(),
16749 E->setAtIndexMethodDecl());
16752template<
typenameDerived>
16754TreeTransform<Derived>::TransformObjCIsaExpr(ObjCIsaExpr *
E) {
16757 if(
Base.isInvalid())
16761 if(!getDerived().AlwaysRebuild() &&
16762 Base.get() ==
E->getBase())
16765 returngetDerived().RebuildObjCIsaExpr(
Base.get(),
E->getIsaMemberLoc(),
16770template<
typenameDerived>
16772TreeTransform<Derived>::TransformShuffleVectorExpr(ShuffleVectorExpr *
E) {
16773 boolArgumentChanged =
false;
16775SubExprs.reserve(
E->getNumSubExprs());
16776 if(getDerived().TransformExprs(
E->getSubExprs(),
E->getNumSubExprs(),
false,
16777SubExprs, &ArgumentChanged))
16780 if(!getDerived().AlwaysRebuild() &&
16784 returngetDerived().RebuildShuffleVectorExpr(
E->getBuiltinLoc(),
16786 E->getRParenLoc());
16789template<
typenameDerived>
16791TreeTransform<Derived>::TransformConvertVectorExpr(ConvertVectorExpr *
E) {
16792 ExprResultSrcExpr = getDerived().TransformExpr(
E->getSrcExpr());
16793 if(SrcExpr.isInvalid())
16796TypeSourceInfo *
Type= getDerived().TransformType(
E->getTypeSourceInfo());
16800 if(!getDerived().AlwaysRebuild() &&
16801Type ==
E->getTypeSourceInfo() &&
16802SrcExpr.get() ==
E->getSrcExpr())
16805 returngetDerived().RebuildConvertVectorExpr(
E->getBuiltinLoc(),
16806SrcExpr.get(), Type,
16807 E->getRParenLoc());
16810template<
typenameDerived>
16812TreeTransform<Derived>::TransformBlockExpr(BlockExpr *
E) {
16813BlockDecl *oldBlock =
E->getBlockDecl();
16816BlockScopeInfo *blockScope = SemaRef.
getCurBlock();
16819blockScope->TheDecl->setBlockMissingReturnType(
16820oldBlock->blockMissingReturnType());
16825 constFunctionProtoType *exprFunctionType =
E->getFunctionType();
16828Sema::ExtParameterInfoBuilder extParamInfos;
16829 if(getDerived().TransformFunctionTypeParams(
16830 E->getCaretLocation(), oldBlock->parameters(),
nullptr,
16831exprFunctionType->getExtParameterInfosOrNull(), paramTypes, ¶ms,
16833getSema().ActOnBlockError(
E->getCaretLocation(),
nullptr);
16837QualType exprResultType =
16838getDerived().TransformType(exprFunctionType->getReturnType());
16840 autoepi = exprFunctionType->getExtProtoInfo();
16841epi.ExtParameterInfos = extParamInfos.getPointerOrNull(paramTypes.size());
16844getDerived().RebuildFunctionProtoType(exprResultType, paramTypes, epi);
16848 if(!params.empty())
16849blockScope->TheDecl->setParams(params);
16851 if(!oldBlock->blockMissingReturnType()) {
16852blockScope->HasImplicitReturnType =
false;
16853blockScope->ReturnType = exprResultType;
16857 StmtResultbody = getDerived().TransformStmt(
E->getBody());
16858 if(body.isInvalid()) {
16859getSema().ActOnBlockError(
E->getCaretLocation(),
nullptr);
16867 for(
const auto&I : oldBlock->captures()) {
16868VarDecl *oldCapture = I.getVariable();
16871 if(oldCapture->isParameterPack())
16874VarDecl *newCapture =
16875cast<VarDecl>(getDerived().TransformDecl(
E->getCaretLocation(),
16877assert(blockScope->CaptureMap.count(newCapture));
16883assert((!blockScope->isCXXThisCaptured() || oldBlock->capturesCXXThis()) &&
16884 "this pointer isn't captured in the old block");
16892template<
typenameDerived>
16894TreeTransform<Derived>::TransformAsTypeExpr(AsTypeExpr *
E) {
16895 ExprResultSrcExpr = getDerived().TransformExpr(
E->getSrcExpr());
16896 if(SrcExpr.isInvalid())
16899QualType
Type= getDerived().TransformType(
E->
getType());
16901 returnSemaRef.
BuildAsTypeExpr(SrcExpr.get(), Type,
E->getBuiltinLoc(),
16902 E->getRParenLoc());
16905template<
typenameDerived>
16907TreeTransform<Derived>::TransformAtomicExpr(AtomicExpr *
E) {
16908 boolArgumentChanged =
false;
16910SubExprs.reserve(
E->getNumSubExprs());
16911 if(getDerived().TransformExprs(
E->getSubExprs(),
E->getNumSubExprs(),
false,
16912SubExprs, &ArgumentChanged))
16915 if(!getDerived().AlwaysRebuild() &&
16919 returngetDerived().RebuildAtomicExpr(
E->getBuiltinLoc(), SubExprs,
16920 E->getOp(),
E->getRParenLoc());
16927template<
typenameDerived>
16931getDerived().getBaseEntity());
16934template<
typenameDerived>
16938getDerived().getBaseEntity());
16941template<
typenameDerived>
16944 boolWrittenAsLValue,
16947Sigil, getDerived().getBaseEntity());
16950template<
typenameDerived>
16956getDerived().getBaseEntity());
16959template<
typenameDerived>
16967 Decl, ProtocolLAngleLoc, Protocols, ProtocolLocs, ProtocolRAngleLoc,
16971template<
typenameDerived>
16983BaseType,
Loc, TypeArgsLAngleLoc, TypeArgs, TypeArgsRAngleLoc,
16984ProtocolLAngleLoc, Protocols, ProtocolLocs, ProtocolRAngleLoc,
16989template<
typenameDerived>
16996template<
typenameDerived>
16999 Expr*SizeExpr,
unsignedIndexTypeQuals,
SourceRangeBracketsRange) {
17000 if(SizeExpr || !Size)
17002IndexTypeQuals, BracketsRange,
17003getDerived().getBaseEntity());
17011 for(
const auto&
T: Types)
17022 returnSemaRef.
BuildArrayType(ElementType, SizeMod, ArraySize,
17023IndexTypeQuals, BracketsRange,
17024getDerived().getBaseEntity());
17027template<
typenameDerived>
17030 Expr*SizeExpr,
unsignedIndexTypeQuals,
SourceRangeBracketsRange) {
17031 returngetDerived().RebuildArrayType(ElementType, SizeMod, &Size, SizeExpr,
17032IndexTypeQuals, BracketsRange);
17035template<
typenameDerived>
17039 returngetDerived().RebuildArrayType(ElementType, SizeMod,
nullptr,
nullptr,
17040IndexTypeQuals, BracketsRange);
17043template<
typenameDerived>
17046 unsignedIndexTypeQuals,
SourceRangeBracketsRange) {
17047 returngetDerived().RebuildArrayType(ElementType, SizeMod,
nullptr,
17049IndexTypeQuals, BracketsRange);
17052template<
typenameDerived>
17055 unsignedIndexTypeQuals,
SourceRangeBracketsRange) {
17056 returngetDerived().RebuildArrayType(ElementType, SizeMod,
nullptr,
17058IndexTypeQuals, BracketsRange);
17061template<
typenameDerived>
17068template<
typenameDerived>
17070 unsignedNumElements,
17076template<
typenameDerived>
17080 returnSemaRef.
BuildVectorType(ElementType, SizeExpr, AttributeLoc);
17083template<
typenameDerived>
17085 unsignedNumElements,
17088NumElements,
true);
17095template<
typenameDerived>
17103template<
typenameDerived>
17105 QualTypeElementType,
unsignedNumRows,
unsignedNumColumns) {
17110template<
typenameDerived>
17118template<
typenameDerived>
17123getDerived().getBaseLocation(),
17124getDerived().getBaseEntity(),
17128template<
typenameDerived>
17133template<
typenameDerived>
17136assert(
D&&
"no decl found");
17140 if(
auto*UPD = dyn_cast<UsingPackDecl>(
D)) {
17144 if(UPD->expansions().empty()) {
17145getSema().Diag(
Loc, diag::err_using_pack_expansion_empty)
17146<< UPD->isCXXClassMember() << UPD;
17155 for(
auto*
E: UPD->expansions()) {
17156 QualTypeThisT = RebuildUnresolvedUsingType(
Loc,
E);
17161 else if(
T.isNull())
17165 "mismatched resolved types in using pack expansion");
17167 return T.isNull() ? FallbackT :
T;
17168}
else if(
auto*Using = dyn_cast<UsingDecl>(
D)) {
17169assert(Using->hasTypename() &&
17170 "UnresolvedUsingTypenameDecl transformed to non-typename using");
17173assert(++Using->shadow_begin() == Using->shadow_end());
17182assert(isa<UnresolvedUsingTypenameDecl>(
D) &&
17183 "UnresolvedUsingTypenameDecl transformed to non-using decl");
17185cast<UnresolvedUsingTypenameDecl>(
D));
17189template<
typenameDerived>
17195template<
typenameDerived>
17201template<
typenameDerived>
17206template<
typenameDerived>
17212FullySubstituted, Expansions);
17215template<
typenameDerived>
17222template<
typenameDerived>
17230template<
typenameDerived>
17236template<
typenameDerived>
17244template<
typenameDerived>
17255template<
typenameDerived>
17261template<
typenameDerived>
17270template<
typenameDerived>
17278 boolAllowInjectedClassName) {
17282getSema().ActOnTemplateName(
nullptr, SS, TemplateKWLoc,
17285AllowInjectedClassName);
17286 returnTemplate.
get();
17289template<
typenameDerived>
17296 boolAllowInjectedClassName) {
17299 SourceLocationSymbolLocations[3] = { NameLoc, NameLoc, NameLoc };
17300Name.setOperatorFunctionId(NameLoc, Operator, SymbolLocations);
17302getSema().ActOnTemplateName(
17304 false, Template, AllowInjectedClassName);
17305 returnTemplate.
get();
17308template<
typenameDerived>
17313 boolisPostIncDec = Second && (Op == OO_PlusPlus || Op == OO_MinusMinus);
17319Opc,
First, Second);
17321 if(
Result.isInvalid())
17328 if(
Result.isInvalid())
17334 if(Op == OO_Subscript) {
17335 if(!
First->getType()->isOverloadableType() &&
17337 returngetSema().CreateBuiltinArraySubscriptExpr(
First, CalleeLoc, Second,
17339}
else if(Op == OO_Arrow) {
17342 if(
First->getType()->isDependentType())
17346}
else if(Second ==
nullptr|| isPostIncDec) {
17347 if(!
First->getType()->isOverloadableType() ||
17348(Op == OO_Amp && getSema().isQualifiedMemberAccess(
First))) {
17355 returngetSema().CreateBuiltinUnaryOp(OpLoc, Opc,
First);
17359!
First->getType()->isOverloadableType() &&
17366 if(
Result.isInvalid())
17374 if(!Second || isPostIncDec) {
17384 First, Second, RequiresADL);
17385 if(
Result.isInvalid())
17391template<
typenameDerived>
17406->template getAs<RecordType>())){
17409 Base, OperatorLoc, isArrow ? tok::arrow : tok::period, SS, ScopeType,
17410CCLoc, TildeLoc, Destroyed);
17422 if(!ScopeType->getType()->getAs<
TagType>()) {
17423getSema().Diag(ScopeType->getTypeLoc().getBeginLoc(),
17424diag::err_expected_class_or_namespace)
17425<< ScopeType->getType() << getSema().getLangOpts().CPlusPlus;
17433 returngetSema().BuildMemberReferenceExpr(
Base, BaseType,
17434OperatorLoc, isArrow,
17442template<
typenameDerived>
17450 for(
unsignedI = 0; I < NumParams; ++I) {
17451 if(I != ContextParamPos) {
17457Params.push_back(std::make_pair(StringRef(), QualType()));
17460getSema().ActOnCapturedRegionStart(
Loc,
nullptr,
17461S->getCapturedRegionKind(), Params);
17464Sema::CompoundScopeRAII CompoundScope(getSema());
17465Body = getDerived().TransformStmt(S->getCapturedStmt());
17468 if(Body.isInvalid()) {
17469getSema().ActOnCapturedRegionError();
17473 returngetSema().ActOnCapturedRegionEnd(Body.get());
17476template<
typenameDerived>
17478TreeTransform<Derived>::TransformSYCLKernelCallStmt(SYCLKernelCallStmt *S) {
17482llvm_unreachable(
"SYCL kernel call statement cannot appear in dependent " 17486template<
typenameDerived>
17487ExprResultTreeTransform<Derived>::TransformHLSLOutArgExpr(HLSLOutArgExpr *
E) {
17490 returngetDerived().TransformExpr(
E->getArgLValue());
static Decl::Kind getKind(const Decl *D)
Defines the C++ template declaration subclasses.
Defines the clang::Expr interface and subclasses for C++ expressions.
Defines Expressions and AST nodes for C++2a concepts.
llvm::MachO::Target Target
llvm::MachO::Record Record
This file defines OpenMP AST classes for clauses.
Defines some OpenMP-specific enums and functions.
This file declares semantic analysis for Objective-C.
This file declares semantic analysis for OpenACC constructs and clauses.
This file declares semantic analysis for OpenMP constructs and clauses.
This file declares semantic analysis for expressions involving.
This file declares semantic analysis for SYCL constructs.
Defines the Objective-C statement AST node classes.
This file defines OpenACC AST classes for statement-level contructs.
This file defines OpenMP AST classes for executable directives and clauses.
This file defines SYCL AST classes used to represent calls to SYCL kernels.
static QualType getPointeeType(const MemRegion *R)
QualType getUsingType(const UsingShadowDecl *Found, QualType Underlying) const
TranslationUnitDecl * getTranslationUnitDecl() const
unsigned getIntWidth(QualType T) const
QualType getAutoType(QualType DeducedType, AutoTypeKeyword Keyword, bool IsDependent, bool IsPack=false, ConceptDecl *TypeConstraintConcept=nullptr, ArrayRef< TemplateArgument > TypeConstraintArgs={}) const
C++11 deduced auto type.
QualType getDependentTemplateSpecializationType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier *NNS, const IdentifierInfo *Name, ArrayRef< TemplateArgumentLoc > Args) const
DeclarationNameTable DeclarationNames
QualType getAttributedType(attr::Kind attrKind, QualType modifiedType, QualType equivalentType, const Attr *attr=nullptr) const
QualType getFunctionNoProtoType(QualType ResultTy, const FunctionType::ExtInfo &Info) const
Return a K&R style C function type like 'int()'.
QualType getArrayParameterType(QualType Ty) const
Return the uniqued reference to a specified array parameter type from the original array type.
CanQualType getCanonicalType(QualType T) const
Return the canonical (structural) type corresponding to the specified potentially non-canonical type ...
bool hasSameType(QualType T1, QualType T2) const
Determine whether the given types T1 and T2 are equivalent.
TemplateName getQualifiedTemplateName(NestedNameSpecifier *NNS, bool TemplateKeyword, TemplateName Template) const
Retrieve the template name that represents a qualified template name such as std::vector.
QualType getVectorType(QualType VectorType, unsigned NumElts, VectorKind VecKind) const
Return the unique reference to a vector type of the specified element type and size.
QualType getSubstTemplateTypeParmType(QualType Replacement, Decl *AssociatedDecl, unsigned Index, std::optional< unsigned > PackIndex, SubstTemplateTypeParmTypeFlag Flag=SubstTemplateTypeParmTypeFlag::None) const
Retrieve a substitution-result type.
QualType getPointerType(QualType T) const
Return the uniqued reference to the type for a pointer to the specified type.
QualType getTypeDeclType(const TypeDecl *Decl, const TypeDecl *PrevDecl=nullptr) const
Return the unique reference to the type for the specified type declaration.
QualType getMacroQualifiedType(QualType UnderlyingTy, const IdentifierInfo *MacroII) const
QualType getDecayedType(QualType T) const
Return the uniqued reference to the decayed version of the given type.
QualType getBaseElementType(const ArrayType *VAT) const
Return the innermost element type of an array type.
QualType getDeducedTemplateSpecializationType(TemplateName Template, QualType DeducedType, bool IsDependent) const
C++17 deduced class template specialization type.
CanQualType UnsignedLongTy
TypeSourceInfo * getTrivialTypeSourceInfo(QualType T, SourceLocation Loc=SourceLocation()) const
Allocate a TypeSourceInfo where all locations have been initialized to a given location,...
CanQualType getSizeType() const
Return the unique type for "size_t" (C99 7.17), defined in <stddef.h>.
CanQualType PseudoObjectTy
QualType getQualifiedType(SplitQualType split) const
Un-split a SplitQualType.
QualType getElaboratedType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier *NNS, QualType NamedType, TagDecl *OwnedTagDecl=nullptr) const
QualType getObjCObjectPointerType(QualType OIT) const
Return a ObjCObjectPointerType type for the given ObjCObjectType.
QualType getPackExpansionType(QualType Pattern, std::optional< unsigned > NumExpansions, bool ExpectPackInType=true) const
Form a pack expansion type with the given pattern.
const ArrayType * getAsArrayType(QualType T) const
Type Query functions.
CanQualType UnsignedInt128Ty
CanQualType UnsignedCharTy
CanQualType UnsignedIntTy
CanQualType UnsignedLongLongTy
CanQualType UnsignedShortTy
QualType getDependentNameType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier *NNS, const IdentifierInfo *Name, QualType Canon=QualType()) const
TemplateName getSubstTemplateTemplateParmPack(const TemplateArgument &ArgPack, Decl *AssociatedDecl, unsigned Index, bool Final) const
QualType getHLSLAttributedResourceType(QualType Wrapped, QualType Contained, const HLSLAttributedResourceType::Attributes &Attrs)
QualType getAddrSpaceQualType(QualType T, LangAS AddressSpace) const
Return the uniqued reference to the type for an address space qualified type with the specified type ...
QualType getTypeOfType(QualType QT, TypeOfKind Kind) const
getTypeOfType - Unlike many "get<Type>" functions, we don't unique TypeOfType nodes.
QualType getConstantMatrixType(QualType ElementType, unsigned NumRows, unsigned NumColumns) const
Return the unique reference to the matrix type of the specified element type and size.
An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent.
SourceLocation getRParenLoc() const
TypeLoc getValueLoc() const
SourceLocation getKWLoc() const
SourceLocation getLParenLoc() const
Attr - This represents one attribute.
attr::Kind getKind() const
Represents an attribute applied to a statement.
Represents a C++11 auto or C++14 decltype(auto) type, possibly constrained by a type-constraint.
ArrayRef< TemplateArgument > getTypeConstraintArguments() const
ConceptDecl * getTypeConstraintConcept() const
AutoTypeKeyword getKeyword() const
static OverloadedOperatorKind getOverloadedOperator(Opcode Opc)
Retrieve the overloaded operator kind that corresponds to the given binary opcode.
bool isAssignmentOp() const
static Opcode getOverloadedOpcode(OverloadedOperatorKind OO)
Retrieve the binary opcode that corresponds to the given overloaded operator.
void setIsVariadic(bool value)
Represents a C++2a __builtin_bit_cast(T, v) expression.
SourceLocation getEndLoc() const LLVM_READONLY
SourceLocation getBeginLoc() const LLVM_READONLY
Represents binding an expression to a temporary.
CXXCatchStmt - This represents a C++ catch block.
Represents a call to a C++ constructor.
SourceRange getParenOrBraceRange() const
Expr * getArg(unsigned Arg)
Return the specified argument.
bool isStdInitListInitialization() const
Whether this constructor call was written as list-initialization, but was interpreted as forming a st...
SourceLocation getEndLoc() const LLVM_READONLY
SourceLocation getBeginLoc() const LLVM_READONLY
bool isListInitialization() const
Whether this constructor call was written as list-initialization.
unsigned getNumArgs() const
Return the number of arguments to the constructor call.
Represents a C++ constructor within a class.
static CXXDefaultArgExpr * Create(const ASTContext &C, SourceLocation Loc, ParmVarDecl *Param, Expr *RewrittenExpr, DeclContext *UsedContext)
Represents a call to an inherited base class constructor from an inheriting constructor.
Abstract class common to all of the C++ "named"/"keyword" casts.
Represents a C++ struct/union/class.
unsigned getLambdaDependencyKind() const
An expression "T()" which creates an rvalue of a non-class type T.
Represents a C++ nested-name-specifier or a global scope specifier.
char * location_data() const
Retrieve the data associated with the source-location information.
SourceRange getRange() const
void MakeGlobal(ASTContext &Context, SourceLocation ColonColonLoc)
Turn this (empty) nested-name-specifier into the global nested-name-specifier '::'.
NestedNameSpecifierLoc getWithLocInContext(ASTContext &Context) const
Retrieve a nested-name-specifier with location information, copied into the given AST context.
NestedNameSpecifier * getScopeRep() const
Retrieve the representation of the nested-name-specifier.
unsigned location_size() const
Retrieve the size of the data associated with source-location information.
void MakeSuper(ASTContext &Context, CXXRecordDecl *RD, SourceLocation SuperLoc, SourceLocation ColonColonLoc)
Turns this (empty) nested-name-specifier into '__super' nested-name-specifier.
void Extend(ASTContext &Context, SourceLocation TemplateKWLoc, TypeLoc TL, SourceLocation ColonColonLoc)
Extend the current nested-name-specifier by another nested-name-specifier component of the form 'type...
void Adopt(NestedNameSpecifierLoc Other)
Adopt an existing nested-name-specifier (with source-range information).
Implicit construction of a std::initializer_list<T> object from an array temporary within list-initia...
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
static CallExpr * Create(const ASTContext &Ctx, Expr *Fn, ArrayRef< Expr * > Args, QualType Ty, ExprValueKind VK, SourceLocation RParenLoc, FPOptionsOverride FPFeatures, unsigned MinNumArgs=0, ADLCallKind UsesADL=NotADL)
Create a call expression.
Represents the body of a CapturedStmt, and serves as its DeclContext.
unsigned getNumParams() const
unsigned getContextParamPosition() const
ImplicitParamDecl * getParam(unsigned i) const
This captures a statement into a function.
SourceLocation getBegin() const
CompoundStmt - This represents a group of statements like { stmt stmt }.
Declaration of a C++20 concept.
static ConceptReference * Create(const ASTContext &C, NestedNameSpecifierLoc NNS, SourceLocation TemplateKWLoc, DeclarationNameInfo ConceptNameInfo, NamedDecl *FoundDecl, ConceptDecl *NamedConcept, const ASTTemplateArgumentListInfo *ArgsAsWritten)
const TypeClass * getTypePtr() const
static DeclAccessPair make(NamedDecl *D, AccessSpecifier AS)
The results of name lookup within a DeclContext.
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
lookup_result lookup(DeclarationName Name) const
lookup - Find the declarations (if any) with the given Name in this context.
void addDecl(Decl *D)
Add the declaration D into this context.
A reference to a declared variable, function, enum, etc.
DeclStmt - Adaptor class for mixing declarations with statements and expressions.
Decl - This represents one declaration (or definition), e.g.
SourceLocation getEndLoc() const LLVM_READONLY
bool isInvalidDecl() const
SourceLocation getLocation() const
DeclContext * getDeclContext()
AccessSpecifier getAccess() const
SourceLocation getBeginLoc() const LLVM_READONLY
The name of a declaration.
@ CXXConversionFunctionName
SourceLocation getInnerLocStart() const
Return start of source range ignoring outer template declarations.
TypeSourceInfo * getTypeSourceInfo() const
Information about one declarator, including the parsed type information and the identifier.
QualType getDeducedType() const
Get the type deduced for this placeholder type, or null if it has not been deduced.
A qualified reference to a name whose declaration cannot yet be resolved.
Represents a dependent template name that cannot be resolved prior to template instantiation.
void setQualifierLoc(NestedNameSpecifierLoc QualifierLoc)
unsigned getNumArgs() const
SourceLocation getTemplateNameLoc() const
SourceLocation getLAngleLoc() const
void setTemplateKeywordLoc(SourceLocation Loc)
SourceLocation getTemplateKeywordLoc() const
void setElaboratedKeywordLoc(SourceLocation Loc)
void setRAngleLoc(SourceLocation Loc)
SourceLocation getRAngleLoc() const
SourceLocation getElaboratedKeywordLoc() const
void setLAngleLoc(SourceLocation Loc)
void setArgLocInfo(unsigned i, TemplateArgumentLocInfo AI)
void setTemplateNameLoc(SourceLocation Loc)
Represents a template specialization type whose template cannot be resolved, e.g.
Designation - Represent a full designation, which is a sequence of designators.
static Designator CreateArrayRangeDesignator(Expr *Start, Expr *End, SourceLocation LBracketLoc, SourceLocation EllipsisLoc)
Creates a GNU array-range designator.
static Designator CreateArrayDesignator(Expr *Index, SourceLocation LBracketLoc)
Creates an array designator.
static Designator CreateFieldDesignator(const IdentifierInfo *FieldName, SourceLocation DotLoc, SourceLocation FieldLoc)
Creates a field designator.
bool hasErrorOccurred() const
Wrap a function effect's condition expression in another struct so that FunctionProtoType's TrailingO...
Expr * getCondition() const
SourceLocation getElaboratedKeywordLoc() const
NestedNameSpecifierLoc getQualifierLoc() const
void setElaboratedKeywordLoc(SourceLocation Loc)
TypeLoc getNamedTypeLoc() const
void setQualifierLoc(NestedNameSpecifierLoc QualifierLoc)
Represents a type that was referred to using an elaborated type keyword, e.g., struct S,...
RAII object that enters a new expression evaluation context.
TypeSourceInfo * getTypeInfoAsWritten() const
getTypeInfoAsWritten - Returns the type source info for the type that this expression is casting to.
This represents one expression.
bool isValueDependent() const
Determines whether the value of this expression depends on.
bool isTypeDependent() const
Determines whether the type of this expression depends on.
ExprObjectKind getObjectKind() const
getObjectKind - The object kind that this expression produces.
SourceLocation getExprLoc() const LLVM_READONLY
getExprLoc - Return the preferred location for the arrow when diagnosing a problem with a generic exp...
bool hasPlaceholderType() const
Returns whether this expression has a placeholder type.
static ExprValueKind getValueKindForType(QualType T)
getValueKindForType - Given a formal return or parameter type, give its value kind.
Represents difference between two FPOptions values.
Represents a member of a struct/union/class.
Represents a function declaration or definition.
QualType getReturnType() const
ArrayRef< ParmVarDecl * > parameters() const
QualType getCallResultType() const
Determine the type of an expression that calls this function.
Represents an abstract function effect, using just an enumeration describing its kind.
StringRef name() const
The description printed in diagnostics, e.g. 'nonblocking'.
Kind oppositeKind() const
Return the opposite kind, for effects which have opposites.
ArrayRef< EffectConditionExpr > conditions() const
Represents a K&R-style 'int foo()' function, which has no information available about its arguments.
Represents a prototype with parameter type info, e.g.
param_type_iterator param_type_begin() const
const ExtParameterInfo * getExtParameterInfosOrNull() const
Return a pointer to the beginning of the array of extra parameter information, if present,...
bool hasTrailingReturn() const
Whether this function prototype has a trailing return type.
ExtProtoInfo getExtProtoInfo() const
ArrayRef< QualType > getParamTypes() const
unsigned getNumParams() const
SourceLocation getLocalRangeEnd() const
void setLocalRangeBegin(SourceLocation L)
void setLParenLoc(SourceLocation Loc)
SourceRange getExceptionSpecRange() const
void setParam(unsigned i, ParmVarDecl *VD)
ArrayRef< ParmVarDecl * > getParams() const
void setRParenLoc(SourceLocation Loc)
void setLocalRangeEnd(SourceLocation L)
void setExceptionSpecRange(SourceRange R)
TypeLoc getReturnLoc() const
SourceLocation getLocalRangeBegin() const
SourceLocation getLParenLoc() const
SourceLocation getRParenLoc() const
Interesting information about a specific parameter that can't simply be reflected in parameter's type...
QualType getReturnType() const
AssociationTy< false > Association
One of these records is kept for each identifier that is lexed.
IdentifierInfo & get(StringRef Name)
Return the identifier token info for the specified named identifier.
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Represents an implicitly-generated value initialization of an object of a given type.
const TypeClass * getTypePtr() const
static IntegerLiteral * Create(const ASTContext &C, const llvm::APInt &V, QualType type, SourceLocation l)
Returns a new integer literal with value 'V' and type 'type'.
Represents the declaration of a label.
Describes the capture of a variable or of this, or of a C++1y init-capture.
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
const LambdaCapture * capture_iterator
An iterator that walks over the captures of the lambda, both implicit and explicit.
Represents the results of name lookup.
@ FoundOverloaded
Name lookup found a set of overloaded functions that met the criteria.
@ FoundUnresolvedValue
Name lookup found an unresolvable value declaration and cannot yet complete.
@ Ambiguous
Name lookup results in an ambiguity; use getAmbiguityKind to figure out what kind of ambiguity we hav...
@ NotFound
No entity found met the criteria.
@ NotFoundInCurrentInstantiation
No entity found met the criteria within the current instantiation,, but there were dependent base cla...
@ Found
Name lookup found a single declaration that met the criteria.
LLVM_ATTRIBUTE_REINITIALIZES void clear()
Clears out any current state.
void addDecl(NamedDecl *D)
Add a declaration to these results with its natural access.
bool empty() const
Return true if no decls were found.
void resolveKind()
Resolves the result kind of the lookup, possibly hiding decls.
SourceLocation getNameLoc() const
Gets the location of the identifier.
NamedDecl * getRepresentativeDecl() const
Fetches a representative decl. Useful for lazy diagnostics.
DeclarationName getLookupName() const
Gets the name to look up.
Represents a prvalue temporary that is written into memory so that a reference can bind to it.
This represents a decl that may have a name.
NamedDecl * getUnderlyingDecl()
Looks through UsingDecls and ObjCCompatibleAliasDecls for the underlying named decl.
IdentifierInfo * getIdentifier() const
Get the identifier that names this declaration, if there is one.
StringRef getName() const
Get the name of identifier for this declaration as a StringRef.
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
Represents a C++ namespace alias.
Represent a C++ namespace.
A C++ nested-name-specifier augmented with source location information.
SourceLocation getBeginLoc() const
Retrieve the location of the beginning of this nested-name-specifier.
SourceLocation getLocalEndLoc() const
Retrieve the location of the end of this component of the nested-name-specifier.
SourceLocation getEndLoc() const
Retrieve the location of the end of this nested-name-specifier.
TypeLoc getTypeLoc() const
For a nested-name-specifier that refers to a type, retrieve the type with source-location information...
void * getOpaqueData() const
Retrieve the opaque pointer that refers to source-location data.
NestedNameSpecifier * getNestedNameSpecifier() const
Retrieve the nested-name-specifier to which this instance refers.
SourceLocation getLocalBeginLoc() const
Retrieve the location of the beginning of this component of the nested-name-specifier.
SourceRange getSourceRange() const LLVM_READONLY
Retrieve the source range covering the entirety of this nested-name-specifier.
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
CXXRecordDecl * getAsRecordDecl() const
Retrieve the record declaration stored in this nested name specifier.
bool isDependent() const
Whether this nested name specifier refers to a dependent type or not.
SpecifierKind getKind() const
Determine what kind of nested name specifier is stored.
NamespaceAliasDecl * getAsNamespaceAlias() const
Retrieve the namespace alias stored in this nested name specifier.
IdentifierInfo * getAsIdentifier() const
Retrieve the identifier stored in this nested name specifier.
@ NamespaceAlias
A namespace alias, stored as a NamespaceAliasDecl*.
@ TypeSpec
A type, stored as a Type*.
@ TypeSpecWithTemplate
A type that was preceded by the 'template' keyword, stored as a Type*.
@ Super
Microsoft's '__super' specifier, stored as a CXXRecordDecl* of the class it appeared in.
@ Identifier
An identifier, stored as an IdentifierInfo*.
@ Global
The global specifier '::'. There is no stored value.
@ Namespace
A namespace, stored as a NamespaceDecl*.
NamespaceDecl * getAsNamespace() const
Retrieve the namespace stored in this nested name specifier.
This is a basic class for representing single OpenMP clause.
This is a basic class for representing single OpenMP executable directive.
This represents clauses with a list of expressions that are mappable.
ObjCIvarDecl - Represents an ObjC instance variable.
@ SuperInstance
The receiver is the instance of the superclass object.
@ Instance
The receiver is an object instance.
@ SuperClass
The receiver is a superclass.
@ Class
The receiver is a class.
ObjCMethodDecl - Represents an instance or class method declaration.
bool isInstanceMethod() const
Represents one property declaration in an Objective-C interface.
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
Represents the declaration of an Objective-C type parameter.
@ Array
An index into an array.
@ Identifier
A field in a dependent type, known only by its name.
@ Base
An implicit indirection through a C++ base class, when the field found is in a base class.
Wrapper for void* pointer.
static OpaquePtr make(QualType P)
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class.
Expr * getSourceExpr() const
The source expression of an opaque value expression is the expression which originally generated the ...
static OpenACCAsyncClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, Expr *IntExpr, SourceLocation EndLoc)
static OpenACCAttachClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
static OpenACCAutoClause * Create(const ASTContext &Ctx, SourceLocation BeginLoc, SourceLocation EndLoc)
This is the base type for all OpenACC Clauses.
static OpenACCCollapseClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, bool HasForce, Expr *LoopCount, SourceLocation EndLoc)
static OpenACCCopyClause * Create(const ASTContext &C, OpenACCClauseKind Spelling, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
static OpenACCCopyInClause * Create(const ASTContext &C, OpenACCClauseKind Spelling, SourceLocation BeginLoc, SourceLocation LParenLoc, bool IsReadOnly, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
static OpenACCCopyOutClause * Create(const ASTContext &C, OpenACCClauseKind Spelling, SourceLocation BeginLoc, SourceLocation LParenLoc, bool IsZero, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
static OpenACCCreateClause * Create(const ASTContext &C, OpenACCClauseKind Spelling, SourceLocation BeginLoc, SourceLocation LParenLoc, bool IsZero, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
static OpenACCDefaultAsyncClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, Expr *IntExpr, SourceLocation EndLoc)
static OpenACCDefaultClause * Create(const ASTContext &C, OpenACCDefaultClauseKind K, SourceLocation BeginLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
static OpenACCDeleteClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
static OpenACCDetachClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
static OpenACCDeviceClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
static OpenACCDeviceNumClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, Expr *IntExpr, SourceLocation EndLoc)
static OpenACCDevicePtrClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
static OpenACCDeviceTypeClause * Create(const ASTContext &C, OpenACCClauseKind K, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< DeviceTypeArgument > Archs, SourceLocation EndLoc)
static OpenACCFinalizeClause * Create(const ASTContext &Ctx, SourceLocation BeginLoc, SourceLocation EndLoc)
static OpenACCFirstPrivateClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
static OpenACCHostClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
static OpenACCIfClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, Expr *ConditionExpr, SourceLocation EndLoc)
static OpenACCIfPresentClause * Create(const ASTContext &Ctx, SourceLocation BeginLoc, SourceLocation EndLoc)
static OpenACCIndependentClause * Create(const ASTContext &Ctx, SourceLocation BeginLoc, SourceLocation EndLoc)
static OpenACCNoCreateClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
static OpenACCNumGangsClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< Expr * > IntExprs, SourceLocation EndLoc)
static OpenACCNumWorkersClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, Expr *IntExpr, SourceLocation EndLoc)
static OpenACCPresentClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
static OpenACCPrivateClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
static OpenACCSelfClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, Expr *ConditionExpr, SourceLocation EndLoc)
static OpenACCSeqClause * Create(const ASTContext &Ctx, SourceLocation BeginLoc, SourceLocation EndLoc)
static OpenACCTileClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< Expr * > SizeExprs, SourceLocation EndLoc)
static OpenACCUseDeviceClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, ArrayRef< Expr * > VarList, SourceLocation EndLoc)
static OpenACCVectorClause * Create(const ASTContext &Ctx, SourceLocation BeginLoc, SourceLocation LParenLoc, Expr *IntExpr, SourceLocation EndLoc)
static OpenACCVectorLengthClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, Expr *IntExpr, SourceLocation EndLoc)
static OpenACCWaitClause * Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc, Expr *DevNumExpr, SourceLocation QueuesLoc, ArrayRef< Expr * > QueueIdExprs, SourceLocation EndLoc)
static OpenACCWorkerClause * Create(const ASTContext &Ctx, SourceLocation BeginLoc, SourceLocation LParenLoc, Expr *IntExpr, SourceLocation EndLoc)
A reference to an overloaded function set, either an UnresolvedLookupExpr or an UnresolvedMemberExpr.
bool hasExplicitTemplateArgs() const
Determines whether this expression had explicit template arguments.
SourceLocation getLAngleLoc() const
Retrieve the location of the left angle bracket starting the explicit template argument list followin...
SourceLocation getNameLoc() const
Gets the location of the name.
SourceLocation getTemplateKeywordLoc() const
Retrieve the location of the template keyword preceding this name, if any.
NestedNameSpecifierLoc getQualifierLoc() const
Fetches the nested-name qualifier with source-location information, if one was given.
TemplateArgumentLoc const * getTemplateArgs() const
llvm::iterator_range< decls_iterator > decls() const
unsigned getNumTemplateArgs() const
DeclarationName getName() const
Gets the name looked up.
SourceLocation getRAngleLoc() const
Retrieve the location of the right angle bracket ending the explicit template argument list following...
bool hasTemplateKeyword() const
Determines whether the name was preceded by the template keyword.
Represents a C++11 pack expansion that produces a sequence of expressions.
void setEllipsisLoc(SourceLocation Loc)
SourceLocation getEllipsisLoc() const
TypeLoc getPatternLoc() const
Represents a pack expansion of types.
std::optional< unsigned > getNumExpansions() const
Retrieve the number of expansions that this pack expansion will generate, if known.
ParenExpr - This represents a parenthesized expression, e.g.
SourceLocation getLParen() const
Get the location of the left parentheses '('.
SourceLocation getRParen() const
Get the location of the right parentheses ')'.
Represents a parameter to a function.
unsigned getFunctionScopeIndex() const
Returns the index of this parameter in its prototype or method scope.
void setScopeInfo(unsigned scopeDepth, unsigned parameterIndex)
static ParmVarDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, const IdentifierInfo *Id, QualType T, TypeSourceInfo *TInfo, StorageClass S, Expr *DefArg)
unsigned getFunctionScopeDepth() const
void setSigilLoc(SourceLocation Loc)
TypeLoc getPointeeLoc() const
SourceLocation getSigilLoc() const
PointerType - C99 6.7.5.1 - Pointer Declarators.
QualType getPointeeType() const
Stores the type being destroyed by a pseudo-destructor expression.
const IdentifierInfo * getIdentifier() const
SourceLocation getLocation() const
TypeSourceInfo * getTypeSourceInfo() const
A (possibly-)qualified type.
bool isNull() const
Return true if this QualType doesn't point to a type yet.
const Type * getTypePtr() const
Retrieves a pointer to the underlying (unqualified) type.
Qualifiers getQualifiers() const
Retrieve the set of qualifiers applied to this type.
QualType getUnqualifiedType() const
Retrieve the unqualified variant of the given type, removing as little sugar as possible.
Qualifiers getLocalQualifiers() const
Retrieve the set of qualifiers local to this particular QualType instance, not including any qualifie...
Represents a template name as written in source code.
Wrapper of type source information for a type with non-trivial direct qualifiers.
The collection of all-type qualifiers we support.
void removeObjCLifetime()
static Qualifiers fromCVRMask(unsigned CVR)
bool hasObjCLifetime() const
LangAS getAddressSpace() const
Represents a struct/union/class.
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...
Base for LValueReferenceType and RValueReferenceType.
QualType getPointeeTypeAsWritten() const
Represents the body of a requires-expression.
static RequiresExprBodyDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation StartLoc)
C++2a [expr.prim.req]: A requires-expression provides a concise way to express requirements on templa...
static RequiresExpr * Create(ASTContext &C, SourceLocation RequiresKWLoc, RequiresExprBodyDecl *Body, SourceLocation LParenLoc, ArrayRef< ParmVarDecl * > LocalParameters, SourceLocation RParenLoc, ArrayRef< concepts::Requirement * > Requirements, SourceLocation RBraceLoc)
static ResolvedUnexpandedPackExpr * Create(ASTContext &C, SourceLocation BeginLoc, QualType T, unsigned NumExprs)
static SEHFinallyStmt * Create(const ASTContext &C, SourceLocation FinallyLoc, Stmt *Block)
Represents a __leave statement.
Smart pointer class that efficiently represents Objective-C method names.
SemaDiagnosticBuilder Diag(SourceLocation Loc, unsigned DiagID, bool DeferHint=false)
Emit a diagnostic.
VarDecl * BuildObjCExceptionDecl(TypeSourceInfo *TInfo, QualType ExceptionType, SourceLocation StartLoc, SourceLocation IdLoc, const IdentifierInfo *Id, bool Invalid=false)
Build a type-check a new Objective-C exception variable declaration.
StmtResult ActOnObjCForCollectionStmt(SourceLocation ForColLoc, Stmt *First, Expr *collection, SourceLocation RParenLoc)
StmtResult FinishObjCForCollectionStmt(Stmt *ForCollection, Stmt *Body)
FinishObjCForCollectionStmt - Attach the body to a objective-C foreach statement.
ExprResult BuildObjCDictionaryLiteral(SourceRange SR, MutableArrayRef< ObjCDictionaryElement > Elements)
ExprResult BuildInstanceMessage(Expr *Receiver, QualType ReceiverType, SourceLocation SuperLoc, Selector Sel, ObjCMethodDecl *Method, SourceLocation LBracLoc, ArrayRef< SourceLocation > SelectorLocs, SourceLocation RBracLoc, MultiExprArg Args, bool isImplicit=false)
Build an Objective-C instance message expression.
QualType BuildObjCTypeParamType(const ObjCTypeParamDecl *Decl, SourceLocation ProtocolLAngleLoc, ArrayRef< ObjCProtocolDecl * > Protocols, ArrayRef< SourceLocation > ProtocolLocs, SourceLocation ProtocolRAngleLoc, bool FailOnError=false)
Build an Objective-C type parameter type.
ExprResult BuildClassMessage(TypeSourceInfo *ReceiverTypeInfo, QualType ReceiverType, SourceLocation SuperLoc, Selector Sel, ObjCMethodDecl *Method, SourceLocation LBracLoc, ArrayRef< SourceLocation > SelectorLocs, SourceLocation RBracLoc, MultiExprArg Args, bool isImplicit=false)
Build an Objective-C class message expression.
StmtResult ActOnObjCAtSynchronizedStmt(SourceLocation AtLoc, Expr *SynchExpr, Stmt *SynchBody)
ExprResult BuildObjCEncodeExpression(SourceLocation AtLoc, TypeSourceInfo *EncodedTypeInfo, SourceLocation RParenLoc)
ExprResult BuildObjCArrayLiteral(SourceRange SR, MultiExprArg Elements)
ExprResult BuildObjCBoxedExpr(SourceRange SR, Expr *ValueExpr)
BuildObjCBoxedExpr - builds an ObjCBoxedExpr AST node for the '@' prefixed parenthesized expression.
StmtResult ActOnObjCAtTryStmt(SourceLocation AtLoc, Stmt *Try, MultiStmtArg Catch, Stmt *Finally)
StmtResult ActOnObjCAtFinallyStmt(SourceLocation AtLoc, Stmt *Body)
StmtResult BuildObjCAtThrowStmt(SourceLocation AtLoc, Expr *Throw)
QualType BuildObjCObjectType(QualType BaseType, SourceLocation Loc, SourceLocation TypeArgsLAngleLoc, ArrayRef< TypeSourceInfo * > TypeArgs, SourceLocation TypeArgsRAngleLoc, SourceLocation ProtocolLAngleLoc, ArrayRef< ObjCProtocolDecl * > Protocols, ArrayRef< SourceLocation > ProtocolLocs, SourceLocation ProtocolRAngleLoc, bool FailOnError, bool Rebuilding)
Build an Objective-C object pointer type.
ExprResult ActOnObjCAtSynchronizedOperand(SourceLocation atLoc, Expr *operand)
ExprResult BuildObjCBridgedCast(SourceLocation LParenLoc, ObjCBridgeCastKind Kind, SourceLocation BridgeKeywordLoc, TypeSourceInfo *TSInfo, Expr *SubExpr)
StmtResult ActOnObjCAtCatchStmt(SourceLocation AtLoc, SourceLocation RParen, Decl *Parm, Stmt *Body)
StmtResult ActOnObjCAutoreleasePoolStmt(SourceLocation AtLoc, Stmt *Body)
ExprResult BuildObjCSubscriptExpression(SourceLocation RB, Expr *BaseExpr, Expr *IndexExpr, ObjCMethodDecl *getterMethod, ObjCMethodDecl *setterMethod)
Build an ObjC subscript pseudo-object expression, given that that's supported by the runtime.
ArrayRef< Expr * > getIntExprs()
ArrayRef< Expr * > getQueueIdExprs() const
OpenACCDirectiveKind getDirectiveKind() const
SourceLocation getEndLoc() const
void setLParenLoc(SourceLocation EndLoc)
void setConditionDetails(Expr *ConditionExpr)
void setCollapseDetails(bool IsForce, Expr *LoopCount)
OpenACCClauseKind getClauseKind() const
const Expr * getConditionExpr() const
SourceLocation getLParenLoc() const
SourceLocation getBeginLoc() const
void setDefaultDetails(OpenACCDefaultClauseKind DefKind)
SourceLocation getQueuesLoc() const
void setVarListDetails(ArrayRef< Expr * > VarList, bool IsReadOnly, bool IsZero)
Expr * getDevNumExpr() const
ArrayRef< Expr * > getVarList()
unsigned getNumIntExprs() const
void setWaitDetails(Expr *DevNum, SourceLocation QueuesLoc, llvm::SmallVector< Expr * > &&IntExprs)
void setEndLoc(SourceLocation EndLoc)
Expr * getLoopCount() const
void setIntExprDetails(ArrayRef< Expr * > IntExprs)
OpenACCDefaultClauseKind getDefaultClauseKind() const
void ActOnWhileStmt(SourceLocation WhileLoc)
ExprResult ActOnOpenACCAsteriskSizeExpr(SourceLocation AsteriskLoc)
void ActOnDoStmt(SourceLocation DoLoc)
void ActOnRangeForStmtBegin(SourceLocation ForLoc, const Stmt *OldRangeFor, const Stmt *RangeFor)
StmtResult ActOnEndStmtDirective(OpenACCDirectiveKind K, SourceLocation StartLoc, SourceLocation DirLoc, SourceLocation LParenLoc, SourceLocation MiscLoc, ArrayRef< Expr * > Exprs, OpenACCAtomicKind AK, SourceLocation RParenLoc, SourceLocation EndLoc, ArrayRef< OpenACCClause * > Clauses, StmtResult AssocStmt)
Called after the directive has been completely parsed, including the declaration group or associated ...
void ActOnForStmtEnd(SourceLocation ForLoc, StmtResult Body)
void ActOnForStmtBegin(SourceLocation ForLoc, const Stmt *First, const Stmt *Second, const Stmt *Third)
ExprResult ActOnArraySectionExpr(Expr *Base, SourceLocation LBLoc, Expr *LowerBound, SourceLocation ColonLocFirst, Expr *Length, SourceLocation RBLoc)
Checks and creates an Array Section used in an OpenACC construct/clause.
OMPClause * ActOnOpenMPNocontextClause(Expr *Condition, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'nocontext' clause.
OMPClause * ActOnOpenMPXDynCGroupMemClause(Expr *Size, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on a well-formed 'ompx_dyn_cgroup_mem' clause.
OMPClause * ActOnOpenMPSafelenClause(Expr *Length, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'safelen' clause.
OMPClause * ActOnOpenMPHoldsClause(Expr *E, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'holds' clause.
OMPClause * ActOnOpenMPDefaultClause(llvm::omp::DefaultKind Kind, SourceLocation KindLoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'default' clause.
OMPClause * ActOnOpenMPFilterClause(Expr *ThreadID, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'filter' clause.
OMPClause * ActOnOpenMPFullClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on well-form 'full' clauses.
OMPClause * ActOnOpenMPDetachClause(Expr *Evt, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'detach' clause.
OMPClause * ActOnOpenMPUseClause(Expr *InteropVar, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation VarLoc, SourceLocation EndLoc)
Called on well-formed 'use' clause.
OMPClause * ActOnOpenMPToClause(ArrayRef< OpenMPMotionModifierKind > MotionModifiers, ArrayRef< SourceLocation > MotionModifiersLoc, CXXScopeSpec &MapperIdScopeSpec, DeclarationNameInfo &MapperId, SourceLocation ColonLoc, ArrayRef< Expr * > VarList, const OMPVarListLocTy &Locs, ArrayRef< Expr * > UnresolvedMappers={})
Called on well-formed 'to' clause.
OMPClause * ActOnOpenMPPrivateClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'private' clause.
OMPClause * ActOnOpenMPOrderedClause(SourceLocation StartLoc, SourceLocation EndLoc, SourceLocation LParenLoc=SourceLocation(), Expr *NumForLoops=nullptr)
Called on well-formed 'ordered' clause.
OMPClause * ActOnOpenMPIsDevicePtrClause(ArrayRef< Expr * > VarList, const OMPVarListLocTy &Locs)
Called on well-formed 'is_device_ptr' clause.
OMPClause * ActOnOpenMPHasDeviceAddrClause(ArrayRef< Expr * > VarList, const OMPVarListLocTy &Locs)
Called on well-formed 'has_device_addr' clause.
OMPClause * ActOnOpenMPPartialClause(Expr *FactorExpr, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-form 'partial' clauses.
OMPClause * ActOnOpenMPLastprivateClause(ArrayRef< Expr * > VarList, OpenMPLastprivateModifier LPKind, SourceLocation LPKindLoc, SourceLocation ColonLoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'lastprivate' clause.
OMPClause * ActOnOpenMPFirstprivateClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'firstprivate' clause.
OMPClause * ActOnOpenMPPriorityClause(Expr *Priority, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'priority' clause.
OMPClause * ActOnOpenMPDistScheduleClause(OpenMPDistScheduleClauseKind Kind, Expr *ChunkSize, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation KindLoc, SourceLocation CommaLoc, SourceLocation EndLoc)
Called on well-formed 'dist_schedule' clause.
OMPClause * ActOnOpenMPPermutationClause(ArrayRef< Expr * > PermExprs, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-form 'permutation' clause after parsing its arguments.
OMPClause * ActOnOpenMPNontemporalClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'nontemporal' clause.
OMPClause * ActOnOpenMPFromClause(ArrayRef< OpenMPMotionModifierKind > MotionModifiers, ArrayRef< SourceLocation > MotionModifiersLoc, CXXScopeSpec &MapperIdScopeSpec, DeclarationNameInfo &MapperId, SourceLocation ColonLoc, ArrayRef< Expr * > VarList, const OMPVarListLocTy &Locs, ArrayRef< Expr * > UnresolvedMappers={})
Called on well-formed 'from' clause.
OMPClause * ActOnOpenMPBindClause(OpenMPBindClauseKind Kind, SourceLocation KindLoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on a well-formed 'bind' clause.
OMPClause * ActOnOpenMPThreadLimitClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'thread_limit' clause.
OMPClause * ActOnOpenMPSharedClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'shared' clause.
OMPClause * ActOnOpenMPCopyinClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'copyin' clause.
OMPClause * ActOnOpenMPDestroyClause(Expr *InteropVar, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation VarLoc, SourceLocation EndLoc)
Called on well-formed 'destroy' clause.
OMPClause * ActOnOpenMPAffinityClause(SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc, Expr *Modifier, ArrayRef< Expr * > Locators)
Called on well-formed 'affinity' clause.
OMPClause * ActOnOpenMPNumTeamsClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'num_teams' clause.
OMPClause * ActOnOpenMPDependClause(const OMPDependClause::DependDataTy &Data, Expr *DepModifier, ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'depend' clause.
OMPClause * ActOnOpenMPDoacrossClause(OpenMPDoacrossClauseModifier DepType, SourceLocation DepLoc, SourceLocation ColonLoc, ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'doacross' clause.
OMPClause * ActOnOpenMPGrainsizeClause(OpenMPGrainsizeClauseModifier Modifier, Expr *Size, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ModifierLoc, SourceLocation EndLoc)
Called on well-formed 'grainsize' clause.
ExprResult ActOnOMPArraySectionExpr(Expr *Base, SourceLocation LBLoc, Expr *LowerBound, SourceLocation ColonLocFirst, SourceLocation ColonLocSecond, Expr *Length, Expr *Stride, SourceLocation RBLoc)
ExprResult ActOnOMPIteratorExpr(Scope *S, SourceLocation IteratorKwLoc, SourceLocation LLoc, SourceLocation RLoc, ArrayRef< OMPIteratorData > Data)
OMPClause * ActOnOpenMPUsesAllocatorClause(SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< UsesAllocatorsData > Data)
Called on well-formed 'uses_allocators' clause.
OMPClause * ActOnOpenMPAllocatorClause(Expr *Allocator, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'allocator' clause.
OMPClause * ActOnOpenMPInclusiveClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'inclusive' clause.
OMPClause * ActOnOpenMPTaskReductionClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc, CXXScopeSpec &ReductionIdScopeSpec, const DeclarationNameInfo &ReductionId, ArrayRef< Expr * > UnresolvedReductions={})
Called on well-formed 'task_reduction' clause.
OMPClause * ActOnOpenMPOrderClause(OpenMPOrderClauseModifier Modifier, OpenMPOrderClauseKind Kind, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation MLoc, SourceLocation KindLoc, SourceLocation EndLoc)
Called on well-formed 'order' clause.
OMPClause * ActOnOpenMPReductionClause(ArrayRef< Expr * > VarList, OpenMPReductionClauseModifier Modifier, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ModifierLoc, SourceLocation ColonLoc, SourceLocation EndLoc, CXXScopeSpec &ReductionIdScopeSpec, const DeclarationNameInfo &ReductionId, ArrayRef< Expr * > UnresolvedReductions={})
Called on well-formed 'reduction' clause.
OMPClause * ActOnOpenMPSizesClause(ArrayRef< Expr * > SizeExprs, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-form 'sizes' clause.
OMPClause * ActOnOpenMPDeviceClause(OpenMPDeviceClauseModifier Modifier, Expr *Device, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ModifierLoc, SourceLocation EndLoc)
Called on well-formed 'device' clause.
OMPClause * ActOnOpenMPNumThreadsClause(Expr *NumThreads, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'num_threads' clause.
OMPClause * ActOnOpenMPInReductionClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc, CXXScopeSpec &ReductionIdScopeSpec, const DeclarationNameInfo &ReductionId, ArrayRef< Expr * > UnresolvedReductions={})
Called on well-formed 'in_reduction' clause.
OMPClause * ActOnOpenMPFlushClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'flush' pseudo clause.
StmtResult ActOnOpenMPExecutableDirective(OpenMPDirectiveKind Kind, const DeclarationNameInfo &DirName, OpenMPDirectiveKind CancelRegion, ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
OMPClause * ActOnOpenMPMessageClause(Expr *MS, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'message' clause.
OMPClause * ActOnOpenMPScheduleClause(OpenMPScheduleClauseModifier M1, OpenMPScheduleClauseModifier M2, OpenMPScheduleClauseKind Kind, Expr *ChunkSize, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation M1Loc, SourceLocation M2Loc, SourceLocation KindLoc, SourceLocation CommaLoc, SourceLocation EndLoc)
Called on well-formed 'schedule' clause.
OMPClause * ActOnOpenMPSimdlenClause(Expr *Length, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'simdlen' clause.
OMPClause * ActOnOpenMPUseDevicePtrClause(ArrayRef< Expr * > VarList, const OMPVarListLocTy &Locs)
Called on well-formed 'use_device_ptr' clause.
OMPClause * ActOnOpenMPProcBindClause(llvm::omp::ProcBindKind Kind, SourceLocation KindLoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'proc_bind' clause.
OMPClause * ActOnOpenMPXBareClause(SourceLocation StartLoc, SourceLocation EndLoc)
Called on a well-formed 'ompx_bare' clause.
StmtResult ActOnOpenMPInformationalDirective(OpenMPDirectiveKind Kind, const DeclarationNameInfo &DirName, ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Process an OpenMP informational directive.
StmtResult ActOnOpenMPCanonicalLoop(Stmt *AStmt)
Called for syntactical loops (ForStmt or CXXForRangeStmt) associated to an OpenMP loop directive.
OMPClause * ActOnOpenMPHintClause(Expr *Hint, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'hint' clause.
ExprResult ActOnOMPArrayShapingExpr(Expr *Base, SourceLocation LParenLoc, SourceLocation RParenLoc, ArrayRef< Expr * > Dims, ArrayRef< SourceRange > Brackets)
OMPClause * ActOnOpenMPAtClause(OpenMPAtClauseKind Kind, SourceLocation KindLoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'at' clause.
OMPClause * ActOnOpenMPInitClause(Expr *InteropVar, OMPInteropInfo &InteropInfo, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation VarLoc, SourceLocation EndLoc)
Called on well-formed 'init' clause.
OMPClause * ActOnOpenMPUseDeviceAddrClause(ArrayRef< Expr * > VarList, const OMPVarListLocTy &Locs)
Called on well-formed 'use_device_addr' clause.
OMPClause * ActOnOpenMPAllocateClause(Expr *Allocator, Expr *Alignment, OpenMPAllocateClauseModifier FirstModifier, SourceLocation FirstModifierLoc, OpenMPAllocateClauseModifier SecondModifier, SourceLocation SecondModifierLoc, ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation ColonLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'allocate' clause.
OMPClause * ActOnOpenMPFinalClause(Expr *Condition, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'final' clause.
OMPClause * ActOnOpenMPMapClause(Expr *IteratorModifier, ArrayRef< OpenMPMapModifierKind > MapTypeModifiers, ArrayRef< SourceLocation > MapTypeModifiersLoc, CXXScopeSpec &MapperIdScopeSpec, DeclarationNameInfo &MapperId, OpenMPMapClauseKind MapType, bool IsMapTypeImplicit, SourceLocation MapLoc, SourceLocation ColonLoc, ArrayRef< Expr * > VarList, const OMPVarListLocTy &Locs, bool NoDiagnose=false, ArrayRef< Expr * > UnresolvedMappers={})
Called on well-formed 'map' clause.
OMPClause * ActOnOpenMPNumTasksClause(OpenMPNumTasksClauseModifier Modifier, Expr *NumTasks, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ModifierLoc, SourceLocation EndLoc)
Called on well-formed 'num_tasks' clause.
OMPClause * ActOnOpenMPSeverityClause(OpenMPSeverityClauseKind Kind, SourceLocation KindLoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'severity' clause.
OMPClause * ActOnOpenMPLinearClause(ArrayRef< Expr * > VarList, Expr *Step, SourceLocation StartLoc, SourceLocation LParenLoc, OpenMPLinearClauseKind LinKind, SourceLocation LinLoc, SourceLocation ColonLoc, SourceLocation StepModifierLoc, SourceLocation EndLoc)
Called on well-formed 'linear' clause.
OMPClause * ActOnOpenMPDefaultmapClause(OpenMPDefaultmapClauseModifier M, OpenMPDefaultmapClauseKind Kind, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation MLoc, SourceLocation KindLoc, SourceLocation EndLoc)
Called on well-formed 'defaultmap' clause.
OMPClause * ActOnOpenMPAlignedClause(ArrayRef< Expr * > VarList, Expr *Alignment, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc)
Called on well-formed 'aligned' clause.
OMPClause * ActOnOpenMPDepobjClause(Expr *Depobj, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'depobj' pseudo clause.
OMPClause * ActOnOpenMPNovariantsClause(Expr *Condition, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'novariants' clause.
OMPClause * ActOnOpenMPCopyprivateClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'copyprivate' clause.
OMPClause * ActOnOpenMPCollapseClause(Expr *NumForLoops, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'collapse' clause.
OMPClause * ActOnOpenMPAlignClause(Expr *Alignment, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'align' clause.
OMPClause * ActOnOpenMPXAttributeClause(ArrayRef< const Attr * > Attrs, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on a well-formed 'ompx_attribute' clause.
OMPClause * ActOnOpenMPExclusiveClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Called on well-formed 'exclusive' clause.
OMPClause * ActOnOpenMPIfClause(OpenMPDirectiveKind NameModifier, Expr *Condition, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation NameModifierLoc, SourceLocation ColonLoc, SourceLocation EndLoc)
Called on well-formed 'if' clause.
ExprResult checkAssignment(Scope *S, SourceLocation OpLoc, BinaryOperatorKind Opcode, Expr *LHS, Expr *RHS)
Expr * recreateSyntacticForm(PseudoObjectExpr *E)
Given a pseudo-object expression, recreate what it looks like syntactically without the attendant Opa...
ExprResult checkRValue(Expr *E)
ExprResult BuildUniqueStableNameExpr(SourceLocation OpLoc, SourceLocation LParen, SourceLocation RParen, TypeSourceInfo *TSI)
RAII object used to change the argument pack substitution index within a Sema object.
RAII object used to temporarily allow the C++ 'this' expression to be used, with the given qualifiers...
A RAII object to enter scope of a compound statement.
A helper class for building up ExtParameterInfos.
const FunctionProtoType::ExtParameterInfo * getPointerOrNull(unsigned numParams)
Return a pointer (suitable for setting in an ExtProtoInfo) to the ExtParameterInfo array we've built ...
void set(unsigned index, FunctionProtoType::ExtParameterInfo info)
Set the ExtParameterInfo for the parameter at the given index,.
Records and restores the CurFPFeatures state on entry/exit of compound statements.
Sema - This implements semantic analysis and AST building for C.
QualType BuildParenType(QualType T)
Build a paren type including T.
ParsedType CreateParsedType(QualType T, TypeSourceInfo *TInfo)
Package the given type and TSI into a ParsedType.
QualType getCurrentThisType()
Try to retrieve the type of the 'this' pointer.
bool CheckSpecifiedExceptionType(QualType &T, SourceRange Range)
CheckSpecifiedExceptionType - Check if the given type is valid in an exception specification.
ExprResult BuildOperatorCoawaitCall(SourceLocation Loc, Expr *E, UnresolvedLookupExpr *Lookup)
Build a call to 'operator co_await' if there is a suitable operator for the given expression.
ExprResult BuildMemberReferenceExpr(Expr *Base, QualType BaseType, SourceLocation OpLoc, bool IsArrow, CXXScopeSpec &SS, SourceLocation TemplateKWLoc, NamedDecl *FirstQualifierInScope, const DeclarationNameInfo &NameInfo, const TemplateArgumentListInfo *TemplateArgs, const Scope *S, ActOnMemberAccessExtraArgs *ExtraArgs=nullptr)
StmtResult BuildMSDependentExistsStmt(SourceLocation KeywordLoc, bool IsIfExists, NestedNameSpecifierLoc QualifierLoc, DeclarationNameInfo NameInfo, Stmt *Nested)
@ LookupOrdinaryName
Ordinary name lookup, which finds ordinary names (functions, variables, typedefs, etc....
@ LookupMemberName
Member name lookup, which finds the names of class/struct/union members.
@ LookupTagName
Tag name lookup, which finds the names of enums, classes, structs, and unions.
bool checkFinalSuspendNoThrow(const Stmt *FinalSuspend)
Check that the expression co_await promise.final_suspend() shall not be potentially-throwing.
QualType BuildAddressSpaceAttr(QualType &T, LangAS ASIdx, Expr *AddrSpace, SourceLocation AttrLoc)
BuildAddressSpaceAttr - Builds a DependentAddressSpaceType if an expression is uninstantiated.
ExprResult ActOnConstantExpression(ExprResult Res)
StmtResult ActOnMSAsmStmt(SourceLocation AsmLoc, SourceLocation LBraceLoc, ArrayRef< Token > AsmToks, StringRef AsmString, unsigned NumOutputs, unsigned NumInputs, ArrayRef< StringRef > Constraints, ArrayRef< StringRef > Clobbers, ArrayRef< Expr * > Exprs, SourceLocation EndLoc)
StmtResult BuildCoroutineBodyStmt(CoroutineBodyStmt::CtorArgs)
ExprResult BuildCoyieldExpr(SourceLocation KwLoc, Expr *E)
static std::enable_if_t< std::is_base_of_v< Attr, AttrInfo >, SourceLocation > getAttrLoc(const AttrInfo &AL)
A helper function to provide Attribute Location for the Attr types AND the ParsedAttr.
QualType BuildVectorType(QualType T, Expr *VecSize, SourceLocation AttrLoc)
StmtResult BuildAttributedStmt(SourceLocation AttrsLoc, ArrayRef< const Attr * > Attrs, Stmt *SubStmt)
@ IER_DoesNotExist
The symbol does not exist.
@ IER_Dependent
The name is a dependent name, so the results will differ from one instantiation to the next.
@ IER_Error
An error occurred.
@ IER_Exists
The symbol exists.
void ActOnStartStmtExpr()
ExprResult BuildLambdaExpr(SourceLocation StartLoc, SourceLocation EndLoc, sema::LambdaScopeInfo *LSI)
Complete a lambda-expression having processed and attached the lambda body.
void ActOnStmtExprError()
void MarkDeclarationsReferencedInExpr(Expr *E, bool SkipLocalVariables=false, ArrayRef< const Expr * > StopAt={})
Mark any declarations that appear within this expression or any potentially-evaluated subexpressions ...
std::optional< FunctionEffectMode > ActOnEffectExpression(Expr *CondExpr, StringRef AttributeName)
Try to parse the conditional expression attached to an effect attribute (e.g.
VarDecl * buildCoroutinePromise(SourceLocation Loc)
ExprResult CheckBooleanCondition(SourceLocation Loc, Expr *E, bool IsConstexpr=false)
CheckBooleanCondition - Diagnose problems involving the use of the given expression as a boolean cond...
@ Boolean
A boolean condition, from 'if', 'while', 'for', or 'do'.
@ Switch
An integral condition for a 'switch' statement.
@ ConstexprIf
A constant boolean condition from 'if constexpr'.
bool RequireCompleteDeclContext(CXXScopeSpec &SS, DeclContext *DC)
Require that the context specified by SS be complete.
ExprResult BuildBuiltinBitCastExpr(SourceLocation KWLoc, TypeSourceInfo *TSI, Expr *Operand, SourceLocation RParenLoc)
StmtResult ActOnGotoStmt(SourceLocation GotoLoc, SourceLocation LabelLoc, LabelDecl *TheDecl)
ExprResult MaybeBindToTemporary(Expr *E)
MaybeBindToTemporary - If the passed in expression has a record type with a non-trivial destructor,...
StmtResult BuildCoreturnStmt(SourceLocation KwLoc, Expr *E, bool IsImplicit=false)
ExprResult ActOnStartCXXMemberReference(Scope *S, Expr *Base, SourceLocation OpLoc, tok::TokenKind OpKind, ParsedType &ObjectType, bool &MayBePseudoDestructor)
ExprResult ActOnCaseExpr(SourceLocation CaseLoc, ExprResult Val)
QualType BuildExtVectorType(QualType T, Expr *ArraySize, SourceLocation AttrLoc)
Build an ext-vector type.
ExprResult ActOnDesignatedInitializer(Designation &Desig, SourceLocation EqualOrColonLoc, bool GNUSyntax, ExprResult Init)
ExprResult BuildStmtExpr(SourceLocation LPLoc, Stmt *SubStmt, SourceLocation RPLoc, unsigned TemplateDepth)
ExprResult BuildOverloadedArrowExpr(Scope *S, Expr *Base, SourceLocation OpLoc, bool *NoArrowOperatorFound=nullptr)
BuildOverloadedArrowExpr - Build a call to an overloaded operator-> (if one exists),...
ExprResult BuildResolvedCoawaitExpr(SourceLocation KwLoc, Expr *Operand, Expr *Awaiter, bool IsImplicit=false)
ExprResult BuildVAArgExpr(SourceLocation BuiltinLoc, Expr *E, TypeSourceInfo *TInfo, SourceLocation RPLoc)
ExprResult ActOnCXXDelete(SourceLocation StartLoc, bool UseGlobal, bool ArrayForm, Expr *Operand)
ActOnCXXDelete - Parsed a C++ 'delete' expression (C++ 5.3.5), as in:
ExprResult BuildCXXTypeId(QualType TypeInfoType, SourceLocation TypeidLoc, TypeSourceInfo *Operand, SourceLocation RParenLoc)
Build a C++ typeid expression with a type operand.
QualType BuildFunctionType(QualType T, MutableArrayRef< QualType > ParamTypes, SourceLocation Loc, DeclarationName Entity, const FunctionProtoType::ExtProtoInfo &EPI)
Build a function type.
ExprResult PerformMemberExprBaseConversion(Expr *Base, bool IsArrow)
Perform conversions on the LHS of a member access expression.
DiagnosticsEngine & getDiagnostics() const
concepts::TypeRequirement * BuildTypeRequirement(TypeSourceInfo *Type)
TypeSourceInfo * CheckPackExpansion(TypeSourceInfo *Pattern, SourceLocation EllipsisLoc, std::optional< unsigned > NumExpansions)
Construct a pack expansion type from the pattern of the pack expansion.
ExprResult BuildPackIndexingExpr(Expr *PackExpression, SourceLocation EllipsisLoc, Expr *IndexExpr, SourceLocation RSquareLoc, ArrayRef< Expr * > ExpandedExprs={}, bool FullySubstituted=false)
ParsedType getDestructorName(const IdentifierInfo &II, SourceLocation NameLoc, Scope *S, CXXScopeSpec &SS, ParsedType ObjectType, bool EnteringContext)
ASTContext & getASTContext() const
CXXDestructorDecl * LookupDestructor(CXXRecordDecl *Class)
Look for the destructor of the given class.
ExprResult BuildUnaryOp(Scope *S, SourceLocation OpLoc, UnaryOperatorKind Opc, Expr *Input, bool IsAfterAmp=false)
ExprResult BuildTemplateIdExpr(const CXXScopeSpec &SS, SourceLocation TemplateKWLoc, LookupResult &R, bool RequiresADL, const TemplateArgumentListInfo *TemplateArgs)
ExprResult CreateOverloadedBinOp(SourceLocation OpLoc, BinaryOperatorKind Opc, const UnresolvedSetImpl &Fns, Expr *LHS, Expr *RHS, bool RequiresADL=true, bool AllowRewrittenCandidates=true, FunctionDecl *DefaultedFn=nullptr)
Create a binary operation that may resolve to an overloaded operator.
StmtResult ActOnSEHTryBlock(bool IsCXXTry, SourceLocation TryLoc, Stmt *TryBlock, Stmt *Handler)
ExprResult ImpCastExprToType(Expr *E, QualType Type, CastKind CK, ExprValueKind VK=VK_PRValue, const CXXCastPath *BasePath=nullptr, CheckedConversionKind CCK=CheckedConversionKind::Implicit)
ImpCastExprToType - If Expr is not of type 'Type', insert an implicit cast.
ExprResult BuildPredefinedExpr(SourceLocation Loc, PredefinedIdentKind IK)
ExprResult BuildCompoundLiteralExpr(SourceLocation LParenLoc, TypeSourceInfo *TInfo, SourceLocation RParenLoc, Expr *LiteralExpr)
ExprResult ActOnAddrLabel(SourceLocation OpLoc, SourceLocation LabLoc, LabelDecl *TheDecl)
ActOnAddrLabel - Parse the GNU address of label extension: "&&foo".
ExprResult ActOnParenListExpr(SourceLocation L, SourceLocation R, MultiExprArg Val)
QualType BuildCountAttributedArrayOrPointerType(QualType WrappedTy, Expr *CountExpr, bool CountInBytes, bool OrNull)
ExprResult BuildCXXNew(SourceRange Range, bool UseGlobal, SourceLocation PlacementLParen, MultiExprArg PlacementArgs, SourceLocation PlacementRParen, SourceRange TypeIdParens, QualType AllocType, TypeSourceInfo *AllocTypeInfo, std::optional< Expr * > ArraySize, SourceRange DirectInitRange, Expr *Initializer)
bool isAcceptableTagRedeclaration(const TagDecl *Previous, TagTypeKind NewTag, bool isDefinition, SourceLocation NewTagLoc, const IdentifierInfo *Name)
Determine whether a tag with a given kind is acceptable as a redeclaration of the given tag declarati...
DeclRefExpr * BuildDeclRefExpr(ValueDecl *D, QualType Ty, ExprValueKind VK, SourceLocation Loc, const CXXScopeSpec *SS=nullptr)
QualType BuildBitIntType(bool IsUnsigned, Expr *BitWidth, SourceLocation Loc)
Build a bit-precise integer type.
ExprResult ActOnChooseExpr(SourceLocation BuiltinLoc, Expr *CondExpr, Expr *LHSExpr, Expr *RHSExpr, SourceLocation RPLoc)
ExprResult CreateGenericSelectionExpr(SourceLocation KeyLoc, SourceLocation DefaultLoc, SourceLocation RParenLoc, bool PredicateIsExpr, void *ControllingExprOrType, ArrayRef< TypeSourceInfo * > Types, ArrayRef< Expr * > Exprs)
ControllingExprOrType is either a TypeSourceInfo * or an Expr *.
QualType BuildQualifiedType(QualType T, SourceLocation Loc, Qualifiers Qs, const DeclSpec *DS=nullptr)
StmtResult ActOnFinishSwitchStmt(SourceLocation SwitchLoc, Stmt *Switch, Stmt *Body)
SourceLocation getLocForEndOfToken(SourceLocation Loc, unsigned Offset=0)
Calls Lexer::getLocForEndOfToken()
const LangOptions & getLangOpts() const
StmtResult ActOnWhileStmt(SourceLocation WhileLoc, SourceLocation LParenLoc, ConditionResult Cond, SourceLocation RParenLoc, Stmt *Body)
ExprResult BuildCXXFoldExpr(UnresolvedLookupExpr *Callee, SourceLocation LParenLoc, Expr *LHS, BinaryOperatorKind Operator, SourceLocation EllipsisLoc, Expr *RHS, SourceLocation RParenLoc, std::optional< unsigned > NumExpansions)
bool isPotentialImplicitMemberAccess(const CXXScopeSpec &SS, LookupResult &R, bool IsAddressOfOperand)
Check whether an expression might be an implicit class member access.
void collectUnexpandedParameterPacks(TemplateArgument Arg, SmallVectorImpl< UnexpandedParameterPack > &Unexpanded)
Collect the set of unexpanded parameter packs within the given template argument.
ExprResult BuildSourceLocExpr(SourceLocIdentKind Kind, QualType ResultTy, SourceLocation BuiltinLoc, SourceLocation RPLoc, DeclContext *ParentContext)
ExprResult BuildCXXTypeConstructExpr(TypeSourceInfo *Type, SourceLocation LParenLoc, MultiExprArg Exprs, SourceLocation RParenLoc, bool ListInitialization)
ExprResult BuildBuiltinOffsetOf(SourceLocation BuiltinLoc, TypeSourceInfo *TInfo, ArrayRef< OffsetOfComponent > Components, SourceLocation RParenLoc)
__builtin_offsetof(type, a.b[123][456].c)
sema::LambdaScopeInfo * getCurLambda(bool IgnoreNonLambdaCapturingScope=false)
Retrieve the current lambda scope info, if any.
ExprResult TemporaryMaterializationConversion(Expr *E)
If E is a prvalue denoting an unmaterialized temporary, materialize it as an xvalue.
ExprResult ConvertVectorExpr(Expr *E, TypeSourceInfo *TInfo, SourceLocation BuiltinLoc, SourceLocation RParenLoc)
ConvertVectorExpr - Handle __builtin_convertvector.
QualType CheckTypenameType(ElaboratedTypeKeyword Keyword, SourceLocation KeywordLoc, NestedNameSpecifierLoc QualifierLoc, const IdentifierInfo &II, SourceLocation IILoc, TypeSourceInfo **TSI, bool DeducedTSTContext)
ExprResult BuildTypeTrait(TypeTrait Kind, SourceLocation KWLoc, ArrayRef< TypeSourceInfo * > Args, SourceLocation RParenLoc)
DeclContext * getCurLexicalContext() const
ExprResult BuildUnresolvedCoawaitExpr(SourceLocation KwLoc, Expr *Operand, UnresolvedLookupExpr *Lookup)
NonTagKind getNonTagTypeDeclKind(const Decl *D, TagTypeKind TTK)
Given a non-tag type declaration, returns an enum useful for indicating what kind of non-tag type thi...
ExprResult BuildExpressionTrait(ExpressionTrait OET, SourceLocation KWLoc, Expr *Queried, SourceLocation RParen)
bool buildCoroutineParameterMoves(SourceLocation Loc)
ExprResult BuildCStyleCastExpr(SourceLocation LParenLoc, TypeSourceInfo *Ty, SourceLocation RParenLoc, Expr *Op)
ExprResult BuildCXXUuidof(QualType TypeInfoType, SourceLocation TypeidLoc, TypeSourceInfo *Operand, SourceLocation RParenLoc)
Build a Microsoft __uuidof expression with a type operand.
sema::FunctionScopeInfo * getCurFunction() const
DeclGroupPtrTy BuildDeclaratorGroup(MutableArrayRef< Decl * > Group)
BuildDeclaratorGroup - convert a list of declarations into a declaration group, performing any necess...
Expr * BuildCXXThisExpr(SourceLocation Loc, QualType Type, bool IsImplicit)
Build a CXXThisExpr and mark it referenced in the current context.
QualType BuildReferenceType(QualType T, bool LValueRef, SourceLocation Loc, DeclarationName Entity)
Build a reference type.
ExprResult CreateOverloadedUnaryOp(SourceLocation OpLoc, UnaryOperatorKind Opc, const UnresolvedSetImpl &Fns, Expr *input, bool RequiresADL=true)
Create a unary operation that may resolve to an overloaded operator.
int ArgumentPackSubstitutionIndex
The current index into pack expansion arguments that will be used for substitution of parameter packs...
ExprResult BuildDeclarationNameExpr(const CXXScopeSpec &SS, LookupResult &R, bool NeedsADL, bool AcceptInvalidDecl=false)
sema::BlockScopeInfo * getCurBlock()
Retrieve the current block, if any.
DeclContext * CurContext
CurContext - This is the current declaration context of parsing.
VarDecl * BuildExceptionDeclaration(Scope *S, TypeSourceInfo *TInfo, SourceLocation StartLoc, SourceLocation IdLoc, const IdentifierInfo *Id)
Perform semantic analysis for the variable declaration that occurs within a C++ catch clause,...
bool BuildCXXNestedNameSpecifier(Scope *S, NestedNameSpecInfo &IdInfo, bool EnteringContext, CXXScopeSpec &SS, NamedDecl *ScopeLookupResult, bool ErrorRecoveryLookup, bool *IsCorrectedToColon=nullptr, bool OnlyNamespace=false)
Build a new nested-name-specifier for "identifier::", as described by ActOnCXXNestedNameSpecifier.
void MarkDeclRefReferenced(DeclRefExpr *E, const Expr *Base=nullptr)
Perform reference-marking and odr-use handling for a DeclRefExpr.
ExprResult BuildCXXNoexceptExpr(SourceLocation KeyLoc, Expr *Operand, SourceLocation RParen)
ExprResult BuildQualifiedDeclarationNameExpr(CXXScopeSpec &SS, const DeclarationNameInfo &NameInfo, bool IsAddressOfOperand, TypeSourceInfo **RecoveryTSI=nullptr)
BuildQualifiedDeclarationNameExpr - Build a C++ qualified declaration name, generally during template...
StmtResult ActOnForStmt(SourceLocation ForLoc, SourceLocation LParenLoc, Stmt *First, ConditionResult Second, FullExprArg Third, SourceLocation RParenLoc, Stmt *Body)
StmtResult ActOnIndirectGotoStmt(SourceLocation GotoLoc, SourceLocation StarLoc, Expr *DestExp)
ExprResult ActOnParenExpr(SourceLocation L, SourceLocation R, Expr *E)
ExprResult CheckPlaceholderExpr(Expr *E)
Check for operands with placeholder types and complain if found.
ExprResult BuildCXXConstructExpr(SourceLocation ConstructLoc, QualType DeclInitType, NamedDecl *FoundDecl, CXXConstructorDecl *Constructor, MultiExprArg Exprs, bool HadMultipleCandidates, bool IsListInitialization, bool IsStdInitListInitialization, bool RequiresZeroInit, CXXConstructionKind ConstructKind, SourceRange ParenRange)
BuildCXXConstructExpr - Creates a complete call to a constructor, including handling of its default a...
NonTagKind
Common ways to introduce type names without a tag for use in diagnostics.
@ TryCapture_ExplicitByVal
@ TryCapture_ExplicitByRef
ExprResult BuildAsTypeExpr(Expr *E, QualType DestTy, SourceLocation BuiltinLoc, SourceLocation RParenLoc)
Create a new AsTypeExpr node (bitcast) from the arguments.
ExprResult BuildFieldReferenceExpr(Expr *BaseExpr, bool IsArrow, SourceLocation OpLoc, const CXXScopeSpec &SS, FieldDecl *Field, DeclAccessPair FoundDecl, const DeclarationNameInfo &MemberNameInfo)
bool CheckRebuiltStmtAttributes(ArrayRef< const Attr * > Attrs)
ExprResult ActOnConditionalOp(SourceLocation QuestionLoc, SourceLocation ColonLoc, Expr *CondExpr, Expr *LHSExpr, Expr *RHSExpr)
ActOnConditionalOp - Parse a ?: operation.
QualType BuildPackIndexingType(QualType Pattern, Expr *IndexExpr, SourceLocation Loc, SourceLocation EllipsisLoc, bool FullySubstituted=false, ArrayRef< QualType > Expansions={})
ExprResult BuildPossibleImplicitMemberExpr(const CXXScopeSpec &SS, SourceLocation TemplateKWLoc, LookupResult &R, const TemplateArgumentListInfo *TemplateArgs, const Scope *S)
Builds an expression which might be an implicit member expression.
DeclContext * computeDeclContext(QualType T)
Compute the DeclContext that is associated with the given type.
concepts::ExprRequirement * BuildExprRequirement(Expr *E, bool IsSatisfied, SourceLocation NoexceptLoc, concepts::ExprRequirement::ReturnTypeRequirement ReturnTypeRequirement)
QualType BuildAtomicType(QualType T, SourceLocation Loc)
QualType CheckTemplateIdType(TemplateName Template, SourceLocation TemplateLoc, TemplateArgumentListInfo &TemplateArgs)
void ActOnInitializerError(Decl *Dcl)
ActOnInitializerError - Given that there was an error parsing an initializer for the given declaratio...
bool diagnoseConflictingFunctionEffect(const FunctionEffectsRef &FX, const FunctionEffectWithCondition &EC, SourceLocation NewAttrLoc)
Warn and return true if adding a function effect to a set would create a conflict.
bool DiagnoseUseOfDecl(NamedDecl *D, ArrayRef< SourceLocation > Locs, const ObjCInterfaceDecl *UnknownObjCClass=nullptr, bool ObjCPropertyAccess=false, bool AvoidPartialAvailabilityChecks=false, ObjCInterfaceDecl *ClassReciever=nullptr, bool SkipTrailingRequiresClause=false)
Determine whether the use of this declaration is valid, and emit any corresponding diagnostics.
StmtResult BuildReturnStmt(SourceLocation ReturnLoc, Expr *RetValExp, bool AllowRecovery=false)
ExprResult BuildPseudoDestructorExpr(Expr *Base, SourceLocation OpLoc, tok::TokenKind OpKind, const CXXScopeSpec &SS, TypeSourceInfo *ScopeType, SourceLocation CCLoc, SourceLocation TildeLoc, PseudoDestructorTypeStorage DestroyedType)
QualType BuildPointerType(QualType T, SourceLocation Loc, DeclarationName Entity)
Build a pointer type.
StmtResult BuildCXXForRangeStmt(SourceLocation ForLoc, SourceLocation CoawaitLoc, Stmt *InitStmt, SourceLocation ColonLoc, Stmt *RangeDecl, Stmt *Begin, Stmt *End, Expr *Cond, Expr *Inc, Stmt *LoopVarDecl, SourceLocation RParenLoc, BuildForRangeKind Kind, ArrayRef< MaterializeTemporaryExpr * > LifetimeExtendTemps={})
BuildCXXForRangeStmt - Build or instantiate a C++11 for-range statement.
StmtResult ActOnDoStmt(SourceLocation DoLoc, Stmt *Body, SourceLocation WhileLoc, SourceLocation CondLParen, Expr *Cond, SourceLocation CondRParen)
StmtResult ActOnStartOfSwitchStmt(SourceLocation SwitchLoc, SourceLocation LParenLoc, Stmt *InitStmt, ConditionResult Cond, SourceLocation RParenLoc)
ExprResult BuildQualifiedTemplateIdExpr(CXXScopeSpec &SS, SourceLocation TemplateKWLoc, const DeclarationNameInfo &NameInfo, const TemplateArgumentListInfo *TemplateArgs, bool IsAddressOfOperand)
ExprResult BuiltinShuffleVector(CallExpr *TheCall)
BuiltinShuffleVector - Handle __builtin_shufflevector.
@ ConstantEvaluated
The current context is "potentially evaluated" in C++11 terms, but the expression is evaluated at com...
@ PotentiallyEvaluated
The current expression is potentially evaluated at run time, which means that code may be generated t...
@ Unevaluated
The current expression and its subexpressions occur within an unevaluated operand (C++11 [expr]p7),...
@ ImmediateFunctionContext
In addition of being constant evaluated, the current expression occurs in an immediate function conte...
QualType BuildDecltypeType(Expr *E, bool AsUnevaluated=true)
If AsUnevaluated is false, E is treated as though it were an evaluated context, such as when building...
QualType BuildUnaryTransformType(QualType BaseType, UTTKind UKind, SourceLocation Loc)
StmtResult ActOnSEHExceptBlock(SourceLocation Loc, Expr *FilterExpr, Stmt *Block)
ExprResult CreateUnaryExprOrTypeTraitExpr(TypeSourceInfo *TInfo, SourceLocation OpLoc, UnaryExprOrTypeTrait ExprKind, SourceRange R)
Build a sizeof or alignof expression given a type operand.
StmtResult ActOnDeclStmt(DeclGroupPtrTy Decl, SourceLocation StartLoc, SourceLocation EndLoc)
bool LookupQualifiedName(LookupResult &R, DeclContext *LookupCtx, bool InUnqualifiedLookup=false)
Perform qualified name lookup into a given context.
Expr * MaybeCreateExprWithCleanups(Expr *SubExpr)
MaybeCreateExprWithCleanups - If the current full-expression requires any cleanups,...
SmallVector< ExpressionEvaluationContextRecord, 8 > ExprEvalContexts
A stack of expression evaluation contexts.
ExprResult BuildEmptyCXXFoldExpr(SourceLocation EllipsisLoc, BinaryOperatorKind Operator)
ExprResult BuildCXXThrow(SourceLocation OpLoc, Expr *Ex, bool IsThrownVarInScope)
QualType BuildArrayType(QualType T, ArraySizeModifier ASM, Expr *ArraySize, unsigned Quals, SourceRange Brackets, DeclarationName Entity)
Build an array type.
ExprResult BuildCXXDefaultInitExpr(SourceLocation Loc, FieldDecl *Field)
QualType BuildReadPipeType(QualType T, SourceLocation Loc)
Build a Read-only Pipe type.
concepts::NestedRequirement * BuildNestedRequirement(Expr *E)
QualType BuildWritePipeType(QualType T, SourceLocation Loc)
Build a Write-only Pipe type.
@ BFRK_Rebuild
Instantiation or recovery rebuild of a for-range statement.
ExprResult CheckConceptTemplateId(const CXXScopeSpec &SS, SourceLocation TemplateKWLoc, const DeclarationNameInfo &ConceptNameInfo, NamedDecl *FoundDecl, ConceptDecl *NamedConcept, const TemplateArgumentListInfo *TemplateArgs)
void ActOnCaseStmtBody(Stmt *CaseStmt, Stmt *SubStmt)
ActOnCaseStmtBody - This installs a statement as the body of a case.
ExprResult ActOnBlockStmtExpr(SourceLocation CaretLoc, Stmt *Body, Scope *CurScope)
ActOnBlockStmtExpr - This is called when the body of a block statement literal was successfully compl...
QualType BuildTypeofExprType(Expr *E, TypeOfKind Kind)
ExprResult BuildArrayTypeTrait(ArrayTypeTrait ATT, SourceLocation KWLoc, TypeSourceInfo *TSInfo, Expr *DimExpr, SourceLocation RParen)
void MarkMemberReferenced(MemberExpr *E)
Perform reference-marking and odr-use handling for a MemberExpr.
ExprResult BuildCXXNamedCast(SourceLocation OpLoc, tok::TokenKind Kind, TypeSourceInfo *Ty, Expr *E, SourceRange AngleBrackets, SourceRange Parens)
void MarkFunctionReferenced(SourceLocation Loc, FunctionDecl *Func, bool MightBeOdrUse=true)
Mark a function referenced, and check whether it is odr-used (C++ [basic.def.odr]p2,...
QualType BuildMatrixType(QualType T, Expr *NumRows, Expr *NumColumns, SourceLocation AttrLoc)
ExprResult CreateRecoveryExpr(SourceLocation Begin, SourceLocation End, ArrayRef< Expr * > SubExprs, QualType T=QualType())
Attempts to produce a RecoveryExpr after some AST node cannot be created.
ExprResult BuildBinOp(Scope *S, SourceLocation OpLoc, BinaryOperatorKind Opc, Expr *LHSExpr, Expr *RHSExpr)
ExprResult PerformObjectMemberConversion(Expr *From, NestedNameSpecifier *Qualifier, NamedDecl *FoundDecl, NamedDecl *Member)
Cast a base object to a member's actual type.
StmtResult ActOnIfStmt(SourceLocation IfLoc, IfStatementKind StatementKind, SourceLocation LParenLoc, Stmt *InitStmt, ConditionResult Cond, SourceLocation RParenLoc, Stmt *ThenVal, SourceLocation ElseLoc, Stmt *ElseVal)
ExprResult BuildInitList(SourceLocation LBraceLoc, MultiExprArg InitArgList, SourceLocation RBraceLoc)
void ActOnBlockStart(SourceLocation CaretLoc, Scope *CurScope)
ActOnBlockStart - This callback is invoked when a block literal is started.
ExprResult ActOnArraySubscriptExpr(Scope *S, Expr *Base, SourceLocation LLoc, MultiExprArg ArgExprs, SourceLocation RLoc)
ExprResult CreateBuiltinBinOp(SourceLocation OpLoc, BinaryOperatorKind Opc, Expr *LHSExpr, Expr *RHSExpr)
CreateBuiltinBinOp - Creates a new built-in binary operation with operator Opc at location TokLoc.
ExprResult BuildAtomicExpr(SourceRange CallRange, SourceRange ExprRange, SourceLocation RParenLoc, MultiExprArg Args, AtomicExpr::AtomicOp Op, AtomicArgumentOrder ArgOrder=AtomicArgumentOrder::API)
ExprResult ActOnCallExpr(Scope *S, Expr *Fn, SourceLocation LParenLoc, MultiExprArg ArgExprs, SourceLocation RParenLoc, Expr *ExecConfig=nullptr)
ActOnCallExpr - Handle a call to Fn with the specified array of arguments.
static QualType GetTypeFromParser(ParsedType Ty, TypeSourceInfo **TInfo=nullptr)
static ConditionResult ConditionError()
StmtResult ActOnCompoundStmt(SourceLocation L, SourceLocation R, ArrayRef< Stmt * > Elts, bool isStmtExpr)
SemaPseudoObject & PseudoObject()
StmtResult ActOnLabelStmt(SourceLocation IdentLoc, LabelDecl *TheDecl, SourceLocation ColonLoc, Stmt *SubStmt)
StmtResult ActOnCXXTryBlock(SourceLocation TryLoc, Stmt *TryBlock, ArrayRef< Stmt * > Handlers)
ActOnCXXTryBlock - Takes a try compound-statement and a number of handlers and creates a try statemen...
StmtResult ActOnDefaultStmt(SourceLocation DefaultLoc, SourceLocation ColonLoc, Stmt *SubStmt, Scope *CurScope)
ExprResult HandleExprEvaluationContextForTypeof(Expr *E)
StmtResult ActOnCaseStmt(SourceLocation CaseLoc, ExprResult LHS, SourceLocation DotDotDotLoc, ExprResult RHS, SourceLocation ColonLoc)
QualType BuildMemberPointerType(QualType T, QualType Class, SourceLocation Loc, DeclarationName Entity)
Build a member pointer type T Class::*.
QualType BuildBlockPointerType(QualType T, SourceLocation Loc, DeclarationName Entity)
Build a block pointer type.
StmtResult FinishCXXForRangeStmt(Stmt *ForRange, Stmt *Body)
FinishCXXForRangeStmt - Attach the body to a C++0x for-range statement.
ExprResult ActOnFinishFullExpr(Expr *Expr, bool DiscardedValue)
ExprResult CreateBuiltinMatrixSubscriptExpr(Expr *Base, Expr *RowIdx, Expr *ColumnIdx, SourceLocation RBLoc)
StmtResult ActOnGCCAsmStmt(SourceLocation AsmLoc, bool IsSimple, bool IsVolatile, unsigned NumOutputs, unsigned NumInputs, IdentifierInfo **Names, MultiExprArg Constraints, MultiExprArg Exprs, Expr *AsmString, MultiExprArg Clobbers, unsigned NumLabels, SourceLocation RParenLoc)
static SizeOfPackExpr * Create(ASTContext &Context, SourceLocation OperatorLoc, NamedDecl *Pack, SourceLocation PackLoc, SourceLocation RParenLoc, std::optional< unsigned > Length=std::nullopt, ArrayRef< TemplateArgument > PartialArgs={})
static bool MayBeDependent(SourceLocIdentKind Kind)
Encodes a location in the source.
bool isValid() const
Return true if this is a valid SourceLocation object.
A trivial tuple used to represent a source range.
SourceLocation getEnd() const
SourceLocation getBegin() const
Stmt - This represents one statement.
SourceLocation getEndLoc() const LLVM_READONLY
StmtClass getStmtClass() const
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation tokens are not useful in isolation - they are low level value objects created/interpre...
SourceLocation getBeginLoc() const LLVM_READONLY
A structure for storing an already-substituted template template parameter pack.
Wrapper for substituted template type parameters.
Represents the declaration of a struct/union/class/enum.
A convenient class for passing around template argument information.
void setLAngleLoc(SourceLocation Loc)
void setRAngleLoc(SourceLocation Loc)
void addArgument(const TemplateArgumentLoc &Loc)
llvm::ArrayRef< TemplateArgumentLoc > arguments() const
const TemplateArgumentLoc * operator->() const
pointer(TemplateArgumentLoc Arg)
Simple iterator that traverses the template arguments in a container that provides a getArgLoc() memb...
TemplateArgumentLoc operator*() const
TemplateArgumentLocContainerIterator operator++(int)
friend bool operator!=(const TemplateArgumentLocContainerIterator &X, const TemplateArgumentLocContainerIterator &Y)
TemplateArgumentLocContainerIterator()
TemplateArgumentLoc value_type
TemplateArgumentLocContainerIterator(ArgLocContainer &Container, unsigned Index)
friend bool operator==(const TemplateArgumentLocContainerIterator &X, const TemplateArgumentLocContainerIterator &Y)
TemplateArgumentLocContainerIterator & operator++()
std::input_iterator_tag iterator_category
TemplateArgumentLoc reference
pointer operator->() const
const TemplateArgumentLoc * operator->() const
pointer(TemplateArgumentLoc Arg)
Iterator adaptor that invents template argument location information for each of the template argumen...
TemplateArgumentLocInventIterator & operator++()
pointer operator->() const
std::iterator_traits< InputIterator >::difference_type difference_type
reference operator*() const
TemplateArgumentLocInventIterator operator++(int)
friend bool operator==(const TemplateArgumentLocInventIterator &X, const TemplateArgumentLocInventIterator &Y)
TemplateArgumentLocInventIterator(TreeTransform< Derived > &Self, InputIterator Iter)
friend bool operator!=(const TemplateArgumentLocInventIterator &X, const TemplateArgumentLocInventIterator &Y)
std::input_iterator_tag iterator_category
TemplateArgumentLoc reference
TemplateArgumentLoc value_type
Location wrapper for a TemplateArgument.
const TemplateArgument & getArgument() const
SourceLocation getTemplateNameLoc() const
TypeSourceInfo * getTypeSourceInfo() const
SourceRange getSourceRange() const LLVM_READONLY
NestedNameSpecifierLoc getTemplateQualifierLoc() const
Expr * getSourceExpression() const
Represents a template argument.
Expr * getAsExpr() const
Retrieve the template argument as an expression.
QualType getNonTypeTemplateArgumentType() const
If this is a non-type template argument, get its type.
QualType getAsType() const
Retrieve the type for a type template argument.
llvm::APSInt getAsIntegral() const
Retrieve the template argument as an integral value.
TemplateName getAsTemplate() const
Retrieve the template name for a template name argument.
ValueDecl * getAsDecl() const
Retrieve the declaration for a declaration non-type template argument.
@ Declaration
The template argument is a declaration that was provided for a pointer, reference,...
@ Template
The template argument is a template name that was provided for a template template parameter.
@ StructuralValue
The template argument is a non-type template argument that can't be represented by the special-case D...
@ Pack
The template argument is actually a parameter pack.
@ TemplateExpansion
The template argument is a pack expansion of a template name that was provided for a template templat...
@ NullPtr
The template argument is a null pointer or null pointer to member that was provided for a non-type te...
@ Type
The template argument is a type.
@ Null
Represents an empty template argument, e.g., one that has not been deduced.
@ Integral
The template argument is an integral value stored in an llvm::APSInt that was provided for an integra...
@ Expression
The template argument is an expression, and we've not resolved it to one of the other forms yet,...
ArgKind getKind() const
Return the kind of stored template argument.
const APValue & getAsStructuralValue() const
Get the value of a StructuralValue.
The base class of all kinds of template declarations (e.g., class, function, etc.).
Represents a C++ template name within the type system.
bool isNull() const
Determine whether this template name is NULL.
DependentTemplateName * getAsDependentTemplateName() const
Retrieve the underlying dependent template name structure, if any.
Stores a list of template parameters for a TemplateDecl and its derived classes.
void setArgLocInfo(unsigned i, TemplateArgumentLocInfo AI)
void setTemplateKeywordLoc(SourceLocation Loc)
void setTemplateNameLoc(SourceLocation Loc)
void setLAngleLoc(SourceLocation Loc)
SourceLocation getTemplateNameLoc() const
void setRAngleLoc(SourceLocation Loc)
Represents a type template specialization; the template must be a class template, a type alias templa...
Wrapper for template type parameters.
The top declaration context.
RAII object that temporarily sets the base location and entity used for reporting diagnostics in type...
TemporaryBase(TreeTransform &Self, SourceLocation Location, DeclarationName Entity)
A semantic tree transformation that allows one to transform one abstract syntax tree into another.
ExprResult RebuildObjCAtSynchronizedOperand(SourceLocation atLoc, Expr *object)
Rebuild the operand to an Objective-C @synchronized statement.
OMPClause * RebuildOMPNontemporalClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build a new OpenMP 'nontemporal' clause.
StmtResult RebuildOpenACCDataConstruct(SourceLocation BeginLoc, SourceLocation DirLoc, SourceLocation EndLoc, ArrayRef< OpenACCClause * > Clauses, StmtResult StrBlock)
ExprResult TransformInitializer(Expr *Init, bool NotCopyInit)
Transform the given initializer.
StmtResult RebuildLabelStmt(SourceLocation IdentLoc, LabelDecl *L, SourceLocation ColonLoc, Stmt *SubStmt)
Build a new label statement.
StmtResult RebuildCoroutineBodyStmt(CoroutineBodyStmt::CtorArgs Args)
StmtResult RebuildObjCAutoreleasePoolStmt(SourceLocation AtLoc, Stmt *Body)
Build a new Objective-C @autoreleasepool statement.
OMPClause * RebuildOMPDistScheduleClause(OpenMPDistScheduleClauseKind Kind, Expr *ChunkSize, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation KindLoc, SourceLocation CommaLoc, SourceLocation EndLoc)
Build a new OpenMP 'dist_schedule' clause.
ExprResult RebuildUnaryOperator(SourceLocation OpLoc, UnaryOperatorKind Opc, Expr *SubExpr)
Build a new unary operator expression.
OMPClause * RebuildOMPProcBindClause(ProcBindKind Kind, SourceLocation KindKwLoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build a new OpenMP 'proc_bind' clause.
StmtResult RebuildOMPInformationalDirective(OpenMPDirectiveKind Kind, DeclarationNameInfo DirName, ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Build a new OpenMP informational directive.
ExprResult RebuildCXXDefaultInitExpr(SourceLocation Loc, FieldDecl *Field)
Build a new C++11 default-initialization expression.
OMPClause * RebuildOMPPriorityClause(Expr *Priority, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build a new OpenMP 'priority' clause.
StmtResult RebuildOpenACCSetConstruct(SourceLocation BeginLoc, SourceLocation DirLoc, SourceLocation EndLoc, ArrayRef< OpenACCClause * > Clauses)
ExprResult RebuildObjCEncodeExpr(SourceLocation AtLoc, TypeSourceInfo *EncodeTypeInfo, SourceLocation RParenLoc)
Build a new Objective-C @encode expression.
StmtResult RebuildOpenACCCombinedConstruct(OpenACCDirectiveKind K, SourceLocation BeginLoc, SourceLocation DirLoc, SourceLocation EndLoc, ArrayRef< OpenACCClause * > Clauses, StmtResult Loop)
StmtResult SkipLambdaBody(LambdaExpr *E, Stmt *Body)
Alternative implementation of TransformLambdaBody that skips transforming the body.
StmtResult RebuildOpenACCExitDataConstruct(SourceLocation BeginLoc, SourceLocation DirLoc, SourceLocation EndLoc, ArrayRef< OpenACCClause * > Clauses)
StmtResult RebuildOpenACCShutdownConstruct(SourceLocation BeginLoc, SourceLocation DirLoc, SourceLocation EndLoc, ArrayRef< OpenACCClause * > Clauses)
OMPClause * RebuildOMPAllocateClause(Expr *Allocate, Expr *Alignment, OpenMPAllocateClauseModifier FirstModifier, SourceLocation FirstModifierLoc, OpenMPAllocateClauseModifier SecondModifier, SourceLocation SecondModifierLoc, ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc)
Build a new OpenMP 'allocate' clause.
ExprResult RebuildObjCIsaExpr(Expr *BaseArg, SourceLocation IsaLoc, SourceLocation OpLoc, bool IsArrow)
Build a new Objective-C "isa" expression.
StmtResult RebuildObjCAtFinallyStmt(SourceLocation AtLoc, Stmt *Body)
Build a new Objective-C @finally statement.
SourceLocation getBaseLocation()
Returns the location of the entity being transformed, if that information was not available elsewhere...
ExprResult RebuildCallExpr(Expr *Callee, SourceLocation LParenLoc, MultiExprArg Args, SourceLocation RParenLoc, Expr *ExecConfig=nullptr)
Build a new call expression.
ExprResult RebuildObjCIvarRefExpr(Expr *BaseArg, ObjCIvarDecl *Ivar, SourceLocation IvarLoc, bool IsArrow, bool IsFreeIvar)
Build a new Objective-C ivar reference expression.
OMPClause * RebuildOMPAtClause(OpenMPAtClauseKind Kind, SourceLocation KwLoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build a new OpenMP 'at' clause.
StmtResult RebuildCoreturnStmt(SourceLocation CoreturnLoc, Expr *Result, bool IsImplicit)
Build a new co_return statement.
OMPClause * RebuildOMPInReductionClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc, CXXScopeSpec &ReductionIdScopeSpec, const DeclarationNameInfo &ReductionId, ArrayRef< Expr * > UnresolvedReductions)
Build a new OpenMP 'in_reduction' clause.
ExprResult RebuildCompoundLiteralExpr(SourceLocation LParenLoc, TypeSourceInfo *TInfo, SourceLocation RParenLoc, Expr *Init)
Build a new compound literal expression.
ExprResult TransformAddressOfOperand(Expr *E)
The operand of a unary address-of operator has special rules: it's allowed to refer to a non-static m...
ExprResult RebuildCXXThisExpr(SourceLocation ThisLoc, QualType ThisType, bool isImplicit)
Build a new C++ "this" expression.
ExprResult RebuildCXXTypeidExpr(QualType TypeInfoType, SourceLocation TypeidLoc, Expr *Operand, SourceLocation RParenLoc)
Build a new C++ typeid(expr) expression.
TreeTransform(Sema &SemaRef)
Initializes a new tree transformer.
QualType RebuildDependentTemplateSpecializationType(ElaboratedTypeKeyword Keyword, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, const IdentifierInfo *Name, SourceLocation NameLoc, TemplateArgumentListInfo &Args, bool AllowInjectedClassName)
Build a new typename type that refers to a template-id.
QualType RebuildDependentSizedMatrixType(QualType ElementType, Expr *RowExpr, Expr *ColumnExpr, SourceLocation AttributeLoc)
Build a new matrix type given the type and dependently-defined dimensions.
QualType RebuildUnaryTransformType(QualType BaseType, UnaryTransformType::UTTKind UKind, SourceLocation Loc)
Build a new unary transform type.
ExprResult RebuildObjCPropertyRefExpr(Expr *BaseArg, ObjCPropertyDecl *Property, SourceLocation PropertyLoc)
Build a new Objective-C property reference expression.
void InventTemplateArgumentLoc(const TemplateArgument &Arg, TemplateArgumentLoc &ArgLoc)
Fakes up a TemplateArgumentLoc for a given TemplateArgument.
OMPClause * RebuildOMPUseClause(Expr *InteropVar, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation VarLoc, SourceLocation EndLoc)
Build a new OpenMP 'use' clause.
StmtResult RebuildOpenACCEnterDataConstruct(SourceLocation BeginLoc, SourceLocation DirLoc, SourceLocation EndLoc, ArrayRef< OpenACCClause * > Clauses)
QualType TransformType(TypeLocBuilder &TLB, TypeLoc TL)
Transform the given type-with-location into a new type, collecting location information in the given ...
ExprResult RebuildCXXRewrittenBinaryOperator(SourceLocation OpLoc, BinaryOperatorKind Opcode, const UnresolvedSetImpl &UnqualLookups, Expr *LHS, Expr *RHS)
Build a new rewritten operator expression.
ExprResult TransformUnresolvedLookupExpr(UnresolvedLookupExpr *E, bool IsAddressOfOperand)
ExprResult RebuildSourceLocExpr(SourceLocIdentKind Kind, QualType ResultTy, SourceLocation BuiltinLoc, SourceLocation RPLoc, DeclContext *ParentContext)
Build a new expression representing a call to a source location builtin.
QualType RebuildEnumType(EnumDecl *Enum)
Build a new Enum type.
TemplateName RebuildTemplateName(const TemplateArgument &ArgPack, Decl *AssociatedDecl, unsigned Index, bool Final)
Build a new template name given a template template parameter pack and the.
ExprResult RebuildPackExpansion(Expr *Pattern, SourceLocation EllipsisLoc, std::optional< unsigned > NumExpansions)
Build a new expression pack expansion.
QualType TransformReferenceType(TypeLocBuilder &TLB, ReferenceTypeLoc TL)
Transforms a reference type.
OMPClause * RebuildOMPMessageClause(Expr *MS, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build a new OpenMP 'message' clause.
ExprResult RebuildCXXAddrspaceCastExpr(SourceLocation OpLoc, SourceLocation LAngleLoc, TypeSourceInfo *TInfo, SourceLocation RAngleLoc, SourceLocation LParenLoc, Expr *SubExpr, SourceLocation RParenLoc)
QualType RebuildTypeOfType(QualType Underlying, TypeOfKind Kind)
Build a new typeof(type) type.
ExprResult RebuildVAArgExpr(SourceLocation BuiltinLoc, Expr *SubExpr, TypeSourceInfo *TInfo, SourceLocation RParenLoc)
Build a new va_arg expression.
ExprResult RebuildCXXScalarValueInitExpr(TypeSourceInfo *TSInfo, SourceLocation LParenLoc, SourceLocation RParenLoc)
Build a new C++ zero-initialization expression.
StmtResult TransformCompoundStmt(CompoundStmt *S, bool IsStmtExpr)
OMPClause * RebuildOMPThreadLimitClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build a new OpenMP 'thread_limit' clause.
StmtResult RebuildSEHFinallyStmt(SourceLocation Loc, Stmt *Block)
OMPClause * RebuildOMPSimdlenClause(Expr *Len, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build a new OpenMP 'simdlen' clause.
StmtResult RebuildCXXTryStmt(SourceLocation TryLoc, Stmt *TryBlock, ArrayRef< Stmt * > Handlers)
Build a new C++ try statement.
StmtDiscardKind
The reason why the value of a statement is not discarded, if any.
ExprResult RebuildCoawaitExpr(SourceLocation CoawaitLoc, Expr *Operand, UnresolvedLookupExpr *OpCoawaitLookup, bool IsImplicit)
Build a new co_await expression.
bool TransformTemplateArguments(const TemplateArgumentLoc *Inputs, unsigned NumInputs, TemplateArgumentListInfo &Outputs, bool Uneval=false)
Transform the given set of template arguments.
ExprResult RebuildDesignatedInitExpr(Designation &Desig, MultiExprArg ArrayExprs, SourceLocation EqualOrColonLoc, bool GNUSyntax, Expr *Init)
Build a new designated initializer expression.
OMPClause * RebuildOMPSizesClause(ArrayRef< Expr * > Sizes, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
ExprResult RebuildPredefinedExpr(SourceLocation Loc, PredefinedIdentKind IK)
Build a new predefined expression.
QualType RebuildElaboratedType(SourceLocation KeywordLoc, ElaboratedTypeKeyword Keyword, NestedNameSpecifierLoc QualifierLoc, QualType Named)
Build a new qualified name type.
ExprResult RebuildCXXStaticCastExpr(SourceLocation OpLoc, SourceLocation LAngleLoc, TypeSourceInfo *TInfo, SourceLocation RAngleLoc, SourceLocation LParenLoc, Expr *SubExpr, SourceLocation RParenLoc)
Build a new C++ static_cast expression.
StmtResult RebuildForStmt(SourceLocation ForLoc, SourceLocation LParenLoc, Stmt *Init, Sema::ConditionResult Cond, Sema::FullExprArg Inc, SourceLocation RParenLoc, Stmt *Body)
Build a new for statement.
StmtResult RebuildMSDependentExistsStmt(SourceLocation KeywordLoc, bool IsIfExists, NestedNameSpecifierLoc QualifierLoc, DeclarationNameInfo NameInfo, Stmt *Nested)
Build a new C++0x range-based for statement.
ExprResult RebuildStmtExpr(SourceLocation LParenLoc, Stmt *SubStmt, SourceLocation RParenLoc, unsigned TemplateDepth)
Build a new GNU statement expression.
QualType RebuildDependentNameType(ElaboratedTypeKeyword Keyword, SourceLocation KeywordLoc, NestedNameSpecifierLoc QualifierLoc, const IdentifierInfo *Id, SourceLocation IdLoc, bool DeducedTSTContext)
Build a new typename type that refers to an identifier.
QualType RebuildTemplateSpecializationType(TemplateName Template, SourceLocation TemplateLoc, TemplateArgumentListInfo &Args)
Build a new template specialization type.
bool TryExpandParameterPacks(SourceLocation EllipsisLoc, SourceRange PatternRange, ArrayRef< UnexpandedParameterPack > Unexpanded, bool &ShouldExpand, bool &RetainExpansion, std::optional< unsigned > &NumExpansions)
Determine whether we should expand a pack expansion with the given set of parameter packs into separa...
Sema & getSema() const
Retrieves a reference to the semantic analysis object used for this tree transform.
ExprResult RebuildShuffleVectorExpr(SourceLocation BuiltinLoc, MultiExprArg SubExprs, SourceLocation RParenLoc)
Build a new shuffle vector expression.
QualType TransformType(QualType T)
Transforms the given type into another type.
OMPClause * RebuildOMPOrderClause(OpenMPOrderClauseKind Kind, SourceLocation KindKwLoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, OpenMPOrderClauseModifier Modifier, SourceLocation ModifierKwLoc)
Build a new OpenMP 'order' clause.
QualType RebuildReferenceType(QualType ReferentType, bool LValue, SourceLocation Sigil)
Build a new reference type given the type it references.
ExprResult TransformRequiresTypeParams(SourceLocation KWLoc, SourceLocation RBraceLoc, const RequiresExpr *RE, RequiresExprBodyDecl *Body, ArrayRef< ParmVarDecl * > Params, SmallVectorImpl< QualType > &PTypes, SmallVectorImpl< ParmVarDecl * > &TransParams, Sema::ExtParameterInfoBuilder &PInfos)
Transforms the parameters of a requires expresison into the given vectors.
ExprResult RebuildInitList(SourceLocation LBraceLoc, MultiExprArg Inits, SourceLocation RBraceLoc)
Build a new initializer list expression.
QualType RebuildObjCTypeParamType(const ObjCTypeParamDecl *Decl, SourceLocation ProtocolLAngleLoc, ArrayRef< ObjCProtocolDecl * > Protocols, ArrayRef< SourceLocation > ProtocolLocs, SourceLocation ProtocolRAngleLoc)
StmtResult RebuildObjCAtThrowStmt(SourceLocation AtLoc, Expr *Operand)
Build a new Objective-C @throw statement.
OMPClause * RebuildOMPTaskReductionClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc, CXXScopeSpec &ReductionIdScopeSpec, const DeclarationNameInfo &ReductionId, ArrayRef< Expr * > UnresolvedReductions)
Build a new OpenMP 'task_reduction' clause.
StmtResult RebuildOpenACCWaitConstruct(SourceLocation BeginLoc, SourceLocation DirLoc, SourceLocation LParenLoc, Expr *DevNumExpr, SourceLocation QueuesLoc, ArrayRef< Expr * > QueueIdExprs, SourceLocation RParenLoc, SourceLocation EndLoc, ArrayRef< OpenACCClause * > Clauses)
OMPClause * RebuildOMPCopyinClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build a new OpenMP 'copyin' clause.
QualType RebuildPipeType(QualType ValueType, SourceLocation KWLoc, bool isReadPipe)
Build a new pipe type given its value type.
StmtResult RebuildCaseStmt(SourceLocation CaseLoc, Expr *LHS, SourceLocation EllipsisLoc, Expr *RHS, SourceLocation ColonLoc)
Build a new case statement.
ExprResult RebuildTemplateIdExpr(const CXXScopeSpec &SS, SourceLocation TemplateKWLoc, LookupResult &R, bool RequiresADL, const TemplateArgumentListInfo *TemplateArgs)
Build a new template-id expression.
StmtResult RebuildCXXCatchStmt(SourceLocation CatchLoc, VarDecl *ExceptionDecl, Stmt *Handler)
Build a new C++ catch statement.
OMPClause * RebuildOMPDestroyClause(Expr *InteropVar, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation VarLoc, SourceLocation EndLoc)
Build a new OpenMP 'destroy' clause.
ExprResult RebuildUnaryExprOrTypeTrait(Expr *SubExpr, SourceLocation OpLoc, UnaryExprOrTypeTrait ExprKind, SourceRange R)
Build a new sizeof, alignof or vec step expression with an expression argument.
ExprResult RebuildAddrLabelExpr(SourceLocation AmpAmpLoc, SourceLocation LabelLoc, LabelDecl *Label)
Build a new address-of-label expression.
ExprResult RebuildCxxSubscriptExpr(Expr *Callee, SourceLocation LParenLoc, MultiExprArg Args, SourceLocation RParenLoc)
TemplateName TransformTemplateName(CXXScopeSpec &SS, TemplateName Name, SourceLocation NameLoc, QualType ObjectType=QualType(), NamedDecl *FirstQualifierInScope=nullptr, bool AllowInjectedClassName=false)
Transform the given template name.
OMPClause * RebuildOMPXBareClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build a new OpenMP 'ompx_bare' clause.
const Attr * TransformStmtAttr(const Stmt *OrigS, const Stmt *InstS, const Attr *A)
ExprResult RebuildConditionalOperator(Expr *Cond, SourceLocation QuestionLoc, Expr *LHS, SourceLocation ColonLoc, Expr *RHS)
Build a new conditional operator expression.
StmtResult FinishCXXForRangeStmt(Stmt *ForRange, Stmt *Body)
Attach body to a C++0x range-based for statement.
StmtResult RebuildOpenACCUpdateConstruct(SourceLocation BeginLoc, SourceLocation DirLoc, SourceLocation EndLoc, ArrayRef< OpenACCClause * > Clauses)
StmtResult RebuildObjCAtSynchronizedStmt(SourceLocation AtLoc, Expr *Object, Stmt *Body)
Build a new Objective-C @synchronized statement.
ExprResult RebuildOpenACCAsteriskSizeExpr(SourceLocation AsteriskLoc)
TemplateName RebuildTemplateName(CXXScopeSpec &SS, bool TemplateKW, TemplateDecl *Template)
Build a new template name given a nested name specifier, a flag indicating whether the "template" key...
OMPClause * RebuildOMPDeviceClause(OpenMPDeviceClauseModifier Modifier, Expr *Device, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ModifierLoc, SourceLocation EndLoc)
Build a new OpenMP 'device' clause.
QualType TransformDependentTemplateSpecializationType(TypeLocBuilder &TLB, DependentTemplateSpecializationTypeLoc TL, TemplateName Template, CXXScopeSpec &SS)
OMPClause * RebuildOMPHasDeviceAddrClause(ArrayRef< Expr * > VarList, const OMPVarListLocTy &Locs)
Build a new OpenMP 'has_device_addr' clause.
QualType RebuildDependentSizedExtVectorType(QualType ElementType, Expr *SizeExpr, SourceLocation AttributeLoc)
Build a new potentially dependently-sized extended vector type given the element type and number of e...
void RememberPartiallySubstitutedPack(TemplateArgument Arg)
"Remember" the partially-substituted pack template argument after performing an instantiation that mu...
Decl * TransformDefinition(SourceLocation Loc, Decl *D)
Transform the definition of the given declaration.
OMPClause * RebuildOMPFromClause(ArrayRef< OpenMPMotionModifierKind > MotionModifiers, ArrayRef< SourceLocation > MotionModifiersLoc, CXXScopeSpec &MapperIdScopeSpec, DeclarationNameInfo &MapperId, SourceLocation ColonLoc, ArrayRef< Expr * > VarList, const OMPVarListLocTy &Locs, ArrayRef< Expr * > UnresolvedMappers)
Build a new OpenMP 'from' clause.
ExprResult RebuildDependentCoawaitExpr(SourceLocation CoawaitLoc, Expr *Result, UnresolvedLookupExpr *Lookup)
Build a new co_await expression.
QualType RebuildTypedefType(TypedefNameDecl *Typedef)
Build a new typedef type.
StmtResult RebuildReturnStmt(SourceLocation ReturnLoc, Expr *Result)
Build a new return statement.
TemplateArgument ForgetPartiallySubstitutedPack()
"Forget" about the partially-substituted pack template argument, when performing an instantiation tha...
OMPClause * RebuildOMPNocontextClause(Expr *Condition, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build a new OpenMP 'nocontext' clause.
ExprResult RebuildCXXReinterpretCastExpr(SourceLocation OpLoc, SourceLocation LAngleLoc, TypeSourceInfo *TInfo, SourceLocation RAngleLoc, SourceLocation LParenLoc, Expr *SubExpr, SourceLocation RParenLoc)
Build a new C++ reinterpret_cast expression.
QualType RebuildVectorType(QualType ElementType, unsigned NumElements, VectorKind VecKind)
Build a new vector type given the element type and number of elements.
ExprResult RebuildOffsetOfExpr(SourceLocation OperatorLoc, TypeSourceInfo *Type, ArrayRef< Sema::OffsetOfComponent > Components, SourceLocation RParenLoc)
Build a new builtin offsetof expression.
QualType RebuildParenType(QualType InnerType)
Build a new parenthesized type.
QualType RebuildRecordType(RecordDecl *Record)
Build a new class/struct/union type.
static StmtResult Owned(Stmt *S)
OMPClause * RebuildOMPReductionClause(ArrayRef< Expr * > VarList, OpenMPReductionClauseModifier Modifier, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ModifierLoc, SourceLocation ColonLoc, SourceLocation EndLoc, CXXScopeSpec &ReductionIdScopeSpec, const DeclarationNameInfo &ReductionId, ArrayRef< Expr * > UnresolvedReductions)
Build a new OpenMP 'reduction' clause.
OMPClause * RebuildOMPPartialClause(Expr *Factor, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build a new OpenMP 'partial' clause.
OMPClause * RebuildOMPScheduleClause(OpenMPScheduleClauseModifier M1, OpenMPScheduleClauseModifier M2, OpenMPScheduleClauseKind Kind, Expr *ChunkSize, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation M1Loc, SourceLocation M2Loc, SourceLocation KindLoc, SourceLocation CommaLoc, SourceLocation EndLoc)
Build a new OpenMP 'schedule' clause.
StmtResult TransformLambdaBody(LambdaExpr *E, Stmt *Body)
Transform the body of a lambda-expression.
StmtResult RebuildSEHTryStmt(bool IsCXXTry, SourceLocation TryLoc, Stmt *TryBlock, Stmt *Handler)
OMPClause * RebuildOMPExclusiveClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build a new OpenMP 'exclusive' clause.
QualType RebuildDependentAddressSpaceType(QualType PointeeType, Expr *AddrSpaceExpr, SourceLocation AttributeLoc)
Build a new DependentAddressSpaceType or return the pointee type variable with the correct address sp...
StmtResult RebuildAttributedStmt(SourceLocation AttrLoc, ArrayRef< const Attr * > Attrs, Stmt *SubStmt)
Build a new attributed statement.
ExprResult RebuildConceptSpecializationExpr(NestedNameSpecifierLoc NNS, SourceLocation TemplateKWLoc, DeclarationNameInfo ConceptNameInfo, NamedDecl *FoundDecl, ConceptDecl *NamedConcept, TemplateArgumentListInfo *TALI)
Build a new Objective-C boxed expression.
OMPClause * RebuildOMPDefaultmapClause(OpenMPDefaultmapClauseModifier M, OpenMPDefaultmapClauseKind Kind, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation MLoc, SourceLocation KindLoc, SourceLocation EndLoc)
Build a new OpenMP 'defaultmap' clause.
StmtResult RebuildOpenACCLoopConstruct(SourceLocation BeginLoc, SourceLocation DirLoc, SourceLocation EndLoc, ArrayRef< OpenACCClause * > Clauses, StmtResult Loop)
ExprResult RebuildCXXDefaultArgExpr(SourceLocation Loc, ParmVarDecl *Param, Expr *RewrittenExpr)
Build a new C++ default-argument expression.
StmtResult RebuildWhileStmt(SourceLocation WhileLoc, SourceLocation LParenLoc, Sema::ConditionResult Cond, SourceLocation RParenLoc, Stmt *Body)
Build a new while statement.
OMPClause * RebuildOMPNumTeamsClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build a new OpenMP 'num_teams' clause.
ExprResult RebuildImplicitValueInitExpr(QualType T)
Build a new value-initialized expression.
ExprResult RebuildResolvedUnexpandedPackExpr(SourceLocation BeginLoc, QualType T, ArrayRef< Expr * > Exprs)
bool TransformFunctionTypeParams(SourceLocation Loc, ArrayRef< ParmVarDecl * > Params, const QualType *ParamTypes, const FunctionProtoType::ExtParameterInfo *ParamInfos, SmallVectorImpl< QualType > &PTypes, SmallVectorImpl< ParmVarDecl * > *PVars, Sema::ExtParameterInfoBuilder &PInfos, unsigned *LastParamTransformed)
Transforms the parameters of a function type into the given vectors.
StmtResult RebuildGCCAsmStmt(SourceLocation AsmLoc, bool IsSimple, bool IsVolatile, unsigned NumOutputs, unsigned NumInputs, IdentifierInfo **Names, MultiExprArg Constraints, MultiExprArg Exprs, Expr *AsmString, MultiExprArg Clobbers, unsigned NumLabels, SourceLocation RParenLoc)
Build a new inline asm statement.
StmtResult TransformOMPExecutableDirective(OMPExecutableDirective *S)
ExprResult RebuildObjCMessageExpr(Expr *Receiver, Selector Sel, ArrayRef< SourceLocation > SelectorLocs, ObjCMethodDecl *Method, SourceLocation LBracLoc, MultiExprArg Args, SourceLocation RBracLoc)
Build a new Objective-C instance message.
QualType TransformSubstTemplateTypeParmPackType(TypeLocBuilder &TLB, SubstTemplateTypeParmPackTypeLoc TL, bool SuppressObjCLifetime)
ExprResult RebuildDeclarationNameExpr(const CXXScopeSpec &SS, LookupResult &R, bool RequiresADL)
Build a new expression that references a declaration.
bool TransformExprs(Expr *const *Inputs, unsigned NumInputs, bool IsCall, SmallVectorImpl< Expr * > &Outputs, bool *ArgChanged=nullptr)
Transform the given list of expressions.
StmtResult TransformSEHHandler(Stmt *Handler)
NestedNameSpecifierLoc TransformNestedNameSpecifierLoc(NestedNameSpecifierLoc NNS, QualType ObjectType=QualType(), NamedDecl *FirstQualifierInScope=nullptr)
Transform the given nested-name-specifier with source-location information.
TemplateName RebuildTemplateName(CXXScopeSpec &SS, SourceLocation TemplateKWLoc, OverloadedOperatorKind Operator, SourceLocation NameLoc, QualType ObjectType, bool AllowInjectedClassName)
Build a new template name given a nested name specifier and the overloaded operator name that is refe...
StmtResult RebuildOpenACCHostDataConstruct(SourceLocation BeginLoc, SourceLocation DirLoc, SourceLocation EndLoc, ArrayRef< OpenACCClause * > Clauses, StmtResult StrBlock)
QualType RebuildDecltypeType(Expr *Underlying, SourceLocation Loc)
Build a new C++11 decltype type.
OMPClause * RebuildOMPUseDevicePtrClause(ArrayRef< Expr * > VarList, const OMPVarListLocTy &Locs)
Build a new OpenMP 'use_device_ptr' clause.
QualType TransformDependentTemplateSpecializationType(TypeLocBuilder &TLB, DependentTemplateSpecializationTypeLoc TL, NestedNameSpecifierLoc QualifierLoc)
void ExpandingFunctionParameterPack(ParmVarDecl *Pack)
Note to the derived class when a function parameter pack is being expanded.
void setBase(SourceLocation Loc, DeclarationName Entity)
Sets the "base" location and entity when that information is known based on another transformation.
concepts::TypeRequirement * TransformTypeRequirement(concepts::TypeRequirement *Req)
const Derived & getDerived() const
Retrieves a reference to the derived class.
ExprResult RebuildParenExpr(Expr *SubExpr, SourceLocation LParen, SourceLocation RParen)
Build a new expression in parentheses.
OMPClause * RebuildOMPNumThreadsClause(Expr *NumThreads, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build a new OpenMP 'num_threads' clause.
QualType RebuildBlockPointerType(QualType PointeeType, SourceLocation Sigil)
Build a new block pointer type given its pointee type.
ExprResult RebuildMemberExpr(Expr *Base, SourceLocation OpLoc, bool isArrow, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, const DeclarationNameInfo &MemberNameInfo, ValueDecl *Member, NamedDecl *FoundDecl, const TemplateArgumentListInfo *ExplicitTemplateArgs, NamedDecl *FirstQualifierInScope)
Build a new member access expression.
OMPClause * RebuildOMPSharedClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build a new OpenMP 'shared' clause.
ExprResult RebuildCXXConstructExpr(QualType T, SourceLocation Loc, CXXConstructorDecl *Constructor, bool IsElidable, MultiExprArg Args, bool HadMultipleCandidates, bool ListInitialization, bool StdInitListInitialization, bool RequiresZeroInit, CXXConstructionKind ConstructKind, SourceRange ParenRange)
Build a new object-construction expression.
bool TransformFunctionTypeParams(SourceLocation Loc, ArrayRef< ParmVarDecl * > Params, const QualType *ParamTypes, const FunctionProtoType::ExtParameterInfo *ParamInfos, SmallVectorImpl< QualType > &PTypes, SmallVectorImpl< ParmVarDecl * > *PVars, Sema::ExtParameterInfoBuilder &PInfos)
OMPClause * RebuildOMPLinearClause(ArrayRef< Expr * > VarList, Expr *Step, SourceLocation StartLoc, SourceLocation LParenLoc, OpenMPLinearClauseKind Modifier, SourceLocation ModifierLoc, SourceLocation ColonLoc, SourceLocation StepModifierLoc, SourceLocation EndLoc)
Build a new OpenMP 'linear' clause.
VarDecl * RebuildExceptionDecl(VarDecl *ExceptionDecl, TypeSourceInfo *Declarator, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id)
Build a new C++ exception declaration.
ExprResult RebuildCXXNoexceptExpr(SourceRange Range, Expr *Arg)
Build a new noexcept expression.
QualType RebuildFunctionProtoType(QualType T, MutableArrayRef< QualType > ParamTypes, const FunctionProtoType::ExtProtoInfo &EPI)
Build a new function type.
ExprResult RebuildObjCSubscriptRefExpr(SourceLocation RB, Expr *Base, Expr *Key, ObjCMethodDecl *getterMethod, ObjCMethodDecl *setterMethod)
ExprResult RebuildRecoveryExpr(SourceLocation BeginLoc, SourceLocation EndLoc, ArrayRef< Expr * > SubExprs, QualType Type)
ExprResult RebuildLambdaExpr(SourceLocation StartLoc, SourceLocation EndLoc, LambdaScopeInfo *LSI)
QualType RebuildIncompleteArrayType(QualType ElementType, ArraySizeModifier SizeMod, unsigned IndexTypeQuals, SourceRange BracketsRange)
Build a new incomplete array type given the element type, size modifier, and index type qualifiers.
TemplateArgumentLoc RebuildPackExpansion(TemplateArgumentLoc Pattern, SourceLocation EllipsisLoc, std::optional< unsigned > NumExpansions)
Build a new template argument pack expansion.
CXXRecordDecl::LambdaDependencyKind ComputeLambdaDependency(LambdaScopeInfo *LSI)
ExprResult RebuildPackIndexingExpr(SourceLocation EllipsisLoc, SourceLocation RSquareLoc, Expr *PackIdExpression, Expr *IndexExpr, ArrayRef< Expr * > ExpandedExprs, bool FullySubstituted=false)
StmtResult RebuildOpenACCInitConstruct(SourceLocation BeginLoc, SourceLocation DirLoc, SourceLocation EndLoc, ArrayRef< OpenACCClause * > Clauses)
ExprResult RebuildCXXFunctionalCastExpr(TypeSourceInfo *TInfo, SourceLocation LParenLoc, Expr *Sub, SourceLocation RParenLoc, bool ListInitialization)
Build a new C++ functional-style cast expression.
TypeSourceInfo * TransformType(TypeSourceInfo *DI)
Transforms the given type-with-location into a new type-with-location.
ExprResult RebuildObjCDictionaryLiteral(SourceRange Range, MutableArrayRef< ObjCDictionaryElement > Elements)
Build a new Objective-C dictionary literal.
StmtResult TransformStmt(Stmt *S, StmtDiscardKind SDK=SDK_Discarded)
Transform the given statement.
StmtResult RebuildIndirectGotoStmt(SourceLocation GotoLoc, SourceLocation StarLoc, Expr *Target)
Build a new indirect goto statement.
ExprResult RebuildExtVectorElementExpr(Expr *Base, SourceLocation OpLoc, bool IsArrow, SourceLocation AccessorLoc, IdentifierInfo &Accessor)
Build a new extended vector element access expression.
ExprResult RebuildParenListExpr(SourceLocation LParenLoc, MultiExprArg SubExprs, SourceLocation RParenLoc)
Build a new expression list in parentheses.
OMPClause * RebuildOMPAllocatorClause(Expr *A, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build a new OpenMP 'allocator' clause.
QualType RebuildDependentSizedArrayType(QualType ElementType, ArraySizeModifier SizeMod, Expr *SizeExpr, unsigned IndexTypeQuals, SourceRange BracketsRange)
Build a new dependent-sized array type given the element type, size modifier, size expression,...
NamedDecl * TransformFirstQualifierInScope(NamedDecl *D, SourceLocation Loc)
Transform the given declaration, which was the first part of a nested-name-specifier in a member acce...
OMPClause * RebuildOMPInclusiveClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build a new OpenMP 'inclusive' clause.
StmtResult TransformOMPInformationalDirective(OMPExecutableDirective *S)
This is mostly the same as above, but allows 'informational' class directives when rebuilding the stm...
concepts::ExprRequirement * RebuildExprRequirement(concepts::Requirement::SubstitutionDiagnostic *SubstDiag, bool IsSimple, SourceLocation NoexceptLoc, concepts::ExprRequirement::ReturnTypeRequirement Ret)
OMPClause * TransformOMPClause(OMPClause *S)
Transform the given statement.
QualType RebuildAtomicType(QualType ValueType, SourceLocation KWLoc)
Build a new atomic type given its value type.
ExprResult RebuildBinaryOperator(SourceLocation OpLoc, BinaryOperatorKind Opc, Expr *LHS, Expr *RHS)
Build a new binary operator expression.
ExprResult RebuildCStyleCastExpr(SourceLocation LParenLoc, TypeSourceInfo *TInfo, SourceLocation RParenLoc, Expr *SubExpr)
Build a new C-style cast expression.
OMPClause * RebuildOMPDefaultClause(DefaultKind Kind, SourceLocation KindKwLoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build a new OpenMP 'default' clause.
QualType RebuildObjCObjectPointerType(QualType PointeeType, SourceLocation Star)
Build a new Objective-C object pointer type given the pointee type.
ExprResult TransformExpr(Expr *E)
Transform the given expression.
bool AlreadyTransformed(QualType T)
Determine whether the given type T has already been transformed.
concepts::TypeRequirement * RebuildTypeRequirement(TypeSourceInfo *T)
ExprResult RebuildOMPIteratorExpr(SourceLocation IteratorKwLoc, SourceLocation LLoc, SourceLocation RLoc, ArrayRef< SemaOpenMP::OMPIteratorData > Data)
Build a new iterator expression.
ExprResult RebuildSYCLUniqueStableNameExpr(SourceLocation OpLoc, SourceLocation LParen, SourceLocation RParen, TypeSourceInfo *TSI)
OMPClause * RebuildOMPGrainsizeClause(OpenMPGrainsizeClauseModifier Modifier, Expr *Device, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ModifierLoc, SourceLocation EndLoc)
Build a new OpenMP 'grainsize' clause.
OMPClause * RebuildOMPXDynCGroupMemClause(Expr *Size, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build a new OpenMP 'ompx_dyn_cgroup_mem' clause.
bool TransformTemplateArguments(InputIterator First, InputIterator Last, TemplateArgumentListInfo &Outputs, bool Uneval=false)
Transform the given set of template arguments.
OMPClause * RebuildOMPCollapseClause(Expr *Num, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build a new OpenMP 'collapse' clause.
static ExprResult Owned(Expr *E)
ExprResult RebuildCXXUuidofExpr(QualType Type, SourceLocation TypeidLoc, Expr *Operand, SourceLocation RParenLoc)
Build a new C++ __uuidof(expr) expression.
OMPClause * RebuildOMPNumTasksClause(OpenMPNumTasksClauseModifier Modifier, Expr *NumTasks, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ModifierLoc, SourceLocation EndLoc)
Build a new OpenMP 'num_tasks' clause.
OMPClause * RebuildOMPDepobjClause(Expr *Depobj, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build a new OpenMP 'depobj' pseudo clause.
ExprResult RebuildChooseExpr(SourceLocation BuiltinLoc, Expr *Cond, Expr *LHS, Expr *RHS, SourceLocation RParenLoc)
Build a new __builtin_choose_expr expression.
OMPClause * RebuildOMPAlignClause(Expr *A, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build a new OpenMP 'align' clause.
ExprResult RebuildObjCMessageExpr(TypeSourceInfo *ReceiverTypeInfo, Selector Sel, ArrayRef< SourceLocation > SelectorLocs, ObjCMethodDecl *Method, SourceLocation LBracLoc, MultiExprArg Args, SourceLocation RBracLoc)
Build a new Objective-C class message.
bool TransformOverloadExprDecls(OverloadExpr *Old, bool RequiresADL, LookupResult &R)
Transform the set of declarations in an OverloadExpr.
ExprResult RebuildCXXTemporaryObjectExpr(TypeSourceInfo *TSInfo, SourceLocation LParenOrBraceLoc, MultiExprArg Args, SourceLocation RParenOrBraceLoc, bool ListInitialization)
Build a new object-construction expression.
StmtResult RebuildCXXForRangeStmt(SourceLocation ForLoc, SourceLocation CoawaitLoc, Stmt *Init, SourceLocation ColonLoc, Stmt *Range, Stmt *Begin, Stmt *End, Expr *Cond, Expr *Inc, Stmt *LoopVar, SourceLocation RParenLoc, ArrayRef< MaterializeTemporaryExpr * > LifetimeExtendTemps)
Build a new C++0x range-based for statement.
OMPClause * RebuildOMPOrderedClause(SourceLocation StartLoc, SourceLocation EndLoc, SourceLocation LParenLoc, Expr *Num)
Build a new OpenMP 'ordered' clause.
ExprResult RebuildCoyieldExpr(SourceLocation CoyieldLoc, Expr *Result)
Build a new co_yield expression.
QualType RebuildObjCObjectType(QualType BaseType, SourceLocation Loc, SourceLocation TypeArgsLAngleLoc, ArrayRef< TypeSourceInfo * > TypeArgs, SourceLocation TypeArgsRAngleLoc, SourceLocation ProtocolLAngleLoc, ArrayRef< ObjCProtocolDecl * > Protocols, ArrayRef< SourceLocation > ProtocolLocs, SourceLocation ProtocolRAngleLoc)
Build an Objective-C object type.
llvm::DenseMap< Decl *, Decl * > TransformedLocalDecls
The set of local declarations that have been transformed, for cases where we are forced to build new ...
OMPClause * RebuildOMPNovariantsClause(Expr *Condition, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build a new OpenMP 'novariants' clause.
StmtResult RebuildOpenACCComputeConstruct(OpenACCDirectiveKind K, SourceLocation BeginLoc, SourceLocation DirLoc, SourceLocation EndLoc, ArrayRef< OpenACCClause * > Clauses, StmtResult StrBlock)
ExprResult TransformCXXNamedCastExpr(CXXNamedCastExpr *E)
ExprResult RebuildCXXNewExpr(SourceLocation StartLoc, bool UseGlobal, SourceLocation PlacementLParen, MultiExprArg PlacementArgs, SourceLocation PlacementRParen, SourceRange TypeIdParens, QualType AllocatedType, TypeSourceInfo *AllocatedTypeInfo, std::optional< Expr * > ArraySize, SourceRange DirectInitRange, Expr *Initializer)
Build a new C++ "new" expression.
StmtResult RebuildObjCForCollectionStmt(SourceLocation ForLoc, Stmt *Element, Expr *Collection, SourceLocation RParenLoc, Stmt *Body)
Build a new Objective-C fast enumeration statement.
ExprResult RebuildDependentScopeDeclRefExpr(NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, const DeclarationNameInfo &NameInfo, const TemplateArgumentListInfo *TemplateArgs, bool IsAddressOfOperand, TypeSourceInfo **RecoveryTSI)
Build a new (previously unresolved) declaration reference expression.
StmtResult RebuildObjCAtTryStmt(SourceLocation AtLoc, Stmt *TryBody, MultiStmtArg CatchStmts, Stmt *Finally)
Build a new Objective-C @try statement.
DeclarationName getBaseEntity()
Returns the name of the entity being transformed, if that information was not available elsewhere in ...
ExprResult RebuildCXXUnresolvedConstructExpr(TypeSourceInfo *TSInfo, SourceLocation LParenLoc, MultiExprArg Args, SourceLocation RParenLoc, bool ListInitialization)
Build a new object-construction expression.
ExprResult RebuildSizeOfPackExpr(SourceLocation OperatorLoc, NamedDecl *Pack, SourceLocation PackLoc, SourceLocation RParenLoc, std::optional< unsigned > Length, ArrayRef< TemplateArgument > PartialArgs)
Build a new expression to compute the length of a parameter pack.
ExprResult RebuildCXXOperatorCallExpr(OverloadedOperatorKind Op, SourceLocation OpLoc, SourceLocation CalleeLoc, bool RequiresADL, const UnresolvedSetImpl &Functions, Expr *First, Expr *Second)
Build a new overloaded operator call expression.
OMPClause * RebuildOMPUseDeviceAddrClause(ArrayRef< Expr * > VarList, const OMPVarListLocTy &Locs)
Build a new OpenMP 'use_device_addr' clause.
QualType RebuildDependentBitIntType(bool IsUnsigned, Expr *NumBitsExpr, SourceLocation Loc)
Build a dependent bit-precise int given its value type.
OMPClause * RebuildOMPHintClause(Expr *Hint, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build a new OpenMP 'hint' clause.
Sema::ConditionResult TransformCondition(SourceLocation Loc, VarDecl *Var, Expr *Expr, Sema::ConditionKind Kind)
Transform the specified condition.
TemplateName RebuildTemplateName(CXXScopeSpec &SS, SourceLocation TemplateKWLoc, const IdentifierInfo &Name, SourceLocation NameLoc, QualType ObjectType, NamedDecl *FirstQualifierInScope, bool AllowInjectedClassName)
Build a new template name given a nested name specifier and the name that is referred to as a templat...
OMPClause * RebuildOMPSeverityClause(OpenMPSeverityClauseKind Kind, SourceLocation KwLoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build a new OpenMP 'severity' clause.
OMPClause * RebuildOMPFirstprivateClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build a new OpenMP 'firstprivate' clause.
StmtResult RebuildMSAsmStmt(SourceLocation AsmLoc, SourceLocation LBraceLoc, ArrayRef< Token > AsmToks, StringRef AsmString, unsigned NumOutputs, unsigned NumInputs, ArrayRef< StringRef > Constraints, ArrayRef< StringRef > Clobbers, ArrayRef< Expr * > Exprs, SourceLocation EndLoc)
Build a new MS style inline asm statement.
QualType TransformTemplateSpecializationType(TypeLocBuilder &TLB, TemplateSpecializationTypeLoc TL, TemplateName Template)
VarDecl * RebuildObjCExceptionDecl(VarDecl *ExceptionDecl, TypeSourceInfo *TInfo, QualType T)
Rebuild an Objective-C exception declaration.
concepts::NestedRequirement * TransformNestedRequirement(concepts::NestedRequirement *Req)
QualType RebuildConstantArrayType(QualType ElementType, ArraySizeModifier SizeMod, const llvm::APInt &Size, Expr *SizeExpr, unsigned IndexTypeQuals, SourceRange BracketsRange)
Build a new constant array type given the element type, size modifier, (known) size of the array,...
ExprResult RebuildOMPArrayShapingExpr(Expr *Base, SourceLocation LParenLoc, SourceLocation RParenLoc, ArrayRef< Expr * > Dims, ArrayRef< SourceRange > BracketsRanges)
Build a new array shaping expression.
ExprResult RebuildCXXDeleteExpr(SourceLocation StartLoc, bool IsGlobalDelete, bool IsArrayForm, Expr *Operand)
Build a new C++ "delete" expression.
bool TransformExceptionSpec(SourceLocation Loc, FunctionProtoType::ExceptionSpecInfo &ESI, SmallVectorImpl< QualType > &Exceptions, bool &Changed)
QualType RebuildUnresolvedUsingType(SourceLocation NameLoc, Decl *D)
Rebuild an unresolved typename type, given the decl that the UnresolvedUsingTypenameDecl was transfor...
ExprResult RebuildArrayTypeTrait(ArrayTypeTrait Trait, SourceLocation StartLoc, TypeSourceInfo *TSInfo, Expr *DimExpr, SourceLocation RParenLoc)
Build a new array type trait expression.
OMPClause * RebuildOMPIsDevicePtrClause(ArrayRef< Expr * > VarList, const OMPVarListLocTy &Locs)
Build a new OpenMP 'is_device_ptr' clause.
QualType RebuildMacroQualifiedType(QualType T, const IdentifierInfo *MacroII)
Build a new MacroDefined type.
concepts::NestedRequirement * RebuildNestedRequirement(Expr *Constraint)
ExprResult RebuildMatrixSubscriptExpr(Expr *Base, Expr *RowIdx, Expr *ColumnIdx, SourceLocation RBracketLoc)
Build a new matrix subscript expression.
ExprResult TransformParenDependentScopeDeclRefExpr(ParenExpr *PE, DependentScopeDeclRefExpr *DRE, bool IsAddressOfOperand, TypeSourceInfo **RecoveryTSI)
TemplateParameterList * TransformTemplateParameterList(TemplateParameterList *TPL)
QualType RebuildMemberPointerType(QualType PointeeType, QualType ClassType, SourceLocation Sigil)
Build a new member pointer type given the pointee type and the class type it refers into.
void transformAttrs(Decl *Old, Decl *New)
Transform the attributes associated with the given declaration and place them on the new declaration.
Decl * TransformDecl(SourceLocation Loc, Decl *D)
Transform the given declaration, which is referenced from a type or expression.
bool AlwaysRebuild()
Whether the transformation should always rebuild AST nodes, even if none of the children have changed...
ExprResult RebuildObjCMessageExpr(SourceLocation SuperLoc, Selector Sel, ArrayRef< SourceLocation > SelectorLocs, QualType SuperType, ObjCMethodDecl *Method, SourceLocation LBracLoc, MultiExprArg Args, SourceLocation RBracLoc)
Build a new Objective-C instance/class message to 'super'.
OMPClause * RebuildOMPLastprivateClause(ArrayRef< Expr * > VarList, OpenMPLastprivateModifier LPKind, SourceLocation LPKindLoc, SourceLocation ColonLoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build a new OpenMP 'lastprivate' clause.
QualType RebuildDependentVectorType(QualType ElementType, Expr *SizeExpr, SourceLocation AttributeLoc, VectorKind)
Build a new potentially dependently-sized extended vector type given the element type and number of e...
bool AllowSkippingCXXConstructExpr()
Wether CXXConstructExpr can be skipped when they are implicit.
OMPClause * RebuildOMPSafelenClause(Expr *Len, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build a new OpenMP 'safelen' clause.
StmtResult RebuildSwitchStmtStart(SourceLocation SwitchLoc, SourceLocation LParenLoc, Stmt *Init, Sema::ConditionResult Cond, SourceLocation RParenLoc)
Start building a new switch statement.
StmtResult RebuildDefaultStmt(SourceLocation DefaultLoc, SourceLocation ColonLoc, Stmt *SubStmt)
Build a new default statement.
StmtResult RebuildObjCAtCatchStmt(SourceLocation AtLoc, SourceLocation RParenLoc, VarDecl *Var, Stmt *Body)
Build a new Objective-C @catch statement.
OMPClause * RebuildOMPFilterClause(Expr *ThreadID, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build a new OpenMP 'filter' clause.
ExprResult RebuildCXXPseudoDestructorExpr(Expr *Base, SourceLocation OperatorLoc, bool isArrow, CXXScopeSpec &SS, TypeSourceInfo *ScopeType, SourceLocation CCLoc, SourceLocation TildeLoc, PseudoDestructorTypeStorage Destroyed)
Build a new pseudo-destructor expression.
QualType RebuildPackExpansionType(QualType Pattern, SourceRange PatternRange, SourceLocation EllipsisLoc, std::optional< unsigned > NumExpansions)
Build a new pack expansion type.
QualType RebuildBitIntType(bool IsUnsigned, unsigned NumBits, SourceLocation Loc)
Build a bit-precise int given its value type.
ExprResult RebuildObjCArrayLiteral(SourceRange Range, Expr **Elements, unsigned NumElements)
Build a new Objective-C array literal.
ExprResult RebuildCXXUuidofExpr(QualType Type, SourceLocation TypeidLoc, TypeSourceInfo *Operand, SourceLocation RParenLoc)
Build a new C++ __uuidof(type) expression.
ExprResult RebuildUnresolvedMemberExpr(Expr *BaseE, QualType BaseType, SourceLocation OperatorLoc, bool IsArrow, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, NamedDecl *FirstQualifierInScope, LookupResult &R, const TemplateArgumentListInfo *TemplateArgs)
Build a new member reference expression.
OMPClause * RebuildOMPBindClause(OpenMPBindClauseKind Kind, SourceLocation KindLoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build a new OpenMP 'bind' clause.
concepts::NestedRequirement * RebuildNestedRequirement(StringRef InvalidConstraintEntity, const ASTConstraintSatisfaction &Satisfaction)
OMPClause * RebuildOMPCopyprivateClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build a new OpenMP 'copyprivate' clause.
QualType RebuildAutoType(QualType Deduced, AutoTypeKeyword Keyword, ConceptDecl *TypeConstraintConcept, ArrayRef< TemplateArgument > TypeConstraintArgs)
Build a new C++11 auto type.
QualType RebuildVariableArrayType(QualType ElementType, ArraySizeModifier SizeMod, Expr *SizeExpr, unsigned IndexTypeQuals, SourceRange BracketsRange)
Build a new variable-length array type given the element type, size modifier, size expression,...
ExprResult RebuildCXXDynamicCastExpr(SourceLocation OpLoc, SourceLocation LAngleLoc, TypeSourceInfo *TInfo, SourceLocation RAngleLoc, SourceLocation LParenLoc, Expr *SubExpr, SourceLocation RParenLoc)
Build a new C++ dynamic_cast expression.
ExprResult RebuildGenericSelectionExpr(SourceLocation KeyLoc, SourceLocation DefaultLoc, SourceLocation RParenLoc, TypeSourceInfo *ControllingType, ArrayRef< TypeSourceInfo * > Types, ArrayRef< Expr * > Exprs)
Build a new generic selection expression with a type predicate.
QualType RebuildPointerType(QualType PointeeType, SourceLocation Sigil)
Build a new pointer type given its pointee type.
concepts::TypeRequirement * RebuildTypeRequirement(concepts::Requirement::SubstitutionDiagnostic *SubstDiag)
OMPClause * RebuildOMPPermutationClause(ArrayRef< Expr * > PermExprs, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build a new OpenMP 'permutation' clause.
OMPClause * RebuildOMPUsesAllocatorsClause(ArrayRef< SemaOpenMP::UsesAllocatorsData > Data, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build a new OpenMP 'uses_allocators' clause.
ExprResult RebuildCXXInheritedCtorInitExpr(QualType T, SourceLocation Loc, CXXConstructorDecl *Constructor, bool ConstructsVBase, bool InheritedFromVBase)
Build a new implicit construction via inherited constructor expression.
ExprResult RebuildCXXConstCastExpr(SourceLocation OpLoc, SourceLocation LAngleLoc, TypeSourceInfo *TInfo, SourceLocation RAngleLoc, SourceLocation LParenLoc, Expr *SubExpr, SourceLocation RParenLoc)
Build a new C++ const_cast expression.
ExprResult RebuildAtomicExpr(SourceLocation BuiltinLoc, MultiExprArg SubExprs, AtomicExpr::AtomicOp Op, SourceLocation RParenLoc)
Build a new atomic operation expression.
DeclarationNameInfo TransformDeclarationNameInfo(const DeclarationNameInfo &NameInfo)
Transform the given declaration name.
OMPClause * RebuildOMPXAttributeClause(ArrayRef< const Attr * > Attrs, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build a new OpenMP 'ompx_attribute' clause.
ExprResult RebuildCXXFoldExpr(UnresolvedLookupExpr *ULE, SourceLocation LParenLoc, Expr *LHS, BinaryOperatorKind Operator, SourceLocation EllipsisLoc, Expr *RHS, SourceLocation RParenLoc, std::optional< unsigned > NumExpansions)
Build a new C++1z fold-expression.
OMPClause * RebuildOMPToClause(ArrayRef< OpenMPMotionModifierKind > MotionModifiers, ArrayRef< SourceLocation > MotionModifiersLoc, CXXScopeSpec &MapperIdScopeSpec, DeclarationNameInfo &MapperId, SourceLocation ColonLoc, ArrayRef< Expr * > VarList, const OMPVarListLocTy &Locs, ArrayRef< Expr * > UnresolvedMappers)
Build a new OpenMP 'to' clause.
StmtResult RebuildDoStmt(SourceLocation DoLoc, Stmt *Body, SourceLocation WhileLoc, SourceLocation LParenLoc, Expr *Cond, SourceLocation RParenLoc)
Build a new do-while statement.
OMPClause * RebuildOMPIfClause(OpenMPDirectiveKind NameModifier, Expr *Condition, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation NameModifierLoc, SourceLocation ColonLoc, SourceLocation EndLoc)
Build a new OpenMP 'if' clause.
StmtResult RebuildCaseStmtBody(Stmt *S, Stmt *Body)
Attach the body to a new case statement.
ExprResult RebuildTypeTrait(TypeTrait Trait, SourceLocation StartLoc, ArrayRef< TypeSourceInfo * > Args, SourceLocation RParenLoc)
Build a new type trait expression.
ExprResult RebuildEmptyCXXFoldExpr(SourceLocation EllipsisLoc, BinaryOperatorKind Operator)
Build an empty C++1z fold-expression with the given operator.
QualType TransformTypeWithDeducedTST(QualType T)
Transform a type that is permitted to produce a DeducedTemplateSpecializationType.
OMPClause * RebuildOMPInitClause(Expr *InteropVar, OMPInteropInfo &InteropInfo, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation VarLoc, SourceLocation EndLoc)
Build a new OpenMP 'init' clause.
OMPClause * RebuildOMPDetachClause(Expr *Evt, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build a new OpenMP 'detach' clause.
StmtResult RebuildCompoundStmt(SourceLocation LBraceLoc, MultiStmtArg Statements, SourceLocation RBraceLoc, bool IsStmtExpr)
Build a new compound statement.
ExprResult RebuildDeclRefExpr(NestedNameSpecifierLoc QualifierLoc, ValueDecl *VD, const DeclarationNameInfo &NameInfo, NamedDecl *Found, TemplateArgumentListInfo *TemplateArgs)
Build a new expression that references a declaration.
QualType RebuildArrayType(QualType ElementType, ArraySizeModifier SizeMod, const llvm::APInt *Size, Expr *SizeExpr, unsigned IndexTypeQuals, SourceRange BracketsRange)
Build a new array type given the element type, size modifier, size of the array (if known),...
StmtResult RebuildDeclStmt(MutableArrayRef< Decl * > Decls, SourceLocation StartLoc, SourceLocation EndLoc)
Build a new declaration statement.
QualType RebuildUsingType(UsingShadowDecl *Found, QualType Underlying)
Build a new type found via an alias.
ExprResult RebuildConvertVectorExpr(SourceLocation BuiltinLoc, Expr *SrcExpr, TypeSourceInfo *DstTInfo, SourceLocation RParenLoc)
Build a new convert vector expression.
QualType RebuildQualifiedType(QualType T, QualifiedTypeLoc TL)
Build a new qualified type given its unqualified type and type location.
OMPClause * RebuildOMPDependClause(OMPDependClause::DependDataTy Data, Expr *DepModifier, ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build a new OpenMP 'depend' pseudo clause.
OMPClause * RebuildOMPAlignedClause(ArrayRef< Expr * > VarList, Expr *Alignment, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc)
Build a new OpenMP 'aligned' clause.
unsigned TransformTemplateDepth(unsigned Depth)
Transform a template parameter depth level.
QualType RebuildFunctionNoProtoType(QualType ResultType)
Build a new unprototyped function type.
QualType TransformFunctionProtoType(TypeLocBuilder &TLB, FunctionProtoTypeLoc TL, CXXRecordDecl *ThisContext, Qualifiers ThisTypeQuals, Fn TransformExceptionSpec)
StmtResult RebuildOpenACCAtomicConstruct(SourceLocation BeginLoc, SourceLocation DirLoc, OpenACCAtomicKind AtKind, SourceLocation EndLoc, StmtResult AssociatedStmt)
const Attr * TransformAttr(const Attr *S)
Transform the given attribute.
QualType RebuildConstantMatrixType(QualType ElementType, unsigned NumRows, unsigned NumColumns)
Build a new matrix type given the element type and dimensions.
OMPClause * RebuildOMPMapClause(Expr *IteratorModifier, ArrayRef< OpenMPMapModifierKind > MapTypeModifiers, ArrayRef< SourceLocation > MapTypeModifiersLoc, CXXScopeSpec MapperIdScopeSpec, DeclarationNameInfo MapperId, OpenMPMapClauseKind MapType, bool IsMapTypeImplicit, SourceLocation MapLoc, SourceLocation ColonLoc, ArrayRef< Expr * > VarList, const OMPVarListLocTy &Locs, ArrayRef< Expr * > UnresolvedMappers)
Build a new OpenMP 'map' clause.
ExprResult RebuildBuiltinBitCastExpr(SourceLocation KWLoc, TypeSourceInfo *TSI, Expr *Sub, SourceLocation RParenLoc)
Build a new C++ __builtin_bit_cast expression.
QualType RebuildPackIndexingType(QualType Pattern, Expr *IndexExpr, SourceLocation Loc, SourceLocation EllipsisLoc, bool FullySubstituted, ArrayRef< QualType > Expansions={})
StmtResult RebuildOMPCanonicalLoop(Stmt *LoopStmt)
Build a new OpenMP Canonical loop.
StmtResult RebuildOMPExecutableDirective(OpenMPDirectiveKind Kind, DeclarationNameInfo DirName, OpenMPDirectiveKind CancelRegion, ArrayRef< OMPClause * > Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc)
Build a new OpenMP executable directive.
concepts::ExprRequirement * RebuildExprRequirement(Expr *E, bool IsSimple, SourceLocation NoexceptLoc, concepts::ExprRequirement::ReturnTypeRequirement Ret)
ExprResult TransformDependentScopeDeclRefExpr(DependentScopeDeclRefExpr *E, bool IsAddressOfOperand, TypeSourceInfo **RecoveryTSI)
OMPClause * RebuildOMPFullClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build a new OpenMP 'full' clause.
StmtResult RebuildSEHExceptStmt(SourceLocation Loc, Expr *FilterExpr, Stmt *Block)
OMPClause * RebuildOMPAffinityClause(SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc, Expr *Modifier, ArrayRef< Expr * > Locators)
Build a new OpenMP 'affinity' clause.
ExprResult RebuildCXXTypeidExpr(QualType TypeInfoType, SourceLocation TypeidLoc, TypeSourceInfo *Operand, SourceLocation RParenLoc)
Build a new C++ typeid(type) expression.
TypeSourceInfo * TransformTypeWithDeducedTST(TypeSourceInfo *DI)
ExprResult RebuildCXXDependentScopeMemberExpr(Expr *BaseE, QualType BaseType, bool IsArrow, SourceLocation OperatorLoc, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, NamedDecl *FirstQualifierInScope, const DeclarationNameInfo &MemberNameInfo, const TemplateArgumentListInfo *TemplateArgs)
Build a new member reference expression.
ExprResult RebuildCXXNamedCastExpr(SourceLocation OpLoc, Stmt::StmtClass Class, SourceLocation LAngleLoc, TypeSourceInfo *TInfo, SourceLocation RAngleLoc, SourceLocation LParenLoc, Expr *SubExpr, SourceLocation RParenLoc)
Build a new C++ "named" cast expression, such as static_cast or reinterpret_cast.
StmtResult RebuildSwitchStmtBody(SourceLocation SwitchLoc, Stmt *Switch, Stmt *Body)
Attach the body to the switch statement.
TypeSourceInfo * InventTypeSourceInfo(QualType T)
Fakes up a TypeSourceInfo for a type.
ExprResult RebuildUnaryExprOrTypeTrait(TypeSourceInfo *TInfo, SourceLocation OpLoc, UnaryExprOrTypeTrait ExprKind, SourceRange R)
Build a new sizeof, alignof or vec_step expression with a type argument.
ExprResult RebuildGenericSelectionExpr(SourceLocation KeyLoc, SourceLocation DefaultLoc, SourceLocation RParenLoc, Expr *ControllingExpr, ArrayRef< TypeSourceInfo * > Types, ArrayRef< Expr * > Exprs)
Build a new generic selection expression with an expression predicate.
QualType TransformTemplateTypeParmType(TypeLocBuilder &TLB, TemplateTypeParmTypeLoc TL, bool SuppressObjCLifetime)
Derived & getDerived()
Retrieves a reference to the derived class.
OMPClause * RebuildOMPHoldsClause(Expr *A, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build a new OpenMP 'holds' clause.
ExprResult RebuildArraySectionExpr(bool IsOMPArraySection, Expr *Base, SourceLocation LBracketLoc, Expr *LowerBound, SourceLocation ColonLocFirst, SourceLocation ColonLocSecond, Expr *Length, Expr *Stride, SourceLocation RBracketLoc)
Build a new array section expression.
concepts::ExprRequirement * TransformExprRequirement(concepts::ExprRequirement *Req)
QualType RebuildTypeOfExprType(Expr *Underlying, SourceLocation Loc, TypeOfKind Kind)
Build a new typeof(expr) type.
ParmVarDecl * TransformFunctionTypeParam(ParmVarDecl *OldParm, int indexAdjustment, std::optional< unsigned > NumExpansions, bool ExpectParameterPack)
Transforms a single function-type parameter.
bool ReplacingOriginal()
Whether the transformation is forming an expression or statement that replaces the original.
OMPClause * RebuildOMPFlushClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build a new OpenMP 'flush' pseudo clause.
bool TransformTemplateArgument(const TemplateArgumentLoc &Input, TemplateArgumentLoc &Output, bool Uneval=false)
Transform the given template argument.
QualType RebuildDeducedTemplateSpecializationType(TemplateName Template, QualType Deduced)
By default, builds a new DeducedTemplateSpecializationType with the given deduced type.
ExprResult RebuildArraySubscriptExpr(Expr *LHS, SourceLocation LBracketLoc, Expr *RHS, SourceLocation RBracketLoc)
Build a new array subscript expression.
QualType RebuildExtVectorType(QualType ElementType, unsigned NumElements, SourceLocation AttributeLoc)
Build a new extended vector type given the element type and number of elements.
void transformedLocalDecl(Decl *Old, ArrayRef< Decl * > New)
Note that a local declaration has been transformed by this transformer.
ExprResult RebuildObjCBoxedExpr(SourceRange SR, Expr *ValueExpr)
Build a new Objective-C boxed expression.
ExprResult RebuildCXXThrowExpr(SourceLocation ThrowLoc, Expr *Sub, bool IsThrownVariableInScope)
Build a new C++ throw expression.
bool TransformRequiresExprRequirements(ArrayRef< concepts::Requirement * > Reqs, llvm::SmallVectorImpl< concepts::Requirement * > &Transformed)
bool DropCallArgument(Expr *E)
Determine whether the given call argument should be dropped, e.g., because it is a default argument.
StmtResult RebuildGotoStmt(SourceLocation GotoLoc, SourceLocation LabelLoc, LabelDecl *Label)
Build a new goto statement.
OMPClause * RebuildOMPPrivateClause(ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build a new OpenMP 'private' clause.
ExprResult RebuildObjCPropertyRefExpr(Expr *Base, QualType T, ObjCMethodDecl *Getter, ObjCMethodDecl *Setter, SourceLocation PropertyLoc)
Build a new Objective-C property reference expression.
ExprResult RebuildRequiresExpr(SourceLocation RequiresKWLoc, RequiresExprBodyDecl *Body, SourceLocation LParenLoc, ArrayRef< ParmVarDecl * > LocalParameters, SourceLocation RParenLoc, ArrayRef< concepts::Requirement * > Requirements, SourceLocation ClosingBraceLoc)
Build a new requires expression.
ExprResult RebuildExpressionTrait(ExpressionTrait Trait, SourceLocation StartLoc, Expr *Queried, SourceLocation RParenLoc)
Build a new expression trait expression.
OMPClause * RebuildOMPDoacrossClause(OpenMPDoacrossClauseModifier DepType, SourceLocation DepLoc, SourceLocation ColonLoc, ArrayRef< Expr * > VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build a new OpenMP 'doacross' clause.
OMPClause * RebuildOMPFinalClause(Expr *Condition, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build a new OpenMP 'final' clause.
StmtResult RebuildIfStmt(SourceLocation IfLoc, IfStatementKind Kind, SourceLocation LParenLoc, Sema::ConditionResult Cond, SourceLocation RParenLoc, Stmt *Init, Stmt *Then, SourceLocation ElseLoc, Stmt *Else)
Build a new "if" statement.
TyLocType push(QualType T)
Pushes space for a new TypeLoc of the given type.
void reserve(size_t Requested)
Ensures that this buffer has at least as much capacity as described.
void TypeWasModifiedSafely(QualType T)
Tell the TypeLocBuilder that the type it is storing has been modified in some safe way that doesn't a...
TypeSourceInfo * getTypeSourceInfo(ASTContext &Context, QualType T)
Creates a TypeSourceInfo for the given type.
Base wrapper for a particular "section" of type source info.
UnqualTypeLoc getUnqualifiedLoc() const
Skips past any qualifiers, if this is qualified.
QualType getType() const
Get the type for which this source info wrapper provides information.
T getAs() const
Convert to the specified TypeLoc type, returning a null TypeLoc if this TypeLoc is not of the desired...
T castAs() const
Convert to the specified TypeLoc type, asserting that this TypeLoc is of the desired type.
SourceRange getSourceRange() const LLVM_READONLY
Get the full source range.
unsigned getFullDataSize() const
Returns the size of the type source info data block.
SourceLocation getTemplateKeywordLoc() const
Get the SourceLocation of the template keyword (if any).
T getAsAdjusted() const
Convert to the specified TypeLoc type, returning a null TypeLoc if this TypeLoc is not of the desired...
SourceLocation getBeginLoc() const
Get the begin source location.
A container of type source information.
TypeLoc getTypeLoc() const
Return the TypeLoc wrapper for the type source info.
QualType getType() const
Return the type wrapped by this type source info.
static TagTypeKind getTagTypeKindForKeyword(ElaboratedTypeKeyword Keyword)
Converts an elaborated type keyword into a TagTypeKind.
ElaboratedTypeKeyword getKeyword() const
The base class of the type hierarchy.
bool isPointerType() const
const T * castAs() const
Member-template castAs<specific type>.
bool isReferenceType() const
bool isEnumeralType() const
QualType getPointeeType() const
If this is a pointer, ObjC object pointer, or block pointer, this returns the respective pointee.
AutoType * getContainedAutoType() const
Get the AutoType whose type will be deduced for a variable with an initializer of this type.
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
bool containsUnexpandedParameterPack() const
Whether this type is or contains an unexpanded parameter pack, used to support C++0x variadic templat...
bool isOverloadableType() const
Determines whether this is a type for which one can define an overloaded operator.
bool isObjCLifetimeType() const
Returns true if objects of this type have lifetime semantics under ARC.
bool isFunctionType() const
bool isObjCObjectPointerType() const
const T * getAs() const
Member-template getAs<specific type>'.
bool isRecordType() const
Base class for declarations which introduce a typedef-name.
Wrapper for source info for typedefs.
TypedefNameDecl * getTypedefNameDecl() const
UnaryOperator - This represents the unary-expression's (except sizeof and alignof),...
static Opcode getOverloadedOpcode(OverloadedOperatorKind OO, bool Postfix)
Retrieve the unary opcode that corresponds to the given overloaded operator.
Represents a C++ unqualified-id that has been parsed.
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
CXXRecordDecl * getNamingClass()
Gets the 'naming class' (in the sense of C++0x [class.access.base]p5) of the lookup.
bool requiresADL() const
True if this declaration should be extended by argument-dependent lookup.
static UnresolvedLookupExpr * Create(const ASTContext &Context, CXXRecordDecl *NamingClass, NestedNameSpecifierLoc QualifierLoc, const DeclarationNameInfo &NameInfo, bool RequiresADL, UnresolvedSetIterator Begin, UnresolvedSetIterator End, bool KnownDependent, bool KnownInstantiationDependent)
A set of unresolved declarations.
void addDecl(NamedDecl *D)
A set of unresolved declarations.
Represents the dependent type named by a dependently-scoped typename using declaration,...
Represents a shadow declaration implicitly introduced into a scope by a (resolved) using-declaration ...
NamedDecl * getTargetDecl() const
Gets the underlying declaration which has been brought into the local scope.
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
bool isParameterPack() const
Determine whether this value is actually a function parameter pack, init-capture pack,...
Represents a variable declaration or definition.
@ CInit
C-style initialization with assignment.
@ CallInit
Call-style initialization (C++98)
StorageClass getStorageClass() const
Returns the storage class as written in the source.
A requires-expression requirement which queries the validity and properties of an expression ('simple...
SubstitutionDiagnostic * getExprSubstitutionDiagnostic() const
bool isExprSubstitutionFailure() const
const ReturnTypeRequirement & getReturnTypeRequirement() const
SourceLocation getNoexceptLoc() const
A requires-expression requirement which is satisfied when a general constraint expression is satisfie...
const ASTConstraintSatisfaction & getConstraintSatisfaction() const
bool hasInvalidConstraint() const
Expr * getConstraintExpr() const
StringRef getInvalidConstraintEntity()
A static requirement that can be used in a requires-expression to check properties of types and expre...
A requires-expression requirement which queries the existence of a type name or type template special...
bool isSubstitutionFailure() const
SubstitutionDiagnostic * getSubstitutionDiagnostic() const
TypeSourceInfo * getType() const
bool ContainsUnexpandedParameterPack
Whether this contains an unexpanded parameter pack.
CXXRecordDecl * Lambda
The class that describes the lambda.
CXXMethodDecl * CallOperator
The lambda's compiler-generated operator().
@ AttributedType
The l-value was considered opaque, so the alignment was determined from a type, but that type was an ...
@ Decl
The l-value was an access to a declared entity or something equivalently strong, like the address of ...
const AstTypeMatcher< FunctionType > functionType
Matches FunctionType nodes.
bool Inc(InterpState &S, CodePtr OpPC)
1) Pops a pointer from the stack 2) Load the value from the pointer 3) Writes the value increased by ...
bool Comp(InterpState &S, CodePtr OpPC)
1) Pops the value from the stack.
llvm::PointerUnion< const Decl *, const Expr * > DeclTy
The JSON file list parser is used to communicate input to InstallAPI.
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
@ OO_None
Not an overloaded operator.
@ NUM_OVERLOADED_OPERATORS
ArrayTypeTrait
Names for the array type traits.
AutoTypeKeyword
Which keyword(s) were used to create an AutoType.
llvm::omp::Directive OpenMPDirectiveKind
OpenMP directives.
OpenMPDefaultmapClauseModifier
OpenMP modifiers for 'defaultmap' clause.
OpenMPOrderClauseModifier
OpenMP modifiers for 'order' clause.
IfStatementKind
In an if statement, this denotes whether the statement is a constexpr or consteval if statement.
@ OK_ObjCProperty
An Objective-C property is a logical field of an Objective-C object which is read and written via Obj...
OpenMPAtClauseKind
OpenMP attributes for 'at' clause.
@ LCK_ByCopy
Capturing by copy (a.k.a., by value)
@ LCK_ByRef
Capturing by reference.
@ LCK_StarThis
Capturing the *this object by copy.
OpenMPReductionClauseModifier
OpenMP modifiers for 'reduction' clause.
@ Invalid
Represents an invalid clause, for the purposes of parsing.
@ Self
'self' clause, allowed on Compute and Combined Constructs, plus 'update'.
TypeOfKind
The kind of 'typeof' expression we're after.
OpenMPScheduleClauseModifier
OpenMP modifiers for 'schedule' clause.
OpenMPDistScheduleClauseKind
OpenMP attributes for 'dist_schedule' clause.
OpenMPDoacrossClauseModifier
OpenMP dependence types for 'doacross' clause.
UnaryExprOrTypeTrait
Names for the "expression or type" traits.
std::pair< llvm::PointerUnion< const TemplateTypeParmType *, NamedDecl *, ResolvedUnexpandedPackExpr * >, SourceLocation > UnexpandedParameterPack
@ Property
The type of a property.
@ Result
The result type of a method or function.
OpenMPBindClauseKind
OpenMP bindings for the 'bind' clause.
ArraySizeModifier
Capture whether this is a normal array (e.g.
bool isComputedNoexcept(ExceptionSpecificationType ESpecType)
OpenMPLastprivateModifier
OpenMP 'lastprivate' clause modifier.
OpenMPGrainsizeClauseModifier
OpenMPNumTasksClauseModifier
ActionResult< Expr * > ExprResult
TagTypeKind
The kind of a tag type.
bool transformOMPMappableExprListClause(TreeTransform< Derived > &TT, OMPMappableExprListClause< T > *C, llvm::SmallVectorImpl< Expr * > &Vars, CXXScopeSpec &MapperIdScopeSpec, DeclarationNameInfo &MapperIdInfo, llvm::SmallVectorImpl< Expr * > &UnresolvedMappers)
bool isOpenMPLoopDirective(OpenMPDirectiveKind DKind)
Checks if the specified directive is a directive with an associated loop construct.
std::pair< NullabilityKind, bool > DiagNullabilityKind
A nullability kind paired with a bit indicating whether it used a context-sensitive keyword.
OpenMPSeverityClauseKind
OpenMP attributes for 'severity' clause.
ActionResult< Stmt * > StmtResult
OpenMPDefaultmapClauseKind
OpenMP attributes for 'defaultmap' clause.
OpenMPAllocateClauseModifier
OpenMP modifiers for 'allocate' clause.
OpenMPLinearClauseKind
OpenMP attributes for 'linear' clause.
@ VK_PRValue
A pr-value expression (in the C++11 taxonomy) produces a temporary value.
@ VK_LValue
An l-value expression is a reference to an object with independent storage.
OpaquePtr< QualType > ParsedType
An opaque type for threading parsed type information through the parser.
const FunctionProtoType * T
OpenMPDeviceClauseModifier
OpenMP modifiers for 'device' clause.
ElaboratedTypeKeyword
The elaboration keyword that precedes a qualified type name or introduces an elaborated-type-specifie...
@ None
No keyword precedes the qualified type name.
@ Class
The "class" keyword introduces the elaborated-type-specifier.
@ Enum
The "enum" keyword introduces the elaborated-type-specifier.
@ Typename
The "typename" keyword precedes the qualified type name, e.g., typename T::type.
OpenMPOrderClauseKind
OpenMP attributes for 'order' clause.
TypeTrait
Names for traits that operate specifically on types.
@ Parens
New-expression has a C++98 paren-delimited initializer.
ExceptionSpecificationType
The various types of exception specifications that exist in C++11.
@ EST_DynamicNone
throw()
@ EST_Uninstantiated
not instantiated yet
@ EST_Unevaluated
not evaluated yet, for special member function
@ EST_Dynamic
throw(T1, T2)
OpenMPScheduleClauseKind
OpenMP attributes for 'schedule' clause.
static QualType TransformTypeSpecType(TypeLocBuilder &TLB, TyLoc T)
MutableArrayRef< Expr * > MultiExprArg
OpenMPMapClauseKind
OpenMP mapping kind for 'map' clause.
The result of a constraint satisfaction check, containing the necessary information to diagnose an un...
static const ASTTemplateArgumentListInfo * Create(const ASTContext &C, const TemplateArgumentListInfo &List)
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspon...
SourceLocation getLoc() const
getLoc - Returns the main location of the declaration name.
DeclarationName getName() const
getName - Returns the embedded declaration name.
void setNamedTypeInfo(TypeSourceInfo *TInfo)
setNamedTypeInfo - Sets the source type info associated to the name.
void setName(DeclarationName N)
setName - Sets the embedded declaration name.
TypeSourceInfo * getNamedTypeInfo() const
getNamedTypeInfo - Returns the source type info associated to the name.
A FunctionEffect plus a potential boolean expression determining whether the effect is declared (e....
Holds information about the various types of exception specification.
FunctionDecl * SourceTemplate
The function template whose exception specification this is instantiated from, for EST_Uninstantiated...
ExceptionSpecificationType Type
The kind of exception specification this is.
ArrayRef< QualType > Exceptions
Explicitly-specified list of exception types.
Expr * NoexceptExpr
Noexcept expression, if this is a computed noexcept specification.
Extra information about a function prototype.
ExceptionSpecInfo ExceptionSpec
FunctionEffectsRef FunctionEffects
const ExtParameterInfo * ExtParameterInfos
This structure contains most locations needed for by an OMPVarListClause.
@ LambdaExpressionSubstitution
We are substituting into a lambda expression.
Keeps information about an identifier in a nested-name-spec.
Location information for a TemplateArgument.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4