14 #ifndef LLVM_CLANG_LIB_SEMA_TREETRANSFORM_H 15 #define LLVM_CLANG_LIB_SEMA_TREETRANSFORM_H 37 #include "llvm/ADT/ArrayRef.h" 38 #include "llvm/Support/ErrorHandling.h" 95 template<
typename Derived>
100 class ForgetPartiallySubstitutedPackRAII {
105 ForgetPartiallySubstitutedPackRAII(Derived &Self) : Self(Self) {
106 Old = Self.ForgetPartiallySubstitutedPack();
109 ~ForgetPartiallySubstitutedPackRAII() {
110 Self.RememberPartiallySubstitutedPack(Old);
127 Derived &
getDerived() {
return static_cast<Derived&
>(*this); }
131 return static_cast<const Derived&
>(*this);
184 OldLocation = Self.
getDerived().getBaseLocation();
185 OldEntity = Self.
getDerived().getBaseEntity();
192 Self.
getDerived().setBase(OldLocation, OldEntity);
258 bool &RetainExpansion,
260 ShouldExpand =
false;
351 const Attr *TransformAttr(
const Attr *S);
360 #define PRAGMA_SPELLING_ATTR(X) \ 361 const X##Attr *Transform##X##Attr(const X##Attr *R) { return R; } 362 #include "clang/Basic/AttrList.inc" 381 ExprResult TransformInitializer(Expr *Init,
bool NotCopyInit);
406 bool TransformExprs(Expr *
const *Inputs,
unsigned NumInputs,
bool IsCall,
407 SmallVectorImpl<Expr *> &Outputs,
408 bool *ArgChanged =
nullptr);
417 llvm::DenseMap<Decl *, Decl *>::iterator Known
418 = TransformedLocalDecls.find(D);
419 if (Known != TransformedLocalDecls.end())
420 return Known->second;
448 TransformedLocalDecls[Old] = New;
456 return getDerived().TransformDecl(Loc, D);
469 return cast_or_null<NamedDecl>(getDerived().TransformDecl(Loc, D));
473 bool TransformOverloadExprDecls(
OverloadExpr *Old,
bool RequiresADL,
485 NamedDecl *FirstQualifierInScope =
nullptr);
520 NamedDecl *FirstQualifierInScope =
nullptr,
521 bool AllowInjectedClassName =
false);
533 bool Uneval =
false);
556 bool Uneval =
false) {
557 return TransformTemplateArguments(Inputs, Inputs + NumInputs, Outputs,
575 template<
typename InputIterator>
576 bool TransformTemplateArguments(InputIterator First,
579 bool Uneval =
false);
588 getDerived().getBaseLocation());
591 #define ABSTRACT_TYPELOC(CLASS, PARENT) 592 #define TYPELOC(CLASS, PARENT) \ 593 QualType Transform##CLASS##Type(TypeLocBuilder &TLB, CLASS##TypeLoc T); 594 #include "clang/AST/TypeLocNodes.def" 596 template<
typename Fn>
597 QualType TransformFunctionProtoType(TypeLocBuilder &TLB,
598 FunctionProtoTypeLoc TL,
599 CXXRecordDecl *ThisContext,
600 unsigned ThisTypeQuals,
601 Fn TransformExceptionSpec);
603 bool TransformExceptionSpec(SourceLocation Loc,
604 FunctionProtoType::ExceptionSpecInfo &ESI,
605 SmallVectorImpl<QualType> &Exceptions,
608 StmtResult TransformSEHHandler(Stmt *Handler);
611 TransformTemplateSpecializationType(TypeLocBuilder &TLB,
612 TemplateSpecializationTypeLoc TL,
613 TemplateName Template);
616 TransformDependentTemplateSpecializationType(TypeLocBuilder &TLB,
617 DependentTemplateSpecializationTypeLoc TL,
618 TemplateName Template,
621 QualType TransformDependentTemplateSpecializationType(
622 TypeLocBuilder &TLB, DependentTemplateSpecializationTypeLoc TL,
623 NestedNameSpecifierLoc QualifierLoc);
632 bool TransformFunctionTypeParams(
633 SourceLocation Loc, ArrayRef<ParmVarDecl *> Params,
634 const QualType *ParamTypes,
635 const FunctionProtoType::ExtParameterInfo *ParamInfos,
636 SmallVectorImpl<QualType> &PTypes, SmallVectorImpl<ParmVarDecl *> *PVars,
637 Sema::ExtParameterInfoBuilder &PInfos);
644 ParmVarDecl *TransformFunctionTypeParam(ParmVarDecl *OldParm,
646 Optional<unsigned> NumExpansions,
647 bool ExpectParameterPack);
649 QualType TransformReferenceType(TypeLocBuilder &TLB, ReferenceTypeLoc TL);
651 StmtResult TransformCompoundStmt(CompoundStmt *S,
bool IsStmtExpr);
652 ExprResult TransformCXXNamedCastExpr(CXXNamedCastExpr *E);
662 bool IsAddressOfOperand,
665 ExprResult TransformParenDependentScopeDeclRefExpr(
673 #define STMT(Node, Parent) \ 674 LLVM_ATTRIBUTE_NOINLINE \ 675 StmtResult Transform##Node(Node *S); 676 #define EXPR(Node, Parent) \ 677 LLVM_ATTRIBUTE_NOINLINE \ 678 ExprResult Transform##Node(Node *E); 679 #define ABSTRACT_STMT(Stmt) 680 #include "clang/AST/StmtNodes.inc" 682 #define OPENMP_CLAUSE(Name, Class) \ 683 LLVM_ATTRIBUTE_NOINLINE \ 684 OMPClause *Transform ## Class(Class *S); 685 #include "clang/Basic/OpenMPKinds.def" 694 QualType RebuildQualifiedType(QualType T, SourceLocation Loc,
701 QualType RebuildPointerType(QualType PointeeType, SourceLocation Sigil);
707 QualType RebuildBlockPointerType(QualType PointeeType, SourceLocation Sigil);
717 QualType RebuildReferenceType(QualType ReferentType,
719 SourceLocation Sigil);
726 QualType RebuildMemberPointerType(QualType PointeeType, QualType ClassType,
727 SourceLocation Sigil);
729 QualType RebuildObjCTypeParamType(
const ObjCTypeParamDecl *Decl,
730 SourceLocation ProtocolLAngleLoc,
731 ArrayRef<ObjCProtocolDecl *> Protocols,
732 ArrayRef<SourceLocation> ProtocolLocs,
733 SourceLocation ProtocolRAngleLoc);
739 QualType RebuildObjCObjectType(QualType BaseType,
741 SourceLocation TypeArgsLAngleLoc,
742 ArrayRef<TypeSourceInfo *> TypeArgs,
743 SourceLocation TypeArgsRAngleLoc,
744 SourceLocation ProtocolLAngleLoc,
745 ArrayRef<ObjCProtocolDecl *> Protocols,
746 ArrayRef<SourceLocation> ProtocolLocs,
747 SourceLocation ProtocolRAngleLoc);
753 QualType RebuildObjCObjectPointerType(QualType PointeeType,
754 SourceLocation Star);
763 QualType RebuildArrayType(QualType ElementType,
765 const llvm::APInt *Size,
767 unsigned IndexTypeQuals,
768 SourceRange BracketsRange);
775 QualType RebuildConstantArrayType(QualType ElementType,
777 const llvm::APInt &Size,
778 unsigned IndexTypeQuals,
779 SourceRange BracketsRange);
786 QualType RebuildIncompleteArrayType(QualType ElementType,
788 unsigned IndexTypeQuals,
789 SourceRange BracketsRange);
796 QualType RebuildVariableArrayType(QualType ElementType,
799 unsigned IndexTypeQuals,
800 SourceRange BracketsRange);
807 QualType RebuildDependentSizedArrayType(QualType ElementType,
810 unsigned IndexTypeQuals,
811 SourceRange BracketsRange);
818 QualType RebuildVectorType(QualType ElementType,
unsigned NumElements,
826 QualType RebuildExtVectorType(QualType ElementType,
unsigned NumElements,
827 SourceLocation AttributeLoc);
834 QualType RebuildDependentSizedExtVectorType(QualType ElementType,
836 SourceLocation AttributeLoc);
846 QualType RebuildDependentAddressSpaceType(QualType PointeeType,
848 SourceLocation AttributeLoc);
854 QualType RebuildFunctionProtoType(QualType T,
855 MutableArrayRef<QualType> ParamTypes,
856 const FunctionProtoType::ExtProtoInfo &EPI);
859 QualType RebuildFunctionNoProtoType(QualType ResultType);
863 QualType RebuildUnresolvedUsingType(SourceLocation NameLoc, Decl *D);
918 Template, Deduced,
false);
963 bool AllowInjectedClassName) {
967 SS.
Adopt(QualifierLoc);
969 = getDerived().RebuildTemplateName(SS, *Name, NameLoc,
QualType(),
970 nullptr, AllowInjectedClassName);
985 getDerived().RebuildTemplateSpecializationType(InstName, NameLoc, Args);
1006 bool DeducedTSTContext) {
1008 SS.
Adopt(QualifierLoc);
1023 if (!DeducedTSTContext) {
1024 if (
auto *Deduced = dyn_cast_or_null<DeducedTemplateSpecializationType>(
1026 SemaRef.
Diag(IdLoc, diag::err_dependent_deduced_tst)
1028 Deduced->getTemplateName())
1030 if (
auto *TD = Deduced->getTemplateName().getAsTemplateDecl())
1031 SemaRef.
Diag(TD->getLocation(), diag::note_template_decl_here);
1064 llvm_unreachable(
"Tag lookup cannot find non-tags");
1082 SemaRef.
Diag(IdLoc, diag::err_tag_reference_non_tag) << SomeDecl
1088 SemaRef.
Diag(IdLoc, diag::err_not_tag_in_scope)
1097 SemaRef.
Diag(KeywordLoc, diag::err_use_with_wrong_tag) <<
Id;
1117 return getSema().CheckPackExpansion(Pattern, PatternRange, EllipsisLoc,
1153 bool AllowInjectedClassName);
1166 bool AllowInjectedClassName);
1177 return getSema().Context.getSubstTemplateTemplateParmPack(Param, ArgPack);
1188 return getSema().ActOnCompoundStmt(LBraceLoc, RBraceLoc, Statements,
1201 return getSema().ActOnCaseStmt(CaseLoc, LHS, EllipsisLoc, RHS,
1210 getSema().ActOnCaseStmtBody(S, Body);
1221 return getSema().ActOnDefaultStmt(DefaultLoc, ColonLoc, SubStmt,
1251 return getSema().ActOnIfStmt(IfLoc, IsConstexpr, Init, Cond, Then,
1261 return getSema().ActOnStartOfSwitchStmt(SwitchLoc, Init, Cond);
1270 return getSema().ActOnFinishSwitchStmt(SwitchLoc, Switch, Body);
1279 return getSema().ActOnWhileStmt(WhileLoc, Cond, Body);
1289 return getSema().ActOnDoStmt(DoLoc, Body, WhileLoc, LParenLoc,
1301 return getSema().ActOnForStmt(ForLoc, LParenLoc, Init, Cond,
1302 Inc, RParenLoc, Body);
1311 return getSema().ActOnGotoStmt(GotoLoc, LabelLoc, Label);
1321 return getSema().ActOnIndirectGotoStmt(GotoLoc, StarLoc, Target);
1329 return getSema().BuildReturnStmt(ReturnLoc, Result);
1339 return getSema().ActOnDeclStmt(DG, StartLoc, EndLoc);
1347 bool IsVolatile,
unsigned NumOutputs,
1352 return getSema().ActOnGCCAsmStmt(AsmLoc, IsSimple, IsVolatile, NumOutputs,
1353 NumInputs, Names, Constraints, Exprs,
1354 AsmString, Clobbers, RParenLoc);
1363 StringRef AsmString,
1364 unsigned NumOutputs,
unsigned NumInputs,
1369 return getSema().ActOnMSAsmStmt(AsmLoc, LBraceLoc, AsmToks, AsmString,
1370 NumOutputs, NumInputs,
1371 Constraints, Clobbers, Exprs, EndLoc);
1380 return getSema().BuildCoreturnStmt(CoreturnLoc, Result, IsImplicit);
1389 return getSema().BuildResolvedCoawaitExpr(CoawaitLoc, Result, IsImplicit);
1399 return getSema().BuildUnresolvedCoawaitExpr(CoawaitLoc, Result, Lookup);
1407 return getSema().BuildCoyieldExpr(CoyieldLoc, Result);
1411 return getSema().BuildCoroutineBodyStmt(Args);
1422 return getSema().ActOnObjCAtTryStmt(AtLoc, TryBody, CatchStmts,
1432 return getSema().BuildObjCExceptionDecl(TInfo, T,
1446 return getSema().ActOnObjCAtCatchStmt(AtLoc, RParenLoc,
1456 return getSema().ActOnObjCAtFinallyStmt(AtLoc, Body);
1465 return getSema().BuildObjCAtThrowStmt(AtLoc, Operand);
1478 return getSema().ActOnOpenMPExecutableDirective(
1479 Kind, DirName, CancelRegion, Clauses, AStmt, StartLoc, EndLoc);
1492 return getSema().ActOnOpenMPIfClause(NameModifier, Condition, StartLoc,
1493 LParenLoc, NameModifierLoc, ColonLoc,
1504 return getSema().ActOnOpenMPFinalClause(Condition, StartLoc, LParenLoc,
1516 return getSema().ActOnOpenMPNumThreadsClause(NumThreads, StartLoc,
1527 return getSema().ActOnOpenMPSafelenClause(Len, StartLoc, LParenLoc, EndLoc);
1537 return getSema().ActOnOpenMPSimdlenClause(Len, StartLoc, LParenLoc, EndLoc);
1547 return getSema().ActOnOpenMPCollapseClause(Num, StartLoc, LParenLoc,
1560 return getSema().ActOnOpenMPDefaultClause(Kind, KindKwLoc,
1561 StartLoc, LParenLoc, EndLoc);
1573 return getSema().ActOnOpenMPProcBindClause(Kind, KindKwLoc,
1574 StartLoc, LParenLoc, EndLoc);
1586 return getSema().ActOnOpenMPScheduleClause(
1587 M1, M2, Kind, ChunkSize, StartLoc, LParenLoc, M1Loc, M2Loc, KindLoc,
1598 return getSema().ActOnOpenMPOrderedClause(StartLoc, EndLoc, LParenLoc, Num);
1609 return getSema().ActOnOpenMPPrivateClause(VarList, StartLoc, LParenLoc,
1621 return getSema().ActOnOpenMPFirstprivateClause(VarList, StartLoc, LParenLoc,
1633 return getSema().ActOnOpenMPLastprivateClause(VarList, StartLoc, LParenLoc,
1645 return getSema().ActOnOpenMPSharedClause(VarList, StartLoc, LParenLoc,
1661 return getSema().ActOnOpenMPReductionClause(
1662 VarList, StartLoc, LParenLoc, ColonLoc, EndLoc, ReductionIdScopeSpec,
1663 ReductionId, UnresolvedReductions);
1676 return getSema().ActOnOpenMPTaskReductionClause(
1677 VarList, StartLoc, LParenLoc, ColonLoc, EndLoc, ReductionIdScopeSpec,
1678 ReductionId, UnresolvedReductions);
1692 return getSema().ActOnOpenMPInReductionClause(
1693 VarList, StartLoc, LParenLoc, ColonLoc, EndLoc, ReductionIdScopeSpec,
1694 ReductionId, UnresolvedReductions);
1708 return getSema().ActOnOpenMPLinearClause(VarList, Step, StartLoc, LParenLoc,
1709 Modifier, ModifierLoc, ColonLoc,
1722 return getSema().ActOnOpenMPAlignedClause(VarList, Alignment, StartLoc,
1723 LParenLoc, ColonLoc, EndLoc);
1734 return getSema().ActOnOpenMPCopyinClause(VarList, StartLoc, LParenLoc,
1746 return getSema().ActOnOpenMPCopyprivateClause(VarList, StartLoc, LParenLoc,
1758 return getSema().ActOnOpenMPFlushClause(VarList, StartLoc, LParenLoc,
1771 return getSema().ActOnOpenMPDependClause(DepKind, DepLoc, ColonLoc, VarList,
1772 StartLoc, LParenLoc, EndLoc);
1782 return getSema().ActOnOpenMPDeviceClause(Device, StartLoc, LParenLoc,
1796 return getSema().ActOnOpenMPMapClause(MapTypeModifier, MapType,
1797 IsMapTypeImplicit, MapLoc, ColonLoc,
1798 VarList, StartLoc, LParenLoc, EndLoc);
1808 return getSema().ActOnOpenMPNumTeamsClause(NumTeams, StartLoc, LParenLoc,
1820 return getSema().ActOnOpenMPThreadLimitClause(ThreadLimit, StartLoc,
1831 return getSema().ActOnOpenMPPriorityClause(Priority, StartLoc, LParenLoc,
1842 return getSema().ActOnOpenMPGrainsizeClause(Grainsize, StartLoc, LParenLoc,
1853 return getSema().ActOnOpenMPNumTasksClause(NumTasks, StartLoc, LParenLoc,
1864 return getSema().ActOnOpenMPHintClause(Hint, StartLoc, LParenLoc, EndLoc);
1876 return getSema().ActOnOpenMPDistScheduleClause(
1877 Kind, ChunkSize, StartLoc, LParenLoc, KindLoc, CommaLoc, EndLoc);
1888 return getSema().ActOnOpenMPToClause(VarList, StartLoc, LParenLoc, EndLoc);
1899 return getSema().ActOnOpenMPFromClause(VarList, StartLoc, LParenLoc,
1911 return getSema().ActOnOpenMPUseDevicePtrClause(VarList, StartLoc, LParenLoc,
1923 return getSema().ActOnOpenMPIsDevicePtrClause(VarList, StartLoc, LParenLoc,
1933 return getSema().ActOnObjCAtSynchronizedOperand(atLoc,
object);
1942 return getSema().ActOnObjCAtSynchronizedStmt(AtLoc, Object, Body);
1951 return getSema().ActOnObjCAutoreleasePoolStmt(AtLoc, Body);
1963 StmtResult ForEachStmt = getSema().ActOnObjCForCollectionStmt(ForLoc,
1970 return getSema().FinishObjCForCollectionStmt(ForEachStmt.
get(), Body);
1982 VarDecl *Var = getSema().BuildExceptionDeclaration(
nullptr, Declarator,
1983 StartLoc, IdLoc, Id);
1985 getSema().CurContext->addDecl(Var);
1996 return Owned(
new (getSema().Context)
CXXCatchStmt(CatchLoc, ExceptionDecl,
2006 return getSema().ActOnCXXTryBlock(TryLoc, TryBlock, Handlers);
2022 if (
DeclStmt *RangeStmt = dyn_cast<DeclStmt>(Range)) {
2023 if (RangeStmt->isSingleDecl()) {
2024 if (
VarDecl *RangeVar = dyn_cast<VarDecl>(RangeStmt->getSingleDecl())) {
2025 if (RangeVar->isInvalidDecl())
2028 Expr *RangeExpr = RangeVar->getInit();
2031 return getSema().ActOnObjCForCollectionStmt(ForLoc, LoopVar, RangeExpr,
2037 return getSema().BuildCXXForRangeStmt(ForLoc, CoawaitLoc, ColonLoc,
2039 Cond, Inc, LoopVar, RParenLoc,
2052 return getSema().BuildMSDependentExistsStmt(KeywordLoc, IsIfExists,
2053 QualifierLoc, NameInfo, Nested);
2061 return getSema().FinishCXXForRangeStmt(ForRange, Body);
2066 return getSema().ActOnSEHTryBlock(IsCXXTry, TryLoc, TryBlock, Handler);
2071 return getSema().ActOnSEHExceptBlock(Loc, FilterExpr, Block);
2084 return getSema().BuildPredefinedExpr(Loc, IT);
2094 return getSema().BuildDeclarationNameExpr(SS, R, RequiresADL);
2107 SS.
Adopt(QualifierLoc);
2111 return getSema().BuildDeclarationNameExpr(SS, NameInfo, VD);
2120 return getSema().ActOnParenExpr(LParen, RParen, SubExpr);
2143 return getSema().BuildUnaryOp(
nullptr, OpLoc, Opc, SubExpr);
2154 return getSema().BuildBuiltinOffsetOf(OperatorLoc, Type, Components,
2167 return getSema().CreateUnaryExprOrTypeTraitExpr(TInfo, OpLoc, ExprKind, R);
2179 = getSema().CreateUnaryExprOrTypeTraitExpr(SubExpr, OpLoc, ExprKind);
2194 return getSema().ActOnArraySubscriptExpr(
nullptr, LHS,
2207 return getSema().ActOnOMPArraySectionExpr(Base, LBracketLoc, LowerBound,
2208 ColonLoc, Length, RBracketLoc);
2218 Expr *ExecConfig =
nullptr) {
2219 return getSema().ActOnCallExpr(
nullptr, Callee, LParenLoc,
2220 Args, RParenLoc, ExecConfig);
2242 assert(!QualifierLoc &&
"Can't have an unnamed field with a qualifier!");
2244 "unnamed member not of record type?");
2247 getSema().PerformObjectMemberConversion(BaseResult.get(),
2250 if (BaseResult.isInvalid())
2252 Base = BaseResult.get();
2255 MemberExpr(Base, isArrow, OpLoc, Member, MemberNameInfo,
2256 cast<FieldDecl>(Member)->getType(), VK,
OK_Ordinary);
2261 SS.
Adopt(QualifierLoc);
2263 Base = BaseResult.
get();
2275 return getSema().BuildMemberReferenceExpr(Base, BaseType, OpLoc, isArrow,
2277 FirstQualifierInScope,
2278 R, ExplicitTemplateArgs,
2289 return getSema().BuildBinOp(
nullptr, OpLoc, Opc, LHS, RHS);
2301 return getSema().ActOnConditionalOp(QuestionLoc, ColonLoc, Cond,
2313 return getSema().BuildCStyleCastExpr(LParenLoc, TInfo, RParenLoc,
2325 return getSema().BuildCompoundLiteralExpr(LParenLoc, TInfo, RParenLoc,
2340 return getSema().BuildMemberReferenceExpr(Base, Base->
getType(),
2403 return getSema().BuildVAArgExpr(BuiltinLoc,
2415 return getSema().ActOnParenListExpr(LParenLoc, RParenLoc, SubExprs);
2425 return getSema().ActOnAddrLabel(AmpAmpLoc, LabelLoc, Label);
2435 return getSema().ActOnStmtExpr(LParenLoc, SubStmt, RParenLoc);
2457 Expr *ControllingExpr,
2460 return getSema().CreateGenericSelectionExpr(KeyLoc, DefaultLoc, RParenLoc,
2461 ControllingExpr, Types, Exprs);
2493 case Stmt::CXXStaticCastExprClass:
2494 return getDerived().RebuildCXXStaticCastExpr(OpLoc, LAngleLoc, TInfo,
2495 RAngleLoc, LParenLoc,
2496 SubExpr, RParenLoc);
2498 case Stmt::CXXDynamicCastExprClass:
2499 return getDerived().RebuildCXXDynamicCastExpr(OpLoc, LAngleLoc, TInfo,
2500 RAngleLoc, LParenLoc,
2501 SubExpr, RParenLoc);
2503 case Stmt::CXXReinterpretCastExprClass:
2504 return getDerived().RebuildCXXReinterpretCastExpr(OpLoc, LAngleLoc, TInfo,
2505 RAngleLoc, LParenLoc,
2509 case Stmt::CXXConstCastExprClass:
2510 return getDerived().RebuildCXXConstCastExpr(OpLoc, LAngleLoc, TInfo,
2511 RAngleLoc, LParenLoc,
2512 SubExpr, RParenLoc);
2515 llvm_unreachable(
"Invalid C++ named cast");
2530 return getSema().BuildCXXNamedCast(OpLoc, tok::kw_static_cast,
2547 return getSema().BuildCXXNamedCast(OpLoc, tok::kw_dynamic_cast,
2564 return getSema().BuildCXXNamedCast(OpLoc, tok::kw_reinterpret_cast,
2581 return getSema().BuildCXXNamedCast(OpLoc, tok::kw_const_cast,
2595 return getSema().BuildCXXTypeConstructExpr(TInfo, LParenLoc,
2608 return getSema().BuildCXXTypeId(TypeInfoType, TypeidLoc, Operand,
2621 return getSema().BuildCXXTypeId(TypeInfoType, TypeidLoc, Operand,
2633 return getSema().BuildCXXUuidof(TypeInfoType, TypeidLoc, Operand,
2645 return getSema().BuildCXXUuidof(TypeInfoType, TypeidLoc, Operand,
2657 getSema().CheckCXXThisCapture(ThisLoc);
2658 return new (getSema().Context)
CXXThisExpr(ThisLoc, ThisType, isImplicit);
2666 bool IsThrownVariableInScope) {
2667 return getSema().BuildCXXThrow(ThrowLoc, Sub, IsThrownVariableInScope);
2697 return getSema().BuildCXXTypeConstructExpr(TSInfo, LParenLoc,
2715 Expr *Initializer) {
2716 return getSema().BuildCXXNew(StartLoc, UseGlobal,
2733 bool IsGlobalDelete,
2736 return getSema().ActOnCXXDelete(StartLoc, IsGlobalDelete, IsArrayForm,
2748 return getSema().BuildTypeTrait(Trait, StartLoc, Args, RParenLoc);
2760 return getSema().BuildArrayTypeTrait(Trait, StartLoc, TSInfo, DimExpr, RParenLoc);
2771 return getSema().BuildExpressionTrait(Trait, StartLoc, Queried, RParenLoc);
2784 bool IsAddressOfOperand,
2787 SS.
Adopt(QualifierLoc);
2789 if (TemplateArgs || TemplateKWLoc.
isValid())
2790 return getSema().BuildQualifiedTemplateIdExpr(SS, TemplateKWLoc, NameInfo,
2793 return getSema().BuildQualifiedDeclarationNameExpr(
2794 SS, NameInfo, IsAddressOfOperand,
nullptr, RecoveryTSI);
2806 return getSema().BuildTemplateIdExpr(SS, TemplateKWLoc, R, RequiresADL,
2819 bool HadMultipleCandidates,
2820 bool ListInitialization,
2821 bool StdInitListInitialization,
2822 bool RequiresZeroInit,
2826 if (getSema().CompleteConstructorCall(Constructor, Args, Loc,
2830 return getSema().BuildCXXConstructExpr(Loc, T, Constructor,
2833 HadMultipleCandidates,
2835 StdInitListInitialization,
2836 RequiresZeroInit, ConstructKind,
2844 bool ConstructsVBase,
2845 bool InheritedFromVBase) {
2847 Loc, T, Constructor, ConstructsVBase, InheritedFromVBase);
2858 return getSema().BuildCXXTypeConstructExpr(TSInfo,
2872 return getSema().BuildCXXTypeConstructExpr(TSInfo,
2892 SS.
Adopt(QualifierLoc);
2895 OperatorLoc, IsArrow,
2897 FirstQualifierInScope,
2899 TemplateArgs,
nullptr);
2915 SS.
Adopt(QualifierLoc);
2918 OperatorLoc, IsArrow,
2920 FirstQualifierInScope,
2921 R, TemplateArgs,
nullptr);
2940 RParenLoc, Length, PartialArgs);
2948 return getSema().BuildObjCBoxedExpr(SR, ValueExpr);
2956 Expr **Elements,
unsigned NumElements) {
2957 return getSema().BuildObjCArrayLiteral(Range,
2965 return getSema().BuildObjCSubscriptExpression(RB, Base, Key,
2966 getterMethod, setterMethod);
2975 return getSema().BuildObjCDictionaryLiteral(Range, Elements);
2999 Sel, Method, LBracLoc, SelectorLocs,
3014 Sel, Method, LBracLoc, SelectorLocs,
3030 Sel, Method, LBracLoc, SelectorLocs,
3035 Sel, Method, LBracLoc, SelectorLocs,
3047 bool IsArrow,
bool IsFreeIvar) {
3050 ExprResult Result = getSema().BuildMemberReferenceExpr(
3056 if (IsFreeIvar && Result.isUsable())
3057 cast<ObjCIvarRefExpr>(Result.get())->setIsFreeIvar(IsFreeIvar);
3070 return getSema().BuildMemberReferenceExpr(BaseArg, BaseArg->
getType(),
3093 PropertyLoc, Base));
3104 return getSema().BuildMemberReferenceExpr(BaseArg, BaseArg->
getType(),
3125 assert(!Lookup.
empty() &&
"No __builtin_shufflevector?");
3134 CK_BuiltinFnToFnPtr).
get();
3138 SemaRef.
Context, Callee, SubExprs, Builtin->getCallResultType(),
3150 BuiltinLoc, RParenLoc);
3165 EllipsisLoc, NumExpansions);
3186 llvm_unreachable(
"Pack expansion pattern has no parameter packs");
3208 return getSema().CheckPackExpansion(Pattern, EllipsisLoc, NumExpansions);
3219 return getSema().BuildCXXFoldExpr(LParenLoc, LHS, Operator, EllipsisLoc,
3229 return getSema().BuildEmptyCXXFoldExpr(EllipsisLoc, Operator);
3265 bool DeducibleTSTContext);
3268 template<
typename Derived>
3277 #define STMT(Node, Parent) \ 3278 case Stmt::Node##Class: return getDerived().Transform##Node(cast<Node>(S)); 3279 #define ABSTRACT_STMT(Node) 3280 #define EXPR(Node, Parent) 3281 #include "clang/AST/StmtNodes.inc" 3284 #define STMT(Node, Parent) 3285 #define ABSTRACT_STMT(Stmt) 3286 #define EXPR(Node, Parent) case Stmt::Node##Class: 3287 #include "clang/AST/StmtNodes.inc" 3289 ExprResult E = getDerived().TransformExpr(cast<Expr>(S));
3293 return getSema().ActOnExprStmt(E);
3300 template<
typename Derived>
3308 #define OPENMP_CLAUSE(Name, Class) \ 3309 case OMPC_ ## Name : \ 3310 return getDerived().Transform ## Class(cast<Class>(S)); 3311 #include "clang/Basic/OpenMPKinds.def" 3318 template<
typename Derived>
3325 #define STMT(Node, Parent) case Stmt::Node##Class: break; 3326 #define ABSTRACT_STMT(Stmt) 3327 #define EXPR(Node, Parent) \ 3328 case Stmt::Node##Class: return getDerived().Transform##Node(cast<Node>(E)); 3329 #include "clang/AST/StmtNodes.inc" 3335 template<
typename Derived>
3344 Init = ExprTemp->getSubExpr();
3346 if (
auto *AIL = dyn_cast<ArrayInitLoopExpr>(Init))
3347 Init = AIL->getCommonExpr();
3350 Init = MTE->GetTemporaryExpr();
3353 Init = Binder->getSubExpr();
3356 Init = ICE->getSubExprAsWritten();
3359 dyn_cast<CXXStdInitializerListExpr>(Init))
3360 return TransformInitializer(ILE->getSubExpr(), NotCopyInit);
3366 if (!NotCopyInit && !(Construct && Construct->isListInitialization()))
3367 return getDerived().TransformExpr(Init);
3372 return getDerived().RebuildParenListExpr(Parens.
getBegin(), None,
3377 if (isa<ImplicitValueInitExpr>(Init))
3383 if (!Construct || isa<CXXTemporaryObjectExpr>(Construct))
3384 return getDerived().TransformExpr(Init);
3388 if (Construct && Construct->isStdInitListInitialization())
3389 return TransformInitializer(Construct->getArg(0), NotCopyInit);
3392 bool ArgChanged =
false;
3393 if (getDerived().TransformExprs(Construct->getArgs(), Construct->getNumArgs(),
3394 true, NewArgs, &ArgChanged))
3398 if (Construct->isListInitialization())
3399 return getDerived().RebuildInitList(Construct->getLocStart(), NewArgs,
3400 Construct->getLocEnd(),
3401 Construct->getType());
3404 SourceRange Parens = Construct->getParenOrBraceRange();
3408 assert(NewArgs.empty() &&
3409 "no parens or braces but have direct init with arguments?");
3412 return getDerived().RebuildParenListExpr(Parens.
getBegin(), NewArgs,
3416 template<
typename Derived>
3422 for (
unsigned I = 0; I != NumInputs; ++I) {
3424 if (IsCall && getDerived().DropCallArgument(Inputs[I])) {
3432 Expr *Pattern = Expansion->getPattern();
3435 getSema().collectUnexpandedParameterPacks(Pattern, Unexpanded);
3436 assert(!Unexpanded.empty() &&
"Pack expansion without parameter packs?");
3441 bool RetainExpansion =
false;
3444 if (getDerived().TryExpandParameterPacks(Expansion->getEllipsisLoc(),
3447 Expand, RetainExpansion,
3456 ExprResult OutPattern = getDerived().TransformExpr(Pattern);
3460 ExprResult Out = getDerived().RebuildPackExpansion(OutPattern.
get(),
3461 Expansion->getEllipsisLoc(),
3468 Outputs.push_back(Out.
get());
3474 if (ArgChanged) *ArgChanged =
true;
3478 for (
unsigned I = 0; I != *NumExpansions; ++I) {
3480 ExprResult Out = getDerived().TransformExpr(Pattern);
3484 if (Out.
get()->containsUnexpandedParameterPack()) {
3485 Out = getDerived().RebuildPackExpansion(
3486 Out.
get(), Expansion->getEllipsisLoc(), OrigNumExpansions);
3491 Outputs.push_back(Out.
get());
3496 if (RetainExpansion) {
3497 ForgetPartiallySubstitutedPackRAII Forget(getDerived());
3499 ExprResult Out = getDerived().TransformExpr(Pattern);
3503 Out = getDerived().RebuildPackExpansion(
3504 Out.
get(), Expansion->getEllipsisLoc(), OrigNumExpansions);
3508 Outputs.push_back(Out.
get());
3515 IsCall ? getDerived().TransformInitializer(Inputs[I],
false)
3516 : getDerived().TransformExpr(Inputs[I]);
3520 if (Result.
get() != Inputs[I] && ArgChanged)
3523 Outputs.push_back(Result.
get());
3529 template <
typename Derived>
3533 VarDecl *ConditionVar = cast_or_null<VarDecl>(
3534 getDerived().TransformDefinition(Var->
getLocation(), Var));
3539 return getSema().ActOnConditionVariable(ConditionVar, Loc, Kind);
3543 ExprResult CondExpr = getDerived().TransformExpr(Expr);
3548 return getSema().ActOnCondition(
nullptr, Loc, CondExpr.
get(),
Kind);
3554 template<
typename Derived>
3563 Qualifiers.push_back(Qualifier);
3566 while (!Qualifiers.empty()) {
3574 if (SemaRef.BuildCXXNestedNameSpecifier(
nullptr, IdInfo,
false,
3575 SS, FirstQualifierInScope,
false))
3582 = cast_or_null<NamespaceDecl>(
3583 getDerived().TransformDecl(
3592 = cast_or_null<NamespaceAliasDecl>(
3608 cast_or_null<CXXRecordDecl>(getDerived().TransformDecl(
3617 FirstQualifierInScope, SS);
3623 (SemaRef.getLangOpts().CPlusPlus11 &&
3626 "Can't get cv-qualifiers here");
3629 diag::warn_cxx98_compat_enum_nested_name_spec);
3638 SemaRef.Diag(TL.
getBeginLoc(), diag::err_nested_name_spec_non_tag)
3646 FirstQualifierInScope =
nullptr;
3652 !getDerived().AlwaysRebuild())
3665 template<
typename Derived>
3685 TemplateDecl *NewTemplate = cast_or_null<TemplateDecl>(
3686 getDerived().TransformDecl(NameInfo.
getLoc(), OldTemplate));
3692 SemaRef.Context.DeclarationNames.getCXXDeductionGuideName(NewTemplate));
3702 NewTInfo = getDerived().TransformType(OldTInfo);
3705 NewCanTy = SemaRef.Context.getCanonicalType(NewTInfo->
getType());
3713 NewCanTy = SemaRef.Context.getCanonicalType(NewT);
3717 = SemaRef.Context.DeclarationNames.getCXXSpecialName(Name.
getNameKind(),
3726 llvm_unreachable(
"Unknown name kind.");
3729 template<
typename Derived>
3736 bool AllowInjectedClassName) {
3739 assert(Template &&
"qualified template name must refer to a template");
3742 = cast_or_null<TemplateDecl>(getDerived().TransformDecl(NameLoc,
3747 if (!getDerived().AlwaysRebuild() &&
3749 TransTemplate == Template)
3752 return getDerived().RebuildTemplateName(SS, QTN->hasTemplateKeyword(),
3760 FirstQualifierInScope =
nullptr;
3763 if (!getDerived().AlwaysRebuild() &&
3768 if (DTN->isIdentifier()) {
3769 return getDerived().RebuildTemplateName(SS,
3770 *DTN->getIdentifier(),
3773 FirstQualifierInScope,
3774 AllowInjectedClassName);
3777 return getDerived().RebuildTemplateName(SS, DTN->getOperator(), NameLoc,
3778 ObjectType, AllowInjectedClassName);
3783 = cast_or_null<TemplateDecl>(getDerived().TransformDecl(NameLoc,
3788 if (!getDerived().AlwaysRebuild() &&
3789 TransTemplate == Template)
3798 = cast_or_null<TemplateTemplateParmDecl>(
3799 getDerived().TransformDecl(NameLoc, SubstPack->getParameterPack()));
3803 if (!getDerived().AlwaysRebuild() &&
3804 TransParam == SubstPack->getParameterPack())
3807 return getDerived().RebuildTemplateName(TransParam,
3808 SubstPack->getArgumentPack());
3812 llvm_unreachable(
"overloaded function decl survived to here");
3815 template<
typename Derived>
3822 llvm_unreachable(
"null template argument in TreeTransform");
3827 SemaRef.Context.getTrivialTypeSourceInfo(Arg.
getAsType(), Loc));
3836 Builder.
MakeTrivial(SemaRef.Context, DTN->getQualifier(), Loc);
3838 Builder.
MakeTrivial(SemaRef.Context, QTN->getQualifier(), Loc);
3865 template<
typename Derived>
3876 llvm_unreachable(
"Unexpected TemplateArgument");
3883 DI = getDerived().TransformType(DI);
3884 if (!DI)
return true;
3893 QualifierLoc = getDerived().TransformNestedNameSpecifierLoc(QualifierLoc);
3899 SS.
Adopt(QualifierLoc);
3901 = getDerived().TransformTemplateName(SS, Arg.
getAsTemplate(),
3912 llvm_unreachable(
"Caller should expand pack expansions");
3924 ExprResult E = getDerived().TransformExpr(InputExpr);
3925 E = SemaRef.ActOnConstantExpression(E);
3938 template<
typename Derived,
typename InputIterator>
3946 typedef typename std::iterator_traits<InputIterator>::difference_type
3963 : Self(Self), Iter(Iter) { }
3986 return X.Iter == Y.Iter;
3991 return X.Iter != Y.Iter;
3995 template<
typename Derived>
3996 template<
typename InputIterator>
4000 for (; First != Last; ++First) {
4013 if (TransformTemplateArguments(PackLocIterator(*
this,
4015 PackLocIterator(*
this,
4029 = getSema().getTemplateArgumentPackExpansionPattern(
4030 In, Ellipsis, OrigNumExpansions);
4033 getSema().collectUnexpandedParameterPacks(Pattern, Unexpanded);
4034 assert(!Unexpanded.empty() &&
"Pack expansion without parameter packs?");
4039 bool RetainExpansion =
false;
4041 if (getDerived().TryExpandParameterPacks(Ellipsis,
4055 if (getDerived().TransformTemplateArgument(Pattern, OutPattern, Uneval))
4058 Out = getDerived().RebuildPackExpansion(OutPattern, Ellipsis,
4069 for (
unsigned I = 0; I != *NumExpansions; ++I) {
4072 if (getDerived().TransformTemplateArgument(Pattern, Out, Uneval))
4076 Out = getDerived().RebuildPackExpansion(Out, Ellipsis,
4087 if (RetainExpansion) {
4088 ForgetPartiallySubstitutedPackRAII Forget(getDerived());
4090 if (getDerived().TransformTemplateArgument(Pattern, Out, Uneval))
4093 Out = getDerived().RebuildPackExpansion(Out, Ellipsis,
4105 if (getDerived().TransformTemplateArgument(In, Out, Uneval))
4119 template<
typename Derived>
4121 if (getDerived().AlreadyTransformed(T))
4126 TypeSourceInfo *DI = getSema().Context.getTrivialTypeSourceInfo(T,
4127 getDerived().getBaseLocation());
4137 template<
typename Derived>
4141 getDerived().getBaseEntity());
4142 if (getDerived().AlreadyTransformed(DI->
getType()))
4150 QualType Result = getDerived().TransformType(TLB, TL);
4157 template<
typename Derived>
4161 #define ABSTRACT_TYPELOC(CLASS, PARENT) 4162 #define TYPELOC(CLASS, PARENT) \ 4163 case TypeLoc::CLASS: \ 4164 return getDerived().Transform##CLASS##Type(TLB, \ 4165 T.castAs<CLASS##TypeLoc>()); 4166 #include "clang/AST/TypeLocNodes.def" 4169 llvm_unreachable(
"unhandled type loc!");
4172 template<
typename Derived>
4174 if (!isa<DependentNameType>(T))
4175 return TransformType(T);
4177 if (getDerived().AlreadyTransformed(T))
4179 TypeSourceInfo *DI = getSema().Context.getTrivialTypeSourceInfo(T,
4180 getDerived().getBaseLocation());
4181 TypeSourceInfo *NewDI = getDerived().TransformTypeWithDeducedTST(DI);
4185 template<
typename Derived>
4188 if (!isa<DependentNameType>(DI->
getType()))
4189 return TransformType(DI);
4193 getDerived().getBaseEntity());
4194 if (getDerived().AlreadyTransformed(DI->
getType()))
4208 QualType Result = getDerived().TransformDependentNameType(
4210 if (Result.isNull())
4214 Result = getDerived().RebuildQualifiedType(
4215 Result, QTL.getBeginLoc(), QTL.getType().getLocalQualifiers());
4222 template<
typename Derived>
4232 Result = getDerived().RebuildQualifiedType(Result, T.
getBeginLoc(), Quals);
4242 template<
typename Derived>
4269 = dyn_cast<SubstTemplateTypeParmType>(T)) {
4273 Replacement = SemaRef.Context.getQualifiedType(
4275 T = SemaRef.Context.getSubstTemplateTypeParmType(
4276 SubstTypeParam->getReplacedParameter(),
Replacement);
4277 }
else if ((AutoTy = dyn_cast<AutoType>(T)) && AutoTy->
isDeduced()) {
4284 T = SemaRef.Context.getAutoType(Deduced, AutoTy->
getKeyword(),
4290 SemaRef.Diag(Loc, diag::err_attr_objc_ownership_redundant) <<
T;
4296 return SemaRef.BuildQualifiedType(T, Loc, Quals);
4299 template<
typename Derived>
4305 if (getDerived().AlreadyTransformed(TL.
getType()))
4309 TransformTSIInObjectScope(TL, ObjectType, UnqualLookup, SS);
4315 template<
typename Derived>
4321 if (getDerived().AlreadyTransformed(TSInfo->
getType()))
4324 return TransformTSIInObjectScope(TSInfo->
getTypeLoc(), ObjectType,
4328 template <
typename Derived>
4333 assert(!getDerived().AlreadyTransformed(T));
4338 if (isa<TemplateSpecializationType>(T)) {
4342 TemplateName Template = getDerived().TransformTemplateName(
4344 ObjectType, UnqualLookup,
true);
4345 if (Template.isNull())
4348 Result = getDerived().TransformTemplateSpecializationType(TLB, SpecTL,
4350 }
else if (isa<DependentTemplateSpecializationType>(T)) {
4355 = getDerived().RebuildTemplateName(SS,
4358 ObjectType, UnqualLookup,
4360 if (Template.isNull())
4363 Result = getDerived().TransformDependentTemplateSpecializationType(TLB,
4369 Result = getDerived().TransformType(TLB, TL);
4378 template <
class TyLoc>
static inline 4380 TyLoc NewT = TLB.
push<TyLoc>(T.getType());
4381 NewT.setNameLoc(T.getNameLoc());
4385 template<
typename Derived>
4395 template<
typename Derived>
4402 template <
typename Derived>
4409 template<
typename Derived>
4413 if (OriginalType.
isNull())
4417 if (getDerived().AlwaysRebuild() ||
4419 Result = SemaRef.Context.getDecayedType(OriginalType);
4425 template<
typename Derived>
4430 if (PointeeType.
isNull())
4439 Result = SemaRef.Context.getObjCObjectPointerType(PointeeType);
4446 if (getDerived().AlwaysRebuild() ||
4448 Result = getDerived().RebuildPointerType(PointeeType, TL.
getSigilLoc());
4462 template<
typename Derived>
4468 if (PointeeType.
isNull())
4472 if (getDerived().AlwaysRebuild() ||
4474 Result = getDerived().RebuildBlockPointerType(PointeeType,
4489 template<
typename Derived>
4497 if (PointeeType.
isNull())
4501 if (getDerived().AlwaysRebuild() ||
4503 Result = getDerived().RebuildReferenceType(PointeeType,
4517 if (isa<LValueReferenceType>(Result))
4526 template<
typename Derived>
4530 return TransformReferenceType(TLB, TL);
4533 template<
typename Derived>
4537 return TransformReferenceType(TLB, TL);
4540 template<
typename Derived>
4545 if (PointeeType.
isNull())
4551 NewClsTInfo = getDerived().TransformType(OldClsTInfo);
4560 NewClsType = NewClsTInfo->
getType();
4562 NewClsType = getDerived().TransformType(OldClsType);
4563 if (NewClsType.isNull())
4568 if (getDerived().AlwaysRebuild() ||
4570 NewClsType != OldClsType) {
4571 Result = getDerived().RebuildMemberPointerType(PointeeType, NewClsType,
4587 NewTL.setClassTInfo(NewClsTInfo);
4592 template<
typename Derived>
4598 if (ElementType.
isNull())
4602 if (getDerived().AlwaysRebuild() ||
4604 Result = getDerived().RebuildConstantArrayType(ElementType,
4625 Size = getDerived().TransformExpr(Size).template getAs<Expr>();
4626 Size = SemaRef.ActOnConstantExpression(Size).get();
4633 template<
typename Derived>
4639 if (ElementType.
isNull())
4643 if (getDerived().AlwaysRebuild() ||
4645 Result = getDerived().RebuildIncompleteArrayType(ElementType,
4661 template<
typename Derived>
4667 if (ElementType.
isNull())
4674 SizeResult = getDerived().TransformExpr(T->
getSizeExpr());
4678 SizeResult = SemaRef.ActOnFinishFullExpr(SizeResult.
get());
4682 Expr *Size = SizeResult.
get();
4685 if (getDerived().AlwaysRebuild() ||
4688 Result = getDerived().RebuildVariableArrayType(ElementType,
4707 template<
typename Derived>
4713 if (ElementType.
isNull())
4725 = getDerived().TransformExpr(origSize);
4726 sizeResult = SemaRef.ActOnConstantExpression(sizeResult);
4730 Expr *size = sizeResult.
get();
4733 if (getDerived().AlwaysRebuild() ||
4736 Result = getDerived().RebuildDependentSizedArrayType(ElementType,
4755 template<
typename Derived>
4763 if (ElementType.
isNull())
4771 Size = SemaRef.ActOnConstantExpression(Size);
4776 if (getDerived().AlwaysRebuild() ||
4779 Result = getDerived().RebuildDependentSizedExtVectorType(ElementType,
4787 if (isa<DependentSizedExtVectorType>(Result)) {
4799 template <
typename Derived>
4806 if (pointeeType.
isNull())
4814 AddrSpace = SemaRef.ActOnConstantExpression(AddrSpace);
4819 if (getDerived().AlwaysRebuild() || pointeeType != T->
getPointeeType() ||
4821 Result = getDerived().RebuildDependentAddressSpaceType(
4828 if (isa<DependentAddressSpaceType>(Result)) {
4838 Result, getDerived().getBaseLocation());
4845 template <
typename Derived>
4850 if (ElementType.
isNull())
4854 if (getDerived().AlwaysRebuild() ||
4856 Result = getDerived().RebuildVectorType(ElementType, T->
getNumElements(),
4868 template<
typename Derived>
4873 if (ElementType.
isNull())
4877 if (getDerived().AlwaysRebuild() ||
4879 Result = getDerived().RebuildExtVectorType(ElementType,
4892 template <
typename Derived>
4895 bool ExpectParameterPack) {
4899 if (NumExpansions && isa<PackExpansionType>(OldDI->
getType())) {
4909 QualType Result = getDerived().TransformType(TLB,
4914 Result = RebuildPackExpansionType(Result,
4924 NewDI = TLB.getTypeSourceInfo(SemaRef.Context, Result);
4926 NewDI = getDerived().TransformType(OldDI);
4930 if (NewDI == OldDI && indexAdjustment == 0)
4947 template <
typename Derived>
4955 int indexAdjustment = 0;
4957 unsigned NumParams = Params.size();
4958 for (
unsigned i = 0; i != NumParams; ++i) {
4960 assert(OldParm->getFunctionScopeIndex() == i);
4964 if (OldParm->isParameterPack()) {
4969 TypeLoc TL = OldParm->getTypeSourceInfo()->getTypeLoc();
4972 SemaRef.collectUnexpandedParameterPacks(Pattern, Unexpanded);
4973 assert(Unexpanded.size() > 0 &&
"Could not find parameter packs!");
4976 bool ShouldExpand =
false;
4977 bool RetainExpansion =
false;
4980 NumExpansions = OrigNumExpansions;
4981 if (getDerived().TryExpandParameterPacks(ExpansionTL.
getEllipsisLoc(),
4982 Pattern.getSourceRange(),
4993 getDerived().ExpandingFunctionParameterPack(OldParm);
4994 for (
unsigned I = 0; I != *NumExpansions; ++I) {
4997 = getDerived().TransformFunctionTypeParam(OldParm,
5005 PInfos.
set(OutParamTypes.size(), ParamInfos[i]);
5006 OutParamTypes.push_back(NewParm->
getType());
5008 PVars->push_back(NewParm);
5013 if (RetainExpansion) {
5014 ForgetPartiallySubstitutedPackRAII Forget(getDerived());
5016 = getDerived().TransformFunctionTypeParam(OldParm,
5024 PInfos.
set(OutParamTypes.size(), ParamInfos[i]);
5025 OutParamTypes.push_back(NewParm->
getType());
5027 PVars->push_back(NewParm);
5043 NewParm = getDerived().TransformFunctionTypeParam(OldParm,
5048 NewParm = getDerived().TransformFunctionTypeParam(
5049 OldParm, indexAdjustment, None,
false);
5056 PInfos.
set(OutParamTypes.size(), ParamInfos[i]);
5057 OutParamTypes.push_back(NewParm->
getType());
5059 PVars->push_back(NewParm);
5066 bool IsPackExpansion =
false;
5070 = dyn_cast<PackExpansionType>(OldType)) {
5072 QualType Pattern = Expansion->getPattern();
5074 getSema().collectUnexpandedParameterPacks(Pattern, Unexpanded);
5077 bool ShouldExpand =
false;
5078 bool RetainExpansion =
false;
5079 if (getDerived().TryExpandParameterPacks(Loc,
SourceRange(),
5090 for (
unsigned I = 0; I != *NumExpansions; ++I) {
5092 QualType NewType = getDerived().TransformType(Pattern);
5098 getSema().getASTContext().getPackExpansionType(NewType, None);
5105 PInfos.
set(OutParamTypes.size(), ParamInfos[i]);
5106 OutParamTypes.push_back(NewType);
5108 PVars->push_back(
nullptr);
5117 if (RetainExpansion) {
5118 ForgetPartiallySubstitutedPackRAII Forget(getDerived());
5119 QualType NewType = getDerived().TransformType(Pattern);
5124 PInfos.
set(OutParamTypes.size(), ParamInfos[i]);
5125 OutParamTypes.push_back(NewType);
5127 PVars->push_back(
nullptr);
5132 OldType = Expansion->getPattern();
5133 IsPackExpansion =
true;
5135 NewType = getDerived().TransformType(OldType);
5137 NewType = getDerived().TransformType(OldType);
5143 if (IsPackExpansion)
5144 NewType = getSema().Context.getPackExpansionType(NewType,
5148 PInfos.
set(OutParamTypes.size(), ParamInfos[i]);
5149 OutParamTypes.push_back(NewType);
5151 PVars->push_back(
nullptr);
5156 for (
unsigned i = 0, e = PVars->size(); i != e; ++i)
5158 assert(parm->getFunctionScopeIndex() == i);
5165 template<
typename Derived>
5172 TLB, TL,
nullptr, 0,
5175 ExceptionStorage, Changed);
5179 template<
typename Derived>
template<
typename Fn>
5182 unsigned ThisTypeQuals, Fn TransformExceptionSpec) {
5199 if (getDerived().TransformFunctionTypeParams(
5203 ParamTypes, &ParamDecls, ExtParamInfos))
5215 ResultType = getDerived().TransformType(TLB, TL.
getReturnLoc());
5221 ResultType = getDerived().TransformType(TLB, TL.
getReturnLoc());
5225 if (getDerived().TransformFunctionTypeParams(
5229 ParamTypes, &ParamDecls, ExtParamInfos))
5235 bool EPIChanged =
false;
5240 if (
auto NewExtParamInfos =
5244 != llvm::makeArrayRef(NewExtParamInfos, ParamTypes.size())) {
5254 if (getDerived().AlwaysRebuild() || ResultType != T->
getReturnType() ||
5255 T->
getParamTypes() != llvm::makeArrayRef(ParamTypes) || EPIChanged) {
5256 Result = getDerived().RebuildFunctionProtoType(ResultType, ParamTypes, EPI);
5267 for (
unsigned i = 0, e = NewTL.
getNumParams(); i != e; ++i)
5273 template<
typename Derived>
5288 NoexceptExpr = getSema().CheckBooleanCondition(Loc, NoexceptExpr.
get());
5292 if (!NoexceptExpr.
get()->isValueDependent()) {
5293 NoexceptExpr = getSema().VerifyIntegerConstantExpression(
5294 NoexceptExpr.
get(),
nullptr,
5295 diag::err_noexcept_needs_constant_expression,
5317 SemaRef.collectUnexpandedParameterPacks(PackExpansion->getPattern(),
5319 assert(!Unexpanded.empty() &&
"Pack expansion without parameter packs?");
5324 bool Expand =
false;
5325 bool RetainExpansion =
false;
5329 if (getDerived().TryExpandParameterPacks(
5331 RetainExpansion, NumExpansions))
5339 QualType U = getDerived().TransformType(PackExpansion->getPattern());
5343 U = SemaRef.Context.getPackExpansionType(U, NumExpansions);
5344 Exceptions.push_back(U);
5350 for (
unsigned ArgIdx = 0; ArgIdx != *NumExpansions; ++ArgIdx) {
5353 QualType U = getDerived().TransformType(PackExpansion->getPattern());
5354 if (U.
isNull() || SemaRef.CheckSpecifiedExceptionType(U, Loc))
5357 Exceptions.push_back(U);
5360 QualType U = getDerived().TransformType(T);
5361 if (U.
isNull() || SemaRef.CheckSpecifiedExceptionType(U, Loc))
5366 Exceptions.push_back(U);
5376 template<
typename Derived>
5386 if (getDerived().AlwaysRebuild() || ResultType != T->
getReturnType())
5387 Result = getDerived().RebuildFunctionNoProtoType(ResultType);
5398 template<
typename Derived>
QualType 5407 if (getDerived().AlwaysRebuild() || D != T->
getDecl()) {
5408 Result = getDerived().RebuildUnresolvedUsingType(TL.
getNameLoc(), D);
5421 template<
typename Derived>
5426 = cast_or_null<TypedefNameDecl>(getDerived().TransformDecl(TL.
getNameLoc(),
5432 if (getDerived().AlwaysRebuild() ||
5434 Result = getDerived().RebuildTypedefType(Typedef);
5445 template<
typename Derived>
5457 E = SemaRef.HandleExprEvaluationContextForTypeof(E.
get());
5462 if (getDerived().AlwaysRebuild() ||
5464 Result = getDerived().RebuildTypeOfExprType(E.
get(), TL.
getTypeofLoc());
5478 template<
typename Derived>
5482 TypeSourceInfo* New_Under_TI = getDerived().TransformType(Old_Under_TI);
5487 if (getDerived().AlwaysRebuild() || New_Under_TI != Old_Under_TI) {
5488 Result = getDerived().RebuildTypeOfType(New_Under_TI->
getType());
5502 template<
typename Derived>
5516 E = getSema().ActOnDecltypeExpression(E.
get());
5521 if (getDerived().AlwaysRebuild() ||
5523 Result = getDerived().RebuildDecltypeType(E.
get(), TL.
getNameLoc());
5535 template<
typename Derived>
5544 Result = getDerived().RebuildUnaryTransformType(NewBase,
5558 template<
typename Derived>
5564 if (!OldDeduced.
isNull()) {
5565 NewDeduced = getDerived().TransformType(OldDeduced);
5571 if (getDerived().AlwaysRebuild() || NewDeduced != OldDeduced ||
5573 Result = getDerived().RebuildAutoType(NewDeduced, T->
getKeyword());
5584 template<
typename Derived>
5592 if (TemplateName.
isNull())
5597 if (!OldDeduced.
isNull()) {
5598 NewDeduced = getDerived().TransformType(OldDeduced);
5603 QualType Result = getDerived().RebuildDeducedTemplateSpecializationType(
5604 TemplateName, NewDeduced);
5615 template<
typename Derived>
5620 = cast_or_null<RecordDecl>(getDerived().TransformDecl(TL.
getNameLoc(),
5626 if (getDerived().AlwaysRebuild() ||
5628 Result = getDerived().RebuildRecordType(Record);
5639 template<
typename Derived>
5644 = cast_or_null<EnumDecl>(getDerived().TransformDecl(TL.
getNameLoc(),
5650 if (getDerived().AlwaysRebuild() ||
5652 Result = getDerived().RebuildEnumType(Enum);
5663 template<
typename Derived>
5671 QualType T = SemaRef.Context.getTypeDeclType(cast<TypeDecl>(D));
5676 template<
typename Derived>
5683 template<
typename Derived>
5694 if (Replacement.isNull())
5711 template<
typename Derived>
5718 template<
typename Derived>
5733 return getDerived().TransformTemplateSpecializationType(TLB, TL, Template);
5736 template<
typename Derived>
5744 if (getDerived().AlwaysRebuild() ||
5746 Result = getDerived().RebuildAtomicType(ValueType, TL.
getKWLoc());
5759 template <
typename Derived>
5770 Result = getDerived().RebuildPipeType(ValueType, TL.
getKWLoc(), isReadPipe);
5786 template<
typename ArgLocContainer>
5788 ArgLocContainer *Container;
5813 : Container(&Container), Index(Index) { }
5827 return Container->getArgLoc(Index);
5831 return pointer(Container->getArgLoc(Index));
5836 return X.Container == Y.Container && X.Index == Y.Index;
5846 template <
typename Derived>
5856 if (getDerived().TransformTemplateArguments(ArgIterator(TL, 0),
5864 getDerived().RebuildTemplateSpecializationType(Template,
5873 if (isa<DependentTemplateSpecializationType>(Result)) {
5882 for (
unsigned i = 0, e = NewTemplateArgs.
size(); i != e; ++i)
5893 for (
unsigned i = 0, e = NewTemplateArgs.
size(); i != e; ++i)
5900 template <
typename Derived>
5911 if (getDerived().TransformTemplateArguments(ArgIterator(TL, 0),
5920 = getSema().Context.getDependentTemplateSpecializationType(
5922 DTN->getQualifier(),
5923 DTN->getIdentifier(),
5934 for (
unsigned i = 0, e = NewTemplateArgs.
size(); i != e; ++i)
5940 = getDerived().RebuildTemplateSpecializationType(Template,
5952 for (
unsigned i = 0, e = NewTemplateArgs.
size(); i != e; ++i)
5959 template<
typename Derived>
5989 diag::err_tag_reference_non_tag)
5992 SemaRef.Diag(TAT->getLocation(), diag::note_declared_at);
5998 if (getDerived().AlwaysRebuild() ||
6003 QualifierLoc, NamedT);
6014 template<
typename Derived>
6020 if (modifiedType.
isNull())
6026 if (getDerived().AlwaysRebuild() ||
6032 if (equivalentType.
isNull())
6039 SemaRef.Diag(TL.
getAttrNameLoc(), diag::err_nullability_nonpointer)
6045 result = SemaRef.Context.getAttributedType(oldType->
getAttrKind(),
6062 template<
typename Derived>
6071 if (getDerived().AlwaysRebuild() ||
6073 Result = getDerived().RebuildParenType(Inner);
6084 template<
typename Derived>
6087 return TransformDependentNameType(TLB, TL,
false);
6090 template<
typename Derived>
6101 = getDerived().RebuildDependentNameType(T->
getKeyword(),
6111 QualType NamedT = ElabT->getNamedType();
6126 template<
typename Derived>
6139 .TransformDependentTemplateSpecializationType(TLB, TL, QualifierLoc);
6142 template<
typename Derived>
6155 if (getDerived().TransformTemplateArguments(ArgIterator(TL, 0),
6160 QualType Result = getDerived().RebuildDependentTemplateSpecializationType(
6167 if (
const ElaboratedType *ElabT = dyn_cast<ElaboratedType>(Result)) {
6168 QualType NamedT = ElabT->getNamedType();
6177 for (
unsigned I = 0, E = NewTemplateArgs.
size(); I != E; ++I)
6184 }
else if (isa<DependentTemplateSpecializationType>(Result)) {
6193 for (
unsigned I = 0, E = NewTemplateArgs.
size(); I != E; ++I)
6202 for (
unsigned I = 0, E = NewTemplateArgs.
size(); I != E; ++I)
6208 template<
typename Derived>
6217 if (getDerived().AlwaysRebuild() ||
6219 Result = getDerived().RebuildPackExpansionType(Pattern,
6232 template<
typename Derived>
6241 template<
typename Derived>
6252 if (getDerived().AlwaysRebuild() ||
6254 Result = getDerived().RebuildObjCTypeParamType(OTP,
6274 template<
typename Derived>
6295 const auto *PackExpansion = PackExpansionLoc.getType()
6298 SemaRef.collectUnexpandedParameterPacks(PackExpansion->getPattern(),
6300 assert(!Unexpanded.empty() &&
"Pack expansion without parameter packs?");
6304 TypeLoc PatternLoc = PackExpansionLoc.getPatternLoc();
6305 bool Expand =
false;
6306 bool RetainExpansion =
false;
6308 if (getDerived().TryExpandParameterPacks(
6309 PackExpansionLoc.getEllipsisLoc(), PatternLoc.getSourceRange(),
6310 Unexpanded, Expand, RetainExpansion, NumExpansions))
6320 TypeArgBuilder.
reserve(PatternLoc.getFullDataSize());
6321 QualType NewPatternType = getDerived().TransformType(TypeArgBuilder,
6323 if (NewPatternType.
isNull())
6326 QualType NewExpansionType = SemaRef.Context.getPackExpansionType(
6327 NewPatternType, NumExpansions);
6329 NewExpansionLoc.
setEllipsisLoc(PackExpansionLoc.getEllipsisLoc());
6330 NewTypeArgInfos.push_back(
6337 for (
unsigned ArgIdx = 0; ArgIdx != *NumExpansions; ++ArgIdx) {
6341 TypeArgBuilder.
reserve(PatternLoc.getFullDataSize());
6343 QualType NewTypeArg = getDerived().TransformType(TypeArgBuilder,
6348 NewTypeArgInfos.push_back(
6357 QualType NewTypeArg = getDerived().TransformType(TypeArgBuilder, TypeArgLoc);
6362 if (NewTypeArg == TypeArg) {
6363 NewTypeArgInfos.push_back(TypeArgInfo);
6367 NewTypeArgInfos.push_back(
6373 if (getDerived().AlwaysRebuild() || AnyChanged) {
6375 Result = getDerived().RebuildObjCObjectType(
6404 template<
typename Derived>
6409 if (PointeeType.
isNull())
6413 if (getDerived().AlwaysRebuild() ||
6415 Result = getDerived().RebuildObjCObjectPointerType(PointeeType,
6429 template<
typename Derived>
6435 template<
typename Derived>
6438 return getDerived().TransformCompoundStmt(S,
false);
6441 template<
typename Derived>
6447 bool SubStmtInvalid =
false;
6448 bool SubStmtChanged =
false;
6450 for (
auto *B : S->
body()) {
6451 StmtResult Result = getDerived().TransformStmt(B);
6455 if (isa<DeclStmt>(B))
6459 SubStmtInvalid =
true;
6463 SubStmtChanged = SubStmtChanged || Result.
get() != B;
6464 Statements.push_back(Result.
getAs<
Stmt>());
6470 if (!getDerived().AlwaysRebuild() &&
6474 return getDerived().RebuildCompoundStmt(S->
getLBracLoc(),
6480 template<
typename Derived>
6489 LHS = getDerived().TransformExpr(S->
getLHS());
6490 LHS = SemaRef.ActOnConstantExpression(LHS);
6495 RHS = getDerived().TransformExpr(S->
getRHS());
6496 RHS = SemaRef.ActOnConstantExpression(RHS);
6518 return getDerived().RebuildCaseStmtBody(Case.
get(), SubStmt.
get());
6521 template<
typename Derived>
6534 template<
typename Derived>
6548 return getDerived().RebuildLabelStmt(S->
getIdentLoc(),
6553 template <
typename Derived>
6561 #define PRAGMA_SPELLING_ATTR(X) \ 6563 return getDerived().Transform##X##Attr(cast<X##Attr>(R)); 6564 #include "clang/Basic/AttrList.inc" 6570 template <
typename Derived>
6572 bool AttrsChanged =
false;
6576 for (
const auto *I : S->
getAttrs()) {
6577 const Attr *R = getDerived().TransformAttr(I);
6578 AttrsChanged |= (I != R);
6589 return getDerived().RebuildAttributedStmt(S->
getAttrLoc(), Attrs,
6593 template<
typename Derived>
6616 if (!ConstexprConditionValue || *ConstexprConditionValue) {
6617 Then = getDerived().TransformStmt(S->
getThen());
6626 if (!ConstexprConditionValue || !*ConstexprConditionValue) {
6627 Else = getDerived().TransformStmt(S->
getElse());
6632 if (!getDerived().AlwaysRebuild() &&
6644 template<
typename Derived>
6661 = getDerived().RebuildSwitchStmtStart(S->
getSwitchLoc(), Init.
get(), Cond);
6671 return getDerived().RebuildSwitchStmtBody(S->
getSwitchLoc(), Switch.
get(),
6675 template<
typename Derived>
6690 if (!getDerived().AlwaysRebuild() &&
6695 return getDerived().RebuildWhileStmt(S->
getWhileLoc(), Cond, Body.
get());
6698 template<
typename Derived>
6711 if (!getDerived().AlwaysRebuild() &&
6721 template<
typename Derived>
6731 if (getSema().getLangOpts().OpenMP && Init.
isUsable())
6732 getSema().ActOnOpenMPLoopInitialization(S->
getForLoc(), Init.
get());
6755 if (!getDerived().AlwaysRebuild() &&
6763 Init.
get(), Cond, FullInc,
6767 template<
typename Derived>
6777 cast<LabelDecl>(LD));
6780 template<
typename Derived>
6786 Target = SemaRef.MaybeCreateExprWithCleanups(Target.
get());
6788 if (!getDerived().AlwaysRebuild() &&
6796 template<
typename Derived>
6802 template<
typename Derived>
6808 template<
typename Derived>
6818 return getDerived().RebuildReturnStmt(S->
getReturnLoc(), Result.
get());
6821 template<
typename Derived>
6824 bool DeclChanged =
false;
6826 for (
auto *D : S->
decls()) {
6827 Decl *Transformed = getDerived().TransformDefinition(D->getLocation(), D);
6831 if (Transformed != D)
6834 Decls.push_back(Transformed);
6837 if (!getDerived().AlwaysRebuild() && !DeclChanged)
6843 template<
typename Derived>
6854 bool ExprsChanged =
false;
6865 ExprResult Result = getDerived().TransformExpr(OutputExpr);
6869 ExprsChanged |= Result.
get() != OutputExpr;
6871 Exprs.push_back(Result.
get());
6875 for (
unsigned I = 0, E = S->
getNumInputs(); I != E; ++I) {
6883 ExprResult Result = getDerived().TransformExpr(InputExpr);
6887 ExprsChanged |= Result.
get() != InputExpr;
6889 Exprs.push_back(Result.
get());
6892 if (!getDerived().AlwaysRebuild() && !ExprsChanged)
6904 Constraints, Exprs, AsmString.
get(),
6908 template<
typename Derived>
6914 bool HadError =
false, HadChange =
false;
6918 TransformedExprs.reserve(SrcExprs.size());
6919 for (
unsigned i = 0, e = SrcExprs.size(); i != e; ++i) {
6920 ExprResult Result = getDerived().TransformExpr(SrcExprs[i]);
6924 HadChange |= (Result.
get() != SrcExprs[i]);
6925 TransformedExprs.push_back(Result.
get());
6930 if (!HadChange && !getDerived().AlwaysRebuild())
6942 template<
typename Derived>
6945 auto *ScopeInfo = SemaRef.getCurFunction();
6946 auto *FD = cast<FunctionDecl>(SemaRef.CurContext);
6947 assert(FD && ScopeInfo && !ScopeInfo->CoroutinePromise &&
6948 ScopeInfo->NeedsCoroutineSuspends &&
6949 ScopeInfo->CoroutineSuspends.first ==
nullptr &&
6950 ScopeInfo->CoroutineSuspends.second ==
nullptr &&
6951 "expected clean scope info");
6955 ScopeInfo->setNeedsCoroutineSuspends(
false);
6959 auto *Promise = SemaRef.buildCoroutinePromise(FD->getLocation());
6963 ScopeInfo->CoroutinePromise = Promise;
6974 ScopeInfo->setCoroutineSuspends(InitSuspend.
get(), FinalSuspend.
get());
6975 assert(isa<Expr>(InitSuspend.
get()) && isa<Expr>(FinalSuspend.
get()));
6982 if (Builder.isInvalid())
6986 assert(ReturnObject &&
"the return object is expected to be valid");
6987 ExprResult Res = getDerived().TransformInitializer(ReturnObject,
6991 Builder.ReturnValue = Res.
get();
6994 assert(!Promise->getType()->isDependentType() &&
6995 "the promise type must no longer be dependent");
6998 "these nodes should not have been built yet");
6999 if (!Builder.buildDependentStatements())
7003 StmtResult Res = getDerived().TransformStmt(OnFallthrough);
7006 Builder.OnFallthrough = Res.
get();
7010 StmtResult Res = getDerived().TransformStmt(OnException);
7013 Builder.OnException = Res.
get();
7017 StmtResult Res = getDerived().TransformStmt(OnAllocFailure);
7020 Builder.ReturnStmtOnAllocFailure = Res.
get();
7025 "allocation and deallocation calls must already be built");
7027 if (AllocRes.isInvalid())
7029 Builder.Allocate = AllocRes.get();
7034 Builder.Deallocate = DeallocRes.
get();
7036 assert(S->
getResultDecl() &&
"ResultDecl must already be built");
7038 if (ResultDecl.isInvalid())
7040 Builder.ResultDecl = ResultDecl.get();
7046 Builder.ReturnStmt = Res.
get();
7049 if (!Builder.buildParameterMoves())
7052 return getDerived().RebuildCoroutineBodyStmt(Builder);
7055 template<
typename Derived>
7069 template<
typename Derived>
7083 template <
typename Derived>
7099 return getDerived().RebuildDependentCoawaitExpr(
7101 cast<UnresolvedLookupExpr>(LookupResult.
get()));
7104 template<
typename Derived>
7119 template<
typename Derived>
7128 bool AnyCatchChanged =
false;
7135 AnyCatchChanged =
true;
7136 CatchStmts.push_back(Catch.
get());
7148 if (!getDerived().AlwaysRebuild() &&
7155 return getDerived().RebuildObjCAtTryStmt(S->
getAtTryLoc(), TryBody.
get(),
7156 CatchStmts, Finally.
get());
7159 template<
typename Derived>
7166 if (FromVar->getTypeSourceInfo()) {
7167 TSInfo = getDerived().TransformType(FromVar->getTypeSourceInfo());
7176 T = getDerived().TransformType(FromVar->getType());
7181 Var = getDerived().RebuildObjCExceptionDecl(FromVar, TSInfo, T);
7190 return getDerived().RebuildObjCAtCatchStmt(S->
getAtCatchLoc(),
7195 template<
typename Derived>
7204 if (!getDerived().AlwaysRebuild() &&
7213 template<
typename Derived>
7218 Operand = getDerived().TransformExpr(S->
getThrowExpr());
7223 if (!getDerived().AlwaysRebuild() &&
7227 return getDerived().RebuildObjCAtThrowStmt(S->
getThrowLoc(), Operand.
get());
7230 template<
typename Derived>
7250 if (!getDerived().AlwaysRebuild() &&
7257 Object.
get(), Body.
get());
7260 template<
typename Derived>
7270 if (!getDerived().AlwaysRebuild() &&
7275 return getDerived().RebuildObjCAutoreleasePoolStmt(
7279 template<
typename Derived>
7299 if (!getDerived().AlwaysRebuild() &&
7306 return getDerived().RebuildObjCForCollectionStmt(S->
getForLoc(),
7313 template <
typename Derived>
7319 getDerived().TransformType(ExceptionDecl->getTypeSourceInfo());
7323 Var = getDerived().RebuildExceptionDecl(
7324 ExceptionDecl, T, ExceptionDecl->getInnerLocStart(),
7325 ExceptionDecl->getLocation(), ExceptionDecl->getIdentifier());
7335 if (!getDerived().AlwaysRebuild() && !Var &&
7339 return getDerived().RebuildCXXCatchStmt(S->
getCatchLoc(), Var, Handler.
get());
7342 template <
typename Derived>
7350 bool HandlerChanged =
false;
7357 HandlerChanged = HandlerChanged || Handler.
get() != S->
getHandler(I);
7358 Handlers.push_back(Handler.
getAs<
Stmt>());
7361 if (!getDerived().AlwaysRebuild() && TryBlock.
get() == S->
getTryBlock() &&
7365 return getDerived().RebuildCXXTryStmt(S->
getTryLoc(), TryBlock.
get(),
7369 template<
typename Derived>
7387 Cond = SemaRef.CheckBooleanCondition(S->
getColonLoc(), Cond.
get());
7391 Cond = SemaRef.MaybeCreateExprWithCleanups(Cond.
get());
7397 Inc = SemaRef.MaybeCreateExprWithCleanups(Inc.
get());
7404 if (getDerived().AlwaysRebuild() ||
7411 NewStmt = getDerived().RebuildCXXForRangeStmt(S->
getForLoc(),
7416 Inc.
get(), LoopVar.
get(),
7429 NewStmt = getDerived().RebuildCXXForRangeStmt(S->
getForLoc(),
7434 Inc.
get(), LoopVar.
get(),
7440 if (NewStmt.
get() == S)
7443 return FinishCXXForRangeStmt(NewStmt.
get(), Body.
get());
7446 template<
typename Derived>
7462 NameInfo = getDerived().TransformDeclarationNameInfo(NameInfo);
7468 if (!getDerived().AlwaysRebuild() &&
7475 SS.
Adopt(QualifierLoc);
7476 bool Dependent =
false;
7477 switch (getSema().CheckMicrosoftIfExistsSymbol(
nullptr, SS, NameInfo)) {
7508 return getDerived().RebuildMSDependentExistsStmt(S->
getKeywordLoc(),
7515 template<
typename Derived>
7535 return new (SemaRef.getASTContext())
7537 SemaRef.getASTContext().PseudoObjectTy,
VK_LValue,
7541 template <
typename Derived>
7545 if (BaseRes.isInvalid())
7547 auto IdxRes = getDerived().TransformExpr(E->
getIdx());
7548 if (IdxRes.isInvalid())
7551 if (!getDerived().AlwaysRebuild() &&
7552 BaseRes.get() == E->
getBase() &&
7553 IdxRes.get() == E->
getIdx())
7556 return getDerived().RebuildArraySubscriptExpr(
7560 template <
typename Derived>
7570 if (!getDerived().AlwaysRebuild() && TryBlock.
get() == S->
getTryBlock() &&
7575 TryBlock.
get(), Handler.
get());
7578 template <
typename Derived>
7584 return getDerived().RebuildSEHFinallyStmt(S->
getFinallyLoc(), Block.
get());
7587 template <
typename Derived>
7597 return getDerived().RebuildSEHExceptStmt(S->
getExceptLoc(), FilterExpr.
get(),
7601 template <
typename Derived>
7603 if (isa<SEHFinallyStmt>(Handler))
7604 return getDerived().TransformSEHFinallyStmt(cast<SEHFinallyStmt>(Handler));
7606 return getDerived().TransformSEHExceptStmt(cast<SEHExceptStmt>(Handler));
7609 template<
typename Derived>
7618 template <
typename Derived>
7625 TClauses.reserve(Clauses.size());
7629 getDerived().getSema().StartOpenMPClause((*I)->getClauseKind());
7630 OMPClause *Clause = getDerived().TransformOMPClause(*I);
7631 getDerived().getSema().EndOpenMPClause();
7633 TClauses.push_back(Clause);
7635 TClauses.push_back(
nullptr);
7645 int ThisCaptureLevel =
7648 while (--ThisCaptureLevel >= 0)
7649 CS = cast<CapturedStmt>(CS)->getCapturedStmt();
7650 Body = getDerived().TransformStmt(CS);
7653 getDerived().getSema().ActOnOpenMPRegionEnd(Body, TClauses);
7658 if (TClauses.size() != Clauses.size()) {
7665 DirName = cast<OMPCriticalDirective>(D)->getDirectiveName();
7666 DirName = getDerived().TransformDeclarationNameInfo(DirName);
7670 CancelRegion = cast<OMPCancellationPointDirective>(D)->getCancelRegion();
7672 CancelRegion = cast<OMPCancelDirective>(D)->getCancelRegion();
7675 return getDerived().RebuildOMPExecutableDirective(
7680 template <
typename Derived>
7684 getDerived().getSema().StartOpenMPDSABlock(OMPD_parallel, DirName,
nullptr,
7686 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7687 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7691 template <
typename Derived>
7695 getDerived().getSema().StartOpenMPDSABlock(OMPD_simd, DirName,
nullptr,
7697 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7698 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7702 template <
typename Derived>
7706 getDerived().getSema().StartOpenMPDSABlock(OMPD_for, DirName,
nullptr,
7708 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7709 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7713 template <
typename Derived>
7717 getDerived().getSema().StartOpenMPDSABlock(OMPD_for_simd, DirName,
nullptr,
7719 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7720 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7724 template <
typename Derived>
7728 getDerived().getSema().StartOpenMPDSABlock(OMPD_sections, DirName,
nullptr,
7730 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7731 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7735 template <
typename Derived>
7739 getDerived().getSema().StartOpenMPDSABlock(OMPD_section, DirName,
nullptr,
7741 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7742 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7746 template <
typename Derived>
7750 getDerived().getSema().StartOpenMPDSABlock(OMPD_single, DirName,
nullptr,
7752 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7753 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7757 template <
typename Derived>
7761 getDerived().getSema().StartOpenMPDSABlock(OMPD_master, DirName,
nullptr,
7763 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7764 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7768 template <
typename Derived>
7773 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7774 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7778 template <
typename Derived>
7782 getDerived().getSema().StartOpenMPDSABlock(OMPD_parallel_for, DirName,
7784 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7785 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7789 template <
typename Derived>
7793 getDerived().getSema().StartOpenMPDSABlock(OMPD_parallel_for_simd, DirName,
7795 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7796 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7800 template <
typename Derived>
7804 getDerived().getSema().StartOpenMPDSABlock(OMPD_parallel_sections, DirName,
7806 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7807 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7811 template <
typename Derived>
7815 getDerived().getSema().StartOpenMPDSABlock(OMPD_task, DirName,
nullptr,
7817 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7818 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7822 template <
typename Derived>
7826 getDerived().getSema().StartOpenMPDSABlock(OMPD_taskyield, DirName,
nullptr,
7828 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7829 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7833 template <
typename Derived>
7837 getDerived().getSema().StartOpenMPDSABlock(OMPD_barrier, DirName,
nullptr,
7839 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7840 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7844 template <
typename Derived>
7848 getDerived().getSema().StartOpenMPDSABlock(OMPD_taskwait, DirName,
nullptr,
7850 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7851 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7855 template <
typename Derived>
7859 getDerived().getSema().StartOpenMPDSABlock(OMPD_taskgroup, DirName,
nullptr,
7861 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7862 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7866 template <
typename Derived>
7870 getDerived().getSema().StartOpenMPDSABlock(OMPD_flush, DirName,
nullptr,
7872 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7873 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7877 template <
typename Derived>
7881 getDerived().getSema().StartOpenMPDSABlock(OMPD_ordered, DirName,
nullptr,
7883 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7884 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7888 template <
typename Derived>
7892 getDerived().getSema().StartOpenMPDSABlock(OMPD_atomic, DirName,
nullptr,
7894 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7895 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7899 template <
typename Derived>
7903 getDerived().getSema().StartOpenMPDSABlock(OMPD_target, DirName,
nullptr,
7905 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7906 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7910 template <
typename Derived>
7914 getDerived().getSema().StartOpenMPDSABlock(OMPD_target_data, DirName,
nullptr,
7916 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7917 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7921 template <
typename Derived>
7925 getDerived().getSema().StartOpenMPDSABlock(OMPD_target_enter_data, DirName,
7927 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7928 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7932 template <
typename Derived>
7936 getDerived().getSema().StartOpenMPDSABlock(OMPD_target_exit_data, DirName,
7938 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7939 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7943 template <
typename Derived>
7947 getDerived().getSema().StartOpenMPDSABlock(OMPD_target_parallel, DirName,
7949 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7950 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7954 template <
typename Derived>
7958 getDerived().getSema().StartOpenMPDSABlock(OMPD_target_parallel_for, DirName,
7960 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7961 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7965 template <
typename Derived>
7969 getDerived().getSema().StartOpenMPDSABlock(OMPD_target_update, DirName,
7971 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7972 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7976 template <
typename Derived>
7980 getDerived().getSema().StartOpenMPDSABlock(OMPD_teams, DirName,
nullptr,
7982 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7983 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7987 template <
typename Derived>
7991 getDerived().getSema().StartOpenMPDSABlock(OMPD_cancellation_point, DirName,
7993 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7994 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7998 template <
typename Derived>
8002 getDerived().getSema().StartOpenMPDSABlock(OMPD_cancel, DirName,
nullptr,
8004 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8005 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8009 template <
typename Derived>
8013 getDerived().getSema().StartOpenMPDSABlock(OMPD_taskloop, DirName,
nullptr,
8015 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8016 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8020 template <
typename Derived>
8024 getDerived().getSema().StartOpenMPDSABlock(OMPD_taskloop_simd, DirName,
8026 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8027 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8031 template <
typename Derived>
8035 getDerived().getSema().StartOpenMPDSABlock(OMPD_distribute, DirName,
nullptr,
8037 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8038 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8042 template <
typename Derived>
8046 getDerived().getSema().StartOpenMPDSABlock(
8047 OMPD_distribute_parallel_for, DirName,
nullptr, D->
getLocStart());
8048 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8049 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8053 template <
typename Derived>
8058 getDerived().getSema().StartOpenMPDSABlock(
8059 OMPD_distribute_parallel_for_simd, DirName,
nullptr, D->
getLocStart());
8060 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8061 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8065 template <
typename Derived>
8069 getDerived().getSema().StartOpenMPDSABlock(OMPD_distribute_simd, DirName,
8071 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8072 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8076 template <
typename Derived>
8080 getDerived().getSema().StartOpenMPDSABlock(OMPD_target_parallel_for_simd,
8083 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8084 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8088 template <
typename Derived>
8092 getDerived().getSema().StartOpenMPDSABlock(OMPD_target_simd, DirName,
nullptr,
8094 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8095 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8099 template <
typename Derived>
8103 getDerived().getSema().StartOpenMPDSABlock(OMPD_teams_distribute, DirName,
8105 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8106 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8110 template <
typename Derived>
8114 getDerived().getSema().StartOpenMPDSABlock(
8115 OMPD_teams_distribute_simd, DirName,
nullptr, D->
getLocStart());
8116 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8117 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8121 template <
typename Derived>
8125 getDerived().getSema().StartOpenMPDSABlock(
8126 OMPD_teams_distribute_parallel_for_simd, DirName,
nullptr, D->
getLocStart());
8127 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8128 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8132 template <
typename Derived>
8136 getDerived().getSema().StartOpenMPDSABlock(OMPD_teams_distribute_parallel_for,
8138 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8139 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8143 template <
typename Derived>
8147 getDerived().getSema().StartOpenMPDSABlock(OMPD_target_teams, DirName,
8149 auto Res = getDerived().TransformOMPExecutableDirective(D);
8150 getDerived().getSema().EndOpenMPDSABlock(Res.get());
8154 template <
typename Derived>
8158 getDerived().getSema().StartOpenMPDSABlock(OMPD_target_teams_distribute,
8160 auto Res = getDerived().TransformOMPExecutableDirective(D);
8161 getDerived().getSema().EndOpenMPDSABlock(Res.get());
8165 template <
typename Derived>
8170 getDerived().getSema().StartOpenMPDSABlock(
8171 OMPD_target_teams_distribute_parallel_for, DirName,
nullptr,
8173 auto Res = getDerived().TransformOMPExecutableDirective(D);
8174 getDerived().getSema().EndOpenMPDSABlock(Res.get());
8178 template <
typename Derived>
8183 getDerived().getSema().StartOpenMPDSABlock(
8184 OMPD_target_teams_distribute_parallel_for_simd, DirName,
nullptr,
8186 auto Res = getDerived().TransformOMPExecutableDirective(D);
8187 getDerived().getSema().EndOpenMPDSABlock(Res.get());
8191 template <
typename Derived>
8196 getDerived().getSema().StartOpenMPDSABlock(
8197 OMPD_target_teams_distribute_simd, DirName,
nullptr, D->
getLocStart());
8198 auto Res = getDerived().TransformOMPExecutableDirective(D);
8199 getDerived().getSema().EndOpenMPDSABlock(Res.get());
8207 template <
typename Derived>
8212 return getDerived().RebuildOMPIfClause(
8217 template <
typename Derived>
8222 return getDerived().RebuildOMPFinalClause(Cond.
get(), C->
getLocStart(),
8226 template <
typename Derived>
8232 return getDerived().RebuildOMPNumThreadsClause(
8236 template <
typename Derived>
8242 return getDerived().RebuildOMPSafelenClause(
8246 template <
typename Derived>
8252 return getDerived().RebuildOMPSimdlenClause(
8256 template <
typename Derived>
8262 return getDerived().RebuildOMPCollapseClause(
8266 template <
typename Derived>
8274 template <
typename Derived>
8282 template <
typename Derived>
8288 return getDerived().RebuildOMPScheduleClause(
8295 template <
typename Derived>
8300 E = getDerived().TransformExpr(Num);
8308 template <
typename Derived>
8315 template <
typename Derived>
8322 template <
typename Derived>
8329 template <
typename Derived>
8335 template <
typename Derived>
8341 template <
typename Derived>
8348 template <
typename Derived>
8355 template <
typename Derived>
8362 template <
typename Derived>
8369 template <
typename Derived>
8375 template <
typename Derived>
8382 template <
typename Derived>
8388 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8391 Vars.push_back(EVar.
get());
8393 return getDerived().RebuildOMPPrivateClause(
8397 template <
typename Derived>
8403 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8406 Vars.push_back(EVar.
get());
8408 return getDerived().RebuildOMPFirstprivateClause(
8412 template <
typename Derived>
8418 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8421 Vars.push_back(EVar.
get());
8423 return getDerived().RebuildOMPLastprivateClause(
8427 template <
typename Derived>
8433 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8436 Vars.push_back(EVar.
get());
8438 return getDerived().RebuildOMPSharedClause(Vars, C->
getLocStart(),
8442 template <
typename Derived>
8448 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8451 Vars.push_back(EVar.
get());
8458 NameInfo = getDerived().TransformDeclarationNameInfo(NameInfo);
8468 auto *ULE = cast<UnresolvedLookupExpr>(E);
8470 for (
auto *D : ULE->decls()) {
8472 cast<NamedDecl>(getDerived().TransformDecl(E->
getExprLoc(), D));
8473 Decls.addDecl(InstD, InstD->
getAccess());
8475 UnresolvedReductions.push_back(
8477 SemaRef.Context,
nullptr,
8479 NameInfo,
true, ULE->isOverloaded(),
8480 Decls.begin(), Decls.end()));
8482 UnresolvedReductions.push_back(
nullptr);
8484 return getDerived().RebuildOMPReductionClause(
8486 C->
getLocEnd(), ReductionIdScopeSpec, NameInfo, UnresolvedReductions);
8489 template <
typename Derived>
8495 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8498 Vars.push_back(EVar.
get());
8505 NameInfo = getDerived().TransformDeclarationNameInfo(NameInfo);
8515 auto *ULE = cast<UnresolvedLookupExpr>(E);
8517 for (
auto *D : ULE->decls()) {
8519 cast<NamedDecl>(getDerived().TransformDecl(E->
getExprLoc(), D));
8520 Decls.addDecl(InstD, InstD->
getAccess());
8523 SemaRef.Context,
nullptr,
8525 true, ULE->isOverloaded(), Decls.begin(), Decls.end()));
8527 UnresolvedReductions.push_back(
nullptr);
8529 return getDerived().RebuildOMPTaskReductionClause(
8531 C->
getLocEnd(), ReductionIdScopeSpec, NameInfo, UnresolvedReductions);
8534 template <
typename Derived>
8540 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8543 Vars.push_back(EVar.
get());
8550 NameInfo = getDerived().TransformDeclarationNameInfo(NameInfo);
8560 auto *ULE = cast<UnresolvedLookupExpr>(E);
8562 for (
auto *D : ULE->decls()) {
8564 cast<NamedDecl>(getDerived().TransformDecl(E->
getExprLoc(), D));
8565 Decls.addDecl(InstD, InstD->
getAccess());
8568 SemaRef.Context,
nullptr,
8570 true, ULE->isOverloaded(), Decls.begin(), Decls.end()));
8572 UnresolvedReductions.push_back(
nullptr);
8574 return getDerived().RebuildOMPInReductionClause(
8576 C->
getLocEnd(), ReductionIdScopeSpec, NameInfo, UnresolvedReductions);
8579 template <
typename Derived>
8585 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8588 Vars.push_back(EVar.
get());
8593 return getDerived().RebuildOMPLinearClause(
8595 C->getModifierLoc(), C->getColonLoc(), C->
getLocEnd());
8598 template <
typename Derived>
8602 Vars.reserve(C->varlist_size());
8603 for (
auto *VE : C->varlists()) {
8604 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8607 Vars.push_back(EVar.
get());
8612 return getDerived().RebuildOMPAlignedClause(
8613 Vars, Alignment.
get(), C->getLocStart(), C->getLParenLoc(),
8617 template <
typename Derived>
8621 Vars.reserve(C->varlist_size());
8622 for (
auto *VE : C->varlists()) {
8623 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8626 Vars.push_back(EVar.
get());
8628 return getDerived().RebuildOMPCopyinClause(Vars, C->getLocStart(),
8629 C->getLParenLoc(), C->getLocEnd());
8632 template <
typename Derived>
8636 Vars.reserve(C->varlist_size());
8637 for (
auto *VE : C->varlists()) {
8638 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8641 Vars.push_back(EVar.
get());
8643 return getDerived().RebuildOMPCopyprivateClause(
8644 Vars, C->getLocStart(), C->getLParenLoc(), C->getLocEnd());
8647 template <
typename Derived>
8650 Vars.reserve(C->varlist_size());
8651 for (
auto *VE : C->varlists()) {
8652 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8655 Vars.push_back(EVar.
get());
8657 return getDerived().RebuildOMPFlushClause(Vars, C->getLocStart(),
8658 C->getLParenLoc(), C->getLocEnd());
8661 template <
typename Derived>
8665 Vars.reserve(C->varlist_size());
8666 for (
auto *VE : C->varlists()) {
8667 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8670 Vars.push_back(EVar.
get());
8672 return getDerived().RebuildOMPDependClause(
8674 C->getLocStart(), C->getLParenLoc(), C->getLocEnd());
8677 template <
typename Derived>
8683 return getDerived().RebuildOMPDeviceClause(
8687 template <
typename Derived>
8690 Vars.reserve(C->varlist_size());
8691 for (
auto *VE : C->varlists()) {
8692 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8695 Vars.push_back(EVar.
get());
8697 return getDerived().RebuildOMPMapClause(
8700 C->getLParenLoc(), C->getLocEnd());
8703 template <
typename Derived>
8709 return getDerived().RebuildOMPNumTeamsClause(
8713 template <
typename Derived>
8719 return getDerived().RebuildOMPThreadLimitClause(
8723 template <
typename Derived>
8729 return getDerived().RebuildOMPPriorityClause(
8733 template <
typename Derived>
8739 return getDerived().RebuildOMPGrainsizeClause(
8743 template <
typename Derived>
8749 return getDerived().RebuildOMPNumTasksClause(
8753 template <
typename Derived>
8758 return getDerived().RebuildOMPHintClause(E.
get(), C->getLocStart(),
8762 template <
typename Derived>
8768 return getDerived().RebuildOMPDistScheduleClause(
8773 template <
typename Derived>
8779 template <
typename Derived>
8782 Vars.reserve(C->varlist_size());
8783 for (
auto *VE : C->varlists()) {
8784 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8787 Vars.push_back(EVar.
get());
8789 return getDerived().RebuildOMPToClause(Vars, C->getLocStart(),
8790 C->getLParenLoc(), C->getLocEnd());
8793 template <
typename Derived>
8796 Vars.reserve(C->varlist_size());
8797 for (
auto *VE : C->varlists()) {
8798 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8801 Vars.push_back(EVar.
get());
8803 return getDerived().RebuildOMPFromClause(Vars, C->getLocStart(),
8804 C->getLParenLoc(), C->getLocEnd());
8807 template <
typename Derived>
8811 Vars.reserve(C->varlist_size());
8812 for (
auto *VE : C->varlists()) {
8813 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8816 Vars.push_back(EVar.
get());
8818 return getDerived().RebuildOMPUseDevicePtrClause(
8819 Vars, C->getLocStart(), C->getLParenLoc(), C->getLocEnd());
8822 template <
typename Derived>
8826 Vars.reserve(C->varlist_size());
8827 for (
auto *VE : C->varlists()) {
8828 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8831 Vars.push_back(EVar.
get());
8833 return getDerived().RebuildOMPIsDevicePtrClause(
8834 Vars, C->getLocStart(), C->getLParenLoc(), C->getLocEnd());
8840 template<
typename Derived>
8846 return getDerived().RebuildPredefinedExpr(E->
getLocation(),
8850 template<
typename Derived>
8862 = cast_or_null<ValueDecl>(getDerived().TransformDecl(E->
getLocation(),
8869 NameInfo = getDerived().TransformDeclarationNameInfo(NameInfo);
8874 if (!getDerived().AlwaysRebuild() &&
8882 SemaRef.MarkDeclRefReferenced(E);
8889 TemplateArgs = &TransArgs;
8898 return getDerived().RebuildDeclRefExpr(QualifierLoc, ND, NameInfo,
8902 template<
typename Derived>
8908 template<
typename Derived>
8914 template<
typename Derived>
8920 template<
typename Derived>
8926 template<
typename Derived>
8932 template<
typename Derived>
8936 SemaRef.MarkFunctionReferenced(E->
getLocStart(), FD);
8937 return SemaRef.MaybeBindToTemporary(E);
8940 template<
typename Derived>
8956 AssocTypes.push_back(AssocType);
8958 AssocTypes.push_back(
nullptr);
8964 AssocExprs.push_back(AssocExpr.
get());
8967 return getDerived().RebuildGenericSelectionExpr(E->
getGenericLoc(),
8970 ControllingExpr.
get(),
8975 template<
typename Derived>
8982 if (!getDerived().AlwaysRebuild() && SubExpr.
get() == E->
getSubExpr())
8985 return getDerived().RebuildParenExpr(SubExpr.
get(), E->
getLParen(),
8992 template<
typename Derived>
8996 return getDerived().TransformDependentScopeDeclRefExpr(DRE,
true,
nullptr);
8998 return getDerived().TransformExpr(E);
9001 template<
typename Derived>
9006 SubExpr = TransformAddressOfOperand(E->
getSubExpr());
9012 if (!getDerived().AlwaysRebuild() && SubExpr.
get() == E->
getSubExpr())
9020 template<
typename Derived>
9034 bool ExprChanged =
false;
9040 Comp.isBrackets =
true;
9046 ExprResult Index = getDerived().TransformExpr(FromIndex);
9050 ExprChanged = ExprChanged || Index.
get() != FromIndex;
9051 Comp.isBrackets =
true;
9052 Comp.U.E = Index.
get();
9058 Comp.isBrackets =
false;
9060 if (!Comp.U.IdentInfo)
9070 Components.push_back(Comp);
9074 if (!getDerived().AlwaysRebuild() &&
9080 return getDerived().RebuildOffsetOfExpr(E->
getOperatorLoc(), Type,
9084 template<
typename Derived>
9088 "opaque value expression requires transformation");
9092 template<
typename Derived>
9098 template<
typename Derived>
9107 Expr *newSyntacticForm = SemaRef.recreateSyntacticForm(E);
9108 ExprResult result = getDerived().TransformExpr(newSyntacticForm);
9114 if (result.
get()->hasPlaceholderType(BuiltinType::PseudoObject))
9115 result = SemaRef.checkPseudoObjectRValue(result.
get());
9120 template<
typename Derived>
9131 if (!getDerived().AlwaysRebuild() && OldT == NewT)
9134 return getDerived().RebuildUnaryExprOrTypeTrait(NewT, E->
getOperatorLoc(),
9152 PE ? dyn_cast<DependentScopeDeclRefExpr>(PE->getSubExpr()) :
nullptr)
9153 SubExpr = getDerived().TransformParenDependentScopeDeclRefExpr(
9154 PE, DRE,
false, &RecoveryTSI);
9159 return getDerived().RebuildUnaryExprOrTypeTrait(
9167 return getDerived().RebuildUnaryExprOrTypeTrait(SubExpr.
get(),
9173 template<
typename Derived>
9185 if (!getDerived().AlwaysRebuild() &&
9190 return getDerived().RebuildArraySubscriptExpr(LHS.
get(),
9196 template <
typename Derived>
9205 LowerBound = getDerived().TransformExpr(E->
getLowerBound());
9212 Length = getDerived().TransformExpr(E->
getLength());
9217 if (!getDerived().AlwaysRebuild() && Base.
get() == E->
getBase() &&
9221 return getDerived().RebuildOMPArraySectionExpr(
9226 template<
typename Derived>
9235 bool ArgChanged =
false;
9241 if (!getDerived().AlwaysRebuild() &&
9244 return SemaRef.MaybeBindToTemporary(E);
9249 return getDerived().RebuildCallExpr(Callee.
get(), FakeLParenLoc,
9254 template<
typename Derived>
9272 = cast_or_null<ValueDecl>(getDerived().TransformDecl(E->
getMemberLoc(),
9281 FoundDecl = cast_or_null<NamedDecl>(
9282 getDerived().TransformDecl(E->
getMemberLoc(), FoundDecl));
9287 if (!getDerived().AlwaysRebuild() &&
9296 SemaRef.MarkMemberReferenced(E);
9319 NamedDecl *FirstQualifierInScope =
nullptr;
9321 if (MemberNameInfo.
getName()) {
9322 MemberNameInfo = getDerived().TransformDeclarationNameInfo(MemberNameInfo);
9323 if (!MemberNameInfo.
getName())
9327 return getDerived().RebuildMemberExpr(Base.
get(), FakeOperatorLoc,
9335 ? &TransArgs :
nullptr),
9336 FirstQualifierInScope);
9339 template<
typename Derived>
9350 if (!getDerived().AlwaysRebuild() &&
9362 template<
typename Derived>
9366 return getDerived().TransformBinaryOperator(E);
9369 template<
typename Derived>
9383 if (!getDerived().AlwaysRebuild() &&
9388 return getDerived().RebuildConditionalOperator(commonExpr.
get(),
9395 template<
typename Derived>
9410 if (!getDerived().AlwaysRebuild() &&
9416 return getDerived().RebuildConditionalOperator(Cond.
get(),
9423 template<
typename Derived>
9431 template<
typename Derived>
9443 if (!getDerived().AlwaysRebuild() &&
9448 return getDerived().RebuildCStyleCastExpr(E->
getLParenLoc(),
9454 template<
typename Derived>
9466 if (!getDerived().AlwaysRebuild() &&
9469 return SemaRef.MaybeBindToTemporary(E);
9475 return getDerived().RebuildCompoundLiteralExpr(E->
getLParenLoc(), NewT,
9480 template<
typename Derived>
9487 if (!getDerived().AlwaysRebuild() &&
9494 return getDerived().RebuildExtVectorElementExpr(Base.
get(), FakeOperatorLoc,
9499 template<
typename Derived>
9505 bool InitChanged =
false;
9509 Inits, &InitChanged))
9512 if (!getDerived().AlwaysRebuild() && !InitChanged) {
9523 template<
typename Derived>
9535 bool ExprChanged =
false;
9537 if (D.isFieldDesignator()) {
9542 FieldDecl *Field = cast_or_null<FieldDecl>(
9543 getDerived().TransformDecl(D.getFieldLoc(), D.getField()));
9544 if (Field != D.getField())
9557 if (D.isArrayDesignator()) {
9566 ArrayExprs.push_back(Index.
get());
9570 assert(D.isArrayRangeDesignator() &&
"New kind of designator?");
9573 if (Start.isInvalid())
9583 D.getEllipsisLoc()));
9588 ArrayExprs.push_back(Start.get());
9589 ArrayExprs.push_back(End.
get());
9592 if (!getDerived().AlwaysRebuild() &&
9597 return getDerived().RebuildDesignatedInitExpr(Desig, ArrayExprs,
9604 template<
typename Derived>
9608 llvm_unreachable(
"Unexpected DesignatedInitUpdateExpr in syntactic form of " 9613 template<
typename Derived>
9617 llvm_unreachable(
"Unexpected NoInitExpr in syntactic form of initializer");
9621 template<
typename Derived>
9624 llvm_unreachable(
"Unexpected ArrayInitLoopExpr outside of initializer");
9628 template<
typename Derived>
9631 llvm_unreachable(
"Unexpected ArrayInitIndexExpr outside of initializer");
9635 template<
typename Derived>
9647 if (!getDerived().AlwaysRebuild() &&
9651 return getDerived().RebuildImplicitValueInitExpr(T);
9654 template<
typename Derived>
9665 if (!getDerived().AlwaysRebuild() &&
9674 template<
typename Derived>
9677 bool ArgumentChanged =
false;
9683 return getDerived().RebuildParenListExpr(E->
getLParenLoc(),
9693 template<
typename Derived>
9702 cast<LabelDecl>(LD));
9705 template<
typename Derived>
9708 SemaRef.ActOnStartStmtExpr();
9710 = getDerived().TransformCompoundStmt(E->
getSubStmt(),
true);
9712 SemaRef.ActOnStmtExprError();
9716 if (!getDerived().AlwaysRebuild() &&
9719 SemaRef.ActOnStmtExprError();
9720 return SemaRef.MaybeBindToTemporary(E);
9728 template<
typename Derived>
9743 if (!getDerived().AlwaysRebuild() &&
9754 template<
typename Derived>
9760 template<
typename Derived>
9767 case OO_Array_Delete:
9768 llvm_unreachable(
"new and delete operators cannot use CXXOperatorCallExpr");
9772 assert(E->
getNumArgs() >= 1 &&
"Object call is missing arguments");
9776 if (Object.isInvalid())
9781 static_cast<Expr *>(Object.get())->getLocEnd());
9789 return getDerived().RebuildCallExpr(Object.get(), FakeLParenLoc,
9794 #define OVERLOADED_OPERATOR(Name,Spelling,Token,Unary,Binary,MemberOnly) \ 9796 #define OVERLOADED_OPERATOR_MULTI(Name,Spelling,Unary,Binary,MemberOnly) 9797 #include "clang/Basic/OperatorKinds.def" 9802 case OO_Conditional:
9803 llvm_unreachable(
"conditional operator is not actually overloadable");
9807 llvm_unreachable(
"not an overloaded operator?");
9816 First = getDerived().TransformAddressOfOperand(E->
getArg(0));
9818 First = getDerived().TransformExpr(E->
getArg(0));
9824 Second = getDerived().TransformExpr(E->
getArg(1));
9829 if (!getDerived().AlwaysRebuild() &&
9833 return SemaRef.MaybeBindToTemporary(E);
9838 return getDerived().RebuildCXXOperatorCallExpr(E->
getOperator(),
9845 template<
typename Derived>
9848 return getDerived().TransformCallExpr(E);
9851 template<
typename Derived>
9865 bool ArgChanged =
false;
9871 if (!getDerived().AlwaysRebuild() &&
9874 return SemaRef.MaybeBindToTemporary(E);
9879 return getDerived().RebuildCallExpr(Callee.
get(), FakeLParenLoc,
9884 template<
typename Derived>
9896 if (!getDerived().AlwaysRebuild() &&
9900 return getDerived().RebuildCXXNamedCastExpr(
9907 template<
typename Derived>
9913 template<
typename Derived>
9919 template<
typename Derived>
9926 template<
typename Derived>
9932 template<
typename Derived>
9946 if (!getDerived().AlwaysRebuild() &&
9951 return getDerived().RebuildCXXFunctionalCastExpr(Type,
9957 template<
typename Derived>
9966 if (!getDerived().AlwaysRebuild() &&
9970 return getDerived().RebuildCXXTypeidExpr(E->
getType(),
9988 if (!getDerived().AlwaysRebuild() &&
9992 return getDerived().RebuildCXXTypeidExpr(E->
getType(),
9998 template<
typename Derived>
10007 if (!getDerived().AlwaysRebuild() &&
10011 return getDerived().RebuildCXXUuidofExpr(E->
getType(),
10024 if (!getDerived().AlwaysRebuild() &&
10028 return getDerived().RebuildCXXUuidofExpr(E->
getType(),
10034 template<
typename Derived>
10040 template<
typename Derived>
10047 template<
typename Derived>
10050 QualType T = getSema().getCurrentThisType();
10052 if (!getDerived().AlwaysRebuild() && T == E->
getType()) {
10061 template<
typename Derived>
10068 if (!getDerived().AlwaysRebuild() &&
10072 return getDerived().RebuildCXXThrowExpr(E->
getThrowLoc(), SubExpr.
get(),
10076 template<
typename Derived>
10080 = cast_or_null<ParmVarDecl>(getDerived().TransformDecl(E->
getLocStart(),
10085 if (!getDerived().AlwaysRebuild() &&
10089 return getDerived().RebuildCXXDefaultArgExpr(E->
getUsedLocation(), Param);
10092 template<
typename Derived>
10096 = cast_or_null<FieldDecl>(getDerived().TransformDecl(E->
getLocStart(),
10101 if (!getDerived().AlwaysRebuild() && Field == E->
getField())
10104 return getDerived().RebuildCXXDefaultInitExpr(E->
getExprLoc(), Field);
10107 template<
typename Derived>
10115 if (!getDerived().AlwaysRebuild() &&
10119 return getDerived().RebuildCXXScalarValueInitExpr(T,
10124 template<
typename Derived>
10130 if (!AllocTypeInfo)
10139 bool ArgumentChanged =
false;
10143 PlacementArgs, &ArgumentChanged))
10150 NewInit = getDerived().TransformInitializer(OldInit,
true);
10157 OperatorNew = cast_or_null<FunctionDecl>(
10166 OperatorDelete = cast_or_null<FunctionDecl>(
10169 if (!OperatorDelete)
10173 if (!getDerived().AlwaysRebuild() &&
10176 NewInit.
get() == OldInit &&
10179 !ArgumentChanged) {
10183 SemaRef.MarkFunctionReferenced(E->
getLocStart(), OperatorNew);
10184 if (OperatorDelete)
10185 SemaRef.MarkFunctionReferenced(E->
getLocStart(), OperatorDelete);
10191 CXXRecordDecl *Record = cast<CXXRecordDecl>(RecordT->getDecl());
10193 SemaRef.MarkFunctionReferenced(E->
getLocStart(), Destructor);
10202 if (!ArraySize.
get()) {
10208 const ArrayType *ArrayT = SemaRef.Context.getAsArrayType(AllocType);
10212 = dyn_cast<ConstantArrayType>(ArrayT)) {
10214 SemaRef.Context.getSizeType(),
10216 AllocType = ConsArrayT->getElementType();
10218 = dyn_cast<DependentSizedArrayType>(ArrayT)) {
10219 if (DepArrayT->getSizeExpr()) {
10220 ArraySize = DepArrayT->getSizeExpr();
10221 AllocType = DepArrayT->getElementType();
10226 return getDerived().RebuildCXXNewExpr(E->
getLocStart(),
10239 template<
typename Derived>
10249 OperatorDelete = cast_or_null<FunctionDecl>(
10252 if (!OperatorDelete)
10256 if (!getDerived().AlwaysRebuild() &&
10261 if (OperatorDelete)
10262 SemaRef.MarkFunctionReferenced(E->
getLocStart(), OperatorDelete);
10265 QualType Destroyed = SemaRef.Context.getBaseElementType(
10268 CXXRecordDecl *Record = cast<CXXRecordDecl>(DestroyedRec->getDecl());
10270 SemaRef.LookupDestructor(Record));
10277 return getDerived().RebuildCXXDeleteExpr(E->
getLocStart(),
10283 template<
typename Derived>
10292 bool MayBePseudoDestructor =
false;
10293 Base = SemaRef.ActOnStartCXXMemberReference(
nullptr, Base.
get(),
10295 E->
isArrow()? tok::arrow : tok::period,
10297 MayBePseudoDestructor);
10301 QualType ObjectType = ObjectTypePtr.get();
10303 if (QualifierLoc) {
10305 = getDerived().TransformNestedNameSpecifierLoc(QualifierLoc, ObjectType);
10310 SS.
Adopt(QualifierLoc);
10316 ObjectType,
nullptr, SS);
10317 if (!DestroyedTypeInfo)
10319 Destroyed = DestroyedTypeInfo;
10337 = SemaRef.Context.getTrivialTypeSourceInfo(SemaRef.GetTypeFromParser(T),
10344 ScopeTypeInfo = getDerived().TransformTypeInObjectScope(
10346 if (!ScopeTypeInfo)
10350 return getDerived().RebuildCXXPseudoDestructorExpr(Base.
get(),
10360 template <
typename Derived>
10365 bool AllEmptyPacks =
true;
10366 for (
auto *OldD : Old->
decls()) {
10367 Decl *InstD = getDerived().TransformDecl(Old->
getNameLoc(), OldD);
10371 if (isa<UsingShadowDecl>(OldD))
10380 NamedDecl *SingleDecl = cast<NamedDecl>(InstD);
10382 if (
auto *UPD = dyn_cast<UsingPackDecl>(InstD))
10383 Decls = UPD->expansions();
10386 for (
auto *D : Decls) {
10387 if (
auto *UD = dyn_cast<UsingDecl>(D)) {
10388 for (
auto *SD : UD->shadows())
10395 AllEmptyPacks &= Decls.empty();
10404 if (AllEmptyPacks && !RequiresADL) {
10405 getSema().Diag(Old->
getNameLoc(), diag::err_using_pack_expansion_empty)
10416 template<
typename Derived>
10424 if (TransformOverloadExprDecls(Old, Old->
requiresADL(), R))
10431 = getDerived().TransformNestedNameSpecifierLoc(Old->
getQualifierLoc());
10435 SS.
Adopt(QualifierLoc);
10440 = cast_or_null<CXXRecordDecl>(getDerived().TransformDecl(
10443 if (!NamingClass) {
10448 R.setNamingClass(NamingClass);
10461 return SemaRef.BuildPossibleImplicitMemberExpr(SS, TemplateKWLoc, R,
10466 return getDerived().RebuildDeclarationNameExpr(SS, R, Old->
requiresADL());
10480 return getDerived().RebuildTemplateIdExpr(SS, TemplateKWLoc, R,
10484 template<
typename Derived>
10487 bool ArgChanged =
false;
10489 for (
unsigned I = 0, N = E->
getNumArgs(); I != N; ++I) {
10495 QualType To = getDerived().TransformType(TLB, FromTL);
10500 Args.push_back(From);
10514 SemaRef.collectUnexpandedParameterPacks(PatternTL, Unexpanded);
10518 bool Expand =
true;
10519 bool RetainExpansion =
false;
10523 if (getDerived().TryExpandParameterPacks(ExpansionTL.
getEllipsisLoc(),
10524 PatternTL.getSourceRange(),
10526 Expand, RetainExpansion,
10539 QualType To = getDerived().TransformType(TLB, PatternTL);
10543 To = getDerived().RebuildPackExpansionType(To,
10544 PatternTL.getSourceRange(),
10559 for (
unsigned I = 0; I != *NumExpansions; ++I) {
10562 TLB.
reserve(PatternTL.getFullDataSize());
10563 QualType To = getDerived().TransformType(TLB, PatternTL);
10568 To = getDerived().RebuildPackExpansionType(To,
10569 PatternTL.getSourceRange(),
10583 if (!RetainExpansion)
10588 ForgetPartiallySubstitutedPackRAII Forget(getDerived());
10593 QualType To = getDerived().TransformType(TLB, PatternTL);
10597 To = getDerived().RebuildPackExpansionType(To,
10598 PatternTL.getSourceRange(),
10610 if (!getDerived().AlwaysRebuild() && !ArgChanged)
10613 return getDerived().RebuildTypeTrait(E->
getTrait(),
10619 template<
typename Derived>
10626 if (!getDerived().AlwaysRebuild() &&
10642 return getDerived().RebuildArrayTypeTrait(E->
getTrait(),
10649 template<
typename Derived>
10664 return getDerived().RebuildExpressionTrait(
10668 template <
typename Derived>
10672 ExprResult NewDRE = getDerived().TransformDependentScopeDeclRefExpr(
10673 DRE, AddrTaken, RecoveryTSI);
10680 if (!getDerived().AlwaysRebuild() && NewDRE.
get() == DRE)
10682 return getDerived().RebuildParenExpr(NewDRE.
get(), PE->
getLParen(),
10686 template <
typename Derived>
10689 return TransformDependentScopeDeclRefExpr(E,
false,
10693 template<
typename Derived>
10697 bool IsAddressOfOperand,
10701 = getDerived().TransformNestedNameSpecifierLoc(E->
getQualifierLoc());
10711 = getDerived().TransformDeclarationNameInfo(E->
getNameInfo());
10716 if (!getDerived().AlwaysRebuild() &&
10723 return getDerived().RebuildDependentScopeDeclRefExpr(
10724 QualifierLoc, TemplateKWLoc, NameInfo,
nullptr,
10725 IsAddressOfOperand, RecoveryTSI);
10734 return getDerived().RebuildDependentScopeDeclRefExpr(
10735 QualifierLoc, TemplateKWLoc, NameInfo, &TransArgs, IsAddressOfOperand,
10739 template<
typename Derived>
10747 (!getDerived().DropCallArgument(E->
getArg(0))) &&
10758 = cast_or_null<CXXConstructorDecl>(
10764 bool ArgumentChanged =
false;
10770 if (!getDerived().AlwaysRebuild() &&
10773 !ArgumentChanged) {
10776 SemaRef.MarkFunctionReferenced(E->
getLocStart(), Constructor);
10780 return getDerived().RebuildCXXConstructExpr(T, E->
getLocStart(),
10791 template<
typename Derived>
10803 if (!getDerived().AlwaysRebuild() &&
10808 SemaRef.MarkFunctionReferenced(E->
getLocStart(), Constructor);
10812 return getDerived().RebuildCXXInheritedCtorInitExpr(
10821 template<
typename Derived>
10832 template<
typename Derived>
10838 template<
typename Derived>
10848 = cast_or_null<CXXConstructorDecl>(
10854 bool ArgumentChanged =
false;
10861 if (!getDerived().AlwaysRebuild() &&
10864 !ArgumentChanged) {
10866 SemaRef.MarkFunctionReferenced(E->
getLocStart(), Constructor);
10867 return SemaRef.MaybeBindToTemporary(E);
10871 return getDerived().RebuildCXXTemporaryObjectExpr(T,
10877 template<
typename Derived>
10882 typedef std::pair<ExprResult, QualType> InitCaptureInfoTy;
10893 ExprResult NewExprInitResult = getDerived().TransformInitializer(
10894 C->getCapturedVar()->getInit(),
10899 Expr *NewExprInit = NewExprInitResult.
get();
10901 VarDecl *OldVD = C->getCapturedVar();
10903 getSema().buildLambdaInitCaptureInitialization(
10906 C->getCapturedVar()->getInitStyle() !=
VarDecl::CInit, NewExprInit);
10907 NewExprInitResult = NewExprInit;
10909 std::make_pair(NewExprInitResult, NewInitCaptureType);
10914 auto TPL = getDerived().TransformTemplateParameterList(
10930 QualType NewCallOpType = TransformFunctionProtoType(
10931 NewCallOpTLBuilder, OldCallOpFPTL,
nullptr, 0,
10934 ExceptionStorage, Changed);
10936 if (NewCallOpType.
isNull())
10938 NewCallOpTSI = NewCallOpTLBuilder.getTypeSourceInfo(getSema().Context,
10955 CXXMethodDecl *NewCallOperator = getSema().startLambdaDefinition(
10963 for (
unsigned I = 0, NumParams = NewCallOperator->
getNumParams();
10964 I != NumParams; ++I) {
10966 if (
P->hasUninstantiatedDefaultArg()) {
10972 P->setDefaultArg(R.
get());
10977 getDerived().transformedLocalDecl(E->
getCallOperator(), NewCallOperator);
10984 getSema().buildLambdaScope(LSI, NewCallOperator,
10992 bool Invalid =
false;
10995 bool FinishedExplicitCaptures =
false;
11001 if (!FinishedExplicitCaptures && C->isImplicit()) {
11002 getSema().finishLambdaExplicitCaptures(LSI);
11003 FinishedExplicitCaptures =
true;
11007 if (C->capturesThis()) {
11008 getSema().CheckCXXThisCapture(C->getLocation(), C->isExplicit(),
11015 if (C->capturesVLAType())
11020 InitCaptureInfoTy InitExprTypePair =
11023 QualType InitQualType = InitExprTypePair.second;
11028 VarDecl *OldVD = C->getCapturedVar();
11029 VarDecl *NewVD = getSema().createLambdaInitCaptureVarDecl(
11035 getDerived().transformedLocalDecl(OldVD, NewVD);
11037 getSema().buildInitCaptureField(LSI, NewVD);
11041 assert(C->capturesVariable() &&
"unexpected kind of lambda capture");
11050 if (C->isPackExpansion()) {
11052 bool ShouldExpand =
false;
11053 bool RetainExpansion =
false;
11055 if (getDerived().TryExpandParameterPacks(C->getEllipsisLoc(),
11058 ShouldExpand, RetainExpansion,
11064 if (ShouldExpand) {
11068 VarDecl *Pack = C->getCapturedVar();
11069 for (
unsigned I = 0; I != *NumExpansions; ++I) {
11072 = cast_or_null<VarDecl>(getDerived().TransformDecl(C->getLocation(),
11074 if (!CapturedVar) {
11080 getSema().tryCaptureVariable(CapturedVar, C->getLocation(),
Kind);
11088 EllipsisLoc = C->getEllipsisLoc();
11093 = cast_or_null<VarDecl>(getDerived().TransformDecl(C->getLocation(),
11094 C->getCapturedVar()));
11101 getSema().tryCaptureVariable(CapturedVar, C->getLocation(),
Kind,
11104 if (!FinishedExplicitCaptures)
11105 getSema().finishLambdaExplicitCaptures(LSI);
11109 getSema().PushExpressionEvaluationContext(
11120 SavedContext.
pop();
11121 getSema().ActOnLambdaError(E->
getLocStart(),
nullptr,
11129 auto LSICopy = *LSI;
11130 getSema().ActOnFinishFunctionBody(NewCallOperator, Body.
get(),
11132 SavedContext.
pop();
11134 return getSema().BuildLambdaExpr(E->
getLocStart(), Body.
get()->getLocEnd(),
11138 template<
typename Derived>
11147 bool ArgumentChanged =
false;
11154 if (!getDerived().AlwaysRebuild() &&
11160 return getDerived().RebuildCXXUnresolvedConstructExpr(T,
11166 template<
typename Derived>
11177 Base = getDerived().TransformExpr(OldBase);
11183 bool MayBePseudoDestructor =
false;
11184 Base = SemaRef.ActOnStartCXXMemberReference(
nullptr, Base.
get(),
11186 E->
isArrow()? tok::arrow : tok::period,
11188 MayBePseudoDestructor);
11192 ObjectType = ObjectTy.get();
11193 BaseType = ((
Expr*) Base.
get())->getType();
11196 BaseType = getDerived().TransformType(E->
getBaseType());
11203 = getDerived().TransformFirstQualifierInScope(
11212 FirstQualifierInScope);
11231 if (!getDerived().AlwaysRebuild() &&
11232 Base.
get() == OldBase &&
11239 return getDerived().RebuildCXXDependentScopeMemberExpr(Base.
get(),
11245 FirstQualifierInScope,
11256 return getDerived().RebuildCXXDependentScopeMemberExpr(Base.
get(),
11262 FirstQualifierInScope,
11267 template<
typename Derived>
11274 Base = getDerived().TransformExpr(Old->
getBase());
11277 Base = getSema().PerformMemberExprBaseConversion(Base.
get(),
11281 BaseType = Base.
get()->getType();
11283 BaseType = getDerived().TransformType(Old->
getBaseType());
11289 = getDerived().TransformNestedNameSpecifierLoc(Old->
getQualifierLoc());
11300 if (TransformOverloadExprDecls(Old,
false, R))
11306 = cast_or_null<CXXRecordDecl>(getDerived().TransformDecl(
11312 R.setNamingClass(NamingClass);
11329 NamedDecl *FirstQualifierInScope =
nullptr;
11331 return getDerived().RebuildUnresolvedMemberExpr(Base.
get(),
11337 FirstQualifierInScope,
11340 ? &TransArgs :
nullptr));
11343 template<
typename Derived>
11352 if (!getDerived().AlwaysRebuild() && SubExpr.
get() == E->
getOperand())
11358 template<
typename Derived>
11365 if (!getDerived().AlwaysRebuild() && Pattern.
get() == E->
getPattern())
11372 template<
typename Derived>
11391 bool ShouldExpand =
false;
11392 bool RetainExpansion =
false;
11396 ShouldExpand, RetainExpansion,
11402 if (ShouldExpand) {
11404 if (
auto *TTPD = dyn_cast<TemplateTypeParmDecl>(Pack)) {
11405 ArgStorage = getSema().Context.getPackExpansionType(
11406 getSema().Context.getTypeDeclType(TTPD), None);
11407 }
else if (
auto *TTPD = dyn_cast<TemplateTemplateParmDecl>(Pack)) {
11410 auto *VD = cast<ValueDecl>(Pack);
11411 ExprResult DRE = getSema().BuildDeclRefExpr(VD, VD->getType(),
11413 if (DRE.isInvalid())
11416 getSema().Context.DependentTy, DRE.get(), E->
getPackLoc(), None);
11418 PackArgs = ArgStorage;
11423 if (!PackArgs.size()) {
11424 auto *Pack = cast_or_null<NamedDecl>(
11428 return getDerived().RebuildSizeOfPackExpr(E->
getOperatorLoc(), Pack,
11436 if (!Arg.isPackExpansion()) {
11437 Result = *Result + 1;
11442 InventTemplateArgumentLoc(Arg, ArgLoc);
11448 getSema().getTemplateArgumentPackExpansionPattern(ArgLoc, Ellipsis,
11449 OrigNumExpansions);
11454 if (getDerived().TransformTemplateArgument(Pattern, OutPattern,
11460 getSema().getFullyPackExpandedSize(OutPattern.
getArgument());
11461 if (!NumExpansions) {
11468 Result = *Result + *NumExpansions;
11484 if (TransformTemplateArguments(PackLocIterator(*
this, PackArgs.begin()),
11485 PackLocIterator(*
this, PackArgs.end()),
11486 TransformedPackArgs,
true))
11493 bool PartialSubstitution =
false;
11494 for (
auto &Loc : TransformedPackArgs.arguments()) {
11495 Args.push_back(Loc.getArgument());
11496 if (Loc.getArgument().isPackExpansion())
11497 PartialSubstitution =
true;
11500 if (PartialSubstitution)
11507 Args.size(), None);
11510 template<
typename Derived>
11518 template<
typename Derived>
11526 template<
typename Derived>
11533 template<
typename Derived>
11540 template<
typename Derived>
11546 getSema().collectUnexpandedParameterPacks(Pattern, Unexpanded);
11547 assert(!Unexpanded.empty() &&
"Pack expansion without parameter packs?");
11551 bool Expand =
true;
11552 bool RetainExpansion =
false;
11557 Expand, RetainExpansion,
11576 if (!getDerived().AlwaysRebuild() &&
11580 return getDerived().RebuildCXXFoldExpr(
11594 if (!LeftFold && RetainExpansion) {
11595 ForgetPartiallySubstitutedPackRAII Forget(getDerived());
11597 ExprResult Out = getDerived().TransformExpr(Pattern);
11601 Result = getDerived().RebuildCXXFoldExpr(
11608 for (
unsigned I = 0; I != *NumExpansions; ++I) {
11610 getSema(), LeftFold ? I : *NumExpansions - I - 1);
11611 ExprResult Out = getDerived().TransformExpr(Pattern);
11615 if (Out.
get()->containsUnexpandedParameterPack()) {
11617 Result = getDerived().RebuildCXXFoldExpr(
11619 LeftFold ? Result.
get() : Out.
get(),
11621 LeftFold ? Out.
get() : Result.
get(),
11625 Result = getDerived().RebuildBinaryOperator(
11627 LeftFold ? Result.
get() : Out.
get(),
11628 LeftFold ? Out.
get() : Result.
get());
11638 if (LeftFold && RetainExpansion) {
11639 ForgetPartiallySubstitutedPackRAII Forget(getDerived());
11641 ExprResult Out = getDerived().TransformExpr(Pattern);
11645 Result = getDerived().RebuildCXXFoldExpr(
11656 return getDerived().RebuildEmptyCXXFoldExpr(E->
getEllipsisLoc(),
11662 template<
typename Derived>
11669 template<
typename Derived>
11672 return SemaRef.MaybeBindToTemporary(E);
11675 template<
typename Derived>
11681 template<
typename Derived>
11688 if (!getDerived().AlwaysRebuild() &&
11695 template<
typename Derived>
11700 bool ArgChanged =
false;
11702 false, Elements, &ArgChanged))
11705 if (!getDerived().AlwaysRebuild() && !ArgChanged)
11706 return SemaRef.MaybeBindToTemporary(E);
11708 return getDerived().RebuildObjCArrayLiteral(E->
getSourceRange(),
11713 template<
typename Derived>
11719 bool ArgChanged =
false;
11726 getSema().collectUnexpandedParameterPacks(OrigElement.
Key, Unexpanded);
11727 getSema().collectUnexpandedParameterPacks(OrigElement.
Value, Unexpanded);
11728 assert(!Unexpanded.empty() &&
"Pack expansion without parameter packs?");
11732 bool Expand =
true;
11733 bool RetainExpansion =
false;
11738 if (getDerived().TryExpandParameterPacks(OrigElement.
EllipsisLoc,
11741 Expand, RetainExpansion,
11750 ExprResult Key = getDerived().TransformExpr(OrigElement.
Key);
11754 if (Key.
get() != OrigElement.
Key)
11761 if (Value.
get() != OrigElement.
Value)
11767 Elements.push_back(Expansion);
11777 for (
unsigned I = 0; I != *NumExpansions; ++I) {
11779 ExprResult Key = getDerived().TransformExpr(OrigElement.
Key);
11794 if (Key.
get()->containsUnexpandedParameterPack() ||
11795 Value.
get()->containsUnexpandedParameterPack())
11798 Elements.push_back(Element);
11808 ExprResult Key = getDerived().TransformExpr(OrigElement.
Key);
11812 if (Key.
get() != OrigElement.
Key)
11817 = getDerived().TransformExpr(OrigElement.
Value);
11821 if (Value.
get() != OrigElement.
Value)
11827 Elements.push_back(Element);
11830 if (!getDerived().AlwaysRebuild() && !ArgChanged)
11831 return SemaRef.MaybeBindToTemporary(E);
11833 return getDerived().RebuildObjCDictionaryLiteral(E->
getSourceRange(),
11837 template<
typename Derived>
11842 if (!EncodedTypeInfo)
11845 if (!getDerived().AlwaysRebuild() &&
11849 return getDerived().RebuildObjCEncodeExpr(E->
getAtLoc(),
11854 template<
typename Derived>
11864 template<
typename Derived>
11876 if (!getDerived().AlwaysRebuild() &&
11886 template <
typename Derived>
11892 template<
typename Derived>
11896 bool ArgChanged =
false;
11907 if (!ReceiverTypeInfo)
11911 if (!getDerived().AlwaysRebuild() &&
11913 return SemaRef.MaybeBindToTemporary(E);
11918 return getDerived().RebuildObjCMessageExpr(ReceiverTypeInfo,
11934 return getDerived().RebuildObjCMessageExpr(E->
getSuperLoc(),
11946 "Only class and instance messages may be instantiated");
11949 if (Receiver.isInvalid())
11953 if (!getDerived().AlwaysRebuild() &&
11955 return SemaRef.MaybeBindToTemporary(E);
11960 return getDerived().RebuildObjCMessageExpr(Receiver.get(),
11969 template<
typename Derived>
11975 template<
typename Derived>
11981 template<
typename Derived>
11992 if (!getDerived().AlwaysRebuild() &&
11996 return getDerived().RebuildObjCIvarRefExpr(Base.
get(), E->
getDecl(),
12001 template<
typename Derived>
12017 if (!getDerived().AlwaysRebuild() &&
12022 return getDerived().RebuildObjCPropertyRefExpr(Base.
get(),
12026 return getDerived().RebuildObjCPropertyRefExpr(Base.
get(),
12027 SemaRef.Context.PseudoObjectTy,
12033 template<
typename Derived>
12047 if (!getDerived().AlwaysRebuild() &&
12051 return getDerived().RebuildObjCSubscriptRefExpr(E->
getRBracket(),
12057 template<
typename Derived>
12066 if (!getDerived().AlwaysRebuild() &&
12075 template<
typename Derived>
12078 bool ArgumentChanged =
false;
12082 SubExprs, &ArgumentChanged))
12085 if (!getDerived().AlwaysRebuild() &&
12089 return getDerived().RebuildShuffleVectorExpr(E->
getBuiltinLoc(),
12094 template<
typename Derived>
12105 if (!getDerived().AlwaysRebuild() &&
12110 return getDerived().RebuildConvertVectorExpr(E->
getBuiltinLoc(),
12111 SrcExpr.
get(), Type,
12115 template<
typename Derived>
12134 if (getDerived().TransformFunctionTypeParams(
12143 getDerived().TransformType(exprFunctionType->
getReturnType());
12149 getDerived().RebuildFunctionProtoType(exprResultType, paramTypes, epi);
12153 if (!params.empty())
12171 if (!SemaRef.getDiagnostics().hasErrorOccurred()) {
12172 for (
const auto &I : oldBlock->
captures()) {
12173 VarDecl *oldCapture = I.getVariable();
12176 if (isa<ParmVarDecl>(oldCapture) &&
12177 cast<ParmVarDecl>(oldCapture)->isParameterPack())
12183 assert(blockScope->
CaptureMap.count(newCapture));
12193 template<
typename Derived>
12196 llvm_unreachable(
"Cannot transform asType expressions yet");
12199 template<
typename Derived>
12203 bool ArgumentChanged =
false;
12207 SubExprs, &ArgumentChanged))
12210 if (!getDerived().AlwaysRebuild() &&
12214 return getDerived().RebuildAtomicExpr(E->
getBuiltinLoc(), SubExprs,
12222 template<
typename Derived>
12225 return SemaRef.BuildPointerType(PointeeType, Star,
12226 getDerived().getBaseEntity());
12229 template<
typename Derived>
12232 return SemaRef.BuildBlockPointerType(PointeeType, Star,
12233 getDerived().getBaseEntity());
12236 template<
typename Derived>
12239 bool WrittenAsLValue,
12241 return SemaRef.BuildReferenceType(ReferentType, WrittenAsLValue,
12242 Sigil, getDerived().getBaseEntity());
12245 template<
typename Derived>
12250 return SemaRef.BuildMemberPointerType(PointeeType, ClassType, Sigil,
12251 getDerived().getBaseEntity());
12254 template<
typename Derived>
12261 return SemaRef.BuildObjCTypeParamType(Decl,
12262 ProtocolLAngleLoc, Protocols,
12263 ProtocolLocs, ProtocolRAngleLoc,
12267 template<
typename Derived>
12278 return SemaRef.BuildObjCObjectType(BaseType, Loc, TypeArgsLAngleLoc,
12279 TypeArgs, TypeArgsRAngleLoc,
12280 ProtocolLAngleLoc, Protocols, ProtocolLocs,
12285 template<
typename Derived>
12289 return SemaRef.Context.getObjCObjectPointerType(PointeeType);
12292 template<
typename Derived>
12296 const llvm::APInt *Size,
12298 unsigned IndexTypeQuals,
12300 if (SizeExpr || !Size)
12301 return SemaRef.BuildArrayType(ElementType, SizeMod, SizeExpr,
12302 IndexTypeQuals, BracketsRange,
12303 getDerived().getBaseEntity());
12306 SemaRef.Context.UnsignedCharTy, SemaRef.Context.UnsignedShortTy,
12307 SemaRef.Context.UnsignedIntTy, SemaRef.Context.UnsignedLongTy,
12308 SemaRef.Context.UnsignedLongLongTy, SemaRef.Context.UnsignedInt128Ty
12310 const unsigned NumTypes = llvm::array_lengthof(Types);
12312 for (
unsigned I = 0; I != NumTypes; ++I)
12313 if (Size->getBitWidth() == SemaRef.Context.getIntWidth(Types[I])) {
12314 SizeType = Types[I];
12323 return SemaRef.BuildArrayType(ElementType, SizeMod, ArraySize,
12324 IndexTypeQuals, BracketsRange,
12325 getDerived().getBaseEntity());
12328 template<
typename Derived>
12332 const llvm::APInt &Size,
12333 unsigned IndexTypeQuals,
12335 return getDerived().RebuildArrayType(ElementType, SizeMod, &Size,
nullptr,
12336 IndexTypeQuals, BracketsRange);
12339 template<
typename Derived>
12343 unsigned IndexTypeQuals,
12345 return getDerived().RebuildArrayType(ElementType, SizeMod,
nullptr,
nullptr,
12346 IndexTypeQuals, BracketsRange);
12349 template<
typename Derived>
12354 unsigned IndexTypeQuals,
12356 return getDerived().RebuildArrayType(ElementType, SizeMod,
nullptr,
12358 IndexTypeQuals, BracketsRange);
12361 template<
typename Derived>
12366 unsigned IndexTypeQuals,
12368 return getDerived().RebuildArrayType(ElementType, SizeMod,
nullptr,
12370 IndexTypeQuals, BracketsRange);
12373 template <
typename Derived>
12376 return SemaRef.BuildAddressSpaceAttr(PointeeType, AddrSpaceExpr,
12380 template <
typename Derived>
12383 unsigned NumElements,
12386 return SemaRef.Context.getVectorType(ElementType, NumElements, VecKind);
12389 template<
typename Derived>
12391 unsigned NumElements,
12393 llvm::APInt numElements(SemaRef.Context.getIntWidth(SemaRef.Context.IntTy),
12394 NumElements,
true);
12398 return SemaRef.BuildExtVectorType(ElementType, VectorSize, AttributeLoc);
12401 template<
typename Derived>
12406 return SemaRef.BuildExtVectorType(ElementType, SizeExpr, AttributeLoc);
12409 template<
typename Derived>
12414 return SemaRef.BuildFunctionType(T, ParamTypes,
12415 getDerived().getBaseLocation(),
12416 getDerived().getBaseEntity(),
12420 template<
typename Derived>
12422 return SemaRef.Context.getFunctionNoProtoType(T);
12425 template<
typename Derived>
12428 assert(D &&
"no decl found");
12433 if (
auto *UPD = dyn_cast<UsingPackDecl>(D)) {
12437 if (UPD->expansions().empty()) {
12438 getSema().Diag(Loc, diag::err_using_pack_expansion_empty)
12448 for (
auto *E : UPD->expansions()) {
12449 QualType ThisT = RebuildUnresolvedUsingType(Loc, E);
12457 assert(getSema().Context.hasSameType(ThisT, T) &&
12458 "mismatched resolved types in using pack expansion");
12460 return T.
isNull() ? FallbackT :
T;
12461 }
else if (
auto *Using = dyn_cast<UsingDecl>(D)) {
12462 assert(Using->hasTypename() &&
12463 "UnresolvedUsingTypenameDecl transformed to non-typename using");
12466 assert(++Using->shadow_begin() == Using->shadow_end());
12467 Ty = cast<TypeDecl>((*Using->shadow_begin())->getTargetDecl());
12469 assert(isa<UnresolvedUsingTypenameDecl>(D) &&
12470 "UnresolvedUsingTypenameDecl transformed to non-using decl");
12471 Ty = cast<UnresolvedUsingTypenameDecl>(D);
12474 return SemaRef.Context.getTypeDeclType(Ty);
12477 template<
typename Derived>
12480 return SemaRef.BuildTypeofExprType(E, Loc);
12483 template<
typename Derived>
12485 return SemaRef.Context.getTypeOfType(Underlying);
12488 template<
typename Derived>
12491 return SemaRef.BuildDecltypeType(E, Loc);
12494 template<
typename Derived>
12498 return SemaRef.BuildUnaryTransformType(BaseType, UKind, Loc);
12501 template<
typename Derived>
12506 return SemaRef.CheckTemplateIdType(Template, TemplateNameLoc, TemplateArgs);
12509 template<
typename Derived>
12512 return SemaRef.BuildAtomicType(ValueType, KWLoc);
12515 template<
typename Derived>
12519 return isReadPipe ? SemaRef.BuildReadPipeType(ValueType, KWLoc)
12520 : SemaRef.BuildWritePipeType(ValueType, KWLoc);
12523 template<
typename Derived>
12528 return SemaRef.Context.getQualifiedTemplateName(SS.
getScopeRep(), TemplateKW,
12532 template<
typename Derived>
12539 bool AllowInjectedClassName) {
12544 getSema().ActOnDependentTemplateName(
nullptr,
12545 SS, TemplateKWLoc, TemplateName,
12548 Template, AllowInjectedClassName);
12549 return Template.
get();
12552 template<
typename Derived>
12558 bool AllowInjectedClassName) {
12561 SourceLocation SymbolLocations[3] = { NameLoc, NameLoc, NameLoc };
12565 getSema().ActOnDependentTemplateName(
nullptr,
12566 SS, TemplateKWLoc, Name,
12569 Template, AllowInjectedClassName);
12570 return Template.
get();
12573 template<
typename Derived>
12581 bool isPostIncDec = Second && (Op == OO_PlusPlus || Op == OO_MinusMinus);
12586 return SemaRef.checkPseudoObjectAssignment(
nullptr, OpLoc, Opc,
12588 ExprResult Result = SemaRef.CheckPlaceholderExpr(First);
12591 First = Result.
get();
12595 ExprResult Result = SemaRef.CheckPlaceholderExpr(Second);
12598 Second = Result.
get();
12602 if (Op == OO_Subscript) {
12605 return getSema().CreateBuiltinArraySubscriptExpr(First,
12608 }
else if (Op == OO_Arrow) {
12610 return SemaRef.BuildOverloadedArrowExpr(
nullptr, First, OpLoc);
12611 }
else if (Second ==
nullptr || isPostIncDec) {
12618 return getSema().CreateBuiltinUnaryOp(OpLoc, Opc, First);
12627 = SemaRef.CreateBuiltinBinOp(OpLoc, Opc, First, Second);
12641 Functions.
append(ULE->decls_begin(), ULE->decls_end());
12645 RequiresADL = ULE->requiresADL();
12650 NamedDecl *ND = cast<DeclRefExpr>(Callee)->getDecl();
12651 if (!isa<CXXMethodDecl>(ND))
12653 RequiresADL =
false;
12657 Expr *Args[2] = { First, Second };
12658 unsigned NumArgs = 1 + (Second !=
nullptr);
12661 if (NumArgs == 1 || isPostIncDec) {
12664 return SemaRef.CreateOverloadedUnaryOp(OpLoc, Opc, Functions, First,
12668 if (Op == OO_Subscript) {
12672 if (
DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(Callee)) {
12683 return SemaRef.CreateOverloadedArraySubscriptExpr(LBrace, RBrace,
12689 ExprResult Result = SemaRef.CreateOverloadedBinOp(
12690 OpLoc, Opc, Functions, Args[0], Args[1], RequiresADL);
12697 template<
typename Derived>
12712 ->template getAs<RecordType>())){
12714 return SemaRef.BuildPseudoDestructorExpr(
12715 Base, OperatorLoc, isArrow ? tok::arrow : tok::period, SS, ScopeType,
12716 CCLoc, TildeLoc, Destroyed);
12720 DeclarationName Name(SemaRef.Context.DeclarationNames.getCXXDestructorName(
12721 SemaRef.Context.getCanonicalType(DestroyedType->
getType())));
12730 diag::err_expected_class_or_namespace)
12731 << ScopeType->
getType() << getSema().getLangOpts().CPlusPlus;
12739 return getSema().BuildMemberReferenceExpr(Base, BaseType,
12740 OperatorLoc, isArrow,
12748 template<
typename Derived>
12756 for (
unsigned I = 0; I < NumParams; ++I) {
12757 if (I != ContextParamPos) {
12763 Params.push_back(std::make_pair(StringRef(),
QualType()));
12766 getSema().ActOnCapturedRegionStart(Loc,
nullptr,
12775 getSema().ActOnCapturedRegionError();
12779 return getSema().ActOnCapturedRegionEnd(Body.
get());
12784 #endif // LLVM_CLANG_LIB_SEMA_TREETRANSFORM_H SourceLocation getRParenLoc() const
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
ObjCIndirectCopyRestoreExpr - Represents the passing of a function argument by indirect copy-restore ...
A call to an overloaded operator written using operator syntax.
The receiver is the instance of the superclass object.
Represents a single C99 designator.
SourceLocation getLoc() const
getLoc - Returns the main location of the declaration name.
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
SourceLocation getStartLoc() const
CXXRecordDecl * getNamingClass() const
Retrieve the naming class of this lookup.
SourceLocation getRBracLoc() const
const BlockDecl * getBlockDecl() const
This represents '#pragma omp distribute simd' composite directive.
QualType getDeducedType() const
Get the type deduced for this placeholder type, or null if it's either not been deduced or was deduce...
IdentifierInfo * getInputIdentifier(unsigned i) const
This represents '#pragma omp master' directive.
Represents a type that was referred to using an elaborated type keyword, e.g., struct S...
void setScopeInfo(unsigned scopeDepth, unsigned parameterIndex)
TypeLoc getValueLoc() const
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
SourceLocation getRParenLoc() const
The null pointer literal (C++11 [lex.nullptr])
SourceLocation getLAngleLoc() const
Retrieve the location of the left angle bracket starting the explicit template argument list followin...
capture_iterator explicit_capture_end() const
Retrieve an iterator pointing past the end of the sequence of explicit lambda captures.
This represents '#pragma omp task' directive.
This represents a GCC inline-assembly statement extension.
An instance of this class is created to represent a function declaration or definition.
Represents a 'co_await' expression while the type of the promise is dependent.
Expr * getArrayIndex(const Designator &D) const
SourceLocation getForLoc() const
SourceRange getExceptionSpecRange() const
helper_expr_const_range reduction_ops() const
Name lookup found a set of overloaded functions that met the criteria.
This represents 'thread_limit' clause in the '#pragma omp ...' directive.
std::pair< llvm::PointerUnion< const TemplateTypeParmType *, NamedDecl * >, SourceLocation > UnexpandedParameterPack
Expr ** getArgs()
Retrieve the call arguments.
The receiver is an object instance.
bool hasExplicitTemplateArgs() const
Determines whether this expression had explicit template arguments.
const Stmt * getElse() const
SourceRange getSourceRange() const LLVM_READONLY
unsigned getNumInputs() const
SourceLocation getOpLoc() const
SourceLocation getRParenLoc() const
ObjCDictionaryElement getKeyValueElement(unsigned Index) const
const TemplateArgumentLoc * getTemplateArgs() const
Retrieve the template arguments provided as part of this template-id.
const FunctionProtoType * getFunctionType() const
getFunctionType - Return the underlying function type for this block.
CompoundStmt * getBlock() const
friend bool operator==(const TemplateArgumentLocInventIterator &X, const TemplateArgumentLocInventIterator &Y)
Smart pointer class that efficiently represents Objective-C method names.
TemplateArgumentLoc reference
SourceLocation getForLoc() const
This represents clause 'copyin' in the '#pragma omp ...' directives.
const TypeClass * getTypePtr() const
PointerType - C99 6.7.5.1 - Pointer Declarators.
QualType getPointeeType() const
void MakeSuper(ASTContext &Context, CXXRecordDecl *RD, SourceLocation SuperLoc, SourceLocation ColonColonLoc)
Turns this (empty) nested-name-specifier into '__super' nested-name-specifier.
SourceLocation getUsedLocation() const
Retrieve the location where this default argument was actually used.
Represents the dependent type named by a dependently-scoped typename using declaration, e.g.
Stores the type being destroyed by a pseudo-destructor expression.
A (possibly-)qualified type.
Keeps information about an identifier in a nested-name-spec.
void MakeTrivial(ASTContext &Context, NestedNameSpecifier *Qualifier, SourceRange R)
Make a new nested-name-specifier from incomplete source-location information.
ValueDecl * getMemberDecl() const
Retrieve the member declaration to which this expression refers.
void setStarLoc(SourceLocation Loc)
ArrayRef< OMPClause * > clauses()
Expr * getArg(unsigned Arg)
getArg - Return the specified argument.
ObjCMethodDecl * getAtIndexMethodDecl() const
Instantiation or recovery rebuild of a for-range statement.
Selector getSelector() const
SourceLocation getEllipsisLoc() const
SourceLocation getLParen() const
Get the location of the left parentheses '('.
const Expr * getSubExpr() const
capture_iterator capture_end() const
Retrieve an iterator pointing past the end of the sequence of lambda captures.
SourceLocation getCommaLoc()
Get location of ','.
const TypeClass * getTypePtr() const
TemplateParameterList * GLTemplateParameterList
If this is a generic lambda, and the template parameter list has been created (from the AutoTemplateP...
SourceRange getSourceRange() const LLVM_READONLY
Retrieve the source range covering the entirety of this nested-name-specifier.
unsigned getNumSubExprs() const
getNumSubExprs - Return the size of the SubExprs array.
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
Ordinary name lookup, which finds ordinary names (functions, variables, typedefs, etc...
CompoundStmt * getSubStmt()
TemplateArgumentLoc operator*() const
SourceLocation getKWLoc() const
NestedNameSpecifierLoc getTemplateQualifierLoc() const
Expr * getUnderlyingExpr() const
void setKWLoc(SourceLocation Loc)
static ConditionResult ConditionError()
static UnresolvedLookupExpr * Create(const ASTContext &C, CXXRecordDecl *NamingClass, NestedNameSpecifierLoc QualifierLoc, const DeclarationNameInfo &NameInfo, bool ADL, bool Overloaded, UnresolvedSetIterator Begin, UnresolvedSetIterator End)
const TemplateArgumentLoc * operator->() const
void setRParenLoc(SourceLocation Loc)
SourceLocation getRParenLoc() const
bool hasExplicitResultType() const
Whether this lambda had its result type explicitly specified.
bool isThrownVariableInScope() const
Determines whether the variable thrown by this expression (if any!) is within the innermost try block...
AutoTypeKeyword
Which keyword(s) were used to create an AutoType.
bool isLeftFold() const
Does this produce a left-associated sequence of operators?
Represents a 'co_return' statement in the C++ Coroutines TS.
Stmt - This represents one statement.
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this call.
This represents clause 'in_reduction' in the '#pragma omp task' directives.
Expr * getDimensionExpression() const
const ObjCAtFinallyStmt * getFinallyStmt() const
Retrieve the @finally statement, if any.
SourceLocation getLocStart() const LLVM_READONLY
void setLAngleLoc(SourceLocation Loc)
void setExceptionSpecRange(SourceRange R)
CXXCatchStmt * getHandler(unsigned i)
IfStmt - This represents an if/then/else.
SourceLocation getLAngleLoc() const
Retrieve the location of the left angle bracket starting the explicit template argument list followin...
SourceLocation getOperatorLoc() const
getOperatorLoc - Return the location of the operator.
SourceLocation getRParenLoc() const
QualType getPointeeType() const
If this is a pointer, ObjC object pointer, or block pointer, this returns the respective pointee...
TemplateArgumentLoc const * getTemplateArgs() const
TypeLoc getValueLoc() const
ObjCMethodDecl * setAtIndexMethodDecl() const
QualType ReturnType
ReturnType - The target type of return statements in this context, or null if unknown.
StorageClass getStorageClass() const
Returns the storage class as written in the source.
unsigned getNumOutputs() const
ActionResult< Expr * > ExprResult
Microsoft's '__super' specifier, stored as a CXXRecordDecl* of the class it appeared in...
bool isConstexpr() const
Whether this is a (C++11) constexpr function or constexpr constructor.
Represents a qualified type name for which the type name is dependent.
SourceLocation getLocStart() const LLVM_READONLY
This represents '#pragma omp for simd' directive.
SourceLocation getLParenLoc() const
Returns the location of '('.
The template argument is an expression, and we've not resolved it to one of the other forms yet...
bool isRecordType() const
TemplateArgumentLoc reference
const StringLiteral * getAsmString() const
TypeSourceInfo * getTypeSourceInfo() const
SemaDiagnosticBuilder Diag(SourceLocation Loc, unsigned DiagID)
Emit a diagnostic.
Decl - This represents one declaration (or definition), e.g.
This represents 'grainsize' clause in the '#pragma omp ...' directive.
SourceLocation getLocStart() const LLVM_READONLY
This represents '#pragma omp teams distribute parallel for' composite directive.
Stmt * getHandlerBlock() const
SourceLocation getLocStart() const LLVM_READONLY
ObjCMethodDecl * getImplicitPropertySetter() const
Represents the index of the current element of an array being initialized by an ArrayInitLoopExpr.
FunctionDecl * getOperatorNew() const
WrittenBuiltinSpecs & getWrittenBuiltinSpecs()
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
This represents 'if' clause in the '#pragma omp ...' directive.
QualType getDeducedTemplateSpecializationType(TemplateName Template, QualType DeducedType, bool IsDependent) const
C++17 deduced class template specialization type.
const Expr * getSubExpr() const
DeclarationNameInfo getNameInfo() const
Retrieve the name of the entity we're testing for, along with location information.
Defines the C++ template declaration subclasses.
Represents a C++11 auto or C++14 decltype(auto) type.
SourceLocation getIdentLoc() const
Represents an attribute applied to a statement.
ParenExpr - This represents a parethesized expression, e.g.
const AstTypeMatcher< FunctionType > functionType
Matches FunctionType nodes.
bool hasQualifier() const
Determines whether this member expression actually had a C++ nested-name-specifier prior to the name ...
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies this name, if any.
Expr * getLowerBound()
Get lower bound of array section.
This represents 'priority' clause in the '#pragma omp ...' directive.
The base class of the type hierarchy.
This represents '#pragma omp target teams distribute' combined directive.
Represents Objective-C's @throw statement.
bool requiresZeroInitialization() const
Whether this construction first requires zero-initialization before the initializer is called...
void setParams(ArrayRef< ParmVarDecl *> NewParamInfo)
reference operator*() const
const IdentifierInfo * getField() const
bool hasExplicitTemplateArgs() const
Determines whether this declaration reference was followed by an explicit template argument list...
void setTemplateKeywordLoc(SourceLocation Loc)
Represents an array type, per C99 6.7.5.2 - Array Declarators.
The template argument is a declaration that was provided for a pointer, reference, or pointer to member non-type template parameter.
NamespaceDecl - Represent a C++ namespace.
SourceLocation getKeywordLoc() const
Represents a call to a C++ constructor.
ObjCSubscriptRefExpr - used for array and dictionary subscripting.
Wrapper for source info for typedefs.
static ExprValueKind getValueKindForType(QualType T)
getValueKindForType - Given a formal return or parameter type, give its value kind.
TypeSourceInfo * getTypeInfoAsWritten() const
getTypeInfoAsWritten - Returns the type source info for the type that this expression is casting to...
FPOptions getFPFeatures() const
An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent...
TypeLoc getOriginalLoc() const
SourceLocation getLParenLoc() const
SourceLocation getLocStart() const LLVM_READONLY
Expr * getCondition() const
Returns condition.
std::input_iterator_tag iterator_category
A container of type source information.
This represents 'update' clause in the '#pragma omp atomic' directive.
Wrapper for void* pointer.
Expr * getCondition() const
Returns condition.
This represents '#pragma omp parallel for' directive.
MS property subscript expression.
SourceLocation getGotoLoc() const
unsigned location_size() const
Retrieve the size of the data associated with source-location information.
SourceLocation getOperatorLoc() const
Determine the location of the 'sizeof' keyword.
SourceLocation getLocEnd() const LLVM_READONLY
SourceLocation getRParenLoc() const
This represents '#pragma omp target teams distribute parallel for' combined directive.
Wrapper for source info for pointers decayed from arrays and functions.
Describes the capture of a variable or of this, or of a C++1y init-capture.
Represents a C++ constructor within a class.
SourceLocation getLocEnd() const LLVM_READONLY
Represents a prvalue temporary that is written into memory so that a reference can bind to it...
SourceLocation getAccessorLoc() const
Expr * getAlignment()
Returns alignment.
static int getOpenMPCaptureLevels(OpenMPDirectiveKind Kind)
Return the number of captured regions created for an OpenMP directive.
SourceLocation getLocalBeginLoc() const
Retrieve the location of the beginning of this component of the nested-name-specifier.
Expr * getNumForLoops() const
Return the number of associated for-loops.
SourceLocation getRParenLoc() const
getRParenLoc - Return the location of final right parenthesis.
SourceLocation getEndLoc() const
Get the end source location.
SourceLocation getSecondScheduleModifierLoc() const
Get the second modifier location.
QualType getElementType() const
VarDecl * getConditionVariable() const
Retrieve the variable declared in this "while" statement, if any.
TemplateName getTemplateName() const
Retrieve the name of the template that we are deducing.
SourceLocation getCoawaitLoc() const
Expr * getIndexExpr(unsigned Idx)
Stmt * getExceptionHandler() const
SourceLocation getRParenLoc() const
Expr * getDeallocate() const
An identifier, stored as an IdentifierInfo*.
This represents '#pragma omp target exit data' directive.
void Adopt(NestedNameSpecifierLoc Other)
Adopt an existing nested-name-specifier (with source-range information).
SourceLocation getDependencyLoc() const
Get dependency type location.
void setRAngleLoc(SourceLocation Loc)
This represents 'read' clause in the '#pragma omp atomic' directive.
RAII object that enters a new expression evaluation context.
VarDecl - An instance of this class is created to represent a variable declaration or definition...
This represents clause 'private' in the '#pragma omp ...' directives.
SourceLocation getLParenLoc() const
QualType getBaseType() const
ObjCIsaExpr - Represent X->isa and X.isa when X is an ObjC 'id' type.
Information about one declarator, including the parsed type information and the identifier.
void removeObjCLifetime()
CompoundLiteralExpr - [C99 6.5.2.5].
This represents 'num_threads' clause in the '#pragma omp ...' directive.
Wrapper for source info for member pointers.
bool isEnumeralType() const
SourceLocation getOperatorLoc() const
Retrieve the location of the '.' or '->' operator.
QualType getCXXNameType() const
getCXXNameType - If this name is one of the C++ names (of a constructor, destructor, or conversion function), return the type associated with that name.
Wrapper of type source information for a type with non-trivial direct qualifiers. ...
IdentifierInfo * getIdentifier() const
UnresolvedLookupExpr * getOperatorCoawaitLookup() const
const T * getAs() const
Member-template getAs<specific type>'.
bool isOverloadableType() const
Determines whether this is a type for which one can define an overloaded operator.
Records and restores the FP_CONTRACT state on entry/exit of compound statements.
DeclContext * computeDeclContext(QualType T)
Compute the DeclContext that is associated with the given type.
unsigned getNumArgs() const
Determine the number of arguments to this type trait.
Represents an empty template argument, e.g., one that has not been deduced.
Extra information about a function prototype.
This represents 'defaultmap' clause in the '#pragma omp ...' directive.
Stmt * getResultDecl() const
SourceLocation getStarLoc() const
Represents a C++17 deduced template specialization type.
SourceLocation getColonLoc() const
QualifiedTemplateName * getAsQualifiedTemplateName() const
Retrieve the underlying qualified template name structure, if any.
ObjCMethodDecl - Represents an instance or class method declaration.
SourceLocation getLeftLoc() const
ArrayRef< SourceLocation > getProtocolLocs() const
RAII object used to temporarily allow the C++ 'this' expression to be used, with the given qualifiers...
A namespace, stored as a NamespaceDecl*.
SourceLocation getColonLoc() const
Return the location of ':'.
DeclarationName getName() const
Gets the name looked up.
Implicit construction of a std::initializer_list<T> object from an array temporary within list-initia...
TypeLoc getNamedTypeLoc() const
bool isInvalidDecl() const
SourceLocation getIfLoc() const
void setAttrOperandParensRange(SourceRange range)
void setProtocolRAngleLoc(SourceLocation Loc)
Stores a list of template parameters for a TemplateDecl and its derived classes.
unsigned getContextParamPosition() const
unsigned getNumPlacementArgs() const
TypeSourceInfo * getArgumentTypeInfo() const
bool requiresADL() const
True if this declaration should be extended by argument-dependent lookup.
This represents implicit clause 'flush' for the '#pragma omp flush' directive.
Defines the Objective-C statement AST node classes.
SourceRange getSourceRange() const LLVM_READONLY
Retrieve the source range that covers this offsetof node.
const DeclarationNameInfo & getNameInfo() const
Gets the name info for specified reduction identifier.
SpecifierKind getKind() const
Determine what kind of nested name specifier is stored.
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will call.
A C++ throw-expression (C++ [except.throw]).
Expr * getExprOperand() const
Represents an expression – generally a full-expression – that introduces cleanups to be run at the ...
TypeSourceInfo * getArg(unsigned I) const
Retrieve the Ith argument.
Expr * getAttrExprOperand() const
The attribute's expression operand, if it has one.
ParmVarDecl - Represents a parameter to a function.
SourceRange getSourceRange() const LLVM_READONLY
Represents the result of substituting a type for a template type parameter.
TemplateArgumentLocContainerIterator operator++(int)
SourceLocation getRParenLoc() const
Defines the clang::Expr interface and subclasses for C++ expressions.
VarDecl * getConditionVariable() const
Retrieve the variable declared in this "switch" statement, if any.
SourceLocation getLParenLoc() const
Returns the location of '('.
void setQualifierLoc(NestedNameSpecifierLoc QualifierLoc)
Expr * getGrainsize() const
Return safe iteration space distance.
This represents 'nogroup' clause in the '#pragma omp ...' directive.
A reasonable base class for TypeLocs that correspond to types that are written as a type-specifier...
The collection of all-type qualifiers we support.
CXXRecordDecl * getLambdaClass() const
Retrieve the class that corresponds to the lambda.
void setTypeArgTInfo(unsigned i, TypeSourceInfo *TInfo)
SourceLocation getBuiltinLoc() const
This represents 'safelen' clause in the '#pragma omp ...' directive.
ObjCPropertyDecl * getExplicitProperty() const
bool needsExtraLocalData() const
A C++ static_cast expression (C++ [expr.static.cast]).
SourceLocation getLParenLoc() const
Returns the location of '('.
Expr * getExprOperand() const
bool canHaveNullability(bool ResultIfUnknown=true) const
Determine whether the given type can have a nullability specifier applied to it, i.e., if it is any kind of pointer type.
const Stmt * getSubStmt() const
SourceLocation getAttributeLoc() const
IdentifierInfo * getIdentifier() const
getIdentifier - Get the identifier that names this declaration, if there is one.
Base wrapper for a particular "section" of type source info.
SourceLocation getRParenLoc() const
Retrieve the location of the closing parenthesis.
LabelStmt - Represents a label, which has a substatement.
RecordDecl - Represents a struct/union/class.
Represents a C99 designated initializer expression.
unsigned varlist_size() const
DeclarationName getDeclName() const
getDeclName - Get the actual, stored name of the declaration, which may be a special name...
TypeSourceInfo * getEncodedTypeSourceInfo() const
TypeSourceInfo * getScopeTypeInfo() const
Retrieve the scope type in a qualified pseudo-destructor expression.
SourceLocation getKeywordLoc() const
SourceLocation getLParenLoc() const
Returns the location of '('.
SourceLocation getColonLoc() const
One of these records is kept for each identifier that is lexed.
Expr * GetTemporaryExpr() const
Retrieve the temporary-generating subexpression whose value will be materialized into a glvalue...
void setLocalRangeEnd(SourceLocation L)
Name lookup results in an ambiguity; use getAmbiguityKind to figure out what kind of ambiguity we hav...
SourceLocation getTildeLoc() const
Retrieve the location of the '~'.
SourceLocation getRParenLoc() const
An element in an Objective-C dictionary literal.
This represents '#pragma omp parallel' directive.
ShuffleVectorExpr - clang-specific builtin-in function __builtin_shufflevector.
SourceLocation getColonLoc() const
Gets location of ':' symbol in clause.
Represents a class type in Objective C.
SourceLocation getRParen() const
Get the location of the right parentheses ')'.
Expr * getAsExpr() const
Retrieve the template argument as an expression.
A C++ nested-name-specifier augmented with source location information.
Expr * getInit() const
Retrieve the initializer value.
Represents a dependent template name that cannot be resolved prior to template instantiation.
ArrayRef< QualType > getParamTypes() const
The results of name lookup within a DeclContext.
This represents 'simd' clause in the '#pragma omp ...' directive.
bool isObjCLifetimeType() const
Returns true if objects of this type have lifetime semantics under ARC.
TypeSourceInfo * getTypeSourceInfo() const
TypeLoc getInnerLoc() const
QualType BuildParenType(QualType T)
Build a paren type including T.
The template argument is an integral value stored in an llvm::APSInt that was provided for an integra...
void setBuiltinLoc(SourceLocation Loc)
void setArgLocInfo(unsigned i, TemplateArgumentLocInfo AI)
TemplateDecl * getAsTemplateDecl() const
Retrieve the underlying template declaration that this template name refers to, if known...
TemplateArgumentLoc value_type
TypeSourceInfo * getUnderlyingTInfo() const
bool isExplicitProperty() const
SourceLocation getLocStart() const LLVM_READONLY
bool isSpelledAsLValue() const
SourceLocation getAmpAmpLoc() const
static SourceLocation getFromRawEncoding(unsigned Encoding)
Turn a raw encoding of a SourceLocation object into a real SourceLocation.
void setRBracketLoc(SourceLocation Loc)
TypeSourceInfo * getTypeSourceInfo(ASTContext &Context, QualType T)
Creates a TypeSourceInfo for the given type.
QualType getDependentNameType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier *NNS, const IdentifierInfo *Name, QualType Canon=QualType()) const
OpenMPLinearClauseKind
OpenMP attributes for 'linear' clause.
SourceLocation getEndLoc() const
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...
FieldDecl - An instance of this class is created by Sema::ActOnField to represent a member of a struc...
TemplateName getTemplateName() const
Retrieve the name of the template that we are specializing.
void setBlockMissingReturnType(bool val)
const Type * getAsType() const
Retrieve the type stored in this nested name specifier.
This represents clause 'lastprivate' in the '#pragma omp ...' directives.
The current expression is potentially evaluated at run time, which means that code may be generated t...
SubstTemplateTemplateParmPackStorage * getAsSubstTemplateTemplateParmPack() const
Retrieve the substituted template template parameter pack, if known.
Expr * getBase()
Retrieve the base object of this member expressions, e.g., the x in x.m.
Represents a place-holder for an object not to be initialized by anything.
QualType getElaboratedType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier *NNS, QualType NamedType) const
SourceLocation getAttrNameLoc() const
The location of the attribute name, i.e.
VarDecl * getPromiseDecl() const
ArrayRef< Expr * > getAllExprs() const
const DeclarationNameInfo & getNameInfo() const
Gets the full name info.
unsigned getFunctionScopeIndex() const
Returns the index of this parameter in its prototype or method scope.
SourceLocation getLParenLoc() const
Returns the location of '('.
UnaryExprOrTypeTrait
Names for the "expression or type" traits.
CompoundStmt * getBody() const
Retrieve the body of the lambda.
SourceLocation getProtocolLAngleLoc() const
unsigned getArrayExprIndex() const
For an array element node, returns the index into the array of expressions.
const Expr * getRetValue() const
SourceLocation getLabelLoc() const
NestedNameSpecifierLoc getQualifierLoc() const
bool hasExplicitTemplateArgs() const
Determines whether the member name was followed by an explicit template argument list.
void StartOpenMPDSABlock(OpenMPDirectiveKind K, const DeclarationNameInfo &DirName, Scope *CurScope, SourceLocation Loc)
Called on start of new data sharing attribute block.
Expr * getChunkSize()
Get chunk size.
SourceLocation getRBraceLoc() const
SourceLocation getOperatorLoc() const
void setName(DeclarationName N)
setName - Sets the embedded declaration name.
GNUNullExpr - Implements the GNU __null extension, which is a name for a null pointer constant that h...
bool isReferenceType() const
This represents clause 'map' in the '#pragma omp ...' directives.
SourceLocation getRParenLoc() const
SourceLocation getDefaultKindKwLoc() const
Returns location of clause kind.
Interesting information about a specific parameter that can't simply be reflected in parameter's type...
void setElaboratedKeywordLoc(SourceLocation Loc)
This represents clause 'to' in the '#pragma omp ...' directives.
SourceLocation getProtocolRAngleLoc() const
This represents '#pragma omp target simd' directive.
Expr * getSourceExpr() const
The source expression of an opaque value expression is the expression which originally generated the ...
Represents a C++ member access expression for which lookup produced a set of overloaded functions...
Wrapper for source info for unresolved typename using decls.
qual_iterator qual_begin() const
SourceLocation getRParenLoc() const
std::pair< VarDecl *, Expr * > get() const
ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...
ArrayRef< SourceLocation > getProtocolLocs() const
LookupResultKind getResultKind() const
OpenMPDirectiveKind getDirectiveKind() const
Expr * getSafelen() const
Return safe iteration space distance.
SourceLocation getLocStart() const LLVM_READONLY
This represents '#pragma omp barrier' directive.
SourceLocation getQuestionLoc() const
ObjCArrayLiteral - used for objective-c array containers; as in: @["Hello", NSApp, [NSNumber numberWithInt:42]];.
SourceRange getSourceRange() const LLVM_READONLY
Fetches the full source range of the argument.
Expr * getNumTeams()
Return NumTeams number.
Represents a reference to a non-type template parameter pack that has been substituted with a non-tem...
Expr * getAttrExprOperand() const
The attribute's expression operand, if it has one.
This represents '#pragma omp critical' directive.
bool isAssignmentOp() const
std::pair< NullabilityKind, bool > DiagNullabilityKind
A nullability kind paired with a bit indicating whether it used a context-sensitive keyword...
LambdaCaptureDefault getCaptureDefault() const
Determine the default capture kind for this lambda.
No entity found met the criteria within the current instantiation,, but there were dependent base cla...
bool hasExplicitTemplateArgs() const
Determines whether this lookup had explicit template arguments.
SourceLocation getLParenLoc() const
TemplateDecl * getCXXDeductionGuideTemplate() const
If this name is the name of a C++ deduction guide, return the template associated with that name...
Qualifiers getLocalQualifiers() const
Retrieve the set of qualifiers local to this particular QualType instance, not including any qualifie...
SourceLocation getCatchLoc() const
An r-value expression (a pr-value in the C++11 taxonomy) produces a temporary value.
StmtResult ActOnAttributedStmt(SourceLocation AttrLoc, ArrayRef< const Attr *> Attrs, Stmt *SubStmt)
Represents Objective-C's @catch statement.
DeclClass * getAsSingle() const
This represents clause 'copyprivate' in the '#pragma omp ...' directives.
OpenMPDistScheduleClauseKind
OpenMP attributes for 'dist_schedule' clause.
IndirectGotoStmt - This represents an indirect goto.
Describes an C or C++ initializer list.
SourceLocation getLAngleLoc() const
A C++ typeid expression (C++ [expr.typeid]), which gets the type_info that corresponds to the supplie...
This represents '#pragma omp distribute parallel for' composite directive.
void setProtocolLoc(unsigned i, SourceLocation Loc)
Expr * getKeyExpr() const
This represents '#pragma omp teams distribute parallel for simd' composite directive.
Represents a C++ unqualified-id that has been parsed.
CXXRecordDecl * getAsRecordDecl() const
Retrieve the record declaration stored in this nested name specifier.
UnresolvedUsingTypenameDecl * getDecl() const
SourceLocation getLocEnd() const
Returns ending location of directive.
IdentifierInfo * getAsIdentifier() const
Retrieve the identifier stored in this nested name specifier.
void setLParenLoc(SourceLocation Loc)
ForStmt - This represents a 'for (init;cond;inc)' stmt.
void resolveKind()
Resolves the result kind of the lookup, possibly hiding decls.
void setNameLoc(SourceLocation Loc)
SourceLocation getLocStart() const LLVM_READONLY
Represents the results of name lookup.
NestedNameSpecifierLoc getQualifierLoc() const
Gets the nested name specifier.
SourceLocation getLParenLoc() const
FunctionDecl * getOperatorDelete() const
friend bool operator!=(const TemplateArgumentLocInventIterator &X, const TemplateArgumentLocInventIterator &Y)
Expr * getBaseExpr() const
bool isElidable() const
Whether this construction is elidable.
void setRAngleLoc(SourceLocation Loc)
Expr * getOperand() const
const Expr * getThrowExpr() const
Wrapper for source info for injected class names of class templates.
< Capturing the *this object by copy
unsigned getNumProtocols() const
SourceLocation getProtocolLoc(unsigned i) const
SourceLocation getSigilLoc() const
A convenient class for passing around template argument information.
SourceLocation getLocation() const
ExprResult ActOnDesignatedInitializer(Designation &Desig, SourceLocation Loc, bool GNUSyntax, ExprResult Init)
LabelDecl * getDecl() const
SourceLocation getLBracLoc() const
SourceLocation getLocStart() const
Returns the starting location of the clause.
SourceLocation getRParenLoc() const
Expr * getInitializer()
The initializer of this new-expression.
ExprValueKind getValueKind() const
getValueKind - The value kind that this expression produces.
SourceLocation getIsaMemberLoc() const
getMemberLoc - Return the location of the "member", in X->F, it is the location of 'F'...
SourceLocation getTemplateKeywordLoc() const
Retrieve the location of the template keyword preceding this name, if any.
SourceLocation getElaboratedKeywordLoc() const
NamespaceAliasDecl * getAsNamespaceAlias() const
Retrieve the namespace alias stored in this nested name specifier.
Wrapper for substituted template type parameters.
bool containsUnexpandedParameterPack() const
Whether this type is or contains an unexpanded parameter pack, used to support C++0x variadic templat...
QualType FunctionType
BlockType - The function type of the block, if one was given.
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
TypeDecl - Represents a declaration of a type.
A builtin binary operation expression such as "x + y" or "x <= y".
Wrapper for substituted template type parameters.
SourceLocation getColonLoc() const
Gets location of ':' symbol in clause.
bool constructsVBase() const
Determine whether this constructor is actually constructing a base class (rather than a complete obje...
const Expr * getAssocExpr(unsigned i) const
Expr * getOutputExpr(unsigned i)
SourceLocation getLParenLoc() const
void setRParenLoc(SourceLocation Loc)
SourceLocation getThrowLoc() const
const StringLiteral * getInputConstraintLiteral(unsigned i) const
TemplateArgumentLocContainerIterator & operator++()
const Type * getClass() const
CXXForRangeStmt - This represents C++0x [stmt.ranged]'s ranged for statement, represented as 'for (ra...
CXXRecordDecl * getDecl() const
This represents '#pragma omp cancellation point' directive.
This represents 'default' clause in the '#pragma omp ...' directive.
Expr * IgnoreParenCasts() LLVM_READONLY
IgnoreParenCasts - Ignore parentheses and casts.
ObjCStringLiteral, used for Objective-C string literals i.e.
std::input_iterator_tag iterator_category
SourceLocation getEqualOrColonLoc() const
Retrieve the location of the '=' that precedes the initializer value itself, if present.
SourceLocation getTemplateKeywordLoc() const
SourceLocation getRAngleLoc() const
Retrieve the location of the right angle bracket ending the explicit template argument list following...
Expr * getSizeExpr() const
const CallExpr * getConfig() const
Wrapper for source info for ObjC interfaces.
FPOptions getFPFeatures() const
SourceLocation getLocalEndLoc() const
Retrieve the location of the end of this component of the nested-name-specifier.
param_type_iterator param_type_begin() const
NonTagKind
Common ways to introduce type names without a tag for use in diagnostics.
TypoExpr - Internal placeholder for expressions where typo correction still needs to be performed and...
This represents 'final' clause in the '#pragma omp ...' directive.
This represents 'mergeable' clause in the '#pragma omp ...' directive.
SourceLocation getCaretLocation() const
This represents '#pragma omp teams' directive.
OpenMPDependClauseKind getDependencyKind() const
Get dependency type.
void append(iterator I, iterator E)
Represents a C++ nested-name-specifier or a global scope specifier.
const Expr * getControllingExpr() const
This represents clause 'reduction' in the '#pragma omp ...' directives.
FieldDecl * getField()
Get the field whose initializer will be used.
Helper class for OffsetOfExpr.
Expr * getOperand() const
This represents '#pragma omp teams distribute simd' combined directive.
Represents binding an expression to a temporary.
StringLiteral * getClobberStringLiteral(unsigned i)
ArrayTypeTrait
Names for the array type traits.
Expr * Key
The key for the dictionary element.
SourceLocation getBuiltinLoc() const
void setProtocolLoc(unsigned i, SourceLocation Loc)
SourceLocation getLocStart() const LLVM_READONLY
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
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'.
NestedNameSpecifierLoc getQualifierLoc() const
If the name was qualified, retrieves the nested-name-specifier that precedes the name, with source-location information.
bool isTypeDependent() const
isTypeDependent - Determines whether this expression is type-dependent (C++ [temp.dep.expr]), which means that its type could change from one template instantiation to the next.
DeclarationName getDeclName() const
Retrieve the name that this expression refers to.
An ordinary object is located at an address in memory.
SourceLocation getTryLoc() const
Represents a C++ member access expression where the actual member referenced could not be resolved be...
This represents clause 'is_device_ptr' in the '#pragma omp ...' directives.
void setLocalRangeBegin(SourceLocation L)
This represents the body of a CapturedStmt, and serves as its DeclContext.
VarDecl * getConditionVariable() const
Retrieve the variable declared in this "for" statement, if any.
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)
SourceLocation getOperatorLoc() const
getOperatorLoc - Return the location of the operator.
void addDecl(NamedDecl *D)
Add a declaration to these results with its natural access.
Member name lookup, which finds the names of class/struct/union members.
bool isInitCapture(const LambdaCapture *Capture) const
Determine whether one of this lambda's captures is an init-capture.
const Stmt * getBody() const
unsigned getNumArgs() const
TypeSourceInfo * getTypeSourceInfo() const
The current context is "potentially evaluated" in C++11 terms, but the expression is evaluated at com...
NameKind getNameKind() const
getNameKind - Determine what kind of name this is.
SourceLocation getProtocolRAngleLoc() const
NestedNameSpecifierLoc getWithLocInContext(ASTContext &Context) const
Retrieve a nested-name-specifier with location information, copied into the given AST context...
SourceLocation getElaboratedKeywordLoc() const
Expr * getSizeExpr() const
static Opcode getOverloadedOpcode(OverloadedOperatorKind OO, bool Postfix)
Retrieve the unary opcode that corresponds to the given overloaded operator.
A default argument (C++ [dcl.fct.default]).
void setAttrNameLoc(SourceLocation loc)
QualType getPointeeTypeAsWritten() const
bool isTypeOperand() const
Stmt * getReturnStmt() const
QualType getElementType() const
SourceLocation getMemberLoc() const
RAII object used to change the argument pack substitution index within a Sema object.
TypeSpecTypeLoc pushTypeSpec(QualType T)
Pushes space for a typespec TypeLoc.
Represents an extended vector type where either the type or size is dependent.
NamedDecl * getFirstQualifierFoundInScope() const
Retrieve the first part of the nested-name-specifier that was found in the scope of the member access...
This represents clause 'from' in the '#pragma omp ...' directives.
Represents the this expression in C++.
TyLocType push(QualType T)
Pushes space for a new TypeLoc of the given type.
SourceLocation getLParenLoc() const
Returns the location of '('.
SourceLocation getRParenLoc() const
Retrieve the location of the right parentheses (')') that follows the argument list.
A helper class for building up ExtParameterInfos.
TypeSourceInfo * getAllocatedTypeSourceInfo() const
lookup_result lookup(DeclarationName Name) const
lookup - Find the declarations (if any) with the given Name in this context.
NestedNameSpecifierLoc getQualifierLoc() const
If the member name was qualified, retrieves the nested-name-specifier that precedes the member name...
Class that aids in the construction of nested-name-specifiers along with source-location information ...
TypeTrait
Names for traits that operate specifically on types.
TypeSourceInfo * getQueriedTypeSourceInfo() const
SourceLocation getLocStart() const
Returns starting location of directive kind.
SourceLocation getTemplateKeywordLoc() const
Expr ** getSubExprs()
Retrieve the array of expressions.
const ObjCAtCatchStmt * getCatchStmt(unsigned I) const
Retrieve a @catch statement.
Represents a K&R-style 'int foo()' function, which has no information available about its arguments...
Expr * getAddrSpaceExpr() const
helper_expr_const_range reduction_ops() const
This represents '#pragma omp target parallel for simd' directive.
llvm::Optional< bool > getKnownValue() const
OpenMP 4.0 [2.4, Array Sections].
ConditionalOperator - The ?: ternary operator.
SourceLocation getBuiltinLoc() const
TypeSourceInfo * getTypeSourceInfo() const
Sema - This implements semantic analysis and AST building for C.
bool isStdInitListInitialization() const
Whether this constructor call was written as list-initialization, but was interpreted as forming a st...
Represents a C++ pseudo-destructor (C++ [expr.pseudo]).
CompoundStmt - This represents a group of statements like { stmt stmt }.
OpenMPDefaultClauseKind getDefaultKind() const
Returns kind of the clause.
Represents a prototype with parameter type info, e.g.
SourceLocation getRBracket() const
This represents 'threads' clause in the '#pragma omp ...' directive.
CompoundStmt * getSubStmt() const
Retrieve the compound statement that will be included in the program only if the existence of the sym...
This represents '#pragma omp taskgroup' directive.
Expr * getSimdlen() const
Return safe iteration space distance.
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will (ultimately) call.
void TypeWasModifiedSafely(QualType T)
Tell the TypeLocBuilder that the type it is storing has been modified in some safe way that doesn't a...
A RAII object to enter scope of a compound statement.
This represents clause 'aligned' in the '#pragma omp ...' directives.
const TemplateArgumentLoc * getTemplateArgs() const
Retrieve the template arguments provided as part of this template-id.
OpenMPClauseKind getClauseKind() const
Returns kind of OpenMP clause (private, shared, reduction, etc.).
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation getNameLoc() const
SourceLocation getLocEnd() const LLVM_READONLY
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand...
ArraySizeModifier
Capture whether this is a normal array (e.g.
SourceLocation getTryLoc() const
SourceLocation getRBracketLoc() const
This represents clause 'task_reduction' in the '#pragma omp taskgroup' directives.
SourceLocation getLocation() const
void setSizeExpr(Expr *Size)
SourceRange getRange() const
SourceLocation getLParenLoc() const
Returns the location of '('.
ObjCTypeParamDecl * getDecl() const
Represents a call to the builtin function __builtin_va_arg.
void setArgLocInfo(unsigned i, TemplateArgumentLocInfo AI)
static CXXDefaultArgExpr * Create(const ASTContext &C, SourceLocation Loc, ParmVarDecl *Param)
pointer operator->() const
TypeSourceInfo * getTrivialTypeSourceInfo(QualType T, SourceLocation Loc=SourceLocation()) const
Allocate a TypeSourceInfo where all locations have been initialized to a given location, which defaults to the empty location.
OpenMPProcBindClauseKind getProcBindKind() const
Returns kind of the clause.
SourceLocation getLabelLoc() const
SourceLocation getThrowLoc() const LLVM_READONLY
void setAttrNameLoc(SourceLocation loc)
static unsigned getNumSubExprs(AtomicOp Op)
Determine the number of arguments the specified atomic builtin should have.
SourceLocation getLocEnd() const LLVM_READONLY
void setTemplateNameLoc(SourceLocation Loc)
This represents '#pragma omp distribute' directive.
This represents implicit clause 'depend' for the '#pragma omp task' directive.
An Objective-C property is a logical field of an Objective-C object which is read and written via Obj...
void setAttrExprOperand(Expr *e)
Represents an array type in C++ whose size is a value-dependent expression.
SourceLocation getDestroyedTypeLoc() const
Retrieve the starting location of the type being destroyed.
SourceLocation getBeginLoc() const
Get the begin source location.
SourceLocation getFinallyLoc() const
SourceLocation getTemplateNameLoc() const
An expression "T()" which creates a value-initialized rvalue of type T, which is a non-class type...
Retains information about a block that is currently being parsed.
pointer(TemplateArgumentLoc Arg)
SourceLocation getOperatorLoc() const
Retrieve the location of the '->' or '.' operator.
const Stmt * getAssociatedStmt() const
Returns statement associated with the directive.
CXXMethodDecl * CallOperator
The lambda's compiler-generated operator().
Type source information for an attributed type.
SourceLocation getLocEnd() const LLVM_READONLY
BlockDecl - This represents a block literal declaration, which is like an unnamed FunctionDecl...
unsigned getFunctionScopeDepth() const
void setQualifierLoc(NestedNameSpecifierLoc QualifierLoc)
llvm::MutableArrayRef< Designator > designators()
NamespaceDecl * getAsNamespace() const
Retrieve the namespace stored in this nested name specifier.
This represents 'proc_bind' clause in the '#pragma omp ...' directive.
The current expression is potentially evaluated, but any declarations referenced inside that expressi...
This represents 'capture' clause in the '#pragma omp atomic' directive.
DeclAccessPair getFoundDecl() const
Retrieves the declaration found by lookup.
ValueDecl - Represent the declaration of a variable (in which case it is an lvalue) a function (in wh...
Expr - This represents one expression.
SourceLocation getLocalRangeEnd() const
SourceLocation getElseLoc() const
ExprValueKind
The categorization of expression values, currently following the C++11 scheme.
The "typename" keyword precedes the qualified type name, e.g., typename T::type.
SourceLocation getCaptureDefaultLoc() const
Retrieve the location of this lambda's capture-default, if any.
TemplateArgumentLoc const * getTemplateArgs() const
ArrayRef< StringRef > getClobbers() const
IdentifierInfo * getFieldName() const
For a field or identifier offsetof node, returns the name of the field.
SourceLocation getMapLoc() const LLVM_READONLY
Fetches location of clause mapping kind.
bool isArrow() const
Determine whether this member expression used the '->' operator; otherwise, it used the '...
const FunctionProtoType * T
This represents 'simdlen' clause in the '#pragma omp ...' directive.
SourceLocation getLocStart() const LLVM_READONLY
Expr * getNumTasks() const
Return safe iteration space distance.
SourceLocation getDefaultLoc() const
SourceLocation getScheduleKindLoc()
Get kind location.
TemplateArgumentLocInventIterator(TreeTransform< Derived > &Self, InputIterator Iter)
bool isImplicitAccess() const
True if this is an implicit access, i.e., one in which the member being accessed was not written in t...
SourceLocation getWhileLoc() const
UnqualTypeLoc getUnqualifiedLoc() const
Skips past any qualifiers, if this is qualified.
SourceRange getBracketsRange() const
const T * castAs() const
Member-template castAs<specific type>.
Represents a C++ functional cast expression that builds a temporary object.
ElaboratedTypeKeyword
The elaboration keyword that precedes a qualified type name or introduces an elaborated-type-specifie...
The template argument is a null pointer or null pointer to member that was provided for a non-type te...
const Stmt * getThen() const
SourceLocation getBeginLoc() const
Retrieve the location of the beginning of this nested-name-specifier.
SourceLocation getLParenLoc() const
Returns the location of '('.
A C++ const_cast expression (C++ [expr.const.cast]).
unsigned getNumParams() const
const TypeSourceInfo * getAssocTypeSourceInfo(unsigned i) const
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
T getAs() const
Convert to the specified TypeLoc type, returning a null TypeLoc if this TypeLoc is not of the desired...
Represents a C++ destructor within a class.
VarDecl * getExceptionDecl() const
IdentifierInfo * getDestroyedTypeIdentifier() const
In a dependent pseudo-destructor expression for which we do not have full type information on the des...
unsigned getNumInits() const
bool isImplicitAccess() const
True if this is an implicit access, i.e.
TemplateArgumentLocInventIterator & operator++()
const Expr * getCallee() const
This represents '#pragma omp target teams distribute parallel for simd' combined directive.
bool isIfNotExists() const
Determine whether this is an __if_exists statement.
bool isArrow() const
Determine whether this pseudo-destructor expression was written using an '->' (otherwise, it used a '.
unsigned getNumTemplateArgs() const
ObjCDictionaryLiteral - AST node to represent objective-c dictionary literals; as in:"name" : NSUserN...
const CompoundStmt * getSynchBody() const
DeclContext * getDeclContext()
SourceLocation getLParenLoc() const
const IdentifierInfo * getIdentifier() const
Retrieve the type named by the typename specifier as an identifier.
Represents Objective-C's @synchronized statement.
ObjCSelectorExpr used for @selector in Objective-C.
Expr ** getArgs()
Retrieve the arguments to this message, not including the receiver.
SourceLocation getEllipsisLoc() const
TypeSourceInfo * getNamedTypeInfo() const
getNamedTypeInfo - Returns the source type info associated to the name.
TypeSourceInfo * getTypeSourceInfo() const
NestedNameSpecifierLoc getPrefix() const
Return the prefix of this nested-name-specifier.
Represents an expression that computes the length of a parameter pack.
SourceLocation getRBracketLoc() const
CXXTryStmt - A C++ try block, including all handlers.
AsTypeExpr - Clang builtin function __builtin_astype [OpenCL 6.2.4.2] This AST node provides support ...
OpenMPDistScheduleClauseKind getDistScheduleKind() const
Get kind of the clause.
SourceLocation getAtTryLoc() const
Retrieve the location of the @ in the @try.
void setRParenLoc(SourceLocation Loc)
IdentifierInfo & getAccessor() const
Represents a C++ template name within the type system.
Represents the type decltype(expr) (C++11).
This represents '#pragma omp target teams distribute simd' combined directive.
ArrayTypeTrait getTrait() const
SourceLocation getLocStart() const LLVM_READONLY
A namespace alias, stored as a NamespaceAliasDecl*.
This represents 'ordered' clause in the '#pragma omp ...' directive.
The current expression and its subexpressions occur within an unevaluated operand (C++11 [expr]p7)...
SourceRange getAngleBrackets() const LLVM_READONLY
Kind getKind() const
Determine what kind of offsetof node this is.
void setLParenLoc(SourceLocation Loc)
SourceLocation getLAngleLoc() const
Retrieve the location of the left angle bracket starting the explicit template argument list followin...
SourceLocation getColonLoc() const
Get colon location.
An RAII helper that pops function a function scope on exit.
SourceLocation getLocalRangeBegin() const
SourceLocation getKeywordLoc() const
Retrieve the location of the __if_exists or __if_not_exists keyword.
Wrapper for source info for enum types.
This represents '#pragma omp for' directive.
static QualType TransformTypeSpecType(TypeLocBuilder &TLB, TyLoc T)
SourceLocation getProtocolLAngleLoc() const
Expr * getPattern() const
Get the pattern, that is, the operand that contains an unexpanded pack.
Optional< unsigned > NumExpansions
The number of elements this pack expansion will expand to, if this is a pack expansion and is known...
SourceLocation getSwitchLoc() const
void setEllipsisLoc(SourceLocation Loc)
void setAttrExprOperand(Expr *e)
Declaration of an alias template.
LabelDecl * getLabel() const
const Stmt * getTryBody() const
Retrieve the @try body.
Represents a folding of a pack over an operator.
ProtocolLAngleLoc, ProtocolRAngleLoc, and the source locations for protocol qualifiers are stored aft...
ReturnStmt - This represents a return, optionally of an expression: return; return 4;...
This represents '#pragma omp target teams' directive.
void setHasBaseTypeAsWritten(bool HasBaseType)
A boolean condition, from 'if', 'while', 'for', or 'do'.
An expression that sends a message to the given Objective-C object or class.
This represents a Microsoft inline-assembly statement extension.
SourceLocation getDoLoc() const
SourceLocation getAtLoc() const
ObjCMethodDecl * getImplicitPropertyGetter() const
Expr * getSubExprAsWritten()
Retrieve the cast subexpression as it was written in the source code, looking through any implicit ca...
SourceLocation getRBracketLoc() const
SourceLocation getEnd() const
UnaryOperator - This represents the unary-expression's (except sizeof and alignof), the postinc/postdec operators from postfix-expression, and various extensions.
bool isInstanceMethod() const
SourceLocation getMemberLoc() const
getMemberLoc - Return the location of the "member", in X->F, it is the location of 'F'...
Represents a GCC generic vector type.
ReceiverKind getReceiverKind() const
Determine the kind of receiver that this message is being sent to.
ArraySizeModifier getSizeModifier() const
bool usesGNUSyntax() const
Determines whether this designated initializer used the deprecated GNU syntax for designated initiali...
struct CXXOpName CXXOperatorName
ExprResult ActOnChooseExpr(SourceLocation BuiltinLoc, Expr *CondExpr, Expr *LHSExpr, Expr *RHSExpr, SourceLocation RPLoc)
A member reference to an MSPropertyDecl.
TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in.
Represents a reference to a non-type template parameter that has been substituted with a template arg...
const OffsetOfNode & getComponent(unsigned Idx) const
Expr * getDevice()
Return device number.
const FunctionProtoType::ExtParameterInfo * getPointerOrNull(unsigned numParams)
Return a pointer (suitable for setting in an ExtProtoInfo) to the ExtParameterInfo array we've built ...
This represents '#pragma omp cancel' directive.
This represents 'collapse' clause in the '#pragma omp ...' directive.
This represents clause 'firstprivate' in the '#pragma omp ...' directives.
bool isPackExpansion() const
Determine whether this template argument is a pack expansion.
SourceLocation getCommaLoc()
Get location of ','.
SourceLocation getLocation() const
SourceLocation getRParenLoc() const
QualType getTypeDeclType(const TypeDecl *Decl, const TypeDecl *PrevDecl=nullptr) const
Return the unique reference to the type for the specified type declaration.
SourceLocation getForLoc() const
QualType getDestroyedType() const
Retrieve the type being destroyed.
const Expr * getSubExpr() const
ObjCBridgeCastKind getBridgeKind() const
Determine which kind of bridge is being performed via this cast.
const Expr * getSubExpr() const
void setQualifierLoc(NestedNameSpecifierLoc QualifierLoc)
CStyleCastExpr - An explicit cast in C (C99 6.5.4) or a C-style cast in C++ (C++ [expr.cast]), which uses the syntax (Type)expr.
SourceLocation getPackLoc() const
Determine the location of the parameter pack.
CXXMethodDecl * getCallOperator() const
Retrieve the function call operator associated with this lambda expression.
OpenMPProcBindClauseKind
OpenMP attributes for 'proc_bind' clause.
bool isNull() const
Return true if this QualType doesn't point to a type yet.
A type, stored as a Type*.
InitializationStyle getInitStyle() const
The style of initialization for this declaration.
Expr * getLHS()
An array access can be written A[4] or 4[A] (both are equivalent).
TypeLoc getReturnLoc() const
ImaginaryLiteral - We support imaginary integer and floating point literals, like "1...
This represents '#pragma omp flush' directive.
This represents '#pragma omp parallel for simd' directive.
ExprObjectKind getObjectKind() const
getObjectKind - The object kind that this expression produces.
static SEHFinallyStmt * Create(const ASTContext &C, SourceLocation FinallyLoc, Stmt *Block)
DoStmt - This represents a 'do/while' stmt.
This represents 'seq_cst' clause in the '#pragma omp atomic' directive.
SourceLocation getOperatorLoc() const
Retrieve the location of the '->' or '.' operator.
bool hasAttrExprOperand() const
This represents 'untied' clause in the '#pragma omp ...' directive.
TemplateArgumentLocInventIterator operator++(int)
ExprResult BuildCXXNoexceptExpr(SourceLocation KeyLoc, Expr *Operand, SourceLocation RParen)
SourceLocation getLParenLoc() const
Retrieve the location of the left parentheses ('(') that precedes the argument list.
QualType getAutoType(QualType DeducedType, AutoTypeKeyword Keyword, bool IsDependent) const
C++11 deduced auto type.
bool hasTrailingReturn() const
RecordDecl * getDecl() const
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the member name.
SourceLocation getOperatorLoc() const
Returns the location of the operator symbol in the expression.
void setIsVariadic(bool value)
NestedNameSpecifier * getScopeRep() const
Retrieve the representation of the nested-name-specifier.
void setTypeofLoc(SourceLocation Loc)
const DeclarationNameInfo & getNameInfo() const
Retrieve the name that this expression refers to.
This represents '#pragma omp target enter data' directive.
Simple iterator that traverses the template arguments in a container that provides a getArgLoc() memb...
SourceLocation getLParenLoc()
Get location of '('.
static Opcode getOverloadedOpcode(OverloadedOperatorKind OO)
Retrieve the binary opcode that corresponds to the given overloaded operator.
char * location_data() const
Retrieve the data associated with the source-location information.
friend bool operator==(const TemplateArgumentLocContainerIterator &X, const TemplateArgumentLocContainerIterator &Y)
Wrapper for source info for arrays.
SourceLocation getColonLoc() const
Returns the location of ':'.
This represents 'num_teams' clause in the '#pragma omp ...' directive.
A C++ dynamic_cast expression (C++ [expr.dynamic.cast]).
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class...
void setAttrOperandParensRange(SourceRange range)
SourceLocation getTemplateNameLoc() const
ConvertVectorExpr - Clang builtin function __builtin_convertvector This AST node provides support for...
unsigned getNumArgs() const
Return the number of actual arguments in this message, not counting the receiver. ...
SourceLocation getLParenLoc() const
Tag name lookup, which finds the names of enums, classes, structs, and unions.
TypeLoc getPatternLoc() const
A reference to an overloaded function set, either an UnresolvedLookupExpr or an UnresolvedMemberExpr...
This captures a statement into a function.
A field in a dependent type, known only by its name.
Expr * getInit() const
Get the operand that doesn't contain a pack, for a binary fold.
QualType getCanonicalType() const
Represents a call to an inherited base class constructor from an inheriting constructor.
ExpressionTrait getTrait() const
ActionResult - This structure is used while parsing/acting on expressions, stmts, etc...
ExceptionSpecificationType Type
The kind of exception specification this is.
Expr ** getPlacementArgs()
SourceLocation getLParenLoc()
Get location of '('.
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
void setLAngleLoc(SourceLocation Loc)
SourceLocation getRAngleLoc() const
Retrieve the location of the right angle bracket ending the explicit template argument list following...
ElaboratedTypeKeyword getKeyword() const
ExtProtoInfo getExtProtoInfo() const
TemplateArgumentLocInventIterator()
SourceLocation getLocStart() const LLVM_READONLY
friend bool operator!=(const TemplateArgumentLocContainerIterator &X, const TemplateArgumentLocContainerIterator &Y)
SourceLocation getNameLoc() const
Gets the location of the name.
const ExtParameterInfo * ExtParameterInfos
bool inheritedFromVBase() const
Determine whether the inherited constructor is inherited from a virtual base of the object we constru...
SourceLocation getRAngleLoc() const
Retrieve the location of the right angle bracket ending the explicit template argument list following...
unsigned getNumExprs() const
This represents '#pragma omp single' directive.
Encodes a location in the source.
SourceLocation getStarLoc() const
capture_iterator explicit_capture_begin() const
Retrieve an iterator pointing to the first explicit lambda capture.
QualType getReturnType() const
IdentifierInfo & get(StringRef Name)
Return the identifier token info for the specified named identifier.
This represents 'hint' clause in the '#pragma omp ...' directive.
SourceLocation getLocEnd() const LLVM_READONLY
OpenMPDependClauseKind
OpenMP attributes for 'depend' clause.
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of enums...
SourceLocation getOperatorLoc() const
const Stmt * getCatchBody() const
unsigned getNumHandlers() const
Expr * getSubExpr() const
bool hasExplicitTemplateArgs() const
Determines whether this member expression actually had a C++ template argument list explicitly specif...
SourceLocation getRAngleLoc() const
Retrieve the location of the right angle bracket ending the explicit template argument list following...
SourceLocation getLAngleLoc() const
Retrieve the location of the left angle bracket starting the explicit template argument list followin...
NestedNameSpecifierLoc getQualifierLoc() const
Retrieves the nested-name-specifier that qualifies the type name, with source-location information...
This is a basic class for representing single OpenMP executable directive.
A structure for storing an already-substituted template template parameter pack.
SourceLocation getOperatorLoc() const
Retrieve the location of the cast operator keyword, e.g., static_cast.
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)"...
unsigned getNumElements() const
getNumElements - Return number of elements of objective-c dictionary literal.
void setProtocolLAngleLoc(SourceLocation Loc)
StmtResult ActOnLabelStmt(SourceLocation IdentLoc, LabelDecl *TheDecl, SourceLocation ColonLoc, Stmt *SubStmt)
A call to a literal operator (C++11 [over.literal]) written as a user-defined literal (C++11 [lit...
DeclarationName getName() const
getName - Returns the embedded declaration name.
ArrayRef< const Attr * > getAttrs() const
TagDecl - Represents the declaration of a struct/union/class/enum.
This represents 'schedule' clause in the '#pragma omp ...' directive.
SourceLocation getEllipsisLoc() const
Retrieve the location of the ellipsis that describes this pack expansion.
QualType CheckTypenameType(ElaboratedTypeKeyword Keyword, SourceLocation KeywordLoc, NestedNameSpecifierLoc QualifierLoc, const IdentifierInfo &II, SourceLocation IILoc)
Build the type that describes a C++ typename specifier, e.g., "typename T::type". ...
static SizeOfPackExpr * Create(ASTContext &Context, SourceLocation OperatorLoc, NamedDecl *Pack, SourceLocation PackLoc, SourceLocation RParenLoc, Optional< unsigned > Length=None, ArrayRef< TemplateArgument > PartialArgs=None)
Represents a call to a member function that may be written either with member call syntax (e...
SourceLocation getExceptLoc() const
SourceRange getSourceRange() const LLVM_READONLY
QualType getElementType() const
DeclStmt - Adaptor class for mixing declarations with statements and expressions. ...
OpenMPDirectiveKind
OpenMP directives.
LabelDecl - Represents the declaration of a label.
SourceLocation getLParenLoc() const
Returns the location of '('.
This represents clause 'shared' in the '#pragma omp ...' directives.
void setProtocolRAngleLoc(SourceLocation Loc)
SourceLocation getProcBindKindKwLoc() const
Returns location of clause kind.
DeclarationNameInfo getDirectiveName() const
Return name of the directive.
SourceLocation getLBraceLoc() const
SourceLocation getLocStart() const LLVM_READONLY
Represents a static or instance method of a struct/union/class.
Expr * getPriority()
Return Priority number.
ExprResult SemaBuiltinShuffleVector(CallExpr *TheCall)
SemaBuiltinShuffleVector - Handle __builtin_shufflevector.
SourceLocation getColonLoc() const
SourceLocation getRParenLoc() const
OpenMPLinearClauseKind Modifier
Modifier of 'linear' clause.
SourceLocation getRParenLoc() const
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
C-style initialization with assignment.
pointer operator->() const
SourceLocation getSuperLoc() const
Retrieve the location of the 'super' keyword for a class or instance message to 'super', otherwise an invalid source location.
SourceLocation getAtLoc() const
This represents '#pragma omp taskwait' directive.
QualType getAllocatedType() const
OpenMPMapClauseKind getMapType() const LLVM_READONLY
Fetches mapping kind for the clause.
SourceLocation getRParenLoc() const
const ParmVarDecl * getParamDecl(unsigned i) const
Name lookup found an unresolvable value declaration and cannot yet complete.
void reserve(size_t Requested)
Ensures that this buffer has at least as much capacity as described.
This is a basic class for representing single OpenMP clause.
ExprResult ActOnInitList(SourceLocation LBraceLoc, MultiExprArg InitArgList, SourceLocation RBraceLoc)
QualType getEquivalentType() const
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load, __atomic_store, and __atomic_compare_exchange_*, for the similarly-named C++11 instructions, and __c11 variants for <stdatomic.h>, and corresponding __opencl_atomic_* for OpenCL 2.0.
UnaryExprOrTypeTrait getKind() const
void addDecl(NamedDecl *D)
ObjCProtocolExpr used for protocol expression in Objective-C.
SourceLocation getStarLoc() const
bool isValueDependent() const
isValueDependent - Determines whether this expression is value-dependent (C++ [temp.dep.constexpr]).
QualType getReceiverType() const
Retrieve the receiver type to which this message is being directed.
SourceLocation getLParenLoc() const
SourceLocation getGotoLoc() const
SourceLocation getAtFinallyLoc() const
bool isObjCObjectPointerType() const
SourceLocation getNameModifierLoc() const
Return the location of directive name modifier.
const StringLiteral * getOutputConstraintLiteral(unsigned i) const
static CXXDefaultInitExpr * Create(const ASTContext &C, SourceLocation Loc, FieldDecl *Field)
Field is the non-static data member whose default initializer is used by this expression.
Represents one property declaration in an Objective-C interface.
SourceLocation getLocEnd() const LLVM_READONLY
void setElaboratedKeywordLoc(SourceLocation Loc)
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Stmt * getCapturedStmt()
Retrieve the statement being captured.
OpenMPMapClauseKind getMapTypeModifier() const LLVM_READONLY
Fetches the map type modifier for the clause.
SourceLocation getAtCatchLoc() const
Expr ** getInits()
Retrieve the set of initializers.
This represents '#pragma omp target' directive.
Expr * getInputExpr(unsigned i)
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.
Expr * getNumForLoops() const
Return the number of associated for-loops.
void setLBracketLoc(SourceLocation Loc)
No entity found met the criteria.
AutoTypeKeyword getKeyword() const
IdentType getIdentType() const
SourceLocation getEndLoc() const
Expr * getArrayRangeStart(const Designator &D) const
SourceLocation getRAngleLoc() const
The name is a dependent name, so the results will differ from one instantiation to the next...
An expression trait intrinsic.
EnumDecl * getDecl() const
const ObjCMethodDecl * getMethodDecl() const
This represents '#pragma omp ordered' directive.
StmtExpr - This is the GNU Statement Expression extension: ({int X=4; X;}).
void set(unsigned index, FunctionProtoType::ExtParameterInfo info)
Set the ExtParameterInfo for the parameter at the given index,.
ArrayRef< ParmVarDecl * > getParams() const
This represents '#pragma omp target update' directive.
bool RequireCompleteDeclContext(CXXScopeSpec &SS, DeclContext *DC)
Require that the context specified by SS be complete.
ObjCBoxedExpr - used for generalized expression boxing.
bool isArgumentType() const
unsigned getFullDataSize() const
Returns the size of the type source info data block.
static TagTypeKind getTagTypeKindForKeyword(ElaboratedTypeKeyword Keyword)
Converts an elaborated type keyword into a TagTypeKind.
Optional< unsigned > getNumExpansions() const
Retrieve the number of expansions that this pack expansion will generate, if known.
SourceLocation getStarLoc() const
SourceLocation getLParenLoc() const
Returns the location of '('.
void setLAngleLoc(SourceLocation Loc)
MutableArrayRef< Expr * > MultiExprArg
void addArgument(const TemplateArgumentLoc &Loc)
DependentTemplateName * getAsDependentTemplateName() const
Retrieve the underlying dependent template name structure, if any.
FunctionDecl * getOperatorDelete() const
SourceLocation getTemplateKeywordLoc() const
Retrieve the location of the template keyword preceding this name, if any.
Representation of a Microsoft __if_exists or __if_not_exists statement with a dependent name...
SourceLocation getExprLoc() const LLVM_READONLY
getExprLoc - Return the preferred location for the arrow when diagnosing a problem with a generic exp...
A qualified reference to a name whose declaration cannot yet be resolved.
TypeLoc getElementLoc() const
Expr * Value
The value of the dictionary element.
const Expr * getInitializer() const
QualType getPointeeType() const
Represents a pack expansion of types.
CompoundAssignOperator - For compound assignments (e.g.
SourceLocation getLocation() const LLVM_READONLY
Expr ** getElements()
Retrieve elements of array of literals.
DeclarationNameLoc - Additional source/type location info for a declaration name. ...
void setLParenLoc(SourceLocation Loc)
SourceLocation getLocEnd() const
Returns the ending location of the clause.
void setTemplateKeywordLoc(SourceLocation Loc)
Represents a C11 generic selection.
ArrayRef< TemplateArgument > getPartialArguments() const
Get.
void setTypeArgsLAngleLoc(SourceLocation Loc)
const Expr * getBase() const
Expr * getInstanceReceiver()
Returns the object expression (receiver) for an instance message, or null for a message that is not a...
AddrLabelExpr - The GNU address of label extension, representing &&label.
An Objective-C "bridged" cast expression, which casts between Objective-C pointers and C pointers...
Base class for declarations which introduce a typedef-name.
SourceLocation getTypeofLoc() const
Represents a reference to a function parameter pack that has been substituted but not yet expanded...
Represents a template argument.
SourceLocation getMemberLoc() const
TypeSourceInfo * getDestroyedTypeInfo() const
Retrieve the source location information for the type being destroyed.
VarDecl * getConditionVariable() const
Retrieve the variable declared in this "if" statement, if any.
TypeSourceInfo * getClassTInfo() const
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...
Expr * getFalseExpr() const
getFalseExpr - Return the subexpression which will be evaluated if the condnition evaluates to false;...
Represents a template name that was expressed as a qualified name.
TagTypeKind
The kind of a tag type.
NullStmt - This is the null statement ";": C99 6.8.3p3.
bool isMutable() const
Determine whether the lambda is mutable, meaning that any captures values can be modified.
OpenMPScheduleClauseModifier
OpenMP modifiers for 'schedule' clause.
bool isTypeOperand() const
static ParmVarDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, QualType T, TypeSourceInfo *TInfo, StorageClass S, Expr *DefArg)
bool isNull() const
Determine whether this template name is NULL.
unsigned getNumAssocs() const
Dataflow Directional Tag Classes.
SourceLocation getColonLoc() const
Get colon location.
This represents 'device' clause in the '#pragma omp ...' directive.
NestedNameSpecifier * getNestedNameSpecifier() const
Retrieve the nested-name-specifier to which this instance refers.
bool containsUnexpandedParameterPack() const
Whether this template argument contains an unexpanded parameter pack.
bool isValid() const
Return true if this is a valid SourceLocation object.
DeducedType * getContainedDeducedType() const
Get the DeducedType whose type will be deduced for a variable with an initializer of this type...
int ArgumentPackSubstitutionIndex
The current index into pack expansion arguments that will be used for substitution of parameter packs...
const TemplateArgumentLoc * getTemplateArgs() const
Retrieve the template arguments provided as part of this template-id.
Stmt * getReturnStmtOnAllocFailure() const
const TemplateArgument & getArgument() const
not evaluated yet, for special member function
Expr * getAllocate() const
[C99 6.4.2.2] - A predefined identifier such as func.
DeclarationNameInfo getMemberNameInfo() const
Retrieve the member declaration name info.
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
SourceLocation getLocation() const
Represents a delete expression for memory deallocation and destructor calls, e.g. ...
ArrayRef< Capture > captures() const
IdentifierInfo * getOutputIdentifier(unsigned i) const
The base class of all kinds of template declarations (e.g., class, function, etc.).
OverloadedOperatorKind getOperator() const
Returns the kind of overloaded operator that this expression refers to.
SourceLocation ModifierLoc
Location of linear modifier if any.
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
FunctionDecl * getDirectCallee()
If the callee is a FunctionDecl, return it. Otherwise return 0.
ExprResult ImpCastExprToType(Expr *E, QualType Type, CastKind CK, ExprValueKind VK=VK_RValue, const CXXCastPath *BasePath=nullptr, CheckedConversionKind CCK=CCK_ImplicitConversion)
ImpCastExprToType - If Expr is not of type 'Type', insert an implicit cast.
MSPropertyDecl * getPropertyDecl() const
const Stmt * getFinallyBody() const
QualType getType() const
Get the type for which this source info wrapper provides information.
SourceLocation getLocStart() const LLVM_READONLY
The template argument is a pack expansion of a template name that was provided for a template templat...
bool hasDependentPromiseType() const
This represents '#pragma omp section' directive.
This represents '#pragma omp teams distribute' directive.
Expr * getReturnValueInit() const
Expr * getSourceExpression() const
SourceLocation EllipsisLoc
The location of the ellipsis, if this is a pack expansion.
bool isDependent() const
Whether this nested name specifier refers to a dependent type or not.
TypeSourceInfo * getTypeSourceInfo() const
Retrieve the type source information for the type being constructed.
AccessSpecifier getAccess() const
A constant boolean condition from 'if constexpr'.
A runtime availability query.
TemplateArgumentLocContainerIterator(ArgLocContainer &Container, unsigned Index)
bool hasLocalQualifiers() const
Determine whether this particular QualType instance has any qualifiers, without looking through any t...
A C++ reinterpret_cast expression (C++ [expr.reinterpret.cast]).
This represents '#pragma omp simd' directive.
TypeSourceInfo * getTypeSourceInfo() const
Stmt * getHandler() const
SourceLocation getRAngleLoc() const
Represents a 'co_yield' expression.
DeclarationName getMember() const
Retrieve the name of the member that this expression refers to.
SourceLocation getLBraceLoc() const
DeclarationName - The name of a declaration.
StmtClass getStmtClass() const
Represents the declaration of an Objective-C type parameter.
VectorKind getVectorKind() const
SourceRange getIntroducerRange() const
Retrieve the source range covering the lambda introducer, which contains the explicit capture list su...
bool isCXXClassMember() const
Determine whether this declaration is a C++ class member.
Expr * getOperand() const
Retrieve the operand of the 'co_return' statement.
Represents a C++11 pack expansion that produces a sequence of expressions.
bool isListInitialization() const
Whether this constructor call was written as list-initialization.
This represents clause 'linear' in the '#pragma omp ...' directives.
EnumDecl - Represents an enum.
const Expr * getSynchExpr() const
Stmt * getInitSuspendStmt() const
A pointer to member type per C++ 8.3.3 - Pointers to members.
bool hasObjCLifetime() const
void setSigilLoc(SourceLocation Loc)
bool isIfExists() const
Determine whether this is an __if_exists statement.
TypeLoc getModifiedLoc() const
The modified type, which is generally canonically different from the attribute type.
NestedNameSpecifierLoc getQualifierLoc() const
const DeclarationNameInfo & getMemberNameInfo() const
Retrieve the full name info for the member that this expression refers to.
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspnd...
TemplateArgumentLoc value_type
TemplateParameterList * getTemplateParameterList() const
If this is a generic lambda expression, retrieve the template parameter list associated with it...
This represents '#pragma omp atomic' directive.
A type that was preceded by the 'template' keyword, stored as a Type*.
pack_iterator pack_begin() const
Iterator referencing the first argument of a template argument pack.
const TemplateTypeParmType * getReplacedParameter() const
Gets the template parameter that was substituted for.
bool isNull() const
Determine whether this template argument has no value.
SourceLocation getLParenLoc() const
Returns the location of '('.
SourceLocation getLParenLoc() const
ExprResult SemaConvertVectorExpr(Expr *E, TypeSourceInfo *TInfo, SourceLocation BuiltinLoc, SourceLocation RParenLoc)
SemaConvertVectorExpr - Handle __builtin_convertvector.
bool isImplicitMapType() const LLVM_READONLY
Is this an implicit map type? We have to capture 'IsMapTypeImplicit' from the parser for more informa...
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
Expr * getArrayRangeEnd(const Designator &D) const
TemplateNameKindForDiagnostics getTemplateNameKindForDiagnostics(TemplateName Name)
const Stmt * getBody() const
NestedNameSpecifierLoc getQualifierLoc() const
Represents a __leave statement.
CXXRecordDecl * getNamingClass() const
Gets the 'naming class' (in the sense of C++0x [class.access.base]p5) of the lookup.
SourceLocation getElaboratedKeywordLoc() const
QualType getModifiedType() const
unsigned getNumParams() const
LabelDecl * getLabel() const
void setNameLoc(SourceLocation Loc)
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.
SourceLocation getRBracketLoc() const
bool hasAttrEnumOperand() const
Represents a C++11 noexcept expression (C++ [expr.unary.noexcept]).
SourceRange getSourceRange() const LLVM_READONLY
Get the full source range.
SwitchStmt - This represents a 'switch' stmt.
SourceLocation getColonColonLoc() const
Retrieve the location of the '::' in a qualified pseudo-destructor expression.
Name lookup found a single declaration that met the criteria.
TypeLoc getPointeeLoc() const
Not an overloaded operator.
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name, with source location information.
SourceLocation getRParenLoc() const
DeclarationNameInfo getNameInfo() const
void setAttrEnumOperandLoc(SourceLocation loc)
Represents the body of a coroutine.
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...
ExprResult BuildObjCEncodeExpression(SourceLocation AtLoc, TypeSourceInfo *EncodedTypeInfo, SourceLocation RParenLoc)
Location wrapper for a TemplateArgument.
unsigned getIndexTypeCVRQualifiers() const
SourceLocation getLocEnd() const LLVM_READONLY
SourceLocation getBuiltinLoc() const
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
TypeSourceInfo * getTypeArgTInfo(unsigned i) const
SourceLocation getLParenLoc() const
Returns the location of '('.
OpenMPDirectiveKind getNameModifier() const
Return directive name modifier associated with the clause.
unsigned getNumElements() const
getNumElements - Return number of elements of objective-c array literal.
This file defines OpenMP AST classes for executable directives and clauses.
Represents Objective-C's collection statement.
TypedefNameDecl * getTypedefNameDecl() const
SourceLocation getTemplateNameLoc() const
ObjCEncodeExpr, used for @encode in Objective-C.
SourceLocation getRParenLoc() const
Determine the location of the right parenthesis.
SourceLocation getKWLoc() const
SourceLocation getRParenLoc() const
SourceLocation getLocation() const
An implicit indirection through a C++ base class, when the field found is in a base class...
const llvm::APInt & getSize() const
void setTemplateNameLoc(SourceLocation Loc)
Represents a call to a CUDA kernel function.
bool isFunctionType() const
SourceLocation getRParenLoc() const
Represents a 'co_await' expression.
SourceLocation getLParenLoc() const
Returns the location of '('.
std::iterator_traits< InputIterator >::difference_type difference_type
TypeSourceInfo * getTypeSourceInfo() const
SourceLocation getColonLoc() const
Gets location of ':' symbol in clause.
void setOperatorFunctionId(SourceLocation OperatorLoc, OverloadedOperatorKind Op, SourceLocation SymbolLocations[3])
Specify that this unqualified-id was parsed as an operator-function-id.
SourceRange getDirectInitRange() const
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the member name, with source location information...
OpenMPScheduleClauseKind
OpenMP attributes for 'schedule' clause.
SourceLocation getProtocolLoc(unsigned i) const
Expr * getSizeExpr() const
Expr * getArg(unsigned Arg)
Return the specified argument.
Base for LValueReferenceType and RValueReferenceType.
SourceLocation getEndLoc() const
Retrieve the location of the end of this nested-name-specifier.
ActionResult< Stmt * > StmtResult
ImplicitParamDecl * getParam(unsigned i) const
TypeLocClass getTypeLocClass() const
void setTypeArgsRAngleLoc(SourceLocation Loc)
Wrapper for source info for record types.
SourceLocation getLocStart() const LLVM_READONLY
Default argument expressions have no representation in the source, so they have an empty source range...
SourceLocation getLBracketLoc() const
Represents Objective-C's @finally statement.
SourceLocation getDefaultLoc() const
The template argument is a type.
Wraps an ObjCPointerType with source location information.
SourceLocation getLocStart() const LLVM_READONLY
StringRef getAsmString() const
OpenMPDefaultClauseKind
OpenMP attributes for 'default' clause.
ArrayRef< StringRef > getAllConstraints() const
unsigned getNumArgs() const
SourceLocation getDistScheduleKindLoc()
Get kind location.
bool hasAssociatedStmt() const
Returns true if directive has associated statement.
const Expr * getBase() const
The template argument is actually a parameter pack.
SourceLocation getLocStart() const
llvm::DenseMap< VarDecl *, unsigned > CaptureMap
CaptureMap - A map of captured variables to (index+1) into Captures.
bool isArrow() const
Determine whether this member expression used the '->' operator; otherwise, it used the '...
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
const DeclarationNameInfo & getNameInfo() const
Gets the name info for specified reduction identifier.
This represents 'write' clause in the '#pragma omp atomic' directive.
SourceLocation getLParenLoc() const
void setNamedTypeInfo(TypeSourceInfo *TInfo)
setNamedTypeInfo - Sets the source type info associated to the name.
unsigned getNumClobbers() const
SourceLocation getRParenLoc() const
ObjCIvarRefExpr - A reference to an ObjC instance variable.
ArrayRef< QualType > Exceptions
Explicitly-specified list of exception types.
bool isPartiallySubstituted() const
Determine whether this represents a partially-substituted sizeof...
DeclStmt * getRangeStmt()
unsigned arg_size() const
Retrieve the number of arguments.
bool capturesCXXThis() const
bool LookupQualifiedName(LookupResult &R, DeclContext *LookupCtx, bool InUnqualifiedLookup=false)
Perform qualified name lookup into a given context.
SourceLocation getLParenLoc() const
Returns the location of '('.
TypeLoc getBaseLoc() const
UnqualTypeLoc getUnqualifiedLoc() const
SourceLocation getLocEnd() const LLVM_READONLY
llvm::iterator_range< decls_iterator > decls() const
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
SourceLocation getAsmLoc() const
GotoStmt - This represents a direct goto.
A use of a default initializer in a constructor or in aggregate initialization.
TypeLoc getTypeLoc() const
Return the TypeLoc wrapper for the type source info.
Expr * getSrcExpr() const
getSrcExpr - Return the Expr to be converted.
SourceLocation getLAngleLoc() const
Retrieve the location of the left angle bracket starting the explicit template argument list followin...
TypedefNameDecl * getDecl() const
X
Add a minimal nested name specifier fixit hint to allow lookup of a tag name from an outer enclosing ...
SourceLocation getLAngleLoc() const
void * getOpaqueData() const
Retrieve the opaque pointer that refers to source-location data.
SourceLocation getTypeArgsLAngleLoc() const
pack_iterator pack_end() const
Iterator referencing one past the last argument of a template argument pack.
Expr * NoexceptExpr
Noexcept expression, if this is EST_ComputedNoexcept.
void AddDesignator(Designator D)
AddDesignator - Add a designator to the end of this list.
SourceLocation getLParenLoc() const
Returns the location of '('.
An integral condition for a 'switch' statement.
CapturedDecl * getCapturedDecl()
Retrieve the outlined function declaration.
ArgKind getKind() const
Return the kind of stored template argument.
An attributed type is a type to which a type attribute has been applied.
pointer(TemplateArgumentLoc Arg)
void setKWLoc(SourceLocation Loc)
Call-style initialization (C++98)
const DeclarationNameInfo & getNameInfo() const
Gets the name info for specified reduction identifier.
Represents a type parameter type in Objective C.
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...
OpenMPScheduleClauseModifier getSecondScheduleModifier() const
Get the second modifier of the clause.
TranslationUnitDecl * getTranslationUnitDecl() const
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
SourceLocation getWhileLoc() const
NestedNameSpecifierLoc getWithLocInContext(ASTContext &Context) const
Retrieve a nested-name-specifier with location information, copied into the given AST context...
QualType getUnqualifiedType() const
Retrieve the unqualified variant of the given type, removing as little sugar as possible.
This represents '#pragma omp target parallel' directive.
This represents 'nowait' clause in the '#pragma omp ...' directive.
Represents a C++ struct/union/class.
Represents a template specialization type whose template cannot be resolved, e.g. ...
ContinueStmt - This represents a continue.
SourceLocation getExprLoc() const LLVM_READONLY
OpenMPScheduleClauseModifier getFirstScheduleModifier() const
Get the first modifier of the clause.
Represents a loop initializing the elements of an array.
const TemplateArgumentLoc * operator->() const
This represents 'num_tasks' clause in the '#pragma omp ...' directive.
SourceLocation getLocStart() const LLVM_READONLY
The template argument is a template name that was provided for a template template parameter...
SourceLocation getLocStart() const LLVM_READONLY
Stmt * getFallthroughHandler() const
SourceLocation getColonLoc() const
Represents a C array with an unspecified size.
ChooseExpr - GNU builtin-in function __builtin_choose_expr.
Expr * getFilterExpr() const
SourceLocation getAttrLoc() const
BinaryConditionalOperator - The GNU extension to the conditional operator which allows the middle ope...
CXXCatchStmt - This represents a C++ catch block.
Represents an explicit C++ type conversion that uses "functional" notation (C++ [expr.type.conv]).
SourceLocation getRParenLoc() const
OpenMPScheduleClauseKind getScheduleKind() const
Get kind of the clause.
bool isPackExpansion() const
Determines whether this dictionary element is a pack expansion.
OpenMPMapClauseKind
OpenMP mapping kind for 'map' clause.
Qualifiers getQualifiers() const
Retrieve the set of qualifiers applied to this type.
Expr * getOperand() const
ObjCIvarDecl - Represents an ObjC instance variable.
void setParam(unsigned i, ParmVarDecl *VD)
SourceRange getAttrOperandParensRange() const
The location of the parentheses around the operand, if there is an operand.
QualType getNamedType() const
Retrieve the type named by the qualified-id.
WhileStmt - This represents a 'while' stmt.
SourceLocation getFirstScheduleModifierLoc() const
Get the first modifier location.
SourceRange getParenOrBraceRange() const
unsigned getNumProtocols() const
helper_expr_const_range reduction_ops() const
void setLParenLoc(SourceLocation Loc)
QualType getReplacementType() const
Gets the type that was substituted for the template parameter.
Location information for a TemplateArgument.
bool isCXXThisCaptured() const
Determine whether the C++ 'this' is captured.
SourceLocation getLParenLoc() const
SourceLocation getAtSynchronizedLoc() const
SourceLocation getLocEnd() const LLVM_READONLY
Expr * getThreadLimit()
Return ThreadLimit number.
QualType getPointerType(QualType T) const
Return the uniqued reference to the type for a pointer to the specified type.
Optional< unsigned > getNumExpansions() const
Determine the number of expansions that will be produced when this pack expansion is instantiated...
void MakeGlobal(ASTContext &Context, SourceLocation ColonColonLoc)
Turn this (empty) nested-name-specifier into the global nested-name-specifier '::'.
CompoundStmt * getTryBlock()
SourceLocation getCaseLoc() const
TypeLoc getTypeLoc() const
For a nested-name-specifier that refers to a type, retrieve the type with source-location information...
bool hasAttrOperand() const
SourceLocation getEllipsisLoc() const
Represents Objective-C's @try ... @catch ... @finally statement.
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation tokens are not useful in isolation - they are low level value objects created/interpre...
bool isGlobalDelete() const
This represents '#pragma omp taskloop simd' directive.
SourceLocation getBuiltinLoc() const
getBuiltinLoc - Return the location of the __builtin_convertvector token.
unsigned getNumCatchStmts() const
Retrieve the number of @catch statements in this try-catch-finally block.
Expr * getBase() const
Retrieve the base object of this member expressions, e.g., the x in x.m.
StringLiteral - This represents a string literal expression, e.g.
bool hasExplicitParameters() const
Determine whether this lambda has an explicit parameter list vs.
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
SourceLocation getNameLoc() const
SourceRange getTypeIdParens() const
Expr * getPattern()
Retrieve the pattern of the pack expansion.
bool HasImplicitReturnType
Whether the target type of return statements in this context is deduced (e.g.
void setRAngleLoc(SourceLocation Loc)
StringRef getName() const
getName - Get the name of identifier for this declaration as a StringRef.
This represents 'dist_schedule' clause in the '#pragma omp ...' directive.
SourceRange getAttrOperandParensRange() const
The location of the parentheses around the operand, if there is an operand.
bool blockMissingReturnType() const
capture_iterator capture_begin() const
Retrieve an iterator pointing to the first lambda capture.
Stmt * getBody() const
Retrieve the body of the coroutine as written.
unsigned getNumTypeArgs() const
Abstract class common to all of the C++ "named"/"keyword" casts.
unsigned getNumElements() const
SourceLocation getRAngleLoc() const
Retrieve the location of the right angle bracket ending the explicit template argument list following...
This represents '#pragma omp sections' directive.
Designation - Represent a full designation, which is a sequence of designators.
Expr * getHint() const
Returns number of threads.
static OpaquePtr make(QualType P)
NestedNameSpecifierLoc getQualifierLoc() const
Gets the nested name specifier.
ObjCBoolLiteralExpr - Objective-C Boolean Literal.
bool isObjectReceiver() const
TranslationUnitDecl - The top declaration context.
unsigned getNumComponents() const
This represents '#pragma omp target data' directive.
const ParmVarDecl * getParam() const
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
QualType getAsType() const
Retrieve the type for a type template argument.
A reference to a declared variable, function, enum, etc.
Represents an extended address space qualifier where the input address space value is dependent...
Represents a type template specialization; the template must be a class template, a type alias templa...
ArrayRef< ParmVarDecl * > parameters() const
SourceLocation getColonLoc() const
NestedNameSpecifierLoc getQualifierLoc() const
Fetches the nested-name qualifier with source-location information, if one was given.
NestedNameSpecifierLoc getQualifierLoc() const
Gets the nested name specifier.
bool isPointerType() const
void setProtocolLAngleLoc(SourceLocation Loc)
Iterator adaptor that invents template argument location information for each of the template argumen...
BreakStmt - This represents a break.
Expr * getChunkSize()
Get chunk size.
const VarDecl * getCatchParamDecl() const
SourceLocation getTemplateNameLoc() const
Expr * getOperand() const
SourceLocation getAttrNameLoc() const
The location of the attribute name, i.e.
SourceLocation getTemplateKeywordLoc() const
Retrieve the location of the template keyword preceding the member name, if any.
bool isDefaultArgument() const
Determine whether this expression is a default function argument.
Expr * getNumThreads() const
Returns number of threads.
QualType getDependentTemplateSpecializationType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier *NNS, const IdentifierInfo *Name, const TemplateArgumentListInfo &Args) const
SourceLocation getBridgeKeywordLoc() const
The location of the bridge keyword.
bool hadMultipleCandidates() const
Whether the referred constructor was resolved from an overloaded set having size greater than 1...
An instance of this class represents the declaration of a property member.
DeclStmt * getLoopVarStmt()
Wrapper for source info for builtin types.
An l-value expression is a reference to an object with independent storage.
void setRParenLoc(SourceLocation Loc)
unsigned getNumArgs() const
Wrapper for template type parameters.
static Designator getArray(Expr *Index, SourceLocation LBracketLoc)
const Expr * getBase() const
const Expr * getCond() const
A trivial tuple used to represent a source range.
This represents '#pragma omp taskyield' directive.
NamedDecl - This represents a decl with a name.
void setIdentifier(const IdentifierInfo *Id, SourceLocation IdLoc)
Specify that this unqualified-id was parsed as an identifier.
This represents '#pragma omp distribute parallel for simd' composite directive.
A boolean literal, per ([C++ lex.bool] Boolean literals).
SourceLocation getTemplateKeywordLoc() const
Retrieve the location of the template keyword preceding the member name, if any.
SourceLocation getLParenLoc() const
Returns the location of '('.
OffsetOfExpr - [C99 7.17] - This represents an expression of the form offsetof(record-type, member-designator).
T castAs() const
Convert to the specified TypeLoc type, asserting that this TypeLoc is of the desired type...
Represents a C array with a specified size that is not an integer-constant-expression.
Expr * getQueriedExpression() const
This represents '#pragma omp parallel sections' directive.
Represents a C++ namespace alias.
void setTemplateNameLoc(SourceLocation Loc)
SourceLocation getBuiltinLoc() const
NestedNameSpecifierLoc getQualifierLoc() const
A Microsoft C++ __uuidof expression, which gets the _GUID that corresponds to the supplied type or ex...
No keyword precedes the qualified type name.
SourceLocation getRParenLoc() const
Expr * getUnderlyingExpr() const
SourceLocation getAttributeLoc() const
TemplateName getAsTemplate() const
Retrieve the template name for a template name argument.
Expr * getCommon() const
getCommon - Return the common expression, written to the left of the condition.
unsigned getNumTemplateArgs() const
TypeSourceInfo * getWrittenTypeInfo() const
DeclStmt * getBeginStmt()
const ExtParameterInfo * getExtParameterInfosOrNull() const
Return a pointer to the beginning of the array of extra parameter information, if present...
SourceLocation getRightLoc() const
const Expr * getCond() const
static Designator getArrayRange(Expr *Start, Expr *End, SourceLocation LBracketLoc, SourceLocation EllipsisLoc)
attr::Kind getKind() const
The receiver is a superclass.
SourceLocation getLParenLoc() const
Returns the location of '('.
NamedDecl * getRepresentativeDecl() const
Fetches a representative decl. Useful for lazy diagnostics.
SourceLocation getGenericLoc() const
void getSelectorLocs(SmallVectorImpl< SourceLocation > &SelLocs) const
SourceLocation getAttrEnumOperandLoc() const
The location of the attribute's enumerated operand, if it has one.
The global specifier '::'. There is no stored value.
TemplateName getAsTemplateOrTemplatePattern() const
Retrieve the template argument as a template name; if the argument is a pack expansion, return the pattern as a template name.
void pushFullCopy(TypeLoc L)
Pushes a copy of the given TypeLoc onto this builder.
unsigned getNumParams() const
Return the number of parameters this function must have based on its FunctionType.
SourceLocation getLocStart() const LLVM_READONLY
Wrapper for source info for pointers.
SourceLocation getBegin() const
TypeSourceInfo * getTypeSourceInfo() const
getTypeSourceInfo - Return the destination type.
BinaryOperatorKind getOperator() const
SourceLocation ColonLoc
Location of ':'.
SourceLocation getRParenLoc() const
Return the location of the right parentheses.
SourceLocation getInnerLocStart() const
getInnerLocStart - Return SourceLocation representing start of source range ignoring outer template d...
NamedDecl * getPack() const
Retrieve the parameter pack.
Wrapper for source info for block pointers.
Represents Objective-C's @autoreleasepool Statement.
llvm::Optional< NullabilityKind > getImmediateNullability() const
SourceLocation getKeywordLoc() const
Represents the canonical version of C arrays with a specified constant size.
CompoundStmt * getTryBlock() const
ExceptionSpecInfo ExceptionSpec
QualType getBaseType() const
TemplateArgumentLocContainerIterator()
InitListExpr * getSyntacticForm() const
Expr * getBaseExpr() const
The symbol does not exist.
void clear()
Clears out any current state.
Represents an implicitly-generated value initialization of an object of a given type.
CompoundStmt * getBlock() const
SourceLocation getReturnLoc() const
Stmt * getFinalSuspendStmt() const
void setElaboratedKeywordLoc(SourceLocation Loc)
CapturedRegionKind getCapturedRegionKind() const
Retrieve the captured region kind.
This represents '#pragma omp target parallel for' directive.
Attr - This represents one attribute.
SourceLocation getLocation() const
This represents clause 'use_device_ptr' in the '#pragma omp ...' directives.
SourceLocation getTypeArgsRAngleLoc() const
QualType getPointeeType() const
QualType getType() const
Return the type wrapped by this type source info.
TypeTrait getTrait() const
Determine which type trait this expression uses.
Expr * getLength()
Get length of array section.
void setUnderlyingTInfo(TypeSourceInfo *TI) const
const DeclarationNameInfo & getMemberNameInfo() const
Retrieve the name of the member that this expression refers to.
const IdentifierInfo * getIdentifier() const
Expr * getSizeExpr() const
bool isCXXInstanceMember() const
Determine whether the given declaration is an instance member of a C++ class.
ConstructionKind getConstructionKind() const
Determine whether this constructor is actually constructing a base class (rather than a complete obje...
TypeSourceInfo * getClassReceiverTypeInfo() const
Returns a type-source information of a class message send, or nullptr if the message is not a class m...
Expr * getBase()
An array section can be written only as Base[LowerBound:Length].
Qualifiers::ObjCLifetime getObjCLifetime() const
Returns lifetime attribute of this type.
This represents '#pragma omp taskloop' directive.