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 RebuildDependentVectorType(QualType ElementType, Expr *SizeExpr,
827 SourceLocation AttributeLoc,
835 QualType RebuildExtVectorType(QualType ElementType,
unsigned NumElements,
836 SourceLocation AttributeLoc);
843 QualType RebuildDependentSizedExtVectorType(QualType ElementType,
845 SourceLocation AttributeLoc);
855 QualType RebuildDependentAddressSpaceType(QualType PointeeType,
857 SourceLocation AttributeLoc);
863 QualType RebuildFunctionProtoType(QualType T,
864 MutableArrayRef<QualType> ParamTypes,
865 const FunctionProtoType::ExtProtoInfo &EPI);
868 QualType RebuildFunctionNoProtoType(QualType ResultType);
872 QualType RebuildUnresolvedUsingType(SourceLocation NameLoc, Decl *D);
927 Template, Deduced,
false);
973 bool AllowInjectedClassName) {
977 SS.
Adopt(QualifierLoc);
978 TemplateName InstName = getDerived().RebuildTemplateName(
979 SS, TemplateKWLoc, *Name, NameLoc,
QualType(),
nullptr,
980 AllowInjectedClassName);
995 getDerived().RebuildTemplateSpecializationType(InstName, NameLoc, Args);
1016 bool DeducedTSTContext) {
1018 SS.
Adopt(QualifierLoc);
1033 if (!DeducedTSTContext) {
1034 if (
auto *Deduced = dyn_cast_or_null<DeducedTemplateSpecializationType>(
1036 SemaRef.
Diag(IdLoc, diag::err_dependent_deduced_tst)
1038 Deduced->getTemplateName())
1040 if (
auto *TD = Deduced->getTemplateName().getAsTemplateDecl())
1041 SemaRef.
Diag(TD->getLocation(), diag::note_template_decl_here);
1074 llvm_unreachable(
"Tag lookup cannot find non-tags");
1092 SemaRef.
Diag(IdLoc, diag::err_tag_reference_non_tag) << SomeDecl
1098 SemaRef.
Diag(IdLoc, diag::err_not_tag_in_scope)
1107 SemaRef.
Diag(KeywordLoc, diag::err_use_with_wrong_tag) <<
Id;
1127 return getSema().CheckPackExpansion(Pattern, PatternRange, EllipsisLoc,
1163 bool AllowInjectedClassName);
1176 bool AllowInjectedClassName);
1187 return getSema().Context.getSubstTemplateTemplateParmPack(Param, ArgPack);
1198 return getSema().ActOnCompoundStmt(LBraceLoc, RBraceLoc, Statements,
1211 return getSema().ActOnCaseStmt(CaseLoc, LHS, EllipsisLoc, RHS,
1220 getSema().ActOnCaseStmtBody(S, Body);
1231 return getSema().ActOnDefaultStmt(DefaultLoc, ColonLoc, SubStmt,
1261 return getSema().ActOnIfStmt(IfLoc, IsConstexpr, Init, Cond, Then,
1271 return getSema().ActOnStartOfSwitchStmt(SwitchLoc, Init, Cond);
1280 return getSema().ActOnFinishSwitchStmt(SwitchLoc, Switch, Body);
1289 return getSema().ActOnWhileStmt(WhileLoc, Cond, Body);
1299 return getSema().ActOnDoStmt(DoLoc, Body, WhileLoc, LParenLoc,
1311 return getSema().ActOnForStmt(ForLoc, LParenLoc, Init, Cond,
1312 Inc, RParenLoc, Body);
1321 return getSema().ActOnGotoStmt(GotoLoc, LabelLoc, Label);
1331 return getSema().ActOnIndirectGotoStmt(GotoLoc, StarLoc, Target);
1339 return getSema().BuildReturnStmt(ReturnLoc, Result);
1349 return getSema().ActOnDeclStmt(DG, StartLoc, EndLoc);
1357 bool IsVolatile,
unsigned NumOutputs,
1362 return getSema().ActOnGCCAsmStmt(AsmLoc, IsSimple, IsVolatile, NumOutputs,
1363 NumInputs, Names, Constraints, Exprs,
1364 AsmString, Clobbers, RParenLoc);
1373 StringRef AsmString,
1374 unsigned NumOutputs,
unsigned NumInputs,
1379 return getSema().ActOnMSAsmStmt(AsmLoc, LBraceLoc, AsmToks, AsmString,
1380 NumOutputs, NumInputs,
1381 Constraints, Clobbers, Exprs, EndLoc);
1390 return getSema().BuildCoreturnStmt(CoreturnLoc, Result, IsImplicit);
1399 return getSema().BuildResolvedCoawaitExpr(CoawaitLoc, Result, IsImplicit);
1409 return getSema().BuildUnresolvedCoawaitExpr(CoawaitLoc, Result, Lookup);
1417 return getSema().BuildCoyieldExpr(CoyieldLoc, Result);
1421 return getSema().BuildCoroutineBodyStmt(Args);
1432 return getSema().ActOnObjCAtTryStmt(AtLoc, TryBody, CatchStmts,
1442 return getSema().BuildObjCExceptionDecl(TInfo, T,
1456 return getSema().ActOnObjCAtCatchStmt(AtLoc, RParenLoc,
1466 return getSema().ActOnObjCAtFinallyStmt(AtLoc, Body);
1475 return getSema().BuildObjCAtThrowStmt(AtLoc, Operand);
1488 return getSema().ActOnOpenMPExecutableDirective(
1489 Kind, DirName, CancelRegion, Clauses, AStmt, StartLoc, EndLoc);
1502 return getSema().ActOnOpenMPIfClause(NameModifier, Condition, StartLoc,
1503 LParenLoc, NameModifierLoc, ColonLoc,
1514 return getSema().ActOnOpenMPFinalClause(Condition, StartLoc, LParenLoc,
1526 return getSema().ActOnOpenMPNumThreadsClause(NumThreads, StartLoc,
1537 return getSema().ActOnOpenMPSafelenClause(Len, StartLoc, LParenLoc, EndLoc);
1547 return getSema().ActOnOpenMPSimdlenClause(Len, StartLoc, LParenLoc, EndLoc);
1557 return getSema().ActOnOpenMPCollapseClause(Num, StartLoc, LParenLoc,
1570 return getSema().ActOnOpenMPDefaultClause(Kind, KindKwLoc,
1571 StartLoc, LParenLoc, EndLoc);
1583 return getSema().ActOnOpenMPProcBindClause(Kind, KindKwLoc,
1584 StartLoc, LParenLoc, EndLoc);
1596 return getSema().ActOnOpenMPScheduleClause(
1597 M1, M2, Kind, ChunkSize, StartLoc, LParenLoc, M1Loc, M2Loc, KindLoc,
1608 return getSema().ActOnOpenMPOrderedClause(StartLoc, EndLoc, LParenLoc, Num);
1619 return getSema().ActOnOpenMPPrivateClause(VarList, StartLoc, LParenLoc,
1631 return getSema().ActOnOpenMPFirstprivateClause(VarList, StartLoc, LParenLoc,
1643 return getSema().ActOnOpenMPLastprivateClause(VarList, StartLoc, LParenLoc,
1655 return getSema().ActOnOpenMPSharedClause(VarList, StartLoc, LParenLoc,
1671 return getSema().ActOnOpenMPReductionClause(
1672 VarList, StartLoc, LParenLoc, ColonLoc, EndLoc, ReductionIdScopeSpec,
1673 ReductionId, UnresolvedReductions);
1686 return getSema().ActOnOpenMPTaskReductionClause(
1687 VarList, StartLoc, LParenLoc, ColonLoc, EndLoc, ReductionIdScopeSpec,
1688 ReductionId, UnresolvedReductions);
1702 return getSema().ActOnOpenMPInReductionClause(
1703 VarList, StartLoc, LParenLoc, ColonLoc, EndLoc, ReductionIdScopeSpec,
1704 ReductionId, UnresolvedReductions);
1718 return getSema().ActOnOpenMPLinearClause(VarList, Step, StartLoc, LParenLoc,
1719 Modifier, ModifierLoc, ColonLoc,
1732 return getSema().ActOnOpenMPAlignedClause(VarList, Alignment, StartLoc,
1733 LParenLoc, ColonLoc, EndLoc);
1744 return getSema().ActOnOpenMPCopyinClause(VarList, StartLoc, LParenLoc,
1756 return getSema().ActOnOpenMPCopyprivateClause(VarList, StartLoc, LParenLoc,
1768 return getSema().ActOnOpenMPFlushClause(VarList, StartLoc, LParenLoc,
1781 return getSema().ActOnOpenMPDependClause(DepKind, DepLoc, ColonLoc, VarList,
1782 StartLoc, LParenLoc, EndLoc);
1792 return getSema().ActOnOpenMPDeviceClause(Device, StartLoc, LParenLoc,
1806 return getSema().ActOnOpenMPMapClause(MapTypeModifier, MapType,
1807 IsMapTypeImplicit, MapLoc, ColonLoc,
1808 VarList, StartLoc, LParenLoc, EndLoc);
1818 return getSema().ActOnOpenMPNumTeamsClause(NumTeams, StartLoc, LParenLoc,
1830 return getSema().ActOnOpenMPThreadLimitClause(ThreadLimit, StartLoc,
1841 return getSema().ActOnOpenMPPriorityClause(Priority, StartLoc, LParenLoc,
1852 return getSema().ActOnOpenMPGrainsizeClause(Grainsize, StartLoc, LParenLoc,
1863 return getSema().ActOnOpenMPNumTasksClause(NumTasks, StartLoc, LParenLoc,
1874 return getSema().ActOnOpenMPHintClause(Hint, StartLoc, LParenLoc, EndLoc);
1886 return getSema().ActOnOpenMPDistScheduleClause(
1887 Kind, ChunkSize, StartLoc, LParenLoc, KindLoc, CommaLoc, EndLoc);
1898 return getSema().ActOnOpenMPToClause(VarList, StartLoc, LParenLoc, EndLoc);
1909 return getSema().ActOnOpenMPFromClause(VarList, StartLoc, LParenLoc,
1921 return getSema().ActOnOpenMPUseDevicePtrClause(VarList, StartLoc, LParenLoc,
1933 return getSema().ActOnOpenMPIsDevicePtrClause(VarList, StartLoc, LParenLoc,
1943 return getSema().ActOnObjCAtSynchronizedOperand(atLoc,
object);
1952 return getSema().ActOnObjCAtSynchronizedStmt(AtLoc, Object, Body);
1961 return getSema().ActOnObjCAutoreleasePoolStmt(AtLoc, Body);
1973 StmtResult ForEachStmt = getSema().ActOnObjCForCollectionStmt(ForLoc,
1980 return getSema().FinishObjCForCollectionStmt(ForEachStmt.
get(), Body);
1992 VarDecl *Var = getSema().BuildExceptionDeclaration(
nullptr, Declarator,
1993 StartLoc, IdLoc, Id);
1995 getSema().CurContext->addDecl(Var);
2006 return Owned(
new (getSema().Context)
CXXCatchStmt(CatchLoc, ExceptionDecl,
2016 return getSema().ActOnCXXTryBlock(TryLoc, TryBlock, Handlers);
2032 if (
DeclStmt *RangeStmt = dyn_cast<DeclStmt>(Range)) {
2033 if (RangeStmt->isSingleDecl()) {
2034 if (
VarDecl *RangeVar = dyn_cast<VarDecl>(RangeStmt->getSingleDecl())) {
2035 if (RangeVar->isInvalidDecl())
2038 Expr *RangeExpr = RangeVar->getInit();
2041 return getSema().ActOnObjCForCollectionStmt(ForLoc, LoopVar, RangeExpr,
2047 return getSema().BuildCXXForRangeStmt(ForLoc, CoawaitLoc, ColonLoc,
2049 Cond, Inc, LoopVar, RParenLoc,
2062 return getSema().BuildMSDependentExistsStmt(KeywordLoc, IsIfExists,
2063 QualifierLoc, NameInfo, Nested);
2071 return getSema().FinishCXXForRangeStmt(ForRange, Body);
2076 return getSema().ActOnSEHTryBlock(IsCXXTry, TryLoc, TryBlock, Handler);
2081 return getSema().ActOnSEHExceptBlock(Loc, FilterExpr, Block);
2094 return getSema().BuildPredefinedExpr(Loc, IT);
2104 return getSema().BuildDeclarationNameExpr(SS, R, RequiresADL);
2117 SS.
Adopt(QualifierLoc);
2121 return getSema().BuildDeclarationNameExpr(SS, NameInfo, VD);
2130 return getSema().ActOnParenExpr(LParen, RParen, SubExpr);
2153 return getSema().BuildUnaryOp(
nullptr, OpLoc, Opc, SubExpr);
2164 return getSema().BuildBuiltinOffsetOf(OperatorLoc, Type, Components,
2177 return getSema().CreateUnaryExprOrTypeTraitExpr(TInfo, OpLoc, ExprKind, R);
2189 = getSema().CreateUnaryExprOrTypeTraitExpr(SubExpr, OpLoc, ExprKind);
2204 return getSema().ActOnArraySubscriptExpr(
nullptr, LHS,
2217 return getSema().ActOnOMPArraySectionExpr(Base, LBracketLoc, LowerBound,
2218 ColonLoc, Length, RBracketLoc);
2228 Expr *ExecConfig =
nullptr) {
2229 return getSema().ActOnCallExpr(
nullptr, Callee, LParenLoc,
2230 Args, RParenLoc, ExecConfig);
2253 "unnamed member not of record type?");
2256 getSema().PerformObjectMemberConversion(BaseResult.get(),
2259 if (BaseResult.isInvalid())
2261 Base = BaseResult.get();
2264 return getSema().BuildFieldReferenceExpr(
2265 Base, isArrow, OpLoc, EmptySS, cast<FieldDecl>(Member),
2270 SS.
Adopt(QualifierLoc);
2272 Base = BaseResult.
get();
2284 return getSema().BuildMemberReferenceExpr(Base, BaseType, OpLoc, isArrow,
2286 FirstQualifierInScope,
2287 R, ExplicitTemplateArgs,
2298 return getSema().BuildBinOp(
nullptr, OpLoc, Opc, LHS, RHS);
2310 return getSema().ActOnConditionalOp(QuestionLoc, ColonLoc, Cond,
2322 return getSema().BuildCStyleCastExpr(LParenLoc, TInfo, RParenLoc,
2334 return getSema().BuildCompoundLiteralExpr(LParenLoc, TInfo, RParenLoc,
2349 return getSema().BuildMemberReferenceExpr(Base, Base->
getType(),
2402 return getSema().BuildVAArgExpr(BuiltinLoc,
2414 return getSema().ActOnParenListExpr(LParenLoc, RParenLoc, SubExprs);
2424 return getSema().ActOnAddrLabel(AmpAmpLoc, LabelLoc, Label);
2434 return getSema().ActOnStmtExpr(LParenLoc, SubStmt, RParenLoc);
2456 Expr *ControllingExpr,
2459 return getSema().CreateGenericSelectionExpr(KeyLoc, DefaultLoc, RParenLoc,
2460 ControllingExpr, Types, Exprs);
2492 case Stmt::CXXStaticCastExprClass:
2493 return getDerived().RebuildCXXStaticCastExpr(OpLoc, LAngleLoc, TInfo,
2494 RAngleLoc, LParenLoc,
2495 SubExpr, RParenLoc);
2497 case Stmt::CXXDynamicCastExprClass:
2498 return getDerived().RebuildCXXDynamicCastExpr(OpLoc, LAngleLoc, TInfo,
2499 RAngleLoc, LParenLoc,
2500 SubExpr, RParenLoc);
2502 case Stmt::CXXReinterpretCastExprClass:
2503 return getDerived().RebuildCXXReinterpretCastExpr(OpLoc, LAngleLoc, TInfo,
2504 RAngleLoc, LParenLoc,
2508 case Stmt::CXXConstCastExprClass:
2509 return getDerived().RebuildCXXConstCastExpr(OpLoc, LAngleLoc, TInfo,
2510 RAngleLoc, LParenLoc,
2511 SubExpr, RParenLoc);
2514 llvm_unreachable(
"Invalid C++ named cast");
2529 return getSema().BuildCXXNamedCast(OpLoc, tok::kw_static_cast,
2546 return getSema().BuildCXXNamedCast(OpLoc, tok::kw_dynamic_cast,
2563 return getSema().BuildCXXNamedCast(OpLoc, tok::kw_reinterpret_cast,
2580 return getSema().BuildCXXNamedCast(OpLoc, tok::kw_const_cast,
2594 bool ListInitialization) {
2595 return getSema().BuildCXXTypeConstructExpr(TInfo, LParenLoc,
2597 ListInitialization);
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(
2698 TSInfo, LParenLoc, None, RParenLoc,
false);
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 bool ListInitialization) {
2859 return getSema().BuildCXXTypeConstructExpr(
2860 TSInfo, LParenOrBraceLoc, Args, RParenOrBraceLoc, ListInitialization);
2871 bool ListInitialization) {
2872 return getSema().BuildCXXTypeConstructExpr(TSInfo, LParenLoc, Args,
2873 RParenLoc, ListInitialization);
2890 SS.
Adopt(QualifierLoc);
2893 OperatorLoc, IsArrow,
2895 FirstQualifierInScope,
2897 TemplateArgs,
nullptr);
2913 SS.
Adopt(QualifierLoc);
2916 OperatorLoc, IsArrow,
2918 FirstQualifierInScope,
2919 R, TemplateArgs,
nullptr);
2938 RParenLoc, Length, PartialArgs);
2946 return getSema().BuildObjCBoxedExpr(SR, ValueExpr);
2954 Expr **Elements,
unsigned NumElements) {
2955 return getSema().BuildObjCArrayLiteral(Range,
2963 return getSema().BuildObjCSubscriptExpression(RB, Base, Key,
2964 getterMethod, setterMethod);
2973 return getSema().BuildObjCDictionaryLiteral(Range, Elements);
2997 Sel, Method, LBracLoc, SelectorLocs,
3012 Sel, Method, LBracLoc, SelectorLocs,
3028 Sel, Method, LBracLoc, SelectorLocs,
3033 Sel, Method, LBracLoc, SelectorLocs,
3045 bool IsArrow,
bool IsFreeIvar) {
3048 ExprResult Result = getSema().BuildMemberReferenceExpr(
3054 if (IsFreeIvar && Result.isUsable())
3055 cast<ObjCIvarRefExpr>(Result.get())->setIsFreeIvar(IsFreeIvar);
3068 return getSema().BuildMemberReferenceExpr(BaseArg, BaseArg->
getType(),
3091 PropertyLoc, Base));
3102 return getSema().BuildMemberReferenceExpr(BaseArg, BaseArg->
getType(),
3123 assert(!Lookup.
empty() &&
"No __builtin_shufflevector?");
3132 CK_BuiltinFnToFnPtr).
get();
3136 SemaRef.
Context, Callee, SubExprs, Builtin->getCallResultType(),
3148 BuiltinLoc, RParenLoc);
3163 EllipsisLoc, NumExpansions);
3184 llvm_unreachable(
"Pack expansion pattern has no parameter packs");
3206 return getSema().CheckPackExpansion(Pattern, EllipsisLoc, NumExpansions);
3217 return getSema().BuildCXXFoldExpr(LParenLoc, LHS, Operator, EllipsisLoc,
3227 return getSema().BuildEmptyCXXFoldExpr(EllipsisLoc, Operator);
3263 bool DeducibleTSTContext);
3266 template<
typename Derived>
3275 #define STMT(Node, Parent) \ 3276 case Stmt::Node##Class: return getDerived().Transform##Node(cast<Node>(S)); 3277 #define ABSTRACT_STMT(Node) 3278 #define EXPR(Node, Parent) 3279 #include "clang/AST/StmtNodes.inc" 3282 #define STMT(Node, Parent) 3283 #define ABSTRACT_STMT(Stmt) 3284 #define EXPR(Node, Parent) case Stmt::Node##Class: 3285 #include "clang/AST/StmtNodes.inc" 3287 ExprResult E = getDerived().TransformExpr(cast<Expr>(S));
3291 return getSema().ActOnExprStmt(E);
3298 template<
typename Derived>
3306 #define OPENMP_CLAUSE(Name, Class) \ 3307 case OMPC_ ## Name : \ 3308 return getDerived().Transform ## Class(cast<Class>(S)); 3309 #include "clang/Basic/OpenMPKinds.def" 3316 template<
typename Derived>
3323 #define STMT(Node, Parent) case Stmt::Node##Class: break; 3324 #define ABSTRACT_STMT(Stmt) 3325 #define EXPR(Node, Parent) \ 3326 case Stmt::Node##Class: return getDerived().Transform##Node(cast<Node>(E)); 3327 #include "clang/AST/StmtNodes.inc" 3333 template<
typename Derived>
3342 Init = ExprTemp->getSubExpr();
3344 if (
auto *AIL = dyn_cast<ArrayInitLoopExpr>(Init))
3345 Init = AIL->getCommonExpr();
3348 Init = MTE->GetTemporaryExpr();
3351 Init = Binder->getSubExpr();
3354 Init = ICE->getSubExprAsWritten();
3357 dyn_cast<CXXStdInitializerListExpr>(Init))
3358 return TransformInitializer(ILE->getSubExpr(), NotCopyInit);
3364 if (!NotCopyInit && !(Construct && Construct->isListInitialization()))
3365 return getDerived().TransformExpr(Init);
3370 return getDerived().RebuildParenListExpr(Parens.
getBegin(), None,
3375 if (isa<ImplicitValueInitExpr>(Init))
3381 if (!Construct || isa<CXXTemporaryObjectExpr>(Construct))
3382 return getDerived().TransformExpr(Init);
3386 if (Construct && Construct->isStdInitListInitialization())
3387 return TransformInitializer(Construct->getArg(0), NotCopyInit);
3390 bool ArgChanged =
false;
3391 if (getDerived().TransformExprs(Construct->getArgs(), Construct->getNumArgs(),
3392 true, NewArgs, &ArgChanged))
3396 if (Construct->isListInitialization())
3397 return getDerived().RebuildInitList(Construct->getLocStart(), NewArgs,
3398 Construct->getLocEnd());
3401 SourceRange Parens = Construct->getParenOrBraceRange();
3405 assert(NewArgs.empty() &&
3406 "no parens or braces but have direct init with arguments?");
3409 return getDerived().RebuildParenListExpr(Parens.
getBegin(), NewArgs,
3413 template<
typename Derived>
3419 for (
unsigned I = 0; I != NumInputs; ++I) {
3421 if (IsCall && getDerived().DropCallArgument(Inputs[I])) {
3429 Expr *Pattern = Expansion->getPattern();
3432 getSema().collectUnexpandedParameterPacks(Pattern, Unexpanded);
3433 assert(!Unexpanded.empty() &&
"Pack expansion without parameter packs?");
3438 bool RetainExpansion =
false;
3441 if (getDerived().TryExpandParameterPacks(Expansion->getEllipsisLoc(),
3444 Expand, RetainExpansion,
3453 ExprResult OutPattern = getDerived().TransformExpr(Pattern);
3457 ExprResult Out = getDerived().RebuildPackExpansion(OutPattern.
get(),
3458 Expansion->getEllipsisLoc(),
3465 Outputs.push_back(Out.
get());
3471 if (ArgChanged) *ArgChanged =
true;
3475 for (
unsigned I = 0; I != *NumExpansions; ++I) {
3477 ExprResult Out = getDerived().TransformExpr(Pattern);
3481 if (Out.
get()->containsUnexpandedParameterPack()) {
3482 Out = getDerived().RebuildPackExpansion(
3483 Out.
get(), Expansion->getEllipsisLoc(), OrigNumExpansions);
3488 Outputs.push_back(Out.
get());
3493 if (RetainExpansion) {
3494 ForgetPartiallySubstitutedPackRAII Forget(getDerived());
3496 ExprResult Out = getDerived().TransformExpr(Pattern);
3500 Out = getDerived().RebuildPackExpansion(
3501 Out.
get(), Expansion->getEllipsisLoc(), OrigNumExpansions);
3505 Outputs.push_back(Out.
get());
3512 IsCall ? getDerived().TransformInitializer(Inputs[I],
false)
3513 : getDerived().TransformExpr(Inputs[I]);
3517 if (Result.
get() != Inputs[I] && ArgChanged)
3520 Outputs.push_back(Result.
get());
3526 template <
typename Derived>
3530 VarDecl *ConditionVar = cast_or_null<VarDecl>(
3531 getDerived().TransformDefinition(Var->
getLocation(), Var));
3536 return getSema().ActOnConditionVariable(ConditionVar, Loc, Kind);
3540 ExprResult CondExpr = getDerived().TransformExpr(Expr);
3545 return getSema().ActOnCondition(
nullptr, Loc, CondExpr.
get(),
Kind);
3551 template<
typename Derived>
3560 Qualifiers.push_back(Qualifier);
3563 while (!Qualifiers.empty()) {
3571 if (SemaRef.BuildCXXNestedNameSpecifier(
nullptr, IdInfo,
false,
3572 SS, FirstQualifierInScope,
false))
3579 = cast_or_null<NamespaceDecl>(
3580 getDerived().TransformDecl(
3589 = cast_or_null<NamespaceAliasDecl>(
3605 cast_or_null<CXXRecordDecl>(getDerived().TransformDecl(
3614 FirstQualifierInScope, SS);
3620 (SemaRef.getLangOpts().CPlusPlus11 &&
3623 "Can't get cv-qualifiers here");
3626 diag::warn_cxx98_compat_enum_nested_name_spec);
3635 SemaRef.Diag(TL.
getBeginLoc(), diag::err_nested_name_spec_non_tag)
3643 FirstQualifierInScope =
nullptr;
3649 !getDerived().AlwaysRebuild())
3662 template<
typename Derived>
3682 TemplateDecl *NewTemplate = cast_or_null<TemplateDecl>(
3683 getDerived().TransformDecl(NameInfo.
getLoc(), OldTemplate));
3689 SemaRef.Context.DeclarationNames.getCXXDeductionGuideName(NewTemplate));
3699 NewTInfo = getDerived().TransformType(OldTInfo);
3702 NewCanTy = SemaRef.Context.getCanonicalType(NewTInfo->
getType());
3710 NewCanTy = SemaRef.Context.getCanonicalType(NewT);
3714 = SemaRef.Context.DeclarationNames.getCXXSpecialName(Name.
getNameKind(),
3723 llvm_unreachable(
"Unknown name kind.");
3726 template<
typename Derived>
3733 bool AllowInjectedClassName) {
3736 assert(Template &&
"qualified template name must refer to a template");
3739 = cast_or_null<TemplateDecl>(getDerived().TransformDecl(NameLoc,
3744 if (!getDerived().AlwaysRebuild() &&
3746 TransTemplate == Template)
3749 return getDerived().RebuildTemplateName(SS, QTN->hasTemplateKeyword(),
3757 FirstQualifierInScope =
nullptr;
3760 if (!getDerived().AlwaysRebuild() &&
3768 if (DTN->isIdentifier()) {
3769 return getDerived().RebuildTemplateName(SS,
3771 *DTN->getIdentifier(),
3774 FirstQualifierInScope,
3775 AllowInjectedClassName);
3778 return getDerived().RebuildTemplateName(SS, TemplateKWLoc,
3779 DTN->getOperator(), NameLoc,
3780 ObjectType, AllowInjectedClassName);
3785 = cast_or_null<TemplateDecl>(getDerived().TransformDecl(NameLoc,
3790 if (!getDerived().AlwaysRebuild() &&
3791 TransTemplate == Template)
3800 = cast_or_null<TemplateTemplateParmDecl>(
3801 getDerived().TransformDecl(NameLoc, SubstPack->getParameterPack()));
3805 if (!getDerived().AlwaysRebuild() &&
3806 TransParam == SubstPack->getParameterPack())
3809 return getDerived().RebuildTemplateName(TransParam,
3810 SubstPack->getArgumentPack());
3814 llvm_unreachable(
"overloaded function decl survived to here");
3817 template<
typename Derived>
3824 llvm_unreachable(
"null template argument in TreeTransform");
3829 SemaRef.Context.getTrivialTypeSourceInfo(Arg.
getAsType(), Loc));
3838 Builder.
MakeTrivial(SemaRef.Context, DTN->getQualifier(), Loc);
3840 Builder.
MakeTrivial(SemaRef.Context, QTN->getQualifier(), Loc);
3867 template<
typename Derived>
3882 llvm_unreachable(
"Unexpected TemplateArgument");
3889 DI = getDerived().TransformType(DI);
3890 if (!DI)
return true;
3899 QualifierLoc = getDerived().TransformNestedNameSpecifierLoc(QualifierLoc);
3905 SS.
Adopt(QualifierLoc);
3907 = getDerived().TransformTemplateName(SS, Arg.
getAsTemplate(),
3918 llvm_unreachable(
"Caller should expand pack expansions");
3930 ExprResult E = getDerived().TransformExpr(InputExpr);
3931 E = SemaRef.ActOnConstantExpression(E);
3944 template<
typename Derived,
typename InputIterator>
3952 typedef typename std::iterator_traits<InputIterator>::difference_type
3969 : Self(Self), Iter(Iter) { }
3992 return X.Iter == Y.Iter;
3997 return X.Iter != Y.Iter;
4001 template<
typename Derived>
4002 template<
typename InputIterator>
4006 for (; First != Last; ++First) {
4019 if (TransformTemplateArguments(PackLocIterator(*
this,
4021 PackLocIterator(*
this,
4035 = getSema().getTemplateArgumentPackExpansionPattern(
4036 In, Ellipsis, OrigNumExpansions);
4039 getSema().collectUnexpandedParameterPacks(Pattern, Unexpanded);
4040 assert(!Unexpanded.empty() &&
"Pack expansion without parameter packs?");
4045 bool RetainExpansion =
false;
4047 if (getDerived().TryExpandParameterPacks(Ellipsis,
4061 if (getDerived().TransformTemplateArgument(Pattern, OutPattern, Uneval))
4064 Out = getDerived().RebuildPackExpansion(OutPattern, Ellipsis,
4075 for (
unsigned I = 0; I != *NumExpansions; ++I) {
4078 if (getDerived().TransformTemplateArgument(Pattern, Out, Uneval))
4082 Out = getDerived().RebuildPackExpansion(Out, Ellipsis,
4093 if (RetainExpansion) {
4094 ForgetPartiallySubstitutedPackRAII Forget(getDerived());
4096 if (getDerived().TransformTemplateArgument(Pattern, Out, Uneval))
4099 Out = getDerived().RebuildPackExpansion(Out, Ellipsis,
4111 if (getDerived().TransformTemplateArgument(In, Out, Uneval))
4125 template<
typename Derived>
4127 if (getDerived().AlreadyTransformed(T))
4132 TypeSourceInfo *DI = getSema().Context.getTrivialTypeSourceInfo(T,
4133 getDerived().getBaseLocation());
4143 template<
typename Derived>
4147 getDerived().getBaseEntity());
4148 if (getDerived().AlreadyTransformed(DI->
getType()))
4156 QualType Result = getDerived().TransformType(TLB, TL);
4163 template<
typename Derived>
4167 #define ABSTRACT_TYPELOC(CLASS, PARENT) 4168 #define TYPELOC(CLASS, PARENT) \ 4169 case TypeLoc::CLASS: \ 4170 return getDerived().Transform##CLASS##Type(TLB, \ 4171 T.castAs<CLASS##TypeLoc>()); 4172 #include "clang/AST/TypeLocNodes.def" 4175 llvm_unreachable(
"unhandled type loc!");
4178 template<
typename Derived>
4180 if (!isa<DependentNameType>(T))
4181 return TransformType(T);
4183 if (getDerived().AlreadyTransformed(T))
4185 TypeSourceInfo *DI = getSema().Context.getTrivialTypeSourceInfo(T,
4186 getDerived().getBaseLocation());
4187 TypeSourceInfo *NewDI = getDerived().TransformTypeWithDeducedTST(DI);
4191 template<
typename Derived>
4194 if (!isa<DependentNameType>(DI->
getType()))
4195 return TransformType(DI);
4199 getDerived().getBaseEntity());
4200 if (getDerived().AlreadyTransformed(DI->
getType()))
4214 QualType Result = getDerived().TransformDependentNameType(
4216 if (Result.isNull())
4220 Result = getDerived().RebuildQualifiedType(
4221 Result, QTL.getBeginLoc(), QTL.getType().getLocalQualifiers());
4228 template<
typename Derived>
4238 Result = getDerived().RebuildQualifiedType(Result, T.
getBeginLoc(), Quals);
4248 template<
typename Derived>
4275 = dyn_cast<SubstTemplateTypeParmType>(T)) {
4279 Replacement = SemaRef.Context.getQualifiedType(
4281 T = SemaRef.Context.getSubstTemplateTypeParmType(
4282 SubstTypeParam->getReplacedParameter(),
Replacement);
4283 }
else if ((AutoTy = dyn_cast<AutoType>(T)) && AutoTy->
isDeduced()) {
4290 T = SemaRef.Context.getAutoType(Deduced, AutoTy->
getKeyword(),
4296 SemaRef.Diag(Loc, diag::err_attr_objc_ownership_redundant) << T;
4302 return SemaRef.BuildQualifiedType(T, Loc, Quals);
4305 template<
typename Derived>
4311 if (getDerived().AlreadyTransformed(TL.
getType()))
4315 TransformTSIInObjectScope(TL, ObjectType, UnqualLookup, SS);
4321 template<
typename Derived>
4327 if (getDerived().AlreadyTransformed(TSInfo->
getType()))
4330 return TransformTSIInObjectScope(TSInfo->
getTypeLoc(), ObjectType,
4334 template <
typename Derived>
4339 assert(!getDerived().AlreadyTransformed(T));
4344 if (isa<TemplateSpecializationType>(T)) {
4348 TemplateName Template = getDerived().TransformTemplateName(
4350 ObjectType, UnqualLookup,
true);
4351 if (Template.isNull())
4354 Result = getDerived().TransformTemplateSpecializationType(TLB, SpecTL,
4356 }
else if (isa<DependentTemplateSpecializationType>(T)) {
4361 = getDerived().RebuildTemplateName(SS,
4365 ObjectType, UnqualLookup,
4367 if (Template.isNull())
4370 Result = getDerived().TransformDependentTemplateSpecializationType(TLB,
4376 Result = getDerived().TransformType(TLB, TL);
4385 template <
class TyLoc>
static inline 4387 TyLoc NewT = TLB.
push<TyLoc>(T.getType());
4388 NewT.setNameLoc(T.getNameLoc());
4392 template<
typename Derived>
4402 template<
typename Derived>
4409 template <
typename Derived>
4416 template<
typename Derived>
4420 if (OriginalType.
isNull())
4424 if (getDerived().AlwaysRebuild() ||
4426 Result = SemaRef.Context.getDecayedType(OriginalType);
4432 template<
typename Derived>
4437 if (PointeeType.
isNull())
4446 Result = SemaRef.Context.getObjCObjectPointerType(PointeeType);
4453 if (getDerived().AlwaysRebuild() ||
4455 Result = getDerived().RebuildPointerType(PointeeType, TL.
getSigilLoc());
4469 template<
typename Derived>
4475 if (PointeeType.
isNull())
4479 if (getDerived().AlwaysRebuild() ||
4481 Result = getDerived().RebuildBlockPointerType(PointeeType,
4496 template<
typename Derived>
4504 if (PointeeType.
isNull())
4508 if (getDerived().AlwaysRebuild() ||
4510 Result = getDerived().RebuildReferenceType(PointeeType,
4524 if (isa<LValueReferenceType>(Result))
4533 template<
typename Derived>
4537 return TransformReferenceType(TLB, TL);
4540 template<
typename Derived>
4544 return TransformReferenceType(TLB, TL);
4547 template<
typename Derived>
4552 if (PointeeType.
isNull())
4558 NewClsTInfo = getDerived().TransformType(OldClsTInfo);
4567 NewClsType = NewClsTInfo->
getType();
4569 NewClsType = getDerived().TransformType(OldClsType);
4570 if (NewClsType.isNull())
4575 if (getDerived().AlwaysRebuild() ||
4577 NewClsType != OldClsType) {
4578 Result = getDerived().RebuildMemberPointerType(PointeeType, NewClsType,
4594 NewTL.setClassTInfo(NewClsTInfo);
4599 template<
typename Derived>
4605 if (ElementType.
isNull())
4609 if (getDerived().AlwaysRebuild() ||
4611 Result = getDerived().RebuildConstantArrayType(ElementType,
4632 Size = getDerived().TransformExpr(Size).template getAs<Expr>();
4633 Size = SemaRef.ActOnConstantExpression(Size).get();
4640 template<
typename Derived>
4646 if (ElementType.
isNull())
4650 if (getDerived().AlwaysRebuild() ||
4652 Result = getDerived().RebuildIncompleteArrayType(ElementType,
4668 template<
typename Derived>
4674 if (ElementType.
isNull())
4681 SizeResult = getDerived().TransformExpr(T->
getSizeExpr());
4685 SizeResult = SemaRef.ActOnFinishFullExpr(SizeResult.
get());
4689 Expr *Size = SizeResult.
get();
4692 if (getDerived().AlwaysRebuild() ||
4695 Result = getDerived().RebuildVariableArrayType(ElementType,
4714 template<
typename Derived>
4720 if (ElementType.
isNull())
4732 = getDerived().TransformExpr(origSize);
4733 sizeResult = SemaRef.ActOnConstantExpression(sizeResult);
4737 Expr *size = sizeResult.
get();
4740 if (getDerived().AlwaysRebuild() ||
4743 Result = getDerived().RebuildDependentSizedArrayType(ElementType,
4762 template <
typename Derived>
4767 if (ElementType.
isNull())
4774 Size = SemaRef.ActOnConstantExpression(Size);
4779 if (getDerived().AlwaysRebuild() || ElementType != T->
getElementType() ||
4781 Result = getDerived().RebuildDependentVectorType(
4788 if (isa<DependentVectorType>(Result)) {
4800 template<
typename Derived>
4808 if (ElementType.
isNull())
4816 Size = SemaRef.ActOnConstantExpression(Size);
4821 if (getDerived().AlwaysRebuild() ||
4824 Result = getDerived().RebuildDependentSizedExtVectorType(ElementType,
4832 if (isa<DependentSizedExtVectorType>(Result)) {
4844 template <
typename Derived>
4851 if (pointeeType.
isNull())
4859 AddrSpace = SemaRef.ActOnConstantExpression(AddrSpace);
4864 if (getDerived().AlwaysRebuild() || pointeeType != T->
getPointeeType() ||
4866 Result = getDerived().RebuildDependentAddressSpaceType(
4873 if (isa<DependentAddressSpaceType>(Result)) {
4883 Result, getDerived().getBaseLocation());
4890 template <
typename Derived>
4895 if (ElementType.
isNull())
4899 if (getDerived().AlwaysRebuild() ||
4901 Result = getDerived().RebuildVectorType(ElementType, T->
getNumElements(),
4913 template<
typename Derived>
4918 if (ElementType.
isNull())
4922 if (getDerived().AlwaysRebuild() ||
4924 Result = getDerived().RebuildExtVectorType(ElementType,
4937 template <
typename Derived>
4940 bool ExpectParameterPack) {
4944 if (NumExpansions && isa<PackExpansionType>(OldDI->
getType())) {
4954 QualType Result = getDerived().TransformType(TLB,
4959 Result = RebuildPackExpansionType(Result,
4969 NewDI = TLB.getTypeSourceInfo(SemaRef.Context, Result);
4971 NewDI = getDerived().TransformType(OldDI);
4975 if (NewDI == OldDI && indexAdjustment == 0)
4992 template <
typename Derived>
5000 int indexAdjustment = 0;
5002 unsigned NumParams = Params.size();
5003 for (
unsigned i = 0; i != NumParams; ++i) {
5005 assert(OldParm->getFunctionScopeIndex() == i);
5009 if (OldParm->isParameterPack()) {
5014 TypeLoc TL = OldParm->getTypeSourceInfo()->getTypeLoc();
5017 SemaRef.collectUnexpandedParameterPacks(Pattern, Unexpanded);
5018 assert(Unexpanded.size() > 0 &&
"Could not find parameter packs!");
5021 bool ShouldExpand =
false;
5022 bool RetainExpansion =
false;
5025 NumExpansions = OrigNumExpansions;
5026 if (getDerived().TryExpandParameterPacks(ExpansionTL.
getEllipsisLoc(),
5027 Pattern.getSourceRange(),
5038 getDerived().ExpandingFunctionParameterPack(OldParm);
5039 for (
unsigned I = 0; I != *NumExpansions; ++I) {
5042 = getDerived().TransformFunctionTypeParam(OldParm,
5050 PInfos.
set(OutParamTypes.size(), ParamInfos[i]);
5051 OutParamTypes.push_back(NewParm->
getType());
5053 PVars->push_back(NewParm);
5058 if (RetainExpansion) {
5059 ForgetPartiallySubstitutedPackRAII Forget(getDerived());
5061 = getDerived().TransformFunctionTypeParam(OldParm,
5069 PInfos.
set(OutParamTypes.size(), ParamInfos[i]);
5070 OutParamTypes.push_back(NewParm->
getType());
5072 PVars->push_back(NewParm);
5088 NewParm = getDerived().TransformFunctionTypeParam(OldParm,
5093 NewParm = getDerived().TransformFunctionTypeParam(
5094 OldParm, indexAdjustment, None,
false);
5101 PInfos.
set(OutParamTypes.size(), ParamInfos[i]);
5102 OutParamTypes.push_back(NewParm->
getType());
5104 PVars->push_back(NewParm);
5111 bool IsPackExpansion =
false;
5115 = dyn_cast<PackExpansionType>(OldType)) {
5117 QualType Pattern = Expansion->getPattern();
5119 getSema().collectUnexpandedParameterPacks(Pattern, Unexpanded);
5122 bool ShouldExpand =
false;
5123 bool RetainExpansion =
false;
5124 if (getDerived().TryExpandParameterPacks(Loc,
SourceRange(),
5135 for (
unsigned I = 0; I != *NumExpansions; ++I) {
5137 QualType NewType = getDerived().TransformType(Pattern);
5143 getSema().getASTContext().getPackExpansionType(NewType, None);
5150 PInfos.
set(OutParamTypes.size(), ParamInfos[i]);
5151 OutParamTypes.push_back(NewType);
5153 PVars->push_back(
nullptr);
5162 if (RetainExpansion) {
5163 ForgetPartiallySubstitutedPackRAII Forget(getDerived());
5164 QualType NewType = getDerived().TransformType(Pattern);
5169 PInfos.
set(OutParamTypes.size(), ParamInfos[i]);
5170 OutParamTypes.push_back(NewType);
5172 PVars->push_back(
nullptr);
5177 OldType = Expansion->getPattern();
5178 IsPackExpansion =
true;
5180 NewType = getDerived().TransformType(OldType);
5182 NewType = getDerived().TransformType(OldType);
5188 if (IsPackExpansion)
5189 NewType = getSema().Context.getPackExpansionType(NewType,
5193 PInfos.
set(OutParamTypes.size(), ParamInfos[i]);
5194 OutParamTypes.push_back(NewType);
5196 PVars->push_back(
nullptr);
5201 for (
unsigned i = 0, e = PVars->size(); i != e; ++i)
5203 assert(parm->getFunctionScopeIndex() == i);
5210 template<
typename Derived>
5217 TLB, TL,
nullptr, 0,
5220 ExceptionStorage, Changed);
5224 template<
typename Derived>
template<
typename Fn>
5227 unsigned ThisTypeQuals, Fn TransformExceptionSpec) {
5244 if (getDerived().TransformFunctionTypeParams(
5248 ParamTypes, &ParamDecls, ExtParamInfos))
5260 ResultType = getDerived().TransformType(TLB, TL.
getReturnLoc());
5266 ResultType = getDerived().TransformType(TLB, TL.
getReturnLoc());
5270 if (getDerived().TransformFunctionTypeParams(
5274 ParamTypes, &ParamDecls, ExtParamInfos))
5280 bool EPIChanged =
false;
5285 if (
auto NewExtParamInfos =
5289 != llvm::makeArrayRef(NewExtParamInfos, ParamTypes.size())) {
5299 if (getDerived().AlwaysRebuild() || ResultType != T->
getReturnType() ||
5300 T->
getParamTypes() != llvm::makeArrayRef(ParamTypes) || EPIChanged) {
5301 Result = getDerived().RebuildFunctionProtoType(ResultType, ParamTypes, EPI);
5312 for (
unsigned i = 0, e = NewTL.
getNumParams(); i != e; ++i)
5318 template<
typename Derived>
5334 getSema().ActOnNoexceptSpec(Loc, NoexceptExpr.
get(), EST);
5355 SemaRef.collectUnexpandedParameterPacks(PackExpansion->getPattern(),
5357 assert(!Unexpanded.empty() &&
"Pack expansion without parameter packs?");
5362 bool Expand =
false;
5363 bool RetainExpansion =
false;
5367 if (getDerived().TryExpandParameterPacks(
5369 RetainExpansion, NumExpansions))
5377 QualType U = getDerived().TransformType(PackExpansion->getPattern());
5381 U = SemaRef.Context.getPackExpansionType(U, NumExpansions);
5382 Exceptions.push_back(U);
5388 for (
unsigned ArgIdx = 0; ArgIdx != *NumExpansions; ++ArgIdx) {
5391 QualType U = getDerived().TransformType(PackExpansion->getPattern());
5392 if (U.
isNull() || SemaRef.CheckSpecifiedExceptionType(U, Loc))
5395 Exceptions.push_back(U);
5398 QualType U = getDerived().TransformType(T);
5399 if (U.
isNull() || SemaRef.CheckSpecifiedExceptionType(U, Loc))
5404 Exceptions.push_back(U);
5414 template<
typename Derived>
5424 if (getDerived().AlwaysRebuild() || ResultType != T->
getReturnType())
5425 Result = getDerived().RebuildFunctionNoProtoType(ResultType);
5436 template<
typename Derived>
QualType 5445 if (getDerived().AlwaysRebuild() || D != T->
getDecl()) {
5446 Result = getDerived().RebuildUnresolvedUsingType(TL.
getNameLoc(), D);
5459 template<
typename Derived>
5464 = cast_or_null<TypedefNameDecl>(getDerived().TransformDecl(TL.
getNameLoc(),
5470 if (getDerived().AlwaysRebuild() ||
5472 Result = getDerived().RebuildTypedefType(Typedef);
5483 template<
typename Derived>
5495 E = SemaRef.HandleExprEvaluationContextForTypeof(E.
get());
5500 if (getDerived().AlwaysRebuild() ||
5502 Result = getDerived().RebuildTypeOfExprType(E.
get(), TL.
getTypeofLoc());
5516 template<
typename Derived>
5520 TypeSourceInfo* New_Under_TI = getDerived().TransformType(Old_Under_TI);
5525 if (getDerived().AlwaysRebuild() || New_Under_TI != Old_Under_TI) {
5526 Result = getDerived().RebuildTypeOfType(New_Under_TI->
getType());
5540 template<
typename Derived>
5554 E = getSema().ActOnDecltypeExpression(E.
get());
5559 if (getDerived().AlwaysRebuild() ||
5561 Result = getDerived().RebuildDecltypeType(E.
get(), TL.
getNameLoc());
5573 template<
typename Derived>
5582 Result = getDerived().RebuildUnaryTransformType(NewBase,
5596 template<
typename Derived>
5602 if (!OldDeduced.
isNull()) {
5603 NewDeduced = getDerived().TransformType(OldDeduced);
5609 if (getDerived().AlwaysRebuild() || NewDeduced != OldDeduced ||
5611 Result = getDerived().RebuildAutoType(NewDeduced, T->
getKeyword());
5622 template<
typename Derived>
5630 if (TemplateName.
isNull())
5635 if (!OldDeduced.
isNull()) {
5636 NewDeduced = getDerived().TransformType(OldDeduced);
5641 QualType Result = getDerived().RebuildDeducedTemplateSpecializationType(
5642 TemplateName, NewDeduced);
5653 template<
typename Derived>
5658 = cast_or_null<RecordDecl>(getDerived().TransformDecl(TL.
getNameLoc(),
5664 if (getDerived().AlwaysRebuild() ||
5666 Result = getDerived().RebuildRecordType(Record);
5677 template<
typename Derived>
5682 = cast_or_null<EnumDecl>(getDerived().TransformDecl(TL.
getNameLoc(),
5688 if (getDerived().AlwaysRebuild() ||
5690 Result = getDerived().RebuildEnumType(Enum);
5701 template<
typename Derived>
5709 QualType T = SemaRef.Context.getTypeDeclType(cast<TypeDecl>(D));
5714 template<
typename Derived>
5721 template<
typename Derived>
5732 if (Replacement.isNull())
5749 template<
typename Derived>
5756 template<
typename Derived>
5771 return getDerived().TransformTemplateSpecializationType(TLB, TL, Template);
5774 template<
typename Derived>
5782 if (getDerived().AlwaysRebuild() ||
5784 Result = getDerived().RebuildAtomicType(ValueType, TL.
getKWLoc());
5797 template <
typename Derived>
5808 Result = getDerived().RebuildPipeType(ValueType, TL.
getKWLoc(), isReadPipe);
5824 template<
typename ArgLocContainer>
5826 ArgLocContainer *Container;
5851 : Container(&Container), Index(Index) { }
5865 return Container->getArgLoc(Index);
5869 return pointer(Container->getArgLoc(Index));
5874 return X.Container == Y.Container && X.Index == Y.Index;
5884 template <
typename Derived>
5894 if (getDerived().TransformTemplateArguments(ArgIterator(TL, 0),
5902 getDerived().RebuildTemplateSpecializationType(Template,
5911 if (isa<DependentTemplateSpecializationType>(Result)) {
5920 for (
unsigned i = 0, e = NewTemplateArgs.
size(); i != e; ++i)
5931 for (
unsigned i = 0, e = NewTemplateArgs.
size(); i != e; ++i)
5938 template <
typename Derived>
5949 if (getDerived().TransformTemplateArguments(ArgIterator(TL, 0),
5958 = getSema().Context.getDependentTemplateSpecializationType(
5960 DTN->getQualifier(),
5961 DTN->getIdentifier(),
5972 for (
unsigned i = 0, e = NewTemplateArgs.
size(); i != e; ++i)
5978 = getDerived().RebuildTemplateSpecializationType(Template,
5990 for (
unsigned i = 0, e = NewTemplateArgs.
size(); i != e; ++i)
5997 template<
typename Derived>
6027 diag::err_tag_reference_non_tag)
6030 SemaRef.Diag(TAT->getLocation(), diag::note_declared_at);
6036 if (getDerived().AlwaysRebuild() ||
6041 QualifierLoc, NamedT);
6052 template<
typename Derived>
6058 if (modifiedType.
isNull())
6064 if (getDerived().AlwaysRebuild() ||
6070 if (equivalentType.
isNull())
6077 SemaRef.Diag(TL.
getAttrNameLoc(), diag::err_nullability_nonpointer)
6083 result = SemaRef.Context.getAttributedType(oldType->
getAttrKind(),
6100 template<
typename Derived>
6109 if (getDerived().AlwaysRebuild() ||
6111 Result = getDerived().RebuildParenType(Inner);
6122 template<
typename Derived>
6125 return TransformDependentNameType(TLB, TL,
false);
6128 template<
typename Derived>
6139 = getDerived().RebuildDependentNameType(T->
getKeyword(),
6149 QualType NamedT = ElabT->getNamedType();
6164 template<
typename Derived>
6177 .TransformDependentTemplateSpecializationType(TLB, TL, QualifierLoc);
6180 template<
typename Derived>
6193 if (getDerived().TransformTemplateArguments(ArgIterator(TL, 0),
6198 QualType Result = getDerived().RebuildDependentTemplateSpecializationType(
6205 if (
const ElaboratedType *ElabT = dyn_cast<ElaboratedType>(Result)) {
6206 QualType NamedT = ElabT->getNamedType();
6215 for (
unsigned I = 0, E = NewTemplateArgs.
size(); I != E; ++I)
6222 }
else if (isa<DependentTemplateSpecializationType>(Result)) {
6231 for (
unsigned I = 0, E = NewTemplateArgs.
size(); I != E; ++I)
6240 for (
unsigned I = 0, E = NewTemplateArgs.
size(); I != E; ++I)
6246 template<
typename Derived>
6255 if (getDerived().AlwaysRebuild() ||
6257 Result = getDerived().RebuildPackExpansionType(Pattern,
6270 template<
typename Derived>
6279 template<
typename Derived>
6290 if (getDerived().AlwaysRebuild() ||
6292 Result = getDerived().RebuildObjCTypeParamType(OTP,
6312 template<
typename Derived>
6333 const auto *PackExpansion = PackExpansionLoc.getType()
6336 SemaRef.collectUnexpandedParameterPacks(PackExpansion->getPattern(),
6338 assert(!Unexpanded.empty() &&
"Pack expansion without parameter packs?");
6342 TypeLoc PatternLoc = PackExpansionLoc.getPatternLoc();
6343 bool Expand =
false;
6344 bool RetainExpansion =
false;
6346 if (getDerived().TryExpandParameterPacks(
6347 PackExpansionLoc.getEllipsisLoc(), PatternLoc.getSourceRange(),
6348 Unexpanded, Expand, RetainExpansion, NumExpansions))
6358 TypeArgBuilder.
reserve(PatternLoc.getFullDataSize());
6359 QualType NewPatternType = getDerived().TransformType(TypeArgBuilder,
6361 if (NewPatternType.
isNull())
6364 QualType NewExpansionType = SemaRef.Context.getPackExpansionType(
6365 NewPatternType, NumExpansions);
6367 NewExpansionLoc.
setEllipsisLoc(PackExpansionLoc.getEllipsisLoc());
6368 NewTypeArgInfos.push_back(
6375 for (
unsigned ArgIdx = 0; ArgIdx != *NumExpansions; ++ArgIdx) {
6379 TypeArgBuilder.
reserve(PatternLoc.getFullDataSize());
6381 QualType NewTypeArg = getDerived().TransformType(TypeArgBuilder,
6386 NewTypeArgInfos.push_back(
6395 QualType NewTypeArg = getDerived().TransformType(TypeArgBuilder, TypeArgLoc);
6400 if (NewTypeArg == TypeArg) {
6401 NewTypeArgInfos.push_back(TypeArgInfo);
6405 NewTypeArgInfos.push_back(
6411 if (getDerived().AlwaysRebuild() || AnyChanged) {
6413 Result = getDerived().RebuildObjCObjectType(
6442 template<
typename Derived>
6447 if (PointeeType.
isNull())
6451 if (getDerived().AlwaysRebuild() ||
6453 Result = getDerived().RebuildObjCObjectPointerType(PointeeType,
6467 template<
typename Derived>
6473 template<
typename Derived>
6476 return getDerived().TransformCompoundStmt(S,
false);
6479 template<
typename Derived>
6485 bool SubStmtInvalid =
false;
6486 bool SubStmtChanged =
false;
6488 for (
auto *B : S->
body()) {
6489 StmtResult Result = getDerived().TransformStmt(B);
6493 if (isa<DeclStmt>(B))
6497 SubStmtInvalid =
true;
6501 SubStmtChanged = SubStmtChanged || Result.
get() != B;
6502 Statements.push_back(Result.
getAs<
Stmt>());
6508 if (!getDerived().AlwaysRebuild() &&
6512 return getDerived().RebuildCompoundStmt(S->
getLBracLoc(),
6518 template<
typename Derived>
6527 LHS = getDerived().TransformExpr(S->
getLHS());
6528 LHS = SemaRef.ActOnCaseExpr(S->
getCaseLoc(), LHS);
6533 RHS = getDerived().TransformExpr(S->
getRHS());
6534 RHS = SemaRef.ActOnCaseExpr(S->
getCaseLoc(), RHS);
6556 return getDerived().RebuildCaseStmtBody(Case.
get(), SubStmt.
get());
6559 template<
typename Derived>
6572 template<
typename Derived>
6586 return getDerived().RebuildLabelStmt(S->
getIdentLoc(),
6591 template <
typename Derived>
6599 #define PRAGMA_SPELLING_ATTR(X) \ 6601 return getDerived().Transform##X##Attr(cast<X##Attr>(R)); 6602 #include "clang/Basic/AttrList.inc" 6608 template <
typename Derived>
6610 bool AttrsChanged =
false;
6614 for (
const auto *I : S->
getAttrs()) {
6615 const Attr *R = getDerived().TransformAttr(I);
6616 AttrsChanged |= (I != R);
6627 return getDerived().RebuildAttributedStmt(S->
getAttrLoc(), Attrs,
6631 template<
typename Derived>
6654 if (!ConstexprConditionValue || *ConstexprConditionValue) {
6655 Then = getDerived().TransformStmt(S->
getThen());
6664 if (!ConstexprConditionValue || !*ConstexprConditionValue) {
6665 Else = getDerived().TransformStmt(S->
getElse());
6670 if (!getDerived().AlwaysRebuild() &&
6682 template<
typename Derived>
6699 = getDerived().RebuildSwitchStmtStart(S->
getSwitchLoc(), Init.
get(), Cond);
6709 return getDerived().RebuildSwitchStmtBody(S->
getSwitchLoc(), Switch.
get(),
6713 template<
typename Derived>
6728 if (!getDerived().AlwaysRebuild() &&
6733 return getDerived().RebuildWhileStmt(S->
getWhileLoc(), Cond, Body.
get());
6736 template<
typename Derived>
6749 if (!getDerived().AlwaysRebuild() &&
6759 template<
typename Derived>
6769 if (getSema().getLangOpts().OpenMP && Init.
isUsable())
6770 getSema().ActOnOpenMPLoopInitialization(S->
getForLoc(), Init.
get());
6793 if (!getDerived().AlwaysRebuild() &&
6801 Init.
get(), Cond, FullInc,
6805 template<
typename Derived>
6815 cast<LabelDecl>(LD));
6818 template<
typename Derived>
6824 Target = SemaRef.MaybeCreateExprWithCleanups(Target.
get());
6826 if (!getDerived().AlwaysRebuild() &&
6834 template<
typename Derived>
6840 template<
typename Derived>
6846 template<
typename Derived>
6856 return getDerived().RebuildReturnStmt(S->
getReturnLoc(), Result.
get());
6859 template<
typename Derived>
6862 bool DeclChanged =
false;
6864 for (
auto *D : S->
decls()) {
6865 Decl *Transformed = getDerived().TransformDefinition(D->getLocation(), D);
6869 if (Transformed != D)
6872 Decls.push_back(Transformed);
6875 if (!getDerived().AlwaysRebuild() && !DeclChanged)
6881 template<
typename Derived>
6892 bool ExprsChanged =
false;
6903 ExprResult Result = getDerived().TransformExpr(OutputExpr);
6907 ExprsChanged |= Result.
get() != OutputExpr;
6909 Exprs.push_back(Result.
get());
6913 for (
unsigned I = 0, E = S->
getNumInputs(); I != E; ++I) {
6921 ExprResult Result = getDerived().TransformExpr(InputExpr);
6925 ExprsChanged |= Result.
get() != InputExpr;
6927 Exprs.push_back(Result.
get());
6930 if (!getDerived().AlwaysRebuild() && !ExprsChanged)
6942 Constraints, Exprs, AsmString.
get(),
6946 template<
typename Derived>
6952 bool HadError =
false, HadChange =
false;
6956 TransformedExprs.reserve(SrcExprs.size());
6957 for (
unsigned i = 0, e = SrcExprs.size(); i != e; ++i) {
6958 ExprResult Result = getDerived().TransformExpr(SrcExprs[i]);
6962 HadChange |= (Result.
get() != SrcExprs[i]);
6963 TransformedExprs.push_back(Result.
get());
6968 if (!HadChange && !getDerived().AlwaysRebuild())
6980 template<
typename Derived>
6983 auto *ScopeInfo = SemaRef.getCurFunction();
6984 auto *FD = cast<FunctionDecl>(SemaRef.CurContext);
6985 assert(FD && ScopeInfo && !ScopeInfo->CoroutinePromise &&
6986 ScopeInfo->NeedsCoroutineSuspends &&
6987 ScopeInfo->CoroutineSuspends.first ==
nullptr &&
6988 ScopeInfo->CoroutineSuspends.second ==
nullptr &&
6989 "expected clean scope info");
6993 ScopeInfo->setNeedsCoroutineSuspends(
false);
6997 if (!SemaRef.buildCoroutineParameterMoves(FD->getLocation()))
6999 auto *Promise = SemaRef.buildCoroutinePromise(FD->getLocation());
7003 ScopeInfo->CoroutinePromise = Promise;
7014 ScopeInfo->setCoroutineSuspends(InitSuspend.
get(), FinalSuspend.
get());
7015 assert(isa<Expr>(InitSuspend.
get()) && isa<Expr>(FinalSuspend.
get()));
7022 if (Builder.isInvalid())
7026 assert(ReturnObject &&
"the return object is expected to be valid");
7027 ExprResult Res = getDerived().TransformInitializer(ReturnObject,
7031 Builder.ReturnValue = Res.
get();
7034 assert(!Promise->getType()->isDependentType() &&
7035 "the promise type must no longer be dependent");
7038 "these nodes should not have been built yet");
7039 if (!Builder.buildDependentStatements())
7043 StmtResult Res = getDerived().TransformStmt(OnFallthrough);
7046 Builder.OnFallthrough = Res.
get();
7050 StmtResult Res = getDerived().TransformStmt(OnException);
7053 Builder.OnException = Res.
get();
7057 StmtResult Res = getDerived().TransformStmt(OnAllocFailure);
7060 Builder.ReturnStmtOnAllocFailure = Res.
get();
7065 "allocation and deallocation calls must already be built");
7067 if (AllocRes.isInvalid())
7069 Builder.Allocate = AllocRes.get();
7074 Builder.Deallocate = DeallocRes.
get();
7076 assert(S->
getResultDecl() &&
"ResultDecl must already be built");
7078 if (ResultDecl.isInvalid())
7080 Builder.ResultDecl = ResultDecl.get();
7086 Builder.ReturnStmt = Res.
get();
7090 return getDerived().RebuildCoroutineBodyStmt(Builder);
7093 template<
typename Derived>
7107 template<
typename Derived>
7121 template <
typename Derived>
7137 return getDerived().RebuildDependentCoawaitExpr(
7139 cast<UnresolvedLookupExpr>(LookupResult.
get()));
7142 template<
typename Derived>
7157 template<
typename Derived>
7166 bool AnyCatchChanged =
false;
7173 AnyCatchChanged =
true;
7174 CatchStmts.push_back(Catch.
get());
7186 if (!getDerived().AlwaysRebuild() &&
7193 return getDerived().RebuildObjCAtTryStmt(S->
getAtTryLoc(), TryBody.
get(),
7194 CatchStmts, Finally.
get());
7197 template<
typename Derived>
7204 if (FromVar->getTypeSourceInfo()) {
7205 TSInfo = getDerived().TransformType(FromVar->getTypeSourceInfo());
7214 T = getDerived().TransformType(FromVar->getType());
7219 Var = getDerived().RebuildObjCExceptionDecl(FromVar, TSInfo, T);
7228 return getDerived().RebuildObjCAtCatchStmt(S->
getAtCatchLoc(),
7233 template<
typename Derived>
7242 if (!getDerived().AlwaysRebuild() &&
7251 template<
typename Derived>
7256 Operand = getDerived().TransformExpr(S->
getThrowExpr());
7261 if (!getDerived().AlwaysRebuild() &&
7265 return getDerived().RebuildObjCAtThrowStmt(S->
getThrowLoc(), Operand.
get());
7268 template<
typename Derived>
7288 if (!getDerived().AlwaysRebuild() &&
7295 Object.
get(), Body.
get());
7298 template<
typename Derived>
7308 if (!getDerived().AlwaysRebuild() &&
7313 return getDerived().RebuildObjCAutoreleasePoolStmt(
7317 template<
typename Derived>
7337 if (!getDerived().AlwaysRebuild() &&
7344 return getDerived().RebuildObjCForCollectionStmt(S->
getForLoc(),
7351 template <
typename Derived>
7357 getDerived().TransformType(ExceptionDecl->getTypeSourceInfo());
7361 Var = getDerived().RebuildExceptionDecl(
7362 ExceptionDecl, T, ExceptionDecl->getInnerLocStart(),
7363 ExceptionDecl->getLocation(), ExceptionDecl->getIdentifier());
7373 if (!getDerived().AlwaysRebuild() && !Var &&
7377 return getDerived().RebuildCXXCatchStmt(S->
getCatchLoc(), Var, Handler.
get());
7380 template <
typename Derived>
7388 bool HandlerChanged =
false;
7395 HandlerChanged = HandlerChanged || Handler.
get() != S->
getHandler(I);
7396 Handlers.push_back(Handler.
getAs<
Stmt>());
7399 if (!getDerived().AlwaysRebuild() && TryBlock.
get() == S->
getTryBlock() &&
7403 return getDerived().RebuildCXXTryStmt(S->
getTryLoc(), TryBlock.
get(),
7407 template<
typename Derived>
7425 Cond = SemaRef.CheckBooleanCondition(S->
getColonLoc(), Cond.
get());
7429 Cond = SemaRef.MaybeCreateExprWithCleanups(Cond.
get());
7435 Inc = SemaRef.MaybeCreateExprWithCleanups(Inc.
get());
7442 if (getDerived().AlwaysRebuild() ||
7449 NewStmt = getDerived().RebuildCXXForRangeStmt(S->
getForLoc(),
7454 Inc.
get(), LoopVar.
get(),
7467 NewStmt = getDerived().RebuildCXXForRangeStmt(S->
getForLoc(),
7472 Inc.
get(), LoopVar.
get(),
7478 if (NewStmt.
get() == S)
7481 return FinishCXXForRangeStmt(NewStmt.
get(), Body.
get());
7484 template<
typename Derived>
7500 NameInfo = getDerived().TransformDeclarationNameInfo(NameInfo);
7506 if (!getDerived().AlwaysRebuild() &&
7513 SS.
Adopt(QualifierLoc);
7514 bool Dependent =
false;
7515 switch (getSema().CheckMicrosoftIfExistsSymbol(
nullptr, SS, NameInfo)) {
7546 return getDerived().RebuildMSDependentExistsStmt(S->
getKeywordLoc(),
7553 template<
typename Derived>
7573 return new (SemaRef.getASTContext())
7575 SemaRef.getASTContext().PseudoObjectTy,
VK_LValue,
7579 template <
typename Derived>
7583 if (BaseRes.isInvalid())
7585 auto IdxRes = getDerived().TransformExpr(E->
getIdx());
7586 if (IdxRes.isInvalid())
7589 if (!getDerived().AlwaysRebuild() &&
7590 BaseRes.get() == E->
getBase() &&
7591 IdxRes.get() == E->
getIdx())
7594 return getDerived().RebuildArraySubscriptExpr(
7598 template <
typename Derived>
7608 if (!getDerived().AlwaysRebuild() && TryBlock.
get() == S->
getTryBlock() &&
7613 TryBlock.
get(), Handler.
get());
7616 template <
typename Derived>
7622 return getDerived().RebuildSEHFinallyStmt(S->
getFinallyLoc(), Block.
get());
7625 template <
typename Derived>
7635 return getDerived().RebuildSEHExceptStmt(S->
getExceptLoc(), FilterExpr.
get(),
7639 template <
typename Derived>
7641 if (isa<SEHFinallyStmt>(Handler))
7642 return getDerived().TransformSEHFinallyStmt(cast<SEHFinallyStmt>(Handler));
7644 return getDerived().TransformSEHExceptStmt(cast<SEHExceptStmt>(Handler));
7647 template<
typename Derived>
7656 template <
typename Derived>
7663 TClauses.reserve(Clauses.size());
7667 getDerived().getSema().StartOpenMPClause((*I)->getClauseKind());
7668 OMPClause *Clause = getDerived().TransformOMPClause(*I);
7669 getDerived().getSema().EndOpenMPClause();
7671 TClauses.push_back(Clause);
7673 TClauses.push_back(
nullptr);
7684 Body = getDerived().TransformStmt(CS);
7687 getDerived().getSema().ActOnOpenMPRegionEnd(Body, TClauses);
7692 if (TClauses.size() != Clauses.size()) {
7699 DirName = cast<OMPCriticalDirective>(D)->getDirectiveName();
7700 DirName = getDerived().TransformDeclarationNameInfo(DirName);
7704 CancelRegion = cast<OMPCancellationPointDirective>(D)->getCancelRegion();
7706 CancelRegion = cast<OMPCancelDirective>(D)->getCancelRegion();
7709 return getDerived().RebuildOMPExecutableDirective(
7714 template <
typename Derived>
7718 getDerived().getSema().StartOpenMPDSABlock(OMPD_parallel, DirName,
nullptr,
7720 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7721 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7725 template <
typename Derived>
7729 getDerived().getSema().StartOpenMPDSABlock(OMPD_simd, DirName,
nullptr,
7731 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7732 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7736 template <
typename Derived>
7740 getDerived().getSema().StartOpenMPDSABlock(OMPD_for, DirName,
nullptr,
7742 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7743 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7747 template <
typename Derived>
7751 getDerived().getSema().StartOpenMPDSABlock(OMPD_for_simd, DirName,
nullptr,
7753 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7754 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7758 template <
typename Derived>
7762 getDerived().getSema().StartOpenMPDSABlock(OMPD_sections, DirName,
nullptr,
7764 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7765 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7769 template <
typename Derived>
7773 getDerived().getSema().StartOpenMPDSABlock(OMPD_section, DirName,
nullptr,
7775 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7776 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7780 template <
typename Derived>
7784 getDerived().getSema().StartOpenMPDSABlock(OMPD_single, DirName,
nullptr,
7786 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7787 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7791 template <
typename Derived>
7795 getDerived().getSema().StartOpenMPDSABlock(OMPD_master, DirName,
nullptr,
7797 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7798 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7802 template <
typename Derived>
7807 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7808 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7812 template <
typename Derived>
7816 getDerived().getSema().StartOpenMPDSABlock(OMPD_parallel_for, DirName,
7818 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7819 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7823 template <
typename Derived>
7827 getDerived().getSema().StartOpenMPDSABlock(OMPD_parallel_for_simd, DirName,
7829 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7830 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7834 template <
typename Derived>
7838 getDerived().getSema().StartOpenMPDSABlock(OMPD_parallel_sections, DirName,
7840 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7841 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7845 template <
typename Derived>
7849 getDerived().getSema().StartOpenMPDSABlock(OMPD_task, DirName,
nullptr,
7851 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7852 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7856 template <
typename Derived>
7860 getDerived().getSema().StartOpenMPDSABlock(OMPD_taskyield, DirName,
nullptr,
7862 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7863 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7867 template <
typename Derived>
7871 getDerived().getSema().StartOpenMPDSABlock(OMPD_barrier, DirName,
nullptr,
7873 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7874 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7878 template <
typename Derived>
7882 getDerived().getSema().StartOpenMPDSABlock(OMPD_taskwait, DirName,
nullptr,
7884 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7885 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7889 template <
typename Derived>
7893 getDerived().getSema().StartOpenMPDSABlock(OMPD_taskgroup, DirName,
nullptr,
7895 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7896 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7900 template <
typename Derived>
7904 getDerived().getSema().StartOpenMPDSABlock(OMPD_flush, DirName,
nullptr,
7906 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7907 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7911 template <
typename Derived>
7915 getDerived().getSema().StartOpenMPDSABlock(OMPD_ordered, DirName,
nullptr,
7917 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7918 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7922 template <
typename Derived>
7926 getDerived().getSema().StartOpenMPDSABlock(OMPD_atomic, DirName,
nullptr,
7928 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7929 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7933 template <
typename Derived>
7937 getDerived().getSema().StartOpenMPDSABlock(OMPD_target, DirName,
nullptr,
7939 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7940 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7944 template <
typename Derived>
7948 getDerived().getSema().StartOpenMPDSABlock(OMPD_target_data, DirName,
nullptr,
7950 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7951 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7955 template <
typename Derived>
7959 getDerived().getSema().StartOpenMPDSABlock(OMPD_target_enter_data, DirName,
7961 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7962 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7966 template <
typename Derived>
7970 getDerived().getSema().StartOpenMPDSABlock(OMPD_target_exit_data, DirName,
7972 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7973 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7977 template <
typename Derived>
7981 getDerived().getSema().StartOpenMPDSABlock(OMPD_target_parallel, DirName,
7983 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7984 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7988 template <
typename Derived>
7992 getDerived().getSema().StartOpenMPDSABlock(OMPD_target_parallel_for, DirName,
7994 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7995 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7999 template <
typename Derived>
8003 getDerived().getSema().StartOpenMPDSABlock(OMPD_target_update, DirName,
8005 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8006 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8010 template <
typename Derived>
8014 getDerived().getSema().StartOpenMPDSABlock(OMPD_teams, DirName,
nullptr,
8016 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8017 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8021 template <
typename Derived>
8025 getDerived().getSema().StartOpenMPDSABlock(OMPD_cancellation_point, DirName,
8027 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8028 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8032 template <
typename Derived>
8036 getDerived().getSema().StartOpenMPDSABlock(OMPD_cancel, DirName,
nullptr,
8038 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8039 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8043 template <
typename Derived>
8047 getDerived().getSema().StartOpenMPDSABlock(OMPD_taskloop, DirName,
nullptr,
8049 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8050 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8054 template <
typename Derived>
8058 getDerived().getSema().StartOpenMPDSABlock(OMPD_taskloop_simd, DirName,
8060 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8061 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8065 template <
typename Derived>
8069 getDerived().getSema().StartOpenMPDSABlock(OMPD_distribute, DirName,
nullptr,
8071 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8072 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8076 template <
typename Derived>
8080 getDerived().getSema().StartOpenMPDSABlock(
8081 OMPD_distribute_parallel_for, DirName,
nullptr, D->
getLocStart());
8082 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8083 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8087 template <
typename Derived>
8092 getDerived().getSema().StartOpenMPDSABlock(
8093 OMPD_distribute_parallel_for_simd, DirName,
nullptr, D->
getLocStart());
8094 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8095 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8099 template <
typename Derived>
8103 getDerived().getSema().StartOpenMPDSABlock(OMPD_distribute_simd, DirName,
8105 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8106 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8110 template <
typename Derived>
8114 getDerived().getSema().StartOpenMPDSABlock(OMPD_target_parallel_for_simd,
8117 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8118 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8122 template <
typename Derived>
8126 getDerived().getSema().StartOpenMPDSABlock(OMPD_target_simd, DirName,
nullptr,
8128 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8129 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8133 template <
typename Derived>
8137 getDerived().getSema().StartOpenMPDSABlock(OMPD_teams_distribute, DirName,
8139 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8140 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8144 template <
typename Derived>
8148 getDerived().getSema().StartOpenMPDSABlock(
8149 OMPD_teams_distribute_simd, DirName,
nullptr, D->
getLocStart());
8150 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8151 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8155 template <
typename Derived>
8159 getDerived().getSema().StartOpenMPDSABlock(
8160 OMPD_teams_distribute_parallel_for_simd, DirName,
nullptr, D->
getLocStart());
8161 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8162 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8166 template <
typename Derived>
8170 getDerived().getSema().StartOpenMPDSABlock(OMPD_teams_distribute_parallel_for,
8172 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8173 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8177 template <
typename Derived>
8181 getDerived().getSema().StartOpenMPDSABlock(OMPD_target_teams, DirName,
8183 auto Res = getDerived().TransformOMPExecutableDirective(D);
8184 getDerived().getSema().EndOpenMPDSABlock(Res.get());
8188 template <
typename Derived>
8192 getDerived().getSema().StartOpenMPDSABlock(OMPD_target_teams_distribute,
8194 auto Res = getDerived().TransformOMPExecutableDirective(D);
8195 getDerived().getSema().EndOpenMPDSABlock(Res.get());
8199 template <
typename Derived>
8204 getDerived().getSema().StartOpenMPDSABlock(
8205 OMPD_target_teams_distribute_parallel_for, DirName,
nullptr,
8207 auto Res = getDerived().TransformOMPExecutableDirective(D);
8208 getDerived().getSema().EndOpenMPDSABlock(Res.get());
8212 template <
typename Derived>
8217 getDerived().getSema().StartOpenMPDSABlock(
8218 OMPD_target_teams_distribute_parallel_for_simd, DirName,
nullptr,
8220 auto Res = getDerived().TransformOMPExecutableDirective(D);
8221 getDerived().getSema().EndOpenMPDSABlock(Res.get());
8225 template <
typename Derived>
8230 getDerived().getSema().StartOpenMPDSABlock(
8231 OMPD_target_teams_distribute_simd, DirName,
nullptr, D->
getLocStart());
8232 auto Res = getDerived().TransformOMPExecutableDirective(D);
8233 getDerived().getSema().EndOpenMPDSABlock(Res.get());
8241 template <
typename Derived>
8246 return getDerived().RebuildOMPIfClause(
8251 template <
typename Derived>
8256 return getDerived().RebuildOMPFinalClause(Cond.
get(), C->
getLocStart(),
8260 template <
typename Derived>
8266 return getDerived().RebuildOMPNumThreadsClause(
8270 template <
typename Derived>
8276 return getDerived().RebuildOMPSafelenClause(
8280 template <
typename Derived>
8286 return getDerived().RebuildOMPSimdlenClause(
8290 template <
typename Derived>
8296 return getDerived().RebuildOMPCollapseClause(
8300 template <
typename Derived>
8308 template <
typename Derived>
8316 template <
typename Derived>
8322 return getDerived().RebuildOMPScheduleClause(
8329 template <
typename Derived>
8334 E = getDerived().TransformExpr(Num);
8342 template <
typename Derived>
8349 template <
typename Derived>
8356 template <
typename Derived>
8363 template <
typename Derived>
8369 template <
typename Derived>
8375 template <
typename Derived>
8382 template <
typename Derived>
8389 template <
typename Derived>
8396 template <
typename Derived>
8403 template <
typename Derived>
8409 template <
typename Derived>
8416 template <
typename Derived>
8422 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8425 Vars.push_back(EVar.
get());
8427 return getDerived().RebuildOMPPrivateClause(
8431 template <
typename Derived>
8437 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8440 Vars.push_back(EVar.
get());
8442 return getDerived().RebuildOMPFirstprivateClause(
8446 template <
typename Derived>
8452 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8455 Vars.push_back(EVar.
get());
8457 return getDerived().RebuildOMPLastprivateClause(
8461 template <
typename Derived>
8467 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8470 Vars.push_back(EVar.
get());
8472 return getDerived().RebuildOMPSharedClause(Vars, C->
getLocStart(),
8476 template <
typename Derived>
8482 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8485 Vars.push_back(EVar.
get());
8492 NameInfo = getDerived().TransformDeclarationNameInfo(NameInfo);
8502 auto *ULE = cast<UnresolvedLookupExpr>(E);
8504 for (
auto *D : ULE->decls()) {
8506 cast<NamedDecl>(getDerived().TransformDecl(E->
getExprLoc(), D));
8507 Decls.addDecl(InstD, InstD->
getAccess());
8509 UnresolvedReductions.push_back(
8511 SemaRef.Context,
nullptr,
8513 NameInfo,
true, ULE->isOverloaded(),
8514 Decls.begin(), Decls.end()));
8516 UnresolvedReductions.push_back(
nullptr);
8518 return getDerived().RebuildOMPReductionClause(
8520 C->
getLocEnd(), ReductionIdScopeSpec, NameInfo, UnresolvedReductions);
8523 template <
typename Derived>
8529 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8532 Vars.push_back(EVar.
get());
8539 NameInfo = getDerived().TransformDeclarationNameInfo(NameInfo);
8549 auto *ULE = cast<UnresolvedLookupExpr>(E);
8551 for (
auto *D : ULE->decls()) {
8553 cast<NamedDecl>(getDerived().TransformDecl(E->
getExprLoc(), D));
8554 Decls.addDecl(InstD, InstD->
getAccess());
8557 SemaRef.Context,
nullptr,
8559 true, ULE->isOverloaded(), Decls.begin(), Decls.end()));
8561 UnresolvedReductions.push_back(
nullptr);
8563 return getDerived().RebuildOMPTaskReductionClause(
8565 C->
getLocEnd(), ReductionIdScopeSpec, NameInfo, UnresolvedReductions);
8568 template <
typename Derived>
8574 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8577 Vars.push_back(EVar.
get());
8584 NameInfo = getDerived().TransformDeclarationNameInfo(NameInfo);
8594 auto *ULE = cast<UnresolvedLookupExpr>(E);
8596 for (
auto *D : ULE->decls()) {
8598 cast<NamedDecl>(getDerived().TransformDecl(E->
getExprLoc(), D));
8599 Decls.addDecl(InstD, InstD->
getAccess());
8602 SemaRef.Context,
nullptr,
8604 true, ULE->isOverloaded(), Decls.begin(), Decls.end()));
8606 UnresolvedReductions.push_back(
nullptr);
8608 return getDerived().RebuildOMPInReductionClause(
8610 C->
getLocEnd(), ReductionIdScopeSpec, NameInfo, UnresolvedReductions);
8613 template <
typename Derived>
8619 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8622 Vars.push_back(EVar.
get());
8627 return getDerived().RebuildOMPLinearClause(
8629 C->getModifierLoc(), C->getColonLoc(), 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());
8646 return getDerived().RebuildOMPAlignedClause(
8647 Vars, Alignment.
get(), C->getLocStart(), C->getLParenLoc(),
8651 template <
typename Derived>
8655 Vars.reserve(C->varlist_size());
8656 for (
auto *VE : C->varlists()) {
8657 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8660 Vars.push_back(EVar.
get());
8662 return getDerived().RebuildOMPCopyinClause(Vars, C->getLocStart(),
8663 C->getLParenLoc(), C->getLocEnd());
8666 template <
typename Derived>
8670 Vars.reserve(C->varlist_size());
8671 for (
auto *VE : C->varlists()) {
8672 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8675 Vars.push_back(EVar.
get());
8677 return getDerived().RebuildOMPCopyprivateClause(
8678 Vars, C->getLocStart(), C->getLParenLoc(), C->getLocEnd());
8681 template <
typename Derived>
8684 Vars.reserve(C->varlist_size());
8685 for (
auto *VE : C->varlists()) {
8686 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8689 Vars.push_back(EVar.
get());
8691 return getDerived().RebuildOMPFlushClause(Vars, C->getLocStart(),
8692 C->getLParenLoc(), C->getLocEnd());
8695 template <
typename Derived>
8699 Vars.reserve(C->varlist_size());
8700 for (
auto *VE : C->varlists()) {
8701 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8704 Vars.push_back(EVar.
get());
8706 return getDerived().RebuildOMPDependClause(
8708 C->getLocStart(), C->getLParenLoc(), C->getLocEnd());
8711 template <
typename Derived>
8717 return getDerived().RebuildOMPDeviceClause(
8721 template <
typename Derived>
8724 Vars.reserve(C->varlist_size());
8725 for (
auto *VE : C->varlists()) {
8726 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8729 Vars.push_back(EVar.
get());
8731 return getDerived().RebuildOMPMapClause(
8734 C->getLParenLoc(), C->getLocEnd());
8737 template <
typename Derived>
8743 return getDerived().RebuildOMPNumTeamsClause(
8747 template <
typename Derived>
8753 return getDerived().RebuildOMPThreadLimitClause(
8757 template <
typename Derived>
8763 return getDerived().RebuildOMPPriorityClause(
8767 template <
typename Derived>
8773 return getDerived().RebuildOMPGrainsizeClause(
8777 template <
typename Derived>
8783 return getDerived().RebuildOMPNumTasksClause(
8787 template <
typename Derived>
8792 return getDerived().RebuildOMPHintClause(E.
get(), C->getLocStart(),
8796 template <
typename Derived>
8802 return getDerived().RebuildOMPDistScheduleClause(
8807 template <
typename Derived>
8813 template <
typename Derived>
8816 Vars.reserve(C->varlist_size());
8817 for (
auto *VE : C->varlists()) {
8818 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8821 Vars.push_back(EVar.
get());
8823 return getDerived().RebuildOMPToClause(Vars, C->getLocStart(),
8824 C->getLParenLoc(), C->getLocEnd());
8827 template <
typename Derived>
8830 Vars.reserve(C->varlist_size());
8831 for (
auto *VE : C->varlists()) {
8832 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8835 Vars.push_back(EVar.
get());
8837 return getDerived().RebuildOMPFromClause(Vars, C->getLocStart(),
8838 C->getLParenLoc(), C->getLocEnd());
8841 template <
typename Derived>
8845 Vars.reserve(C->varlist_size());
8846 for (
auto *VE : C->varlists()) {
8847 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8850 Vars.push_back(EVar.
get());
8852 return getDerived().RebuildOMPUseDevicePtrClause(
8853 Vars, C->getLocStart(), C->getLParenLoc(), C->getLocEnd());
8856 template <
typename Derived>
8860 Vars.reserve(C->varlist_size());
8861 for (
auto *VE : C->varlists()) {
8862 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8865 Vars.push_back(EVar.
get());
8867 return getDerived().RebuildOMPIsDevicePtrClause(
8868 Vars, C->getLocStart(), C->getLParenLoc(), C->getLocEnd());
8874 template<
typename Derived>
8880 return getDerived().RebuildPredefinedExpr(E->
getLocation(),
8884 template<
typename Derived>
8896 = cast_or_null<ValueDecl>(getDerived().TransformDecl(E->
getLocation(),
8903 NameInfo = getDerived().TransformDeclarationNameInfo(NameInfo);
8908 if (!getDerived().AlwaysRebuild() &&
8916 SemaRef.MarkDeclRefReferenced(E);
8923 TemplateArgs = &TransArgs;
8932 return getDerived().RebuildDeclRefExpr(QualifierLoc, ND, NameInfo,
8936 template<
typename Derived>
8942 template <
typename Derived>
8948 template<
typename Derived>
8954 template<
typename Derived>
8960 template<
typename Derived>
8966 template<
typename Derived>
8972 template<
typename Derived>
8976 SemaRef.MarkFunctionReferenced(E->
getLocStart(), FD);
8977 return SemaRef.MaybeBindToTemporary(E);
8980 template<
typename Derived>
8996 AssocTypes.push_back(AssocType);
8998 AssocTypes.push_back(
nullptr);
9004 AssocExprs.push_back(AssocExpr.
get());
9007 return getDerived().RebuildGenericSelectionExpr(E->
getGenericLoc(),
9010 ControllingExpr.
get(),
9015 template<
typename Derived>
9022 if (!getDerived().AlwaysRebuild() && SubExpr.
get() == E->
getSubExpr())
9025 return getDerived().RebuildParenExpr(SubExpr.
get(), E->
getLParen(),
9032 template<
typename Derived>
9036 return getDerived().TransformDependentScopeDeclRefExpr(DRE,
true,
nullptr);
9038 return getDerived().TransformExpr(E);
9041 template<
typename Derived>
9046 SubExpr = TransformAddressOfOperand(E->
getSubExpr());
9052 if (!getDerived().AlwaysRebuild() && SubExpr.
get() == E->
getSubExpr())
9060 template<
typename Derived>
9074 bool ExprChanged =
false;
9080 Comp.isBrackets =
true;
9086 ExprResult Index = getDerived().TransformExpr(FromIndex);
9090 ExprChanged = ExprChanged || Index.
get() != FromIndex;
9091 Comp.isBrackets =
true;
9092 Comp.U.E = Index.
get();
9098 Comp.isBrackets =
false;
9100 if (!Comp.U.IdentInfo)
9110 Components.push_back(Comp);
9114 if (!getDerived().AlwaysRebuild() &&
9120 return getDerived().RebuildOffsetOfExpr(E->
getOperatorLoc(), Type,
9124 template<
typename Derived>
9128 "opaque value expression requires transformation");
9132 template<
typename Derived>
9138 template<
typename Derived>
9147 Expr *newSyntacticForm = SemaRef.recreateSyntacticForm(E);
9148 ExprResult result = getDerived().TransformExpr(newSyntacticForm);
9154 if (result.
get()->hasPlaceholderType(BuiltinType::PseudoObject))
9155 result = SemaRef.checkPseudoObjectRValue(result.
get());
9160 template<
typename Derived>
9171 if (!getDerived().AlwaysRebuild() && OldT == NewT)
9174 return getDerived().RebuildUnaryExprOrTypeTrait(NewT, E->
getOperatorLoc(),
9192 PE ? dyn_cast<DependentScopeDeclRefExpr>(PE->getSubExpr()) :
nullptr)
9193 SubExpr = getDerived().TransformParenDependentScopeDeclRefExpr(
9194 PE, DRE,
false, &RecoveryTSI);
9199 return getDerived().RebuildUnaryExprOrTypeTrait(
9207 return getDerived().RebuildUnaryExprOrTypeTrait(SubExpr.
get(),
9213 template<
typename Derived>
9225 if (!getDerived().AlwaysRebuild() &&
9230 return getDerived().RebuildArraySubscriptExpr(LHS.
get(),
9236 template <
typename Derived>
9245 LowerBound = getDerived().TransformExpr(E->
getLowerBound());
9252 Length = getDerived().TransformExpr(E->
getLength());
9257 if (!getDerived().AlwaysRebuild() && Base.
get() == E->
getBase() &&
9261 return getDerived().RebuildOMPArraySectionExpr(
9266 template<
typename Derived>
9275 bool ArgChanged =
false;
9281 if (!getDerived().AlwaysRebuild() &&
9284 return SemaRef.MaybeBindToTemporary(E);
9289 return getDerived().RebuildCallExpr(Callee.
get(), FakeLParenLoc,
9294 template<
typename Derived>
9312 = cast_or_null<ValueDecl>(getDerived().TransformDecl(E->
getMemberLoc(),
9321 FoundDecl = cast_or_null<NamedDecl>(
9322 getDerived().TransformDecl(E->
getMemberLoc(), FoundDecl));
9327 if (!getDerived().AlwaysRebuild() &&
9336 SemaRef.MarkMemberReferenced(E);
9359 NamedDecl *FirstQualifierInScope =
nullptr;
9361 if (MemberNameInfo.
getName()) {
9362 MemberNameInfo = getDerived().TransformDeclarationNameInfo(MemberNameInfo);
9363 if (!MemberNameInfo.
getName())
9367 return getDerived().RebuildMemberExpr(Base.
get(), FakeOperatorLoc,
9375 ? &TransArgs :
nullptr),
9376 FirstQualifierInScope);
9379 template<
typename Derived>
9390 if (!getDerived().AlwaysRebuild() &&
9402 template<
typename Derived>
9406 return getDerived().TransformBinaryOperator(E);
9409 template<
typename Derived>
9423 if (!getDerived().AlwaysRebuild() &&
9428 return getDerived().RebuildConditionalOperator(commonExpr.
get(),
9435 template<
typename Derived>
9450 if (!getDerived().AlwaysRebuild() &&
9456 return getDerived().RebuildConditionalOperator(Cond.
get(),
9463 template<
typename Derived>
9471 template<
typename Derived>
9483 if (!getDerived().AlwaysRebuild() &&
9488 return getDerived().RebuildCStyleCastExpr(E->
getLParenLoc(),
9494 template<
typename Derived>
9506 if (!getDerived().AlwaysRebuild() &&
9509 return SemaRef.MaybeBindToTemporary(E);
9515 return getDerived().RebuildCompoundLiteralExpr(E->
getLParenLoc(), NewT,
9520 template<
typename Derived>
9527 if (!getDerived().AlwaysRebuild() &&
9534 return getDerived().RebuildExtVectorElementExpr(Base.
get(), FakeOperatorLoc,
9539 template<
typename Derived>
9545 bool InitChanged =
false;
9549 Inits, &InitChanged))
9552 if (!getDerived().AlwaysRebuild() && !InitChanged) {
9563 template<
typename Derived>
9575 bool ExprChanged =
false;
9577 if (D.isFieldDesignator()) {
9582 FieldDecl *Field = cast_or_null<FieldDecl>(
9583 getDerived().TransformDecl(D.getFieldLoc(), D.getField()));
9584 if (Field != D.getField())
9597 if (D.isArrayDesignator()) {
9606 ArrayExprs.push_back(Index.
get());
9610 assert(D.isArrayRangeDesignator() &&
"New kind of designator?");
9613 if (Start.isInvalid())
9623 D.getEllipsisLoc()));
9628 ArrayExprs.push_back(Start.get());
9629 ArrayExprs.push_back(End.
get());
9632 if (!getDerived().AlwaysRebuild() &&
9637 return getDerived().RebuildDesignatedInitExpr(Desig, ArrayExprs,
9644 template<
typename Derived>
9648 llvm_unreachable(
"Unexpected DesignatedInitUpdateExpr in syntactic form of " 9653 template<
typename Derived>
9657 llvm_unreachable(
"Unexpected NoInitExpr in syntactic form of initializer");
9661 template<
typename Derived>
9664 llvm_unreachable(
"Unexpected ArrayInitLoopExpr outside of initializer");
9668 template<
typename Derived>
9671 llvm_unreachable(
"Unexpected ArrayInitIndexExpr outside of initializer");
9675 template<
typename Derived>
9687 if (!getDerived().AlwaysRebuild() &&
9691 return getDerived().RebuildImplicitValueInitExpr(T);
9694 template<
typename Derived>
9705 if (!getDerived().AlwaysRebuild() &&
9714 template<
typename Derived>
9717 bool ArgumentChanged =
false;
9723 return getDerived().RebuildParenListExpr(E->
getLParenLoc(),
9733 template<
typename Derived>
9742 cast<LabelDecl>(LD));
9745 template<
typename Derived>
9748 SemaRef.ActOnStartStmtExpr();
9750 = getDerived().TransformCompoundStmt(E->
getSubStmt(),
true);
9752 SemaRef.ActOnStmtExprError();
9756 if (!getDerived().AlwaysRebuild() &&
9759 SemaRef.ActOnStmtExprError();
9760 return SemaRef.MaybeBindToTemporary(E);
9768 template<
typename Derived>
9783 if (!getDerived().AlwaysRebuild() &&
9794 template<
typename Derived>
9800 template<
typename Derived>
9807 case OO_Array_Delete:
9808 llvm_unreachable(
"new and delete operators cannot use CXXOperatorCallExpr");
9812 assert(E->
getNumArgs() >= 1 &&
"Object call is missing arguments");
9816 if (Object.isInvalid())
9821 static_cast<Expr *>(Object.get())->getLocEnd());
9829 return getDerived().RebuildCallExpr(Object.get(), FakeLParenLoc,
9834 #define OVERLOADED_OPERATOR(Name,Spelling,Token,Unary,Binary,MemberOnly) \ 9836 #define OVERLOADED_OPERATOR_MULTI(Name,Spelling,Unary,Binary,MemberOnly) 9837 #include "clang/Basic/OperatorKinds.def" 9842 case OO_Conditional:
9843 llvm_unreachable(
"conditional operator is not actually overloadable");
9847 llvm_unreachable(
"not an overloaded operator?");
9856 First = getDerived().TransformAddressOfOperand(E->
getArg(0));
9858 First = getDerived().TransformExpr(E->
getArg(0));
9864 Second = getDerived().TransformExpr(E->
getArg(1));
9869 if (!getDerived().AlwaysRebuild() &&
9873 return SemaRef.MaybeBindToTemporary(E);
9878 return getDerived().RebuildCXXOperatorCallExpr(E->
getOperator(),
9885 template<
typename Derived>
9888 return getDerived().TransformCallExpr(E);
9891 template<
typename Derived>
9905 bool ArgChanged =
false;
9911 if (!getDerived().AlwaysRebuild() &&
9914 return SemaRef.MaybeBindToTemporary(E);
9919 return getDerived().RebuildCallExpr(Callee.
get(), FakeLParenLoc,
9924 template<
typename Derived>
9936 if (!getDerived().AlwaysRebuild() &&
9940 return getDerived().RebuildCXXNamedCastExpr(
9947 template<
typename Derived>
9953 template<
typename Derived>
9959 template<
typename Derived>
9966 template<
typename Derived>
9972 template<
typename Derived>
9986 if (!getDerived().AlwaysRebuild() &&
9991 return getDerived().RebuildCXXFunctionalCastExpr(Type,
9998 template<
typename Derived>
10007 if (!getDerived().AlwaysRebuild() &&
10011 return getDerived().RebuildCXXTypeidExpr(E->
getType(),
10029 if (!getDerived().AlwaysRebuild() &&
10033 return getDerived().RebuildCXXTypeidExpr(E->
getType(),
10039 template<
typename Derived>
10048 if (!getDerived().AlwaysRebuild() &&
10052 return getDerived().RebuildCXXUuidofExpr(E->
getType(),
10065 if (!getDerived().AlwaysRebuild() &&
10069 return getDerived().RebuildCXXUuidofExpr(E->
getType(),
10075 template<
typename Derived>
10081 template<
typename Derived>
10088 template<
typename Derived>
10091 QualType T = getSema().getCurrentThisType();
10093 if (!getDerived().AlwaysRebuild() && T == E->
getType()) {
10102 template<
typename Derived>
10109 if (!getDerived().AlwaysRebuild() &&
10113 return getDerived().RebuildCXXThrowExpr(E->
getThrowLoc(), SubExpr.
get(),
10117 template<
typename Derived>
10121 = cast_or_null<ParmVarDecl>(getDerived().TransformDecl(E->
getLocStart(),
10126 if (!getDerived().AlwaysRebuild() &&
10130 return getDerived().RebuildCXXDefaultArgExpr(E->
getUsedLocation(), Param);
10133 template<
typename Derived>
10137 = cast_or_null<FieldDecl>(getDerived().TransformDecl(E->
getLocStart(),
10142 if (!getDerived().AlwaysRebuild() && Field == E->
getField())
10145 return getDerived().RebuildCXXDefaultInitExpr(E->
getExprLoc(), Field);
10148 template<
typename Derived>
10156 if (!getDerived().AlwaysRebuild() &&
10160 return getDerived().RebuildCXXScalarValueInitExpr(T,
10165 template<
typename Derived>
10171 if (!AllocTypeInfo)
10180 bool ArgumentChanged =
false;
10184 PlacementArgs, &ArgumentChanged))
10191 NewInit = getDerived().TransformInitializer(OldInit,
true);
10198 OperatorNew = cast_or_null<FunctionDecl>(
10207 OperatorDelete = cast_or_null<FunctionDecl>(
10210 if (!OperatorDelete)
10214 if (!getDerived().AlwaysRebuild() &&
10217 NewInit.
get() == OldInit &&
10220 !ArgumentChanged) {
10224 SemaRef.MarkFunctionReferenced(E->
getLocStart(), OperatorNew);
10225 if (OperatorDelete)
10226 SemaRef.MarkFunctionReferenced(E->
getLocStart(), OperatorDelete);
10232 CXXRecordDecl *Record = cast<CXXRecordDecl>(RecordT->getDecl());
10234 SemaRef.MarkFunctionReferenced(E->
getLocStart(), Destructor);
10243 if (!ArraySize.
get()) {
10249 const ArrayType *ArrayT = SemaRef.Context.getAsArrayType(AllocType);
10253 = dyn_cast<ConstantArrayType>(ArrayT)) {
10255 SemaRef.Context.getSizeType(),
10257 AllocType = ConsArrayT->getElementType();
10259 = dyn_cast<DependentSizedArrayType>(ArrayT)) {
10260 if (DepArrayT->getSizeExpr()) {
10261 ArraySize = DepArrayT->getSizeExpr();
10262 AllocType = DepArrayT->getElementType();
10267 return getDerived().RebuildCXXNewExpr(E->
getLocStart(),
10280 template<
typename Derived>
10290 OperatorDelete = cast_or_null<FunctionDecl>(
10293 if (!OperatorDelete)
10297 if (!getDerived().AlwaysRebuild() &&
10302 if (OperatorDelete)
10303 SemaRef.MarkFunctionReferenced(E->
getLocStart(), OperatorDelete);
10306 QualType Destroyed = SemaRef.Context.getBaseElementType(
10309 CXXRecordDecl *Record = cast<CXXRecordDecl>(DestroyedRec->getDecl());
10311 SemaRef.LookupDestructor(Record));
10318 return getDerived().RebuildCXXDeleteExpr(E->
getLocStart(),
10324 template<
typename Derived>
10333 bool MayBePseudoDestructor =
false;
10334 Base = SemaRef.ActOnStartCXXMemberReference(
nullptr, Base.
get(),
10336 E->
isArrow()? tok::arrow : tok::period,
10338 MayBePseudoDestructor);
10342 QualType ObjectType = ObjectTypePtr.get();
10344 if (QualifierLoc) {
10346 = getDerived().TransformNestedNameSpecifierLoc(QualifierLoc, ObjectType);
10351 SS.
Adopt(QualifierLoc);
10357 ObjectType,
nullptr, SS);
10358 if (!DestroyedTypeInfo)
10360 Destroyed = DestroyedTypeInfo;
10378 = SemaRef.Context.getTrivialTypeSourceInfo(SemaRef.GetTypeFromParser(T),
10385 ScopeTypeInfo = getDerived().TransformTypeInObjectScope(
10387 if (!ScopeTypeInfo)
10391 return getDerived().RebuildCXXPseudoDestructorExpr(Base.
get(),
10401 template <
typename Derived>
10406 bool AllEmptyPacks =
true;
10407 for (
auto *OldD : Old->
decls()) {
10408 Decl *InstD = getDerived().TransformDecl(Old->
getNameLoc(), OldD);
10412 if (isa<UsingShadowDecl>(OldD))
10421 NamedDecl *SingleDecl = cast<NamedDecl>(InstD);
10423 if (
auto *UPD = dyn_cast<UsingPackDecl>(InstD))
10424 Decls = UPD->expansions();
10427 for (
auto *D : Decls) {
10428 if (
auto *UD = dyn_cast<UsingDecl>(D)) {
10429 for (
auto *SD : UD->shadows())
10436 AllEmptyPacks &= Decls.empty();
10445 if (AllEmptyPacks && !RequiresADL) {
10446 getSema().Diag(Old->
getNameLoc(), diag::err_using_pack_expansion_empty)
10447 << isa<UnresolvedMemberExpr>(Old) << Old->
getName();
10457 template<
typename Derived>
10465 if (TransformOverloadExprDecls(Old, Old->
requiresADL(), R))
10472 = getDerived().TransformNestedNameSpecifierLoc(Old->
getQualifierLoc());
10476 SS.
Adopt(QualifierLoc);
10481 = cast_or_null<CXXRecordDecl>(getDerived().TransformDecl(
10484 if (!NamingClass) {
10489 R.setNamingClass(NamingClass);
10502 return SemaRef.BuildPossibleImplicitMemberExpr(SS, TemplateKWLoc, R,
10507 return getDerived().RebuildDeclarationNameExpr(SS, R, Old->
requiresADL());
10521 return getDerived().RebuildTemplateIdExpr(SS, TemplateKWLoc, R,
10525 template<
typename Derived>
10528 bool ArgChanged =
false;
10530 for (
unsigned I = 0, N = E->
getNumArgs(); I != N; ++I) {
10536 QualType To = getDerived().TransformType(TLB, FromTL);
10541 Args.push_back(From);
10555 SemaRef.collectUnexpandedParameterPacks(PatternTL, Unexpanded);
10559 bool Expand =
true;
10560 bool RetainExpansion =
false;
10564 if (getDerived().TryExpandParameterPacks(ExpansionTL.
getEllipsisLoc(),
10565 PatternTL.getSourceRange(),
10567 Expand, RetainExpansion,
10580 QualType To = getDerived().TransformType(TLB, PatternTL);
10584 To = getDerived().RebuildPackExpansionType(To,
10585 PatternTL.getSourceRange(),
10600 for (
unsigned I = 0; I != *NumExpansions; ++I) {
10603 TLB.
reserve(PatternTL.getFullDataSize());
10604 QualType To = getDerived().TransformType(TLB, PatternTL);
10609 To = getDerived().RebuildPackExpansionType(To,
10610 PatternTL.getSourceRange(),
10624 if (!RetainExpansion)
10629 ForgetPartiallySubstitutedPackRAII Forget(getDerived());
10634 QualType To = getDerived().TransformType(TLB, PatternTL);
10638 To = getDerived().RebuildPackExpansionType(To,
10639 PatternTL.getSourceRange(),
10651 if (!getDerived().AlwaysRebuild() && !ArgChanged)
10654 return getDerived().RebuildTypeTrait(E->
getTrait(),
10660 template<
typename Derived>
10667 if (!getDerived().AlwaysRebuild() &&
10683 return getDerived().RebuildArrayTypeTrait(E->
getTrait(),
10690 template<
typename Derived>
10705 return getDerived().RebuildExpressionTrait(
10709 template <
typename Derived>
10713 ExprResult NewDRE = getDerived().TransformDependentScopeDeclRefExpr(
10714 DRE, AddrTaken, RecoveryTSI);
10721 if (!getDerived().AlwaysRebuild() && NewDRE.
get() == DRE)
10723 return getDerived().RebuildParenExpr(NewDRE.
get(), PE->
getLParen(),
10727 template <
typename Derived>
10730 return TransformDependentScopeDeclRefExpr(E,
false,
10734 template<
typename Derived>
10738 bool IsAddressOfOperand,
10742 = getDerived().TransformNestedNameSpecifierLoc(E->
getQualifierLoc());
10752 = getDerived().TransformDeclarationNameInfo(E->
getNameInfo());
10757 if (!getDerived().AlwaysRebuild() &&
10764 return getDerived().RebuildDependentScopeDeclRefExpr(
10765 QualifierLoc, TemplateKWLoc, NameInfo,
nullptr,
10766 IsAddressOfOperand, RecoveryTSI);
10775 return getDerived().RebuildDependentScopeDeclRefExpr(
10776 QualifierLoc, TemplateKWLoc, NameInfo, &TransArgs, IsAddressOfOperand,
10780 template<
typename Derived>
10788 (!getDerived().DropCallArgument(E->
getArg(0))) &&
10799 = cast_or_null<CXXConstructorDecl>(
10805 bool ArgumentChanged =
false;
10811 if (!getDerived().AlwaysRebuild() &&
10814 !ArgumentChanged) {
10817 SemaRef.MarkFunctionReferenced(E->
getLocStart(), Constructor);
10821 return getDerived().RebuildCXXConstructExpr(T, E->
getLocStart(),
10832 template<
typename Derived>
10844 if (!getDerived().AlwaysRebuild() &&
10849 SemaRef.MarkFunctionReferenced(E->
getLocStart(), Constructor);
10853 return getDerived().RebuildCXXInheritedCtorInitExpr(
10862 template<
typename Derived>
10873 template<
typename Derived>
10879 template<
typename Derived>
10889 = cast_or_null<CXXConstructorDecl>(
10895 bool ArgumentChanged =
false;
10902 if (!getDerived().AlwaysRebuild() &&
10905 !ArgumentChanged) {
10907 SemaRef.MarkFunctionReferenced(E->
getLocStart(), Constructor);
10908 return SemaRef.MaybeBindToTemporary(E);
10914 return getDerived().RebuildCXXTemporaryObjectExpr(
10919 template<
typename Derived>
10924 typedef std::pair<ExprResult, QualType> InitCaptureInfoTy;
10935 ExprResult NewExprInitResult = getDerived().TransformInitializer(
10936 C->getCapturedVar()->getInit(),
10941 Expr *NewExprInit = NewExprInitResult.
get();
10943 VarDecl *OldVD = C->getCapturedVar();
10945 getSema().buildLambdaInitCaptureInitialization(
10948 C->getCapturedVar()->getInitStyle() !=
VarDecl::CInit, NewExprInit);
10949 NewExprInitResult = NewExprInit;
10951 std::make_pair(NewExprInitResult, NewInitCaptureType);
10956 auto TPL = getDerived().TransformTemplateParameterList(
10972 QualType NewCallOpType = TransformFunctionProtoType(
10973 NewCallOpTLBuilder, OldCallOpFPTL,
nullptr, 0,
10976 ExceptionStorage, Changed);
10978 if (NewCallOpType.
isNull())
10980 NewCallOpTSI = NewCallOpTLBuilder.getTypeSourceInfo(getSema().Context,
10997 CXXMethodDecl *NewCallOperator = getSema().startLambdaDefinition(
11005 for (
unsigned I = 0, NumParams = NewCallOperator->
getNumParams();
11006 I != NumParams; ++I) {
11008 if (
P->hasUninstantiatedDefaultArg()) {
11014 P->setDefaultArg(R.
get());
11019 getDerived().transformedLocalDecl(E->
getCallOperator(), NewCallOperator);
11026 getSema().buildLambdaScope(LSI, NewCallOperator,
11034 bool Invalid =
false;
11037 bool FinishedExplicitCaptures =
false;
11043 if (!FinishedExplicitCaptures && C->isImplicit()) {
11044 getSema().finishLambdaExplicitCaptures(LSI);
11045 FinishedExplicitCaptures =
true;
11049 if (C->capturesThis()) {
11050 getSema().CheckCXXThisCapture(C->getLocation(), C->isExplicit(),
11057 if (C->capturesVLAType())
11062 InitCaptureInfoTy InitExprTypePair =
11065 QualType InitQualType = InitExprTypePair.second;
11070 VarDecl *OldVD = C->getCapturedVar();
11071 VarDecl *NewVD = getSema().createLambdaInitCaptureVarDecl(
11077 getDerived().transformedLocalDecl(OldVD, NewVD);
11079 getSema().buildInitCaptureField(LSI, NewVD);
11083 assert(C->capturesVariable() &&
"unexpected kind of lambda capture");
11092 if (C->isPackExpansion()) {
11094 bool ShouldExpand =
false;
11095 bool RetainExpansion =
false;
11097 if (getDerived().TryExpandParameterPacks(C->getEllipsisLoc(),
11100 ShouldExpand, RetainExpansion,
11106 if (ShouldExpand) {
11110 VarDecl *Pack = C->getCapturedVar();
11111 for (
unsigned I = 0; I != *NumExpansions; ++I) {
11114 = cast_or_null<VarDecl>(getDerived().TransformDecl(C->getLocation(),
11116 if (!CapturedVar) {
11122 getSema().tryCaptureVariable(CapturedVar, C->getLocation(),
Kind);
11130 EllipsisLoc = C->getEllipsisLoc();
11135 = cast_or_null<VarDecl>(getDerived().TransformDecl(C->getLocation(),
11136 C->getCapturedVar()));
11143 getSema().tryCaptureVariable(CapturedVar, C->getLocation(),
Kind,
11146 if (!FinishedExplicitCaptures)
11147 getSema().finishLambdaExplicitCaptures(LSI);
11151 getSema().PushExpressionEvaluationContext(
11162 SavedContext.
pop();
11163 getSema().ActOnLambdaError(E->
getLocStart(),
nullptr,
11171 auto LSICopy = *LSI;
11172 getSema().ActOnFinishFunctionBody(NewCallOperator, Body.
get(),
11174 SavedContext.
pop();
11176 return getSema().BuildLambdaExpr(E->
getLocStart(), Body.
get()->getLocEnd(),
11180 template<
typename Derived>
11189 bool ArgumentChanged =
false;
11196 if (!getDerived().AlwaysRebuild() &&
11202 return getDerived().RebuildCXXUnresolvedConstructExpr(
11206 template<
typename Derived>
11217 Base = getDerived().TransformExpr(OldBase);
11223 bool MayBePseudoDestructor =
false;
11224 Base = SemaRef.ActOnStartCXXMemberReference(
nullptr, Base.
get(),
11226 E->
isArrow()? tok::arrow : tok::period,
11228 MayBePseudoDestructor);
11232 ObjectType = ObjectTy.get();
11233 BaseType = ((
Expr*) Base.
get())->getType();
11236 BaseType = getDerived().TransformType(E->
getBaseType());
11243 = getDerived().TransformFirstQualifierInScope(
11252 FirstQualifierInScope);
11271 if (!getDerived().AlwaysRebuild() &&
11272 Base.
get() == OldBase &&
11279 return getDerived().RebuildCXXDependentScopeMemberExpr(Base.
get(),
11285 FirstQualifierInScope,
11296 return getDerived().RebuildCXXDependentScopeMemberExpr(Base.
get(),
11302 FirstQualifierInScope,
11307 template<
typename Derived>
11314 Base = getDerived().TransformExpr(Old->
getBase());
11317 Base = getSema().PerformMemberExprBaseConversion(Base.
get(),
11321 BaseType = Base.
get()->getType();
11323 BaseType = getDerived().TransformType(Old->
getBaseType());
11329 = getDerived().TransformNestedNameSpecifierLoc(Old->
getQualifierLoc());
11340 if (TransformOverloadExprDecls(Old,
false, R))
11346 = cast_or_null<CXXRecordDecl>(getDerived().TransformDecl(
11352 R.setNamingClass(NamingClass);
11369 NamedDecl *FirstQualifierInScope =
nullptr;
11371 return getDerived().RebuildUnresolvedMemberExpr(Base.
get(),
11377 FirstQualifierInScope,
11380 ? &TransArgs :
nullptr));
11383 template<
typename Derived>
11392 if (!getDerived().AlwaysRebuild() && SubExpr.
get() == E->
getOperand())
11398 template<
typename Derived>
11405 if (!getDerived().AlwaysRebuild() && Pattern.
get() == E->
getPattern())
11412 template<
typename Derived>
11431 bool ShouldExpand =
false;
11432 bool RetainExpansion =
false;
11436 ShouldExpand, RetainExpansion,
11442 if (ShouldExpand) {
11444 if (
auto *TTPD = dyn_cast<TemplateTypeParmDecl>(Pack)) {
11445 ArgStorage = getSema().Context.getPackExpansionType(
11446 getSema().Context.getTypeDeclType(TTPD), None);
11447 }
else if (
auto *TTPD = dyn_cast<TemplateTemplateParmDecl>(Pack)) {
11450 auto *VD = cast<ValueDecl>(Pack);
11451 ExprResult DRE = getSema().BuildDeclRefExpr(
11452 VD, VD->getType().getNonLValueExprType(getSema().Context),
11455 if (DRE.isInvalid())
11458 getSema().Context.DependentTy, DRE.get(), E->
getPackLoc(), None);
11460 PackArgs = ArgStorage;
11465 if (!PackArgs.size()) {
11466 auto *Pack = cast_or_null<NamedDecl>(
11470 return getDerived().RebuildSizeOfPackExpr(E->
getOperatorLoc(), Pack,
11478 if (!Arg.isPackExpansion()) {
11479 Result = *Result + 1;
11484 InventTemplateArgumentLoc(Arg, ArgLoc);
11490 getSema().getTemplateArgumentPackExpansionPattern(ArgLoc, Ellipsis,
11491 OrigNumExpansions);
11496 if (getDerived().TransformTemplateArgument(Pattern, OutPattern,
11502 getSema().getFullyPackExpandedSize(OutPattern.
getArgument());
11503 if (!NumExpansions) {
11510 Result = *Result + *NumExpansions;
11526 if (TransformTemplateArguments(PackLocIterator(*
this, PackArgs.begin()),
11527 PackLocIterator(*
this, PackArgs.end()),
11528 TransformedPackArgs,
true))
11535 bool PartialSubstitution =
false;
11536 for (
auto &Loc : TransformedPackArgs.arguments()) {
11537 Args.push_back(Loc.getArgument());
11538 if (Loc.getArgument().isPackExpansion())
11539 PartialSubstitution =
true;
11542 if (PartialSubstitution)
11549 Args.size(), None);
11552 template<
typename Derived>
11560 template<
typename Derived>
11568 template<
typename Derived>
11575 template<
typename Derived>
11582 template<
typename Derived>
11588 getSema().collectUnexpandedParameterPacks(Pattern, Unexpanded);
11589 assert(!Unexpanded.empty() &&
"Pack expansion without parameter packs?");
11593 bool Expand =
true;
11594 bool RetainExpansion =
false;
11599 Expand, RetainExpansion,
11618 if (!getDerived().AlwaysRebuild() &&
11622 return getDerived().RebuildCXXFoldExpr(
11636 if (!LeftFold && RetainExpansion) {
11637 ForgetPartiallySubstitutedPackRAII Forget(getDerived());
11639 ExprResult Out = getDerived().TransformExpr(Pattern);
11643 Result = getDerived().RebuildCXXFoldExpr(
11650 for (
unsigned I = 0; I != *NumExpansions; ++I) {
11652 getSema(), LeftFold ? I : *NumExpansions - I - 1);
11653 ExprResult Out = getDerived().TransformExpr(Pattern);
11657 if (Out.
get()->containsUnexpandedParameterPack()) {
11659 Result = getDerived().RebuildCXXFoldExpr(
11661 LeftFold ? Result.
get() : Out.
get(),
11663 LeftFold ? Out.
get() : Result.
get(),
11667 Result = getDerived().RebuildBinaryOperator(
11669 LeftFold ? Result.
get() : Out.
get(),
11670 LeftFold ? Out.
get() : Result.
get());
11680 if (LeftFold && RetainExpansion) {
11681 ForgetPartiallySubstitutedPackRAII Forget(getDerived());
11683 ExprResult Out = getDerived().TransformExpr(Pattern);
11687 Result = getDerived().RebuildCXXFoldExpr(
11698 return getDerived().RebuildEmptyCXXFoldExpr(E->
getEllipsisLoc(),
11704 template<
typename Derived>
11711 template<
typename Derived>
11714 return SemaRef.MaybeBindToTemporary(E);
11717 template<
typename Derived>
11723 template<
typename Derived>
11730 if (!getDerived().AlwaysRebuild() &&
11737 template<
typename Derived>
11742 bool ArgChanged =
false;
11744 false, Elements, &ArgChanged))
11747 if (!getDerived().AlwaysRebuild() && !ArgChanged)
11748 return SemaRef.MaybeBindToTemporary(E);
11750 return getDerived().RebuildObjCArrayLiteral(E->
getSourceRange(),
11755 template<
typename Derived>
11761 bool ArgChanged =
false;
11768 getSema().collectUnexpandedParameterPacks(OrigElement.
Key, Unexpanded);
11769 getSema().collectUnexpandedParameterPacks(OrigElement.
Value, Unexpanded);
11770 assert(!Unexpanded.empty() &&
"Pack expansion without parameter packs?");
11774 bool Expand =
true;
11775 bool RetainExpansion =
false;
11780 if (getDerived().TryExpandParameterPacks(OrigElement.
EllipsisLoc,
11783 Expand, RetainExpansion,
11792 ExprResult Key = getDerived().TransformExpr(OrigElement.
Key);
11796 if (Key.
get() != OrigElement.
Key)
11803 if (Value.
get() != OrigElement.
Value)
11809 Elements.push_back(Expansion);
11819 for (
unsigned I = 0; I != *NumExpansions; ++I) {
11821 ExprResult Key = getDerived().TransformExpr(OrigElement.
Key);
11836 if (Key.
get()->containsUnexpandedParameterPack() ||
11837 Value.
get()->containsUnexpandedParameterPack())
11840 Elements.push_back(Element);
11850 ExprResult Key = getDerived().TransformExpr(OrigElement.
Key);
11854 if (Key.
get() != OrigElement.
Key)
11859 = getDerived().TransformExpr(OrigElement.
Value);
11863 if (Value.
get() != OrigElement.
Value)
11869 Elements.push_back(Element);
11872 if (!getDerived().AlwaysRebuild() && !ArgChanged)
11873 return SemaRef.MaybeBindToTemporary(E);
11875 return getDerived().RebuildObjCDictionaryLiteral(E->
getSourceRange(),
11879 template<
typename Derived>
11884 if (!EncodedTypeInfo)
11887 if (!getDerived().AlwaysRebuild() &&
11891 return getDerived().RebuildObjCEncodeExpr(E->
getAtLoc(),
11896 template<
typename Derived>
11906 template<
typename Derived>
11918 if (!getDerived().AlwaysRebuild() &&
11928 template <
typename Derived>
11934 template<
typename Derived>
11938 bool ArgChanged =
false;
11949 if (!ReceiverTypeInfo)
11953 if (!getDerived().AlwaysRebuild() &&
11955 return SemaRef.MaybeBindToTemporary(E);
11960 return getDerived().RebuildObjCMessageExpr(ReceiverTypeInfo,
11976 return getDerived().RebuildObjCMessageExpr(E->
getSuperLoc(),
11988 "Only class and instance messages may be instantiated");
11991 if (Receiver.isInvalid())
11995 if (!getDerived().AlwaysRebuild() &&
11997 return SemaRef.MaybeBindToTemporary(E);
12002 return getDerived().RebuildObjCMessageExpr(Receiver.get(),
12011 template<
typename Derived>
12017 template<
typename Derived>
12023 template<
typename Derived>
12034 if (!getDerived().AlwaysRebuild() &&
12038 return getDerived().RebuildObjCIvarRefExpr(Base.
get(), E->
getDecl(),
12043 template<
typename Derived>
12059 if (!getDerived().AlwaysRebuild() &&
12064 return getDerived().RebuildObjCPropertyRefExpr(Base.
get(),
12068 return getDerived().RebuildObjCPropertyRefExpr(Base.
get(),
12069 SemaRef.Context.PseudoObjectTy,
12075 template<
typename Derived>
12089 if (!getDerived().AlwaysRebuild() &&
12093 return getDerived().RebuildObjCSubscriptRefExpr(E->
getRBracket(),
12099 template<
typename Derived>
12108 if (!getDerived().AlwaysRebuild() &&
12117 template<
typename Derived>
12120 bool ArgumentChanged =
false;
12124 SubExprs, &ArgumentChanged))
12127 if (!getDerived().AlwaysRebuild() &&
12131 return getDerived().RebuildShuffleVectorExpr(E->
getBuiltinLoc(),
12136 template<
typename Derived>
12147 if (!getDerived().AlwaysRebuild() &&
12152 return getDerived().RebuildConvertVectorExpr(E->
getBuiltinLoc(),
12153 SrcExpr.
get(), Type,
12157 template<
typename Derived>
12176 if (getDerived().TransformFunctionTypeParams(
12185 getDerived().TransformType(exprFunctionType->
getReturnType());
12191 getDerived().RebuildFunctionProtoType(exprResultType, paramTypes, epi);
12195 if (!params.empty())
12213 if (!SemaRef.getDiagnostics().hasErrorOccurred()) {
12214 for (
const auto &I : oldBlock->
captures()) {
12215 VarDecl *oldCapture = I.getVariable();
12218 if (isa<ParmVarDecl>(oldCapture) &&
12219 cast<ParmVarDecl>(oldCapture)->isParameterPack())
12225 assert(blockScope->
CaptureMap.count(newCapture));
12235 template<
typename Derived>
12238 llvm_unreachable(
"Cannot transform asType expressions yet");
12241 template<
typename Derived>
12245 bool ArgumentChanged =
false;
12249 SubExprs, &ArgumentChanged))
12252 if (!getDerived().AlwaysRebuild() &&
12256 return getDerived().RebuildAtomicExpr(E->
getBuiltinLoc(), SubExprs,
12264 template<
typename Derived>
12267 return SemaRef.BuildPointerType(PointeeType, Star,
12268 getDerived().getBaseEntity());
12271 template<
typename Derived>
12274 return SemaRef.BuildBlockPointerType(PointeeType, Star,
12275 getDerived().getBaseEntity());
12278 template<
typename Derived>
12281 bool WrittenAsLValue,
12283 return SemaRef.BuildReferenceType(ReferentType, WrittenAsLValue,
12284 Sigil, getDerived().getBaseEntity());
12287 template<
typename Derived>
12292 return SemaRef.BuildMemberPointerType(PointeeType, ClassType, Sigil,
12293 getDerived().getBaseEntity());
12296 template<
typename Derived>
12303 return SemaRef.BuildObjCTypeParamType(Decl,
12304 ProtocolLAngleLoc, Protocols,
12305 ProtocolLocs, ProtocolRAngleLoc,
12309 template<
typename Derived>
12320 return SemaRef.BuildObjCObjectType(BaseType, Loc, TypeArgsLAngleLoc,
12321 TypeArgs, TypeArgsRAngleLoc,
12322 ProtocolLAngleLoc, Protocols, ProtocolLocs,
12327 template<
typename Derived>
12331 return SemaRef.Context.getObjCObjectPointerType(PointeeType);
12334 template<
typename Derived>
12338 const llvm::APInt *Size,
12340 unsigned IndexTypeQuals,
12342 if (SizeExpr || !Size)
12343 return SemaRef.BuildArrayType(ElementType, SizeMod, SizeExpr,
12344 IndexTypeQuals, BracketsRange,
12345 getDerived().getBaseEntity());
12348 SemaRef.Context.UnsignedCharTy, SemaRef.Context.UnsignedShortTy,
12349 SemaRef.Context.UnsignedIntTy, SemaRef.Context.UnsignedLongTy,
12350 SemaRef.Context.UnsignedLongLongTy, SemaRef.Context.UnsignedInt128Ty
12352 const unsigned NumTypes = llvm::array_lengthof(Types);
12354 for (
unsigned I = 0; I != NumTypes; ++I)
12355 if (Size->getBitWidth() == SemaRef.Context.getIntWidth(Types[I])) {
12356 SizeType = Types[I];
12365 return SemaRef.BuildArrayType(ElementType, SizeMod, ArraySize,
12366 IndexTypeQuals, BracketsRange,
12367 getDerived().getBaseEntity());
12370 template<
typename Derived>
12374 const llvm::APInt &Size,
12375 unsigned IndexTypeQuals,
12377 return getDerived().RebuildArrayType(ElementType, SizeMod, &Size,
nullptr,
12378 IndexTypeQuals, BracketsRange);
12381 template<
typename Derived>
12385 unsigned IndexTypeQuals,
12387 return getDerived().RebuildArrayType(ElementType, SizeMod,
nullptr,
nullptr,
12388 IndexTypeQuals, BracketsRange);
12391 template<
typename Derived>
12396 unsigned IndexTypeQuals,
12398 return getDerived().RebuildArrayType(ElementType, SizeMod,
nullptr,
12400 IndexTypeQuals, BracketsRange);
12403 template<
typename Derived>
12408 unsigned IndexTypeQuals,
12410 return getDerived().RebuildArrayType(ElementType, SizeMod,
nullptr,
12412 IndexTypeQuals, BracketsRange);
12415 template <
typename Derived>
12418 return SemaRef.BuildAddressSpaceAttr(PointeeType, AddrSpaceExpr,
12422 template <
typename Derived>
12425 unsigned NumElements,
12428 return SemaRef.Context.getVectorType(ElementType, NumElements, VecKind);
12431 template <
typename Derived>
12435 return SemaRef.BuildVectorType(ElementType, SizeExpr, AttributeLoc);
12438 template<
typename Derived>
12440 unsigned NumElements,
12442 llvm::APInt numElements(SemaRef.Context.getIntWidth(SemaRef.Context.IntTy),
12443 NumElements,
true);
12447 return SemaRef.BuildExtVectorType(ElementType, VectorSize, AttributeLoc);
12450 template<
typename Derived>
12455 return SemaRef.BuildExtVectorType(ElementType, SizeExpr, AttributeLoc);
12458 template<
typename Derived>
12463 return SemaRef.BuildFunctionType(T, ParamTypes,
12464 getDerived().getBaseLocation(),
12465 getDerived().getBaseEntity(),
12469 template<
typename Derived>
12471 return SemaRef.Context.getFunctionNoProtoType(T);
12474 template<
typename Derived>
12477 assert(D &&
"no decl found");
12482 if (
auto *UPD = dyn_cast<UsingPackDecl>(D)) {
12486 if (UPD->expansions().empty()) {
12487 getSema().Diag(Loc, diag::err_using_pack_expansion_empty)
12497 for (
auto *E : UPD->expansions()) {
12498 QualType ThisT = RebuildUnresolvedUsingType(Loc, E);
12506 assert(getSema().Context.hasSameType(ThisT, T) &&
12507 "mismatched resolved types in using pack expansion");
12509 return T.
isNull() ? FallbackT : T;
12510 }
else if (
auto *Using = dyn_cast<UsingDecl>(D)) {
12511 assert(Using->hasTypename() &&
12512 "UnresolvedUsingTypenameDecl transformed to non-typename using");
12515 assert(++Using->shadow_begin() == Using->shadow_end());
12516 Ty = cast<TypeDecl>((*Using->shadow_begin())->getTargetDecl());
12518 assert(isa<UnresolvedUsingTypenameDecl>(D) &&
12519 "UnresolvedUsingTypenameDecl transformed to non-using decl");
12520 Ty = cast<UnresolvedUsingTypenameDecl>(D);
12523 return SemaRef.Context.getTypeDeclType(Ty);
12526 template<
typename Derived>
12529 return SemaRef.BuildTypeofExprType(E, Loc);
12532 template<
typename Derived>
12534 return SemaRef.Context.getTypeOfType(Underlying);
12537 template<
typename Derived>
12540 return SemaRef.BuildDecltypeType(E, Loc);
12543 template<
typename Derived>
12547 return SemaRef.BuildUnaryTransformType(BaseType, UKind, Loc);
12550 template<
typename Derived>
12555 return SemaRef.CheckTemplateIdType(Template, TemplateNameLoc, TemplateArgs);
12558 template<
typename Derived>
12561 return SemaRef.BuildAtomicType(ValueType, KWLoc);
12564 template<
typename Derived>
12568 return isReadPipe ? SemaRef.BuildReadPipeType(ValueType, KWLoc)
12569 : SemaRef.BuildWritePipeType(ValueType, KWLoc);
12572 template<
typename Derived>
12577 return SemaRef.Context.getQualifiedTemplateName(SS.
getScopeRep(), TemplateKW,
12581 template<
typename Derived>
12589 bool AllowInjectedClassName) {
12593 getSema().ActOnDependentTemplateName(
nullptr,
12594 SS, TemplateKWLoc, TemplateName,
12597 Template, AllowInjectedClassName);
12598 return Template.
get();
12601 template<
typename Derived>
12608 bool AllowInjectedClassName) {
12611 SourceLocation SymbolLocations[3] = { NameLoc, NameLoc, NameLoc };
12614 getSema().ActOnDependentTemplateName(
nullptr,
12615 SS, TemplateKWLoc, Name,
12618 Template, AllowInjectedClassName);
12619 return Template.
get();
12622 template<
typename Derived>
12630 bool isPostIncDec = Second && (Op == OO_PlusPlus || Op == OO_MinusMinus);
12635 return SemaRef.checkPseudoObjectAssignment(
nullptr, OpLoc, Opc,
12637 ExprResult Result = SemaRef.CheckPlaceholderExpr(First);
12640 First = Result.
get();
12644 ExprResult Result = SemaRef.CheckPlaceholderExpr(Second);
12647 Second = Result.
get();
12651 if (Op == OO_Subscript) {
12654 return getSema().CreateBuiltinArraySubscriptExpr(First,
12657 }
else if (Op == OO_Arrow) {
12659 return SemaRef.BuildOverloadedArrowExpr(
nullptr, First, OpLoc);
12660 }
else if (Second ==
nullptr || isPostIncDec) {
12662 (Op == OO_Amp && getSema().isQualifiedMemberAccess(First))) {
12669 return getSema().CreateBuiltinUnaryOp(OpLoc, Opc, First);
12678 = SemaRef.CreateBuiltinBinOp(OpLoc, Opc, First, Second);
12692 Functions.
append(ULE->decls_begin(), ULE->decls_end());
12696 RequiresADL = ULE->requiresADL();
12701 NamedDecl *ND = cast<DeclRefExpr>(Callee)->getDecl();
12702 if (!isa<CXXMethodDecl>(ND))
12704 RequiresADL =
false;
12708 Expr *Args[2] = { First, Second };
12709 unsigned NumArgs = 1 + (Second !=
nullptr);
12712 if (NumArgs == 1 || isPostIncDec) {
12715 return SemaRef.CreateOverloadedUnaryOp(OpLoc, Opc, Functions, First,
12719 if (Op == OO_Subscript) {
12723 if (
DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(Callee)) {
12734 return SemaRef.CreateOverloadedArraySubscriptExpr(LBrace, RBrace,
12740 ExprResult Result = SemaRef.CreateOverloadedBinOp(
12741 OpLoc, Opc, Functions, Args[0], Args[1], RequiresADL);
12748 template<
typename Derived>
12763 ->template getAs<RecordType>())){
12765 return SemaRef.BuildPseudoDestructorExpr(
12766 Base, OperatorLoc, isArrow ? tok::arrow : tok::period, SS, ScopeType,
12767 CCLoc, TildeLoc, Destroyed);
12771 DeclarationName Name(SemaRef.Context.DeclarationNames.getCXXDestructorName(
12772 SemaRef.Context.getCanonicalType(DestroyedType->
getType())));
12781 diag::err_expected_class_or_namespace)
12782 << ScopeType->
getType() << getSema().getLangOpts().CPlusPlus;
12790 return getSema().BuildMemberReferenceExpr(Base, BaseType,
12791 OperatorLoc, isArrow,
12799 template<
typename Derived>
12807 for (
unsigned I = 0; I < NumParams; ++I) {
12808 if (I != ContextParamPos) {
12814 Params.push_back(std::make_pair(StringRef(),
QualType()));
12817 getSema().ActOnCapturedRegionStart(Loc,
nullptr,
12826 getSema().ActOnCapturedRegionError();
12830 return getSema().ActOnCapturedRegionEnd(Body.
get());
12835 #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.
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.
Represents 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
SourceLocation getLocEnd() const LLVM_READONLY
Returns the ending location of the clause.
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
bool isListInitialization() const
Determine whether this expression models list-initialization.
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
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.
CapturedStmt * getInnermostCapturedStmt()
Get innermost captured statement for the construct.
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.
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.
SourceLocation getAttributeLoc() const
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.
Represents a prvalue temporary that is written into memory so that a reference can bind to it...
SourceLocation getAccessorLoc() const
Expr * getAlignment()
Returns alignment.
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.
Represents a variable declaration or definition.
ActionResult< Stmt * > StmtResult
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.
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
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.
Represents a struct/union/class.
Represents a C99 designated initializer expression.
unsigned varlist_size() const
DeclarationName getDeclName() const
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...
Represents a member of a struct/union/class.
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.
SourceLocation getAttrNameLoc() const
The location of the attribute name, i.e.
VarDecl * getPromiseDecl() const
ArrayRef< Expr * > getAllExprs() const
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
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
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
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
static DeclAccessPair make(NamedDecl *D, AccessSpecifier AS)
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 getRParenLoc() const
Expr * getInitializer()
The initializer of this new-expression.
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.
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 getLocStart() const LLVM_READONLY
Returns starting location of directive kind.
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.
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)
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
Expr * getSizeExpr() 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 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
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 getLocEnd() const LLVM_READONLY
SourceLocation getLocStart() const LLVM_READONLY
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
Pepresents 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.
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Expr - This represents one expression.
SourceLocation getLocStart() const LLVM_READONLY
SourceLocation getLocalRangeEnd() const
SourceLocation getElseLoc() const
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 '...
SourceLocation getLocStart() const LLVM_READONLY
This represents 'simdlen' clause in the '#pragma omp ...' directive.
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.
bool isComputedNoexcept(ExceptionSpecificationType ESpecType)
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.
QualType getElaboratedType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier *NNS, QualType NamedType, TagDecl *OwnedTagDecl=nullptr) const
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...
std::pair< NullabilityKind, bool > DiagNullabilityKind
A nullability kind paired with a bit indicating whether it used a context-sensitive keyword...
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
Represents the declaration of a struct/union/class/enum.
MutableArrayRef< Expr * > MultiExprArg
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
SourceLocation getLocStart() const LLVM_READONLY
QualType getElementType() const
DeclStmt - Adaptor class for mixing declarations with statements and expressions. ...
OpenMPDirectiveKind
OpenMP directives.
Represents the declaration of a label.
SourceLocation getLParenLoc() const
Returns the location of '('.
This represents clause 'shared' in the '#pragma omp ...' directives.
Represents a vector type where either the type or size is dependent.
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.
SourceLocation getLocStart() const LLVM_READONLY
Returns the starting location of the clause.
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.
SourceLocation getLocEnd() const LLVM_READONLY
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)
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)
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
SourceLocation getStartLoc() const LLVM_READONLY
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.
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.
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.
ExceptionSpecificationType
The various types of exception specifications that exist in C++11.
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.
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.
VectorType::VectorKind getVectorKind() const
TypeLoc getTypeLoc() const
Return the TypeLoc wrapper for the type source info.
bool isListInitialization() const
Determine whether this expression models list-initialization.
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 a computed noexcept specification.
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...
ActionResult< Expr * > ExprResult
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...
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
void setRAngleLoc(SourceLocation Loc)
StringRef getName() const
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
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
SourceLocation getLocEnd() const LLVM_READONLY
Returns ending location of directive.
A trivial tuple used to represent a source range.
This represents '#pragma omp taskyield' directive.
This represents a decl that may have 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()
QualType getElementType() const
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.
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
Return start of source range ignoring outer template declarations.
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.