13 #ifndef LLVM_CLANG_LIB_SEMA_TREETRANSFORM_H 14 #define LLVM_CLANG_LIB_SEMA_TREETRANSFORM_H 38 #include "llvm/ADT/ArrayRef.h" 39 #include "llvm/Support/ErrorHandling.h" 98 template<
typename Derived>
103 class ForgetPartiallySubstitutedPackRAII {
108 ForgetPartiallySubstitutedPackRAII(Derived &Self) : Self(Self) {
109 Old = Self.ForgetPartiallySubstitutedPack();
112 ~ForgetPartiallySubstitutedPackRAII() {
113 Self.RememberPartiallySubstitutedPack(Old);
130 Derived &
getDerived() {
return static_cast<Derived&
>(*this); }
134 return static_cast<const Derived&
>(*this);
192 OldLocation = Self.
getDerived().getBaseLocation();
193 OldEntity = Self.
getDerived().getBaseEntity();
200 Self.
getDerived().setBase(OldLocation, OldEntity);
266 bool &RetainExpansion,
268 ShouldExpand =
false;
366 const Attr *TransformAttr(
const Attr *S);
375 #define PRAGMA_SPELLING_ATTR(X) \ 376 const X##Attr *Transform##X##Attr(const X##Attr *R) { return R; } 377 #include "clang/Basic/AttrList.inc" 396 ExprResult TransformInitializer(Expr *Init,
bool NotCopyInit);
421 bool TransformExprs(Expr *
const *Inputs,
unsigned NumInputs,
bool IsCall,
422 SmallVectorImpl<Expr *> &Outputs,
423 bool *ArgChanged =
nullptr);
432 llvm::DenseMap<Decl *, Decl *>::iterator Known
433 = TransformedLocalDecls.find(D);
434 if (Known != TransformedLocalDecls.end())
435 return Known->second;
463 assert(New.size() == 1 &&
464 "must override transformedLocalDecl if performing pack expansion");
465 TransformedLocalDecls[Old] = New.front();
473 return getDerived().TransformDecl(Loc, D);
486 return cast_or_null<NamedDecl>(getDerived().TransformDecl(Loc, D));
490 bool TransformOverloadExprDecls(
OverloadExpr *Old,
bool RequiresADL,
502 NamedDecl *FirstQualifierInScope =
nullptr);
546 NamedDecl *FirstQualifierInScope =
nullptr,
547 bool AllowInjectedClassName =
false);
559 bool Uneval =
false);
582 bool Uneval =
false) {
583 return TransformTemplateArguments(Inputs, Inputs + NumInputs, Outputs,
601 template<
typename InputIterator>
602 bool TransformTemplateArguments(InputIterator
First,
605 bool Uneval =
false);
614 getDerived().getBaseLocation());
617 #define ABSTRACT_TYPELOC(CLASS, PARENT) 618 #define TYPELOC(CLASS, PARENT) \ 619 QualType Transform##CLASS##Type(TypeLocBuilder &TLB, CLASS##TypeLoc T); 620 #include "clang/AST/TypeLocNodes.def" 622 template<
typename Fn>
623 QualType TransformFunctionProtoType(TypeLocBuilder &TLB,
624 FunctionProtoTypeLoc TL,
625 CXXRecordDecl *ThisContext,
626 Qualifiers ThisTypeQuals,
627 Fn TransformExceptionSpec);
629 bool TransformExceptionSpec(SourceLocation Loc,
630 FunctionProtoType::ExceptionSpecInfo &ESI,
631 SmallVectorImpl<QualType> &Exceptions,
634 StmtResult TransformSEHHandler(Stmt *Handler);
637 TransformTemplateSpecializationType(TypeLocBuilder &TLB,
638 TemplateSpecializationTypeLoc TL,
639 TemplateName Template);
642 TransformDependentTemplateSpecializationType(TypeLocBuilder &TLB,
643 DependentTemplateSpecializationTypeLoc TL,
644 TemplateName Template,
647 QualType TransformDependentTemplateSpecializationType(
648 TypeLocBuilder &TLB, DependentTemplateSpecializationTypeLoc TL,
649 NestedNameSpecifierLoc QualifierLoc);
658 bool TransformFunctionTypeParams(
659 SourceLocation Loc, ArrayRef<ParmVarDecl *> Params,
660 const QualType *ParamTypes,
661 const FunctionProtoType::ExtParameterInfo *ParamInfos,
662 SmallVectorImpl<QualType> &PTypes, SmallVectorImpl<ParmVarDecl *> *PVars,
663 Sema::ExtParameterInfoBuilder &PInfos);
670 ParmVarDecl *TransformFunctionTypeParam(ParmVarDecl *OldParm,
673 bool ExpectParameterPack);
676 StmtResult TransformLambdaBody(LambdaExpr *E, Stmt *Body);
679 StmtResult SkipLambdaBody(LambdaExpr *E, Stmt *Body);
681 QualType TransformReferenceType(TypeLocBuilder &TLB, ReferenceTypeLoc TL);
683 StmtResult TransformCompoundStmt(CompoundStmt *S,
bool IsStmtExpr);
684 ExprResult TransformCXXNamedCastExpr(CXXNamedCastExpr *E);
694 bool IsAddressOfOperand,
697 ExprResult TransformParenDependentScopeDeclRefExpr(
705 #define STMT(Node, Parent) \ 706 LLVM_ATTRIBUTE_NOINLINE \ 707 StmtResult Transform##Node(Node *S); 708 #define VALUESTMT(Node, Parent) \ 709 LLVM_ATTRIBUTE_NOINLINE \ 710 StmtResult Transform##Node(Node *S, StmtDiscardKind SDK); 711 #define EXPR(Node, Parent) \ 712 LLVM_ATTRIBUTE_NOINLINE \ 713 ExprResult Transform##Node(Node *E); 714 #define ABSTRACT_STMT(Stmt) 715 #include "clang/AST/StmtNodes.inc" 717 #define OPENMP_CLAUSE(Name, Class) \ 718 LLVM_ATTRIBUTE_NOINLINE \ 719 OMPClause *Transform ## Class(Class *S); 720 #include "clang/Basic/OpenMPKinds.def" 728 QualType RebuildQualifiedType(QualType T, QualifiedTypeLoc TL);
734 QualType RebuildPointerType(QualType PointeeType, SourceLocation Sigil);
740 QualType RebuildBlockPointerType(QualType PointeeType, SourceLocation Sigil);
750 QualType RebuildReferenceType(QualType ReferentType,
752 SourceLocation Sigil);
759 QualType RebuildMemberPointerType(QualType PointeeType, QualType ClassType,
760 SourceLocation Sigil);
762 QualType RebuildObjCTypeParamType(
const ObjCTypeParamDecl *Decl,
763 SourceLocation ProtocolLAngleLoc,
764 ArrayRef<ObjCProtocolDecl *> Protocols,
765 ArrayRef<SourceLocation> ProtocolLocs,
766 SourceLocation ProtocolRAngleLoc);
772 QualType RebuildObjCObjectType(QualType BaseType,
774 SourceLocation TypeArgsLAngleLoc,
775 ArrayRef<TypeSourceInfo *> TypeArgs,
776 SourceLocation TypeArgsRAngleLoc,
777 SourceLocation ProtocolLAngleLoc,
778 ArrayRef<ObjCProtocolDecl *> Protocols,
779 ArrayRef<SourceLocation> ProtocolLocs,
780 SourceLocation ProtocolRAngleLoc);
786 QualType RebuildObjCObjectPointerType(QualType PointeeType,
787 SourceLocation Star);
796 QualType RebuildArrayType(QualType ElementType,
797 ArrayType::ArraySizeModifier SizeMod,
800 unsigned IndexTypeQuals,
801 SourceRange BracketsRange);
808 QualType RebuildConstantArrayType(QualType ElementType,
809 ArrayType::ArraySizeModifier SizeMod,
812 unsigned IndexTypeQuals,
813 SourceRange BracketsRange);
820 QualType RebuildIncompleteArrayType(QualType ElementType,
821 ArrayType::ArraySizeModifier SizeMod,
822 unsigned IndexTypeQuals,
823 SourceRange BracketsRange);
830 QualType RebuildVariableArrayType(QualType ElementType,
831 ArrayType::ArraySizeModifier SizeMod,
833 unsigned IndexTypeQuals,
834 SourceRange BracketsRange);
841 QualType RebuildDependentSizedArrayType(QualType ElementType,
842 ArrayType::ArraySizeModifier SizeMod,
844 unsigned IndexTypeQuals,
845 SourceRange BracketsRange);
852 QualType RebuildVectorType(QualType ElementType,
unsigned NumElements,
853 VectorType::VectorKind VecKind);
860 QualType RebuildDependentVectorType(QualType ElementType, Expr *SizeExpr,
861 SourceLocation AttributeLoc,
862 VectorType::VectorKind);
869 QualType RebuildExtVectorType(QualType ElementType,
unsigned NumElements,
870 SourceLocation AttributeLoc);
877 QualType RebuildDependentSizedExtVectorType(QualType ElementType,
879 SourceLocation AttributeLoc);
889 QualType RebuildDependentAddressSpaceType(QualType PointeeType,
891 SourceLocation AttributeLoc);
897 QualType RebuildFunctionProtoType(QualType T,
898 MutableArrayRef<QualType> ParamTypes,
899 const FunctionProtoType::ExtProtoInfo &EPI);
902 QualType RebuildFunctionNoProtoType(QualType ResultType);
906 QualType RebuildUnresolvedUsingType(SourceLocation NameLoc, Decl *D);
962 TypeConstraintConcept,
971 Template, Deduced,
false);
1017 bool AllowInjectedClassName) {
1021 SS.
Adopt(QualifierLoc);
1022 TemplateName InstName = getDerived().RebuildTemplateName(
1023 SS, TemplateKWLoc, *Name, NameLoc,
QualType(),
nullptr,
1024 AllowInjectedClassName);
1039 getDerived().RebuildTemplateSpecializationType(InstName, NameLoc, Args);
1060 bool DeducedTSTContext) {
1062 SS.
Adopt(QualifierLoc);
1074 *Id, IdLoc, DeducedTSTContext);
1077 TagTypeKind Kind = TypeWithKeyword::getTagTypeKindForKeyword(Keyword);
1082 LookupResult Result(SemaRef, Id, IdLoc, Sema::LookupTagName);
1093 case LookupResult::NotFound:
1094 case LookupResult::NotFoundInCurrentInstantiation:
1097 case LookupResult::Found:
1101 case LookupResult::FoundOverloaded:
1102 case LookupResult::FoundUnresolvedValue:
1103 llvm_unreachable(
"Tag lookup cannot find non-tags");
1105 case LookupResult::Ambiguous:
1113 LookupResult Result(SemaRef, Id, IdLoc, Sema::LookupTagName);
1116 case LookupResult::Found:
1117 case LookupResult::FoundOverloaded:
1118 case LookupResult::FoundUnresolvedValue: {
1121 SemaRef.
Diag(IdLoc, diag::err_tag_reference_non_tag) << SomeDecl
1127 SemaRef.
Diag(IdLoc, diag::err_not_tag_in_scope)
1136 SemaRef.
Diag(KeywordLoc, diag::err_use_with_wrong_tag) <<
Id;
1156 return getSema().CheckPackExpansion(Pattern, PatternRange, EllipsisLoc,
1192 bool AllowInjectedClassName);
1205 bool AllowInjectedClassName);
1216 return getSema().Context.getSubstTemplateTemplateParmPack(Param, ArgPack);
1227 return getSema().ActOnCompoundStmt(LBraceLoc, RBraceLoc, Statements,
1240 return getSema().ActOnCaseStmt(CaseLoc, LHS, EllipsisLoc, RHS,
1249 getSema().ActOnCaseStmtBody(S, Body);
1260 return getSema().ActOnDefaultStmt(DefaultLoc, ColonLoc, SubStmt,
1290 return getSema().ActOnIfStmt(IfLoc, IsConstexpr, Init, Cond, Then,
1300 return getSema().ActOnStartOfSwitchStmt(SwitchLoc, Init, Cond);
1309 return getSema().ActOnFinishSwitchStmt(SwitchLoc, Switch, Body);
1318 return getSema().ActOnWhileStmt(WhileLoc, Cond, Body);
1328 return getSema().ActOnDoStmt(DoLoc, Body, WhileLoc, LParenLoc,
1340 return getSema().ActOnForStmt(ForLoc, LParenLoc, Init, Cond,
1341 Inc, RParenLoc, Body);
1350 return getSema().ActOnGotoStmt(GotoLoc, LabelLoc, Label);
1360 return getSema().ActOnIndirectGotoStmt(GotoLoc, StarLoc, Target);
1368 return getSema().BuildReturnStmt(ReturnLoc, Result);
1378 return getSema().ActOnDeclStmt(DG, StartLoc, EndLoc);
1386 bool IsVolatile,
unsigned NumOutputs,
1392 return getSema().ActOnGCCAsmStmt(AsmLoc, IsSimple, IsVolatile, NumOutputs,
1393 NumInputs, Names, Constraints, Exprs,
1394 AsmString, Clobbers, NumLabels, RParenLoc);
1403 StringRef AsmString,
1404 unsigned NumOutputs,
unsigned NumInputs,
1409 return getSema().ActOnMSAsmStmt(AsmLoc, LBraceLoc, AsmToks, AsmString,
1410 NumOutputs, NumInputs,
1411 Constraints, Clobbers, Exprs, EndLoc);
1420 return getSema().BuildCoreturnStmt(CoreturnLoc, Result, IsImplicit);
1429 return getSema().BuildResolvedCoawaitExpr(CoawaitLoc, Result, IsImplicit);
1439 return getSema().BuildUnresolvedCoawaitExpr(CoawaitLoc, Result, Lookup);
1447 return getSema().BuildCoyieldExpr(CoyieldLoc, Result);
1451 return getSema().BuildCoroutineBodyStmt(Args);
1462 return getSema().ActOnObjCAtTryStmt(AtLoc, TryBody, CatchStmts,
1472 return getSema().BuildObjCExceptionDecl(TInfo, T,
1486 return getSema().ActOnObjCAtCatchStmt(AtLoc, RParenLoc,
1496 return getSema().ActOnObjCAtFinallyStmt(AtLoc, Body);
1505 return getSema().BuildObjCAtThrowStmt(AtLoc, Operand);
1518 return getSema().ActOnOpenMPExecutableDirective(
1519 Kind, DirName, CancelRegion, Clauses, AStmt, StartLoc, EndLoc);
1532 return getSema().ActOnOpenMPIfClause(NameModifier, Condition, StartLoc,
1533 LParenLoc, NameModifierLoc, ColonLoc,
1544 return getSema().ActOnOpenMPFinalClause(Condition, StartLoc, LParenLoc,
1556 return getSema().ActOnOpenMPNumThreadsClause(NumThreads, StartLoc,
1567 return getSema().ActOnOpenMPSafelenClause(Len, StartLoc, LParenLoc, EndLoc);
1577 return getSema().ActOnOpenMPSimdlenClause(Len, StartLoc, LParenLoc, EndLoc);
1587 return getSema().ActOnOpenMPAllocatorClause(A, StartLoc, LParenLoc, EndLoc);
1597 return getSema().ActOnOpenMPCollapseClause(Num, StartLoc, LParenLoc,
1610 return getSema().ActOnOpenMPDefaultClause(Kind, KindKwLoc,
1611 StartLoc, LParenLoc, EndLoc);
1623 return getSema().ActOnOpenMPProcBindClause(Kind, KindKwLoc,
1624 StartLoc, LParenLoc, EndLoc);
1636 return getSema().ActOnOpenMPScheduleClause(
1637 M1, M2, Kind, ChunkSize, StartLoc, LParenLoc, M1Loc, M2Loc, KindLoc,
1648 return getSema().ActOnOpenMPOrderedClause(StartLoc, EndLoc, LParenLoc, Num);
1659 return getSema().ActOnOpenMPPrivateClause(VarList, StartLoc, LParenLoc,
1671 return getSema().ActOnOpenMPFirstprivateClause(VarList, StartLoc, LParenLoc,
1686 return getSema().ActOnOpenMPLastprivateClause(
1687 VarList, LPKind, LPKindLoc, ColonLoc, StartLoc, LParenLoc, EndLoc);
1698 return getSema().ActOnOpenMPSharedClause(VarList, StartLoc, LParenLoc,
1714 return getSema().ActOnOpenMPReductionClause(
1715 VarList, StartLoc, LParenLoc, ColonLoc, EndLoc, ReductionIdScopeSpec,
1716 ReductionId, UnresolvedReductions);
1729 return getSema().ActOnOpenMPTaskReductionClause(
1730 VarList, StartLoc, LParenLoc, ColonLoc, EndLoc, ReductionIdScopeSpec,
1731 ReductionId, UnresolvedReductions);
1745 return getSema().ActOnOpenMPInReductionClause(
1746 VarList, StartLoc, LParenLoc, ColonLoc, EndLoc, ReductionIdScopeSpec,
1747 ReductionId, UnresolvedReductions);
1761 return getSema().ActOnOpenMPLinearClause(VarList, Step, StartLoc, LParenLoc,
1762 Modifier, ModifierLoc, ColonLoc,
1775 return getSema().ActOnOpenMPAlignedClause(VarList, Alignment, StartLoc,
1776 LParenLoc, ColonLoc, EndLoc);
1787 return getSema().ActOnOpenMPCopyinClause(VarList, StartLoc, LParenLoc,
1799 return getSema().ActOnOpenMPCopyprivateClause(VarList, StartLoc, LParenLoc,
1811 return getSema().ActOnOpenMPFlushClause(VarList, StartLoc, LParenLoc,
1824 return getSema().ActOnOpenMPDependClause(DepKind, DepLoc, ColonLoc, VarList,
1825 StartLoc, LParenLoc, EndLoc);
1835 return getSema().ActOnOpenMPDeviceClause(Device, StartLoc, LParenLoc,
1850 return getSema().ActOnOpenMPMapClause(MapTypeModifiers, MapTypeModifiersLoc,
1851 MapperIdScopeSpec, MapperId, MapType,
1852 IsMapTypeImplicit, MapLoc, ColonLoc,
1853 VarList, Locs, UnresolvedMappers);
1865 return getSema().ActOnOpenMPAllocateClause(Allocate, VarList, StartLoc,
1866 LParenLoc, ColonLoc, EndLoc);
1876 return getSema().ActOnOpenMPNumTeamsClause(NumTeams, StartLoc, LParenLoc,
1888 return getSema().ActOnOpenMPThreadLimitClause(ThreadLimit, StartLoc,
1899 return getSema().ActOnOpenMPPriorityClause(Priority, StartLoc, LParenLoc,
1910 return getSema().ActOnOpenMPGrainsizeClause(Grainsize, StartLoc, LParenLoc,
1921 return getSema().ActOnOpenMPNumTasksClause(NumTasks, StartLoc, LParenLoc,
1932 return getSema().ActOnOpenMPHintClause(Hint, StartLoc, LParenLoc, EndLoc);
1944 return getSema().ActOnOpenMPDistScheduleClause(
1945 Kind, ChunkSize, StartLoc, LParenLoc, KindLoc, CommaLoc, EndLoc);
1957 return getSema().ActOnOpenMPToClause(VarList, MapperIdScopeSpec, MapperId,
1958 Locs, UnresolvedMappers);
1970 return getSema().ActOnOpenMPFromClause(VarList, MapperIdScopeSpec, MapperId,
1971 Locs, UnresolvedMappers);
1980 return getSema().ActOnOpenMPUseDevicePtrClause(VarList, Locs);
1989 return getSema().ActOnOpenMPIsDevicePtrClause(VarList, Locs);
2003 return getSema().ActOnOpenMPDefaultmapClause(M, Kind, StartLoc, LParenLoc,
2004 MLoc, KindLoc, EndLoc);
2015 return getSema().ActOnOpenMPNontemporalClause(VarList, StartLoc, LParenLoc,
2025 return getSema().ActOnObjCAtSynchronizedOperand(atLoc,
object);
2034 return getSema().ActOnObjCAtSynchronizedStmt(AtLoc, Object, Body);
2043 return getSema().ActOnObjCAutoreleasePoolStmt(AtLoc, Body);
2055 StmtResult ForEachStmt = getSema().ActOnObjCForCollectionStmt(ForLoc,
2062 return getSema().FinishObjCForCollectionStmt(ForEachStmt.
get(), Body);
2074 VarDecl *Var = getSema().BuildExceptionDeclaration(
nullptr, Declarator,
2075 StartLoc, IdLoc, Id);
2077 getSema().CurContext->addDecl(Var);
2088 return Owned(
new (getSema().Context)
CXXCatchStmt(CatchLoc, ExceptionDecl,
2098 return getSema().ActOnCXXTryBlock(TryLoc, TryBlock, Handlers);
2113 if (
DeclStmt *RangeStmt = dyn_cast<DeclStmt>(Range)) {
2114 if (RangeStmt->isSingleDecl()) {
2115 if (
VarDecl *RangeVar = dyn_cast<VarDecl>(RangeStmt->getSingleDecl())) {
2116 if (RangeVar->isInvalidDecl())
2119 Expr *RangeExpr = RangeVar->getInit();
2126 diag::err_objc_for_range_init_stmt)
2129 return getSema().ActOnObjCForCollectionStmt(ForLoc, LoopVar,
2130 RangeExpr, RParenLoc);
2136 return getSema().BuildCXXForRangeStmt(ForLoc, CoawaitLoc, Init, ColonLoc,
2137 Range, Begin, End, Cond, Inc, LoopVar,
2138 RParenLoc, Sema::BFRK_Rebuild);
2150 return getSema().BuildMSDependentExistsStmt(KeywordLoc, IsIfExists,
2151 QualifierLoc, NameInfo, Nested);
2159 return getSema().FinishCXXForRangeStmt(ForRange, Body);
2164 return getSema().ActOnSEHTryBlock(IsCXXTry, TryLoc, TryBlock, Handler);
2169 return getSema().ActOnSEHExceptBlock(Loc, FilterExpr, Block);
2182 return getSema().BuildPredefinedExpr(Loc, IK);
2192 return getSema().BuildDeclarationNameExpr(SS, R, RequiresADL);
2206 SS.
Adopt(QualifierLoc);
2207 return getSema().BuildDeclarationNameExpr(SS, NameInfo, VD, Found,
2217 return getSema().ActOnParenExpr(LParen, RParen, SubExpr);
2240 return getSema().BuildUnaryOp(
nullptr, OpLoc, Opc, SubExpr);
2251 return getSema().BuildBuiltinOffsetOf(OperatorLoc, Type, Components,
2264 return getSema().CreateUnaryExprOrTypeTraitExpr(TInfo, OpLoc, ExprKind, R);
2276 = getSema().CreateUnaryExprOrTypeTraitExpr(SubExpr, OpLoc, ExprKind);
2291 return getSema().ActOnArraySubscriptExpr(
nullptr, LHS,
2304 return getSema().ActOnOMPArraySectionExpr(Base, LBracketLoc, LowerBound,
2305 ColonLoc, Length, RBracketLoc);
2315 Expr *ExecConfig =
nullptr) {
2316 return getSema().BuildCallExpr(
nullptr, Callee, LParenLoc, Args,
2317 RParenLoc, ExecConfig);
2340 "unnamed member not of record type?");
2343 getSema().PerformObjectMemberConversion(BaseResult.get(),
2346 if (BaseResult.isInvalid())
2348 Base = BaseResult.get();
2351 return getSema().BuildFieldReferenceExpr(
2352 Base, isArrow, OpLoc, EmptySS, cast<FieldDecl>(Member),
2353 DeclAccessPair::make(FoundDecl, FoundDecl->
getAccess()), MemberNameInfo);
2357 SS.
Adopt(QualifierLoc);
2359 Base = BaseResult.
get();
2367 LookupResult R(getSema(), MemberNameInfo, Sema::LookupMemberName);
2371 return getSema().BuildMemberReferenceExpr(Base, BaseType, OpLoc, isArrow,
2373 FirstQualifierInScope,
2374 R, ExplicitTemplateArgs,
2385 return getSema().BuildBinOp(
nullptr, OpLoc, Opc, LHS, RHS);
2395 return getSema().CreateOverloadedBinOp(OpLoc, Opcode, UnqualLookups, LHS,
2408 return getSema().ActOnConditionalOp(QuestionLoc, ColonLoc, Cond,
2420 return getSema().BuildCStyleCastExpr(LParenLoc, TInfo, RParenLoc,
2432 return getSema().BuildCompoundLiteralExpr(LParenLoc, TInfo, RParenLoc,
2447 return getSema().BuildMemberReferenceExpr(Base, Base->
getType(),
2500 return getSema().BuildVAArgExpr(BuiltinLoc,
2512 return getSema().ActOnParenListExpr(LParenLoc, RParenLoc, SubExprs);
2522 return getSema().ActOnAddrLabel(AmpAmpLoc, LabelLoc, Label);
2532 return getSema().ActOnStmtExpr(LParenLoc, SubStmt, RParenLoc);
2554 Expr *ControllingExpr,
2557 return getSema().CreateGenericSelectionExpr(KeyLoc, DefaultLoc, RParenLoc,
2558 ControllingExpr, Types, Exprs);
2590 case Stmt::CXXStaticCastExprClass:
2591 return getDerived().RebuildCXXStaticCastExpr(OpLoc, LAngleLoc, TInfo,
2592 RAngleLoc, LParenLoc,
2593 SubExpr, RParenLoc);
2595 case Stmt::CXXDynamicCastExprClass:
2596 return getDerived().RebuildCXXDynamicCastExpr(OpLoc, LAngleLoc, TInfo,
2597 RAngleLoc, LParenLoc,
2598 SubExpr, RParenLoc);
2600 case Stmt::CXXReinterpretCastExprClass:
2601 return getDerived().RebuildCXXReinterpretCastExpr(OpLoc, LAngleLoc, TInfo,
2602 RAngleLoc, LParenLoc,
2606 case Stmt::CXXConstCastExprClass:
2607 return getDerived().RebuildCXXConstCastExpr(OpLoc, LAngleLoc, TInfo,
2608 RAngleLoc, LParenLoc,
2609 SubExpr, RParenLoc);
2612 llvm_unreachable(
"Invalid C++ named cast");
2627 return getSema().BuildCXXNamedCast(OpLoc, tok::kw_static_cast,
2644 return getSema().BuildCXXNamedCast(OpLoc, tok::kw_dynamic_cast,
2661 return getSema().BuildCXXNamedCast(OpLoc, tok::kw_reinterpret_cast,
2678 return getSema().BuildCXXNamedCast(OpLoc, tok::kw_const_cast,
2692 bool ListInitialization) {
2693 return getSema().BuildCXXTypeConstructExpr(TInfo, LParenLoc,
2695 ListInitialization);
2705 return getSema().BuildBuiltinBitCastExpr(KWLoc, TSI, Sub, RParenLoc);
2716 return getSema().BuildCXXTypeId(TypeInfoType, TypeidLoc, Operand,
2729 return getSema().BuildCXXTypeId(TypeInfoType, TypeidLoc, Operand,
2741 return getSema().BuildCXXUuidof(TypeInfoType, TypeidLoc, Operand,
2753 return getSema().BuildCXXUuidof(TypeInfoType, TypeidLoc, Operand,
2765 return getSema().BuildCXXThisExpr(ThisLoc, ThisType, isImplicit);
2773 bool IsThrownVariableInScope) {
2774 return getSema().BuildCXXThrow(ThrowLoc, Sub, IsThrownVariableInScope);
2784 getSema().CurContext);
2795 getSema().CurContext);
2805 return getSema().BuildCXXTypeConstructExpr(
2806 TSInfo, LParenLoc, None, RParenLoc,
false);
2823 Expr *Initializer) {
2824 return getSema().BuildCXXNew(StartLoc, UseGlobal,
2841 bool IsGlobalDelete,
2844 return getSema().ActOnCXXDelete(StartLoc, IsGlobalDelete, IsArrayForm,
2856 return getSema().BuildTypeTrait(Trait, StartLoc, Args, RParenLoc);
2868 return getSema().BuildArrayTypeTrait(Trait, StartLoc, TSInfo, DimExpr, RParenLoc);
2879 return getSema().BuildExpressionTrait(Trait, StartLoc, Queried, RParenLoc);
2892 bool IsAddressOfOperand,
2895 SS.
Adopt(QualifierLoc);
2897 if (TemplateArgs || TemplateKWLoc.
isValid())
2898 return getSema().BuildQualifiedTemplateIdExpr(SS, TemplateKWLoc, NameInfo,
2901 return getSema().BuildQualifiedDeclarationNameExpr(
2902 SS, NameInfo, IsAddressOfOperand,
nullptr, RecoveryTSI);
2914 return getSema().BuildTemplateIdExpr(SS, TemplateKWLoc, R, RequiresADL,
2927 bool HadMultipleCandidates,
2928 bool ListInitialization,
2929 bool StdInitListInitialization,
2930 bool RequiresZeroInit,
2934 if (getSema().CompleteConstructorCall(Constructor, Args, Loc,
2938 return getSema().BuildCXXConstructExpr(Loc, T, Constructor,
2941 HadMultipleCandidates,
2943 StdInitListInitialization,
2944 RequiresZeroInit, ConstructKind,
2952 bool ConstructsVBase,
2953 bool InheritedFromVBase) {
2955 Loc, T, Constructor, ConstructsVBase, InheritedFromVBase);
2966 bool ListInitialization) {
2967 return getSema().BuildCXXTypeConstructExpr(
2968 TSInfo, LParenOrBraceLoc, Args, RParenOrBraceLoc, ListInitialization);
2979 bool ListInitialization) {
2980 return getSema().BuildCXXTypeConstructExpr(TSInfo, LParenLoc, Args,
2981 RParenLoc, ListInitialization);
2998 SS.
Adopt(QualifierLoc);
3001 OperatorLoc, IsArrow,
3003 FirstQualifierInScope,
3005 TemplateArgs,
nullptr);
3021 SS.
Adopt(QualifierLoc);
3024 OperatorLoc, IsArrow,
3026 FirstQualifierInScope,
3027 R, TemplateArgs,
nullptr);
3046 RParenLoc, Length, PartialArgs);
3058 return getSema().BuildSourceLocExpr(Kind, BuiltinLoc, RPLoc, ParentContext);
3071 ExprResult Result = getSema().CheckConceptTemplateId(SS, TemplateKWLoc,
3074 NamedConcept, TALI);
3090 LocalParameters, Requirements, ClosingBraceLoc);
3134 return getSema().BuildObjCBoxedExpr(SR, ValueExpr);
3142 Expr **Elements,
unsigned NumElements) {
3143 return getSema().BuildObjCArrayLiteral(Range,
3151 return getSema().BuildObjCSubscriptExpression(RB, Base, Key,
3152 getterMethod, setterMethod);
3161 return getSema().BuildObjCDictionaryLiteral(Range, Elements);
3185 Sel, Method, LBracLoc, SelectorLocs,
3200 Sel, Method, LBracLoc, SelectorLocs,
3216 Sel, Method, LBracLoc, SelectorLocs,
3221 Sel, Method, LBracLoc, SelectorLocs,
3233 bool IsArrow,
bool IsFreeIvar) {
3236 ExprResult Result = getSema().BuildMemberReferenceExpr(
3242 if (IsFreeIvar && Result.isUsable())
3243 cast<ObjCIvarRefExpr>(Result.get())->setIsFreeIvar(IsFreeIvar);
3256 return getSema().BuildMemberReferenceExpr(BaseArg, BaseArg->
getType(),
3279 PropertyLoc, Base));
3290 return getSema().BuildMemberReferenceExpr(BaseArg, BaseArg->
getType(),
3311 assert(!Lookup.
empty() &&
"No __builtin_shufflevector?");
3320 CK_BuiltinFnToFnPtr).
get();
3324 SemaRef.
Context, Callee, SubExprs, Builtin->getCallResultType(),
3325 Expr::getValueKindForType(Builtin->getReturnType()), RParenLoc);
3336 BuiltinLoc, RParenLoc);
3348 case TemplateArgument::Expression: {
3351 EllipsisLoc, NumExpansions);
3358 case TemplateArgument::Template:
3367 case TemplateArgument::Integral:
3368 case TemplateArgument::Declaration:
3369 case TemplateArgument::Pack:
3370 case TemplateArgument::TemplateExpansion:
3371 case TemplateArgument::NullPtr:
3372 llvm_unreachable(
"Pack expansion pattern has no parameter packs");
3394 return getSema().CheckPackExpansion(Pattern, EllipsisLoc, NumExpansions);
3406 return getSema().BuildCXXFoldExpr(LParenLoc, LHS, Operator, EllipsisLoc,
3407 RHS, RParenLoc, NumExpansions);
3416 return getSema().BuildEmptyCXXFoldExpr(EllipsisLoc, Operator);
3429 return getSema().BuildAtomicExpr(Range, Range, RParenLoc, SubExprs, Op,
3430 Sema::AtomicArgumentOrder::AST);
3450 bool DeducibleTSTContext);
3453 template <
typename Derived>
3459 case Stmt::NoStmtClass:
break;
3463 #define STMT(Node, Parent) \ 3464 case Stmt::Node##Class: return getDerived().Transform##Node(cast<Node>(S)); 3465 #define VALUESTMT(Node, Parent) \ 3466 case Stmt::Node##Class: \ 3467 return getDerived().Transform##Node(cast<Node>(S), SDK); 3468 #define ABSTRACT_STMT(Node) 3469 #define EXPR(Node, Parent) 3470 #include "clang/AST/StmtNodes.inc" 3473 #define STMT(Node, Parent) 3474 #define ABSTRACT_STMT(Stmt) 3475 #define EXPR(Node, Parent) case Stmt::Node##Class: 3476 #include "clang/AST/StmtNodes.inc" 3478 ExprResult E = getDerived().TransformExpr(cast<Expr>(S));
3480 if (SDK == SDK_StmtExprResult)
3481 E = getSema().ActOnStmtExprResult(E);
3482 return getSema().ActOnExprStmt(E, SDK == SDK_Discarded);
3489 template<
typename Derived>
3497 #define OPENMP_CLAUSE(Name, Class) \ 3498 case OMPC_ ## Name : \ 3499 return getDerived().Transform ## Class(cast<Class>(S)); 3500 #include "clang/Basic/OpenMPKinds.def" 3507 template<
typename Derived>
3513 case Stmt::NoStmtClass:
break;
3514 #define STMT(Node, Parent) case Stmt::Node##Class: break; 3515 #define ABSTRACT_STMT(Stmt) 3516 #define EXPR(Node, Parent) \ 3517 case Stmt::Node##Class: return getDerived().Transform##Node(cast<Node>(E)); 3518 #include "clang/AST/StmtNodes.inc" 3524 template<
typename Derived>
3532 if (
auto *FE = dyn_cast<FullExpr>(Init))
3533 Init = FE->getSubExpr();
3535 if (
auto *AIL = dyn_cast<ArrayInitLoopExpr>(Init))
3536 Init = AIL->getCommonExpr();
3539 Init = MTE->getSubExpr();
3542 Init = Binder->getSubExpr();
3545 Init = ICE->getSubExprAsWritten();
3548 dyn_cast<CXXStdInitializerListExpr>(Init))
3549 return TransformInitializer(ILE->getSubExpr(), NotCopyInit);
3555 if (!NotCopyInit && !(Construct && Construct->isListInitialization()))
3556 return getDerived().TransformExpr(Init);
3561 return getDerived().RebuildParenListExpr(Parens.
getBegin(), None,
3566 if (isa<ImplicitValueInitExpr>(Init))
3572 if (!Construct || isa<CXXTemporaryObjectExpr>(Construct))
3573 return getDerived().TransformExpr(Init);
3577 if (Construct && Construct->isStdInitListInitialization())
3578 return TransformInitializer(Construct->getArg(0), NotCopyInit);
3582 getSema(), EnterExpressionEvaluationContext::InitList,
3583 Construct->isListInitialization());
3586 bool ArgChanged =
false;
3587 if (getDerived().TransformExprs(Construct->getArgs(), Construct->getNumArgs(),
3588 true, NewArgs, &ArgChanged))
3592 if (Construct->isListInitialization())
3593 return getDerived().RebuildInitList(Construct->getBeginLoc(), NewArgs,
3594 Construct->getEndLoc());
3597 SourceRange Parens = Construct->getParenOrBraceRange();
3601 assert(NewArgs.empty() &&
3602 "no parens or braces but have direct init with arguments?");
3605 return getDerived().RebuildParenListExpr(Parens.
getBegin(), NewArgs,
3609 template<
typename Derived>
3615 for (
unsigned I = 0; I != NumInputs; ++I) {
3617 if (IsCall && getDerived().DropCallArgument(Inputs[I])) {
3625 Expr *Pattern = Expansion->getPattern();
3628 getSema().collectUnexpandedParameterPacks(Pattern, Unexpanded);
3629 assert(!Unexpanded.empty() &&
"Pack expansion without parameter packs?");
3634 bool RetainExpansion =
false;
3637 if (getDerived().TryExpandParameterPacks(Expansion->getEllipsisLoc(),
3640 Expand, RetainExpansion,
3649 ExprResult OutPattern = getDerived().TransformExpr(Pattern);
3653 ExprResult Out = getDerived().RebuildPackExpansion(OutPattern.
get(),
3654 Expansion->getEllipsisLoc(),
3661 Outputs.push_back(Out.
get());
3667 if (ArgChanged) *ArgChanged =
true;
3671 for (
unsigned I = 0; I != *NumExpansions; ++I) {
3673 ExprResult Out = getDerived().TransformExpr(Pattern);
3677 if (Out.
get()->containsUnexpandedParameterPack()) {
3678 Out = getDerived().RebuildPackExpansion(
3679 Out.
get(), Expansion->getEllipsisLoc(), OrigNumExpansions);
3684 Outputs.push_back(Out.
get());
3689 if (RetainExpansion) {
3690 ForgetPartiallySubstitutedPackRAII Forget(getDerived());
3692 ExprResult Out = getDerived().TransformExpr(Pattern);
3696 Out = getDerived().RebuildPackExpansion(
3697 Out.
get(), Expansion->getEllipsisLoc(), OrigNumExpansions);
3701 Outputs.push_back(Out.
get());
3708 IsCall ? getDerived().TransformInitializer(Inputs[I],
false)
3709 : getDerived().TransformExpr(Inputs[I]);
3713 if (Result.
get() != Inputs[I] && ArgChanged)
3716 Outputs.push_back(Result.
get());
3722 template <
typename Derived>
3726 VarDecl *ConditionVar = cast_or_null<VarDecl>(
3727 getDerived().TransformDefinition(Var->
getLocation(), Var));
3730 return Sema::ConditionError();
3732 return getSema().ActOnConditionVariable(ConditionVar, Loc, Kind);
3736 ExprResult CondExpr = getDerived().TransformExpr(Expr);
3739 return Sema::ConditionError();
3741 return getSema().ActOnCondition(
nullptr, Loc, CondExpr.
get(),
Kind);
3747 template<
typename Derived>
3756 Qualifiers.push_back(Qualifier);
3759 while (!Qualifiers.empty()) {
3767 if (SemaRef.BuildCXXNestedNameSpecifier(
nullptr, IdInfo,
false,
3768 SS, FirstQualifierInScope,
false))
3773 case NestedNameSpecifier::Namespace: {
3775 = cast_or_null<NamespaceDecl>(
3776 getDerived().TransformDecl(
3783 case NestedNameSpecifier::NamespaceAlias: {
3785 = cast_or_null<NamespaceAliasDecl>(
3793 case NestedNameSpecifier::Global:
3799 case NestedNameSpecifier::Super: {
3801 cast_or_null<CXXRecordDecl>(getDerived().TransformDecl(
3807 case NestedNameSpecifier::TypeSpecWithTemplate:
3808 case NestedNameSpecifier::TypeSpec: {
3810 FirstQualifierInScope, SS);
3816 (SemaRef.getLangOpts().CPlusPlus11 &&
3819 "Can't get cv-qualifiers here");
3822 diag::warn_cxx98_compat_enum_nested_name_spec);
3831 SemaRef.Diag(TL.
getBeginLoc(), diag::err_nested_name_spec_non_tag)
3839 FirstQualifierInScope =
nullptr;
3845 !getDerived().AlwaysRebuild())
3858 template<
typename Derived>
3868 case DeclarationName::ObjCZeroArgSelector:
3869 case DeclarationName::ObjCOneArgSelector:
3870 case DeclarationName::ObjCMultiArgSelector:
3871 case DeclarationName::CXXOperatorName:
3872 case DeclarationName::CXXLiteralOperatorName:
3873 case DeclarationName::CXXUsingDirective:
3876 case DeclarationName::CXXDeductionGuideName: {
3878 TemplateDecl *NewTemplate = cast_or_null<TemplateDecl>(
3879 getDerived().TransformDecl(NameInfo.
getLoc(), OldTemplate));
3885 SemaRef.Context.DeclarationNames.getCXXDeductionGuideName(NewTemplate));
3889 case DeclarationName::CXXConstructorName:
3890 case DeclarationName::CXXDestructorName:
3891 case DeclarationName::CXXConversionFunctionName: {
3895 NewTInfo = getDerived().TransformType(OldTInfo);
3898 NewCanTy = SemaRef.Context.getCanonicalType(NewTInfo->
getType());
3906 NewCanTy = SemaRef.Context.getCanonicalType(NewT);
3910 = SemaRef.Context.DeclarationNames.getCXXSpecialName(Name.
getNameKind(),
3919 llvm_unreachable(
"Unknown name kind.");
3922 template<
typename Derived>
3929 bool AllowInjectedClassName) {
3932 assert(Template &&
"qualified template name must refer to a template");
3935 = cast_or_null<TemplateDecl>(getDerived().TransformDecl(NameLoc,
3940 if (!getDerived().AlwaysRebuild() &&
3942 TransTemplate == Template)
3945 return getDerived().RebuildTemplateName(SS, QTN->hasTemplateKeyword(),
3953 FirstQualifierInScope =
nullptr;
3956 if (!getDerived().AlwaysRebuild() &&
3964 if (DTN->isIdentifier()) {
3965 return getDerived().RebuildTemplateName(SS,
3967 *DTN->getIdentifier(),
3970 FirstQualifierInScope,
3971 AllowInjectedClassName);
3974 return getDerived().RebuildTemplateName(SS, TemplateKWLoc,
3975 DTN->getOperator(), NameLoc,
3976 ObjectType, AllowInjectedClassName);
3981 = cast_or_null<TemplateDecl>(getDerived().TransformDecl(NameLoc,
3986 if (!getDerived().AlwaysRebuild() &&
3987 TransTemplate == Template)
3996 = cast_or_null<TemplateTemplateParmDecl>(
3997 getDerived().TransformDecl(NameLoc, SubstPack->getParameterPack()));
4001 if (!getDerived().AlwaysRebuild() &&
4002 TransParam == SubstPack->getParameterPack())
4005 return getDerived().RebuildTemplateName(TransParam,
4006 SubstPack->getArgumentPack());
4010 llvm_unreachable(
"overloaded function decl survived to here");
4013 template<
typename Derived>
4020 llvm_unreachable(
"null template argument in TreeTransform");
4025 SemaRef.Context.getTrivialTypeSourceInfo(Arg.
getAsType(), Loc));
4029 case TemplateArgument::Template:
4030 case TemplateArgument::TemplateExpansion: {
4034 Builder.
MakeTrivial(SemaRef.Context, DTN->getQualifier(), Loc);
4036 Builder.
MakeTrivial(SemaRef.Context, QTN->getQualifier(), Loc);
4038 if (Arg.
getKind() == TemplateArgument::Template)
4050 case TemplateArgument::Expression:
4054 case TemplateArgument::Declaration:
4055 case TemplateArgument::Integral:
4056 case TemplateArgument::Pack:
4057 case TemplateArgument::NullPtr:
4063 template<
typename Derived>
4070 case TemplateArgument::Integral:
4071 case TemplateArgument::Pack:
4072 case TemplateArgument::Declaration:
4073 case TemplateArgument::NullPtr:
4074 llvm_unreachable(
"Unexpected TemplateArgument");
4081 DI = getDerived().TransformType(DI);
4082 if (!DI)
return true;
4088 case TemplateArgument::Template: {
4091 QualifierLoc = getDerived().TransformNestedNameSpecifierLoc(QualifierLoc);
4097 SS.
Adopt(QualifierLoc);
4099 = getDerived().TransformTemplateName(SS, Arg.
getAsTemplate(),
4109 case TemplateArgument::TemplateExpansion:
4110 llvm_unreachable(
"Caller should expand pack expansions");
4112 case TemplateArgument::Expression: {
4116 Uneval ? Sema::ExpressionEvaluationContext::Unevaluated
4117 : Sema::ExpressionEvaluationContext::ConstantEvaluated,
4119 Sema::ExpressionEvaluationContextRecord::EK_TemplateArgument);
4124 ExprResult E = getDerived().TransformExpr(InputExpr);
4125 E = SemaRef.ActOnConstantExpression(E);
4138 template<
typename Derived,
typename InputIterator>
4146 typedef typename std::iterator_traits<InputIterator>::difference_type
4163 : Self(Self), Iter(Iter) { }
4186 return X.Iter == Y.Iter;
4191 return X.Iter != Y.Iter;
4195 template<
typename Derived>
4196 template<
typename InputIterator>
4200 for (; First != Last; ++First) {
4213 if (TransformTemplateArguments(PackLocIterator(*
this,
4215 PackLocIterator(*
this,
4229 = getSema().getTemplateArgumentPackExpansionPattern(
4230 In, Ellipsis, OrigNumExpansions);
4233 getSema().collectUnexpandedParameterPacks(Pattern, Unexpanded);
4234 assert(!Unexpanded.empty() &&
"Pack expansion without parameter packs?");
4239 bool RetainExpansion =
false;
4241 if (getDerived().TryExpandParameterPacks(Ellipsis,
4255 if (getDerived().TransformTemplateArgument(Pattern, OutPattern, Uneval))
4258 Out = getDerived().RebuildPackExpansion(OutPattern, Ellipsis,
4269 for (
unsigned I = 0; I != *NumExpansions; ++I) {
4272 if (getDerived().TransformTemplateArgument(Pattern, Out, Uneval))
4276 Out = getDerived().RebuildPackExpansion(Out, Ellipsis,
4287 if (RetainExpansion) {
4288 ForgetPartiallySubstitutedPackRAII Forget(getDerived());
4290 if (getDerived().TransformTemplateArgument(Pattern, Out, Uneval))
4293 Out = getDerived().RebuildPackExpansion(Out, Ellipsis,
4305 if (getDerived().TransformTemplateArgument(In, Out, Uneval))
4319 template<
typename Derived>
4321 if (getDerived().AlreadyTransformed(T))
4326 TypeSourceInfo *DI = getSema().Context.getTrivialTypeSourceInfo(T,
4327 getDerived().getBaseLocation());
4337 template<
typename Derived>
4341 getDerived().getBaseEntity());
4342 if (getDerived().AlreadyTransformed(DI->
getType()))
4350 QualType Result = getDerived().TransformType(TLB, TL);
4357 template<
typename Derived>
4361 #define ABSTRACT_TYPELOC(CLASS, PARENT) 4362 #define TYPELOC(CLASS, PARENT) \ 4363 case TypeLoc::CLASS: \ 4364 return getDerived().Transform##CLASS##Type(TLB, \ 4365 T.castAs<CLASS##TypeLoc>()); 4366 #include "clang/AST/TypeLocNodes.def" 4369 llvm_unreachable(
"unhandled type loc!");
4372 template<
typename Derived>
4374 if (!isa<DependentNameType>(T))
4375 return TransformType(T);
4377 if (getDerived().AlreadyTransformed(T))
4379 TypeSourceInfo *DI = getSema().Context.getTrivialTypeSourceInfo(T,
4380 getDerived().getBaseLocation());
4381 TypeSourceInfo *NewDI = getDerived().TransformTypeWithDeducedTST(DI);
4385 template<
typename Derived>
4388 if (!isa<DependentNameType>(DI->
getType()))
4389 return TransformType(DI);
4393 getDerived().getBaseEntity());
4394 if (getDerived().AlreadyTransformed(DI->
getType()))
4408 QualType Result = getDerived().TransformDependentNameType(
4410 if (Result.isNull())
4414 Result = getDerived().RebuildQualifiedType(Result, QTL);
4415 if (Result.isNull())
4423 template<
typename Derived>
4431 Result = getDerived().RebuildQualifiedType(Result, T);
4444 template <
typename Derived>
4454 SemaRef.Diag(Loc, diag::err_address_space_mismatch_templ_inst)
4463 T = SemaRef.getASTContext().getAddrSpaceQualType(T,
4477 Quals = Qualifiers::fromCVRMask(Qualifiers::Restrict);
4491 = dyn_cast<SubstTemplateTypeParmType>(T)) {
4492 QualType Replacement = SubstTypeParam->getReplacementType();
4495 Replacement = SemaRef.Context.getQualifiedType(
4497 T = SemaRef.Context.getSubstTemplateTypeParmType(
4498 SubstTypeParam->getReplacedParameter(), Replacement);
4499 }
else if ((AutoTy = dyn_cast<AutoType>(T)) && AutoTy->
isDeduced()) {
4506 T = SemaRef.Context.getAutoType(Deduced, AutoTy->
getKeyword(),
4515 SemaRef.Diag(Loc, diag::err_attr_objc_ownership_redundant) << T;
4521 return SemaRef.BuildQualifiedType(T, Loc, Quals);
4524 template<
typename Derived>
4530 if (getDerived().AlreadyTransformed(TL.
getType()))
4534 TransformTSIInObjectScope(TL, ObjectType, UnqualLookup, SS);
4540 template<
typename Derived>
4546 if (getDerived().AlreadyTransformed(TSInfo->
getType()))
4549 return TransformTSIInObjectScope(TSInfo->
getTypeLoc(), ObjectType,
4553 template <
typename Derived>
4558 assert(!getDerived().AlreadyTransformed(T));
4563 if (isa<TemplateSpecializationType>(T)) {
4567 TemplateName Template = getDerived().TransformTemplateName(
4569 ObjectType, UnqualLookup,
true);
4570 if (Template.isNull())
4573 Result = getDerived().TransformTemplateSpecializationType(TLB, SpecTL,
4575 }
else if (isa<DependentTemplateSpecializationType>(T)) {
4580 = getDerived().RebuildTemplateName(SS,
4584 ObjectType, UnqualLookup,
4586 if (Template.isNull())
4589 Result = getDerived().TransformDependentTemplateSpecializationType(TLB,
4595 Result = getDerived().TransformType(TLB, TL);
4604 template <
class TyLoc>
static inline 4606 TyLoc NewT = TLB.
push<TyLoc>(T.getType());
4607 NewT.setNameLoc(T.getNameLoc());
4611 template<
typename Derived>
4621 template<
typename Derived>
4628 template <
typename Derived>
4635 template<
typename Derived>
4639 if (OriginalType.
isNull())
4643 if (getDerived().AlwaysRebuild() ||
4645 Result = SemaRef.Context.getDecayedType(OriginalType);
4651 template<
typename Derived>
4656 if (PointeeType.
isNull())
4665 Result = SemaRef.Context.getObjCObjectPointerType(PointeeType);
4672 if (getDerived().AlwaysRebuild() ||
4674 Result = getDerived().RebuildPointerType(PointeeType, TL.
getSigilLoc());
4688 template<
typename Derived>
4694 if (PointeeType.
isNull())
4698 if (getDerived().AlwaysRebuild() ||
4700 Result = getDerived().RebuildBlockPointerType(PointeeType,
4715 template<
typename Derived>
4723 if (PointeeType.
isNull())
4727 if (getDerived().AlwaysRebuild() ||
4729 Result = getDerived().RebuildReferenceType(PointeeType,
4743 if (isa<LValueReferenceType>(Result))
4752 template<
typename Derived>
4756 return TransformReferenceType(TLB, TL);
4759 template<
typename Derived>
4763 return TransformReferenceType(TLB, TL);
4766 template<
typename Derived>
4771 if (PointeeType.
isNull())
4777 NewClsTInfo = getDerived().TransformType(OldClsTInfo);
4786 NewClsType = NewClsTInfo->
getType();
4788 NewClsType = getDerived().TransformType(OldClsType);
4789 if (NewClsType.isNull())
4794 if (getDerived().AlwaysRebuild() ||
4796 NewClsType != OldClsType) {
4797 Result = getDerived().RebuildMemberPointerType(PointeeType, NewClsType,
4813 NewTL.setClassTInfo(NewClsTInfo);
4818 template<
typename Derived>
4824 if (ElementType.
isNull())
4831 Expr *NewSize =
nullptr;
4834 SemaRef, Sema::ExpressionEvaluationContext::ConstantEvaluated);
4835 NewSize = getDerived().TransformExpr(OldSize).template getAs<Expr>();
4836 NewSize = SemaRef.ActOnConstantExpression(NewSize).get();
4840 if (getDerived().AlwaysRebuild() ||
4843 Result = getDerived().RebuildConstantArrayType(ElementType,
4864 template<
typename Derived>
4870 if (ElementType.
isNull())
4874 if (getDerived().AlwaysRebuild() ||
4876 Result = getDerived().RebuildIncompleteArrayType(ElementType,
4892 template<
typename Derived>
4898 if (ElementType.
isNull())
4904 SemaRef, Sema::ExpressionEvaluationContext::PotentiallyEvaluated);
4905 SizeResult = getDerived().TransformExpr(T->
getSizeExpr());
4910 SemaRef.ActOnFinishFullExpr(SizeResult.
get(),
false);
4914 Expr *Size = SizeResult.
get();
4917 if (getDerived().AlwaysRebuild() ||
4920 Result = getDerived().RebuildVariableArrayType(ElementType,
4939 template<
typename Derived>
4945 if (ElementType.
isNull())
4950 SemaRef, Sema::ExpressionEvaluationContext::ConstantEvaluated);
4957 = getDerived().TransformExpr(origSize);
4958 sizeResult = SemaRef.ActOnConstantExpression(sizeResult);
4962 Expr *size = sizeResult.
get();
4965 if (getDerived().AlwaysRebuild() ||
4968 Result = getDerived().RebuildDependentSizedArrayType(ElementType,
4987 template <
typename Derived>
4992 if (ElementType.
isNull())
4996 SemaRef, Sema::ExpressionEvaluationContext::ConstantEvaluated);
4999 Size = SemaRef.ActOnConstantExpression(Size);
5004 if (getDerived().AlwaysRebuild() || ElementType != T->
getElementType() ||
5006 Result = getDerived().RebuildDependentVectorType(
5013 if (isa<DependentVectorType>(Result)) {
5025 template<
typename Derived>
5033 if (ElementType.
isNull())
5038 SemaRef, Sema::ExpressionEvaluationContext::ConstantEvaluated);
5041 Size = SemaRef.ActOnConstantExpression(Size);
5046 if (getDerived().AlwaysRebuild() ||
5049 Result = getDerived().RebuildDependentSizedExtVectorType(ElementType,
5057 if (isa<DependentSizedExtVectorType>(Result)) {
5069 template <
typename Derived>
5076 if (pointeeType.
isNull())
5081 SemaRef, Sema::ExpressionEvaluationContext::ConstantEvaluated);
5084 AddrSpace = SemaRef.ActOnConstantExpression(AddrSpace);
5089 if (getDerived().AlwaysRebuild() || pointeeType != T->
getPointeeType() ||
5091 Result = getDerived().RebuildDependentAddressSpaceType(
5098 if (isa<DependentAddressSpaceType>(Result)) {
5108 Result, getDerived().getBaseLocation());
5115 template <
typename Derived>
5120 if (ElementType.
isNull())
5124 if (getDerived().AlwaysRebuild() ||
5126 Result = getDerived().RebuildVectorType(ElementType, T->
getNumElements(),
5138 template<
typename Derived>
5143 if (ElementType.
isNull())
5147 if (getDerived().AlwaysRebuild() ||
5149 Result = getDerived().RebuildExtVectorType(ElementType,
5162 template <
typename Derived>
5165 bool ExpectParameterPack) {
5169 if (NumExpansions && isa<PackExpansionType>(OldDI->
getType())) {
5179 QualType Result = getDerived().TransformType(TLB,
5184 Result = RebuildPackExpansionType(Result,
5194 NewDI = TLB.getTypeSourceInfo(SemaRef.Context, Result);
5196 NewDI = getDerived().TransformType(OldDI);
5200 if (NewDI == OldDI && indexAdjustment == 0)
5217 template <
typename Derived>
5225 int indexAdjustment = 0;
5227 unsigned NumParams = Params.size();
5228 for (
unsigned i = 0; i != NumParams; ++i) {
5230 assert(OldParm->getFunctionScopeIndex() == i);
5234 if (OldParm->isParameterPack()) {
5239 TypeLoc TL = OldParm->getTypeSourceInfo()->getTypeLoc();
5242 SemaRef.collectUnexpandedParameterPacks(Pattern, Unexpanded);
5245 bool ShouldExpand =
false;
5246 bool RetainExpansion =
false;
5248 if (Unexpanded.size() > 0) {
5250 NumExpansions = OrigNumExpansions;
5251 if (getDerived().TryExpandParameterPacks(ExpansionTL.
getEllipsisLoc(),
5252 Pattern.getSourceRange(),
5264 "Could not find parameter packs or undeduced auto type!");
5271 getDerived().ExpandingFunctionParameterPack(OldParm);
5272 for (
unsigned I = 0; I != *NumExpansions; ++I) {
5275 = getDerived().TransformFunctionTypeParam(OldParm,
5283 PInfos.
set(OutParamTypes.size(), ParamInfos[i]);
5284 OutParamTypes.push_back(NewParm->
getType());
5286 PVars->push_back(NewParm);
5291 if (RetainExpansion) {
5292 ForgetPartiallySubstitutedPackRAII Forget(getDerived());
5294 = getDerived().TransformFunctionTypeParam(OldParm,
5302 PInfos.
set(OutParamTypes.size(), ParamInfos[i]);
5303 OutParamTypes.push_back(NewParm->
getType());
5305 PVars->push_back(NewParm);
5321 NewParm = getDerived().TransformFunctionTypeParam(OldParm,
5326 "Parameter pack no longer a parameter pack after " 5329 NewParm = getDerived().TransformFunctionTypeParam(
5330 OldParm, indexAdjustment, None,
false);
5337 PInfos.
set(OutParamTypes.size(), ParamInfos[i]);
5338 OutParamTypes.push_back(NewParm->
getType());
5340 PVars->push_back(NewParm);
5347 bool IsPackExpansion =
false;
5351 = dyn_cast<PackExpansionType>(OldType)) {
5353 QualType Pattern = Expansion->getPattern();
5355 getSema().collectUnexpandedParameterPacks(Pattern, Unexpanded);
5358 bool ShouldExpand =
false;
5359 bool RetainExpansion =
false;
5360 if (getDerived().TryExpandParameterPacks(Loc,
SourceRange(),
5371 for (
unsigned I = 0; I != *NumExpansions; ++I) {
5373 QualType NewType = getDerived().TransformType(Pattern);
5379 getSema().getASTContext().getPackExpansionType(NewType, None);
5386 PInfos.
set(OutParamTypes.size(), ParamInfos[i]);
5387 OutParamTypes.push_back(NewType);
5389 PVars->push_back(
nullptr);
5398 if (RetainExpansion) {
5399 ForgetPartiallySubstitutedPackRAII Forget(getDerived());
5400 QualType NewType = getDerived().TransformType(Pattern);
5405 PInfos.
set(OutParamTypes.size(), ParamInfos[i]);
5406 OutParamTypes.push_back(NewType);
5408 PVars->push_back(
nullptr);
5413 OldType = Expansion->getPattern();
5414 IsPackExpansion =
true;
5416 NewType = getDerived().TransformType(OldType);
5418 NewType = getDerived().TransformType(OldType);
5424 if (IsPackExpansion)
5425 NewType = getSema().Context.getPackExpansionType(NewType,
5429 PInfos.
set(OutParamTypes.size(), ParamInfos[i]);
5430 OutParamTypes.push_back(NewType);
5432 PVars->push_back(
nullptr);
5437 for (
unsigned i = 0, e = PVars->size(); i != e; ++i)
5439 assert(parm->getFunctionScopeIndex() == i);
5446 template<
typename Derived>
5452 return getDerived().TransformFunctionProtoType(
5456 ExceptionStorage, Changed);
5460 template<
typename Derived>
template<
typename Fn>
5463 Qualifiers ThisTypeQuals, Fn TransformExceptionSpec) {
5480 if (getDerived().TransformFunctionTypeParams(
5484 ParamTypes, &ParamDecls, ExtParamInfos))
5496 ResultType = getDerived().TransformType(TLB, TL.
getReturnLoc());
5502 ResultType = getDerived().TransformType(TLB, TL.
getReturnLoc());
5506 if (getDerived().TransformFunctionTypeParams(
5510 ParamTypes, &ParamDecls, ExtParamInfos))
5516 bool EPIChanged =
false;
5521 if (
auto NewExtParamInfos =
5525 != llvm::makeArrayRef(NewExtParamInfos, ParamTypes.size())) {
5535 if (getDerived().AlwaysRebuild() || ResultType != T->
getReturnType() ||
5536 T->
getParamTypes() != llvm::makeArrayRef(ParamTypes) || EPIChanged) {
5537 Result = getDerived().RebuildFunctionProtoType(ResultType, ParamTypes, EPI);
5548 for (
unsigned i = 0, e = NewTL.
getNumParams(); i != e; ++i)
5554 template<
typename Derived>
5563 getSema(), Sema::ExpressionEvaluationContext::ConstantEvaluated);
5570 getSema().ActOnNoexceptSpec(Loc, NoexceptExpr.
get(), EST);
5591 SemaRef.collectUnexpandedParameterPacks(PackExpansion->getPattern(),
5593 assert(!Unexpanded.empty() &&
"Pack expansion without parameter packs?");
5598 bool Expand =
false;
5599 bool RetainExpansion =
false;
5603 if (getDerived().TryExpandParameterPacks(
5605 RetainExpansion, NumExpansions))
5613 QualType U = getDerived().TransformType(PackExpansion->getPattern());
5617 U = SemaRef.Context.getPackExpansionType(U, NumExpansions);
5618 Exceptions.push_back(U);
5624 for (
unsigned ArgIdx = 0; ArgIdx != *NumExpansions; ++ArgIdx) {
5627 QualType U = getDerived().TransformType(PackExpansion->getPattern());
5628 if (U.
isNull() || SemaRef.CheckSpecifiedExceptionType(U, Loc))
5631 Exceptions.push_back(U);
5634 QualType U = getDerived().TransformType(T);
5635 if (U.
isNull() || SemaRef.CheckSpecifiedExceptionType(U, Loc))
5640 Exceptions.push_back(U);
5650 template<
typename Derived>
5660 if (getDerived().AlwaysRebuild() || ResultType != T->
getReturnType())
5661 Result = getDerived().RebuildFunctionNoProtoType(ResultType);
5672 template<
typename Derived>
QualType 5681 if (getDerived().AlwaysRebuild() || D != T->
getDecl()) {
5682 Result = getDerived().RebuildUnresolvedUsingType(TL.
getNameLoc(), D);
5695 template<
typename Derived>
5700 = cast_or_null<TypedefNameDecl>(getDerived().TransformDecl(TL.
getNameLoc(),
5706 if (getDerived().AlwaysRebuild() ||
5708 Result = getDerived().RebuildTypedefType(Typedef);
5719 template<
typename Derived>
5724 SemaRef, Sema::ExpressionEvaluationContext::Unevaluated,
5725 Sema::ReuseLambdaContextDecl);
5731 E = SemaRef.HandleExprEvaluationContextForTypeof(E.
get());
5736 if (getDerived().AlwaysRebuild() ||
5738 Result = getDerived().RebuildTypeOfExprType(E.
get(), TL.
getTypeofLoc());
5752 template<
typename Derived>
5756 TypeSourceInfo* New_Under_TI = getDerived().TransformType(Old_Under_TI);
5761 if (getDerived().AlwaysRebuild() || New_Under_TI != Old_Under_TI) {
5762 Result = getDerived().RebuildTypeOfType(New_Under_TI->
getType());
5776 template<
typename Derived>
5783 SemaRef, Sema::ExpressionEvaluationContext::Unevaluated,
nullptr,
5784 Sema::ExpressionEvaluationContextRecord::EK_Decltype);
5790 E = getSema().ActOnDecltypeExpression(E.
get());
5795 if (getDerived().AlwaysRebuild() ||
5797 Result = getDerived().RebuildDecltypeType(E.
get(), TL.
getNameLoc());
5809 template<
typename Derived>
5818 Result = getDerived().RebuildUnaryTransformType(NewBase,
5832 template<
typename Derived>
5840 if (TemplateName.
isNull())
5845 if (!OldDeduced.
isNull()) {
5846 NewDeduced = getDerived().TransformType(OldDeduced);
5851 QualType Result = getDerived().RebuildDeducedTemplateSpecializationType(
5852 TemplateName, NewDeduced);
5863 template<
typename Derived>
5868 = cast_or_null<RecordDecl>(getDerived().TransformDecl(TL.
getNameLoc(),
5874 if (getDerived().AlwaysRebuild() ||
5876 Result = getDerived().RebuildRecordType(Record);
5887 template<
typename Derived>
5892 = cast_or_null<EnumDecl>(getDerived().TransformDecl(TL.
getNameLoc(),
5898 if (getDerived().AlwaysRebuild() ||
5900 Result = getDerived().RebuildEnumType(Enum);
5911 template<
typename Derived>
5919 QualType T = SemaRef.Context.getTypeDeclType(cast<TypeDecl>(D));
5924 template<
typename Derived>
5931 template<
typename Derived>
5942 if (Replacement.isNull())
5959 template<
typename Derived>
5966 template<
typename Derived>
5981 return getDerived().TransformTemplateSpecializationType(TLB, TL, Template);
5984 template<
typename Derived>
5992 if (getDerived().AlwaysRebuild() ||
5994 Result = getDerived().RebuildAtomicType(ValueType, TL.
getKWLoc());
6007 template <
typename Derived>
6018 Result = getDerived().RebuildPipeType(ValueType, TL.
getKWLoc(), isReadPipe);
6034 template<
typename ArgLocContainer>
6036 ArgLocContainer *Container;
6061 : Container(&Container), Index(Index) { }
6075 return Container->getArgLoc(Index);
6079 return pointer(Container->getArgLoc(Index));
6084 return X.Container == Y.Container && X.Index == Y.Index;
6093 template<
typename Derived>
6099 if (!OldDeduced.
isNull()) {
6100 NewDeduced = getDerived().TransformType(OldDeduced);
6109 NewCD = cast_or_null<ConceptDecl>(
6110 getDerived().TransformDecl(
6117 if (getDerived().TransformTemplateArguments(ArgIterator(TL, 0),
6125 = getDerived().TransformNestedNameSpecifierLoc(
6127 if (!NewNestedNameSpec)
6133 if (getDerived().AlwaysRebuild() || NewDeduced != OldDeduced ||
6136 NewArgList.reserve(NewArgList.size());
6137 for (
const auto &ArgLoc : NewTemplateArgs.
arguments())
6138 NewArgList.push_back(ArgLoc.getArgument());
6139 Result = getDerived().RebuildAutoType(NewDeduced, T->
getKeyword(), NewCD,
6153 for (
unsigned I = 0; I < TL.
getNumArgs(); ++I)
6159 template <
typename Derived>
6169 if (getDerived().TransformTemplateArguments(ArgIterator(TL, 0),
6177 getDerived().RebuildTemplateSpecializationType(Template,
6186 if (isa<DependentTemplateSpecializationType>(Result)) {
6195 for (
unsigned i = 0, e = NewTemplateArgs.
size(); i != e; ++i)
6206 for (
unsigned i = 0, e = NewTemplateArgs.
size(); i != e; ++i)
6213 template <
typename Derived>
6224 if (getDerived().TransformTemplateArguments(ArgIterator(TL, 0),
6233 = getSema().Context.getDependentTemplateSpecializationType(
6235 DTN->getQualifier(),
6236 DTN->getIdentifier(),
6247 for (
unsigned i = 0, e = NewTemplateArgs.
size(); i != e; ++i)
6253 = getDerived().RebuildTemplateSpecializationType(Template,
6265 for (
unsigned i = 0, e = NewTemplateArgs.
size(); i != e; ++i)
6272 template<
typename Derived>
6302 diag::err_tag_reference_non_tag)
6303 << TAT << Sema::NTK_TypeAliasTemplate
6304 << ElaboratedType::getTagTypeKindForKeyword(T->
getKeyword());
6305 SemaRef.Diag(TAT->getLocation(), diag::note_declared_at);
6311 if (getDerived().AlwaysRebuild() ||
6316 QualifierLoc, NamedT);
6327 template<
typename Derived>
6333 if (modifiedType.
isNull())
6338 const Attr *newAttr = oldAttr ? getDerived().TransformAttr(oldAttr) :
nullptr;
6339 if (oldAttr && !newAttr)
6345 if (getDerived().AlwaysRebuild() ||
6351 if (equivalentType.
isNull())
6359 diag::err_nullability_nonpointer)
6365 result = SemaRef.Context.getAttributedType(TL.
getAttrKind(),
6375 template<
typename Derived>
6384 if (getDerived().AlwaysRebuild() ||
6386 Result = getDerived().RebuildParenType(Inner);
6397 template <
typename Derived>
6418 template<
typename Derived>
6421 return TransformDependentNameType(TLB, TL,
false);
6424 template<
typename Derived>
6435 = getDerived().RebuildDependentNameType(T->
getKeyword(),
6445 QualType NamedT = ElabT->getNamedType();
6460 template<
typename Derived>
6473 .TransformDependentTemplateSpecializationType(TLB, TL, QualifierLoc);
6476 template<
typename Derived>
6489 if (getDerived().TransformTemplateArguments(ArgIterator(TL, 0),
6494 QualType Result = getDerived().RebuildDependentTemplateSpecializationType(
6501 if (
const ElaboratedType *ElabT = dyn_cast<ElaboratedType>(Result)) {
6502 QualType NamedT = ElabT->getNamedType();
6511 for (
unsigned I = 0, E = NewTemplateArgs.
size(); I != E; ++I)
6518 }
else if (isa<DependentTemplateSpecializationType>(Result)) {
6527 for (
unsigned I = 0, E = NewTemplateArgs.
size(); I != E; ++I)
6536 for (
unsigned I = 0, E = NewTemplateArgs.
size(); I != E; ++I)
6542 template<
typename Derived>
6551 if (getDerived().AlwaysRebuild() ||
6553 Result = getDerived().RebuildPackExpansionType(Pattern,
6566 template<
typename Derived>
6575 template<
typename Derived>
6586 if (getDerived().AlwaysRebuild() ||
6588 Result = getDerived().RebuildObjCTypeParamType(OTP,
6608 template<
typename Derived>
6629 const auto *PackExpansion = PackExpansionLoc.getType()
6632 SemaRef.collectUnexpandedParameterPacks(PackExpansion->getPattern(),
6634 assert(!Unexpanded.empty() &&
"Pack expansion without parameter packs?");
6638 TypeLoc PatternLoc = PackExpansionLoc.getPatternLoc();
6639 bool Expand =
false;
6640 bool RetainExpansion =
false;
6642 if (getDerived().TryExpandParameterPacks(
6643 PackExpansionLoc.getEllipsisLoc(), PatternLoc.getSourceRange(),
6644 Unexpanded, Expand, RetainExpansion, NumExpansions))
6654 TypeArgBuilder.
reserve(PatternLoc.getFullDataSize());
6655 QualType NewPatternType = getDerived().TransformType(TypeArgBuilder,
6657 if (NewPatternType.
isNull())
6660 QualType NewExpansionType = SemaRef.Context.getPackExpansionType(
6661 NewPatternType, NumExpansions);
6663 NewExpansionLoc.
setEllipsisLoc(PackExpansionLoc.getEllipsisLoc());
6664 NewTypeArgInfos.push_back(
6671 for (
unsigned ArgIdx = 0; ArgIdx != *NumExpansions; ++ArgIdx) {
6675 TypeArgBuilder.
reserve(PatternLoc.getFullDataSize());
6677 QualType NewTypeArg = getDerived().TransformType(TypeArgBuilder,
6682 NewTypeArgInfos.push_back(
6691 QualType NewTypeArg = getDerived().TransformType(TypeArgBuilder, TypeArgLoc);
6696 if (NewTypeArg == TypeArg) {
6697 NewTypeArgInfos.push_back(TypeArgInfo);
6701 NewTypeArgInfos.push_back(
6707 if (getDerived().AlwaysRebuild() || AnyChanged) {
6709 Result = getDerived().RebuildObjCObjectType(
6732 template<
typename Derived>
6737 if (PointeeType.
isNull())
6741 if (getDerived().AlwaysRebuild() ||
6743 Result = getDerived().RebuildObjCObjectPointerType(PointeeType,
6757 template<
typename Derived>
6763 template<
typename Derived>
6769 template<
typename Derived>
6776 bool SubStmtInvalid =
false;
6777 bool SubStmtChanged =
false;
6779 for (
auto *B : S->
body()) {
6780 StmtResult Result = getDerived().TransformStmt(
6781 B, IsStmtExpr && B == ExprResult ? SDK_StmtExprResult : SDK_Discarded);
6786 if (isa<DeclStmt>(B))
6790 SubStmtInvalid =
true;
6794 SubStmtChanged = SubStmtChanged || Result.
get() != B;
6795 Statements.push_back(Result.
getAs<
Stmt>());
6801 if (!getDerived().AlwaysRebuild() &&
6805 return getDerived().RebuildCompoundStmt(S->
getLBracLoc(),
6811 template<
typename Derived>
6817 SemaRef, Sema::ExpressionEvaluationContext::ConstantEvaluated);
6820 LHS = getDerived().TransformExpr(S->
getLHS());
6821 LHS = SemaRef.ActOnCaseExpr(S->
getCaseLoc(), LHS);
6826 RHS = getDerived().TransformExpr(S->
getRHS());
6827 RHS = SemaRef.ActOnCaseExpr(S->
getCaseLoc(), RHS);
6850 return getDerived().RebuildCaseStmtBody(Case.
get(), SubStmt.
get());
6853 template <
typename Derived>
6866 template<
typename Derived>
6885 return getDerived().RebuildLabelStmt(S->
getIdentLoc(),
6890 template <
typename Derived>
6898 #define PRAGMA_SPELLING_ATTR(X) \ 6900 return getDerived().Transform##X##Attr(cast<X##Attr>(R)); 6901 #include "clang/Basic/AttrList.inc" 6907 template <
typename Derived>
6911 bool AttrsChanged =
false;
6915 for (
const auto *I : S->
getAttrs()) {
6916 const Attr *R = getDerived().TransformAttr(I);
6917 AttrsChanged |= (I != R);
6928 return getDerived().RebuildAttributedStmt(S->
getAttrLoc(), Attrs,
6932 template<
typename Derived>
6943 S->
isConstexpr() ? Sema::ConditionKind::ConstexprIf
6944 : Sema::ConditionKind::Boolean);
6955 if (!ConstexprConditionValue || *ConstexprConditionValue) {
6956 Then = getDerived().TransformStmt(S->
getThen());
6965 if (!ConstexprConditionValue || !*ConstexprConditionValue) {
6966 Else = getDerived().TransformStmt(S->
getElse());
6971 if (!getDerived().AlwaysRebuild() &&
6983 template<
typename Derived>
6994 Sema::ConditionKind::Switch);
7000 = getDerived().RebuildSwitchStmtStart(S->
getSwitchLoc(), Init.
get(), Cond);
7010 return getDerived().RebuildSwitchStmtBody(S->
getSwitchLoc(), Switch.
get(),
7014 template<
typename Derived>
7020 Sema::ConditionKind::Boolean);
7029 if (!getDerived().AlwaysRebuild() &&
7034 return getDerived().RebuildWhileStmt(S->
getWhileLoc(), Cond, Body.
get());
7037 template<
typename Derived>
7050 if (!getDerived().AlwaysRebuild() &&
7060 template<
typename Derived>
7063 if (getSema().getLangOpts().OpenMP)
7064 getSema().startOpenMPLoop();
7073 if (getSema().getLangOpts().OpenMP && Init.
isUsable())
7074 getSema().ActOnOpenMPLoopInitialization(S->
getForLoc(), Init.
get());
7079 Sema::ConditionKind::Boolean);
7097 if (!getDerived().AlwaysRebuild() &&
7105 Init.
get(), Cond, FullInc,
7109 template<
typename Derived>
7119 cast<LabelDecl>(LD));
7122 template<
typename Derived>
7128 Target = SemaRef.MaybeCreateExprWithCleanups(Target.
get());
7130 if (!getDerived().AlwaysRebuild() &&
7138 template<
typename Derived>
7144 template<
typename Derived>
7150 template<
typename Derived>
7160 return getDerived().RebuildReturnStmt(S->
getReturnLoc(), Result.
get());
7163 template<
typename Derived>
7166 bool DeclChanged =
false;
7168 for (
auto *D : S->
decls()) {
7169 Decl *Transformed = getDerived().TransformDefinition(D->getLocation(), D);
7173 if (Transformed != D)
7176 Decls.push_back(Transformed);
7179 if (!getDerived().AlwaysRebuild() && !DeclChanged)
7185 template<
typename Derived>
7196 bool ExprsChanged =
false;
7207 ExprResult Result = getDerived().TransformExpr(OutputExpr);
7211 ExprsChanged |= Result.
get() != OutputExpr;
7213 Exprs.push_back(Result.
get());
7217 for (
unsigned I = 0, E = S->
getNumInputs(); I != E; ++I) {
7225 ExprResult Result = getDerived().TransformExpr(InputExpr);
7229 ExprsChanged |= Result.
get() != InputExpr;
7231 Exprs.push_back(Result.
get());
7235 for (
unsigned I = 0, E = S->
getNumLabels(); I != E; ++I) {
7242 Exprs.push_back(Result.
get());
7244 if (!getDerived().AlwaysRebuild() && !ExprsChanged)
7256 Constraints, Exprs, AsmString.
get(),
7261 template<
typename Derived>
7267 bool HadError =
false, HadChange =
false;
7271 TransformedExprs.reserve(SrcExprs.size());
7272 for (
unsigned i = 0, e = SrcExprs.size(); i != e; ++i) {
7273 ExprResult Result = getDerived().TransformExpr(SrcExprs[i]);
7277 HadChange |= (Result.
get() != SrcExprs[i]);
7278 TransformedExprs.push_back(Result.
get());
7283 if (!HadChange && !getDerived().AlwaysRebuild())
7295 template<
typename Derived>
7298 auto *ScopeInfo = SemaRef.getCurFunction();
7299 auto *FD = cast<FunctionDecl>(SemaRef.CurContext);
7300 assert(FD && ScopeInfo && !ScopeInfo->CoroutinePromise &&
7301 ScopeInfo->NeedsCoroutineSuspends &&
7302 ScopeInfo->CoroutineSuspends.first ==
nullptr &&
7303 ScopeInfo->CoroutineSuspends.second ==
nullptr &&
7304 "expected clean scope info");
7308 ScopeInfo->setNeedsCoroutineSuspends(
false);
7316 if (!SemaRef.buildCoroutineParameterMoves(FD->getLocation()))
7318 auto *Promise = SemaRef.buildCoroutinePromise(FD->getLocation());
7321 getDerived().transformedLocalDecl(S->
getPromiseDecl(), {Promise});
7322 ScopeInfo->CoroutinePromise = Promise;
7334 ScopeInfo->setCoroutineSuspends(InitSuspend.
get(), FinalSuspend.
get());
7335 assert(isa<Expr>(InitSuspend.
get()) && isa<Expr>(FinalSuspend.
get()));
7342 if (Builder.isInvalid())
7346 assert(ReturnObject &&
"the return object is expected to be valid");
7347 ExprResult Res = getDerived().TransformInitializer(ReturnObject,
7351 Builder.ReturnValue = Res.
get();
7359 if (!Promise->getType()->isDependentType()) {
7362 "these nodes should not have been built yet");
7363 if (!Builder.buildDependentStatements())
7368 StmtResult Res = getDerived().TransformStmt(OnFallthrough);
7371 Builder.OnFallthrough = Res.
get();
7375 StmtResult Res = getDerived().TransformStmt(OnException);
7378 Builder.OnException = Res.
get();
7382 StmtResult Res = getDerived().TransformStmt(OnAllocFailure);
7385 Builder.ReturnStmtOnAllocFailure = Res.
get();
7390 "allocation and deallocation calls must already be built");
7392 if (AllocRes.isInvalid())
7394 Builder.Allocate = AllocRes.get();
7399 Builder.Deallocate = DeallocRes.
get();
7401 assert(S->
getResultDecl() &&
"ResultDecl must already be built");
7403 if (ResultDecl.isInvalid())
7405 Builder.ResultDecl = ResultDecl.get();
7411 Builder.ReturnStmt = Res.
get();
7415 return getDerived().RebuildCoroutineBodyStmt(Builder);
7418 template<
typename Derived>
7432 template<
typename Derived>
7446 template <
typename Derived>
7462 return getDerived().RebuildDependentCoawaitExpr(
7464 cast<UnresolvedLookupExpr>(LookupResult.
get()));
7467 template<
typename Derived>
7482 template<
typename Derived>
7491 bool AnyCatchChanged =
false;
7498 AnyCatchChanged =
true;
7499 CatchStmts.push_back(Catch.
get());
7511 if (!getDerived().AlwaysRebuild() &&
7518 return getDerived().RebuildObjCAtTryStmt(S->
getAtTryLoc(), TryBody.
get(),
7519 CatchStmts, Finally.
get());
7522 template<
typename Derived>
7529 if (FromVar->getTypeSourceInfo()) {
7530 TSInfo = getDerived().TransformType(FromVar->getTypeSourceInfo());
7539 T = getDerived().TransformType(FromVar->getType());
7544 Var = getDerived().RebuildObjCExceptionDecl(FromVar, TSInfo, T);
7553 return getDerived().RebuildObjCAtCatchStmt(S->
getAtCatchLoc(),
7558 template<
typename Derived>
7567 if (!getDerived().AlwaysRebuild() &&
7576 template<
typename Derived>
7581 Operand = getDerived().TransformExpr(S->
getThrowExpr());
7586 if (!getDerived().AlwaysRebuild() &&
7590 return getDerived().RebuildObjCAtThrowStmt(S->
getThrowLoc(), Operand.
get());
7593 template<
typename Derived>
7613 if (!getDerived().AlwaysRebuild() &&
7620 Object.
get(), Body.
get());
7623 template<
typename Derived>
7633 if (!getDerived().AlwaysRebuild() &&
7638 return getDerived().RebuildObjCAutoreleasePoolStmt(
7642 template<
typename Derived>
7648 getDerived().TransformStmt(S->
getElement(), SDK_NotDiscarded);
7663 if (!getDerived().AlwaysRebuild() &&
7670 return getDerived().RebuildObjCForCollectionStmt(S->
getForLoc(),
7677 template <
typename Derived>
7683 getDerived().TransformType(ExceptionDecl->getTypeSourceInfo());
7687 Var = getDerived().RebuildExceptionDecl(
7688 ExceptionDecl, T, ExceptionDecl->getInnerLocStart(),
7689 ExceptionDecl->getLocation(), ExceptionDecl->getIdentifier());
7699 if (!getDerived().AlwaysRebuild() && !Var &&
7703 return getDerived().RebuildCXXCatchStmt(S->
getCatchLoc(), Var, Handler.
get());
7706 template <
typename Derived>
7714 bool HandlerChanged =
false;
7721 HandlerChanged = HandlerChanged || Handler.
get() != S->
getHandler(I);
7722 Handlers.push_back(Handler.
getAs<
Stmt>());
7725 if (!getDerived().AlwaysRebuild() && TryBlock.
get() == S->
getTryBlock() &&
7729 return getDerived().RebuildCXXTryStmt(S->
getTryLoc(), TryBlock.
get(),
7733 template<
typename Derived>
7756 Cond = SemaRef.CheckBooleanCondition(S->
getColonLoc(), Cond.
get());
7760 Cond = SemaRef.MaybeCreateExprWithCleanups(Cond.
get());
7766 Inc = SemaRef.MaybeCreateExprWithCleanups(Inc.
get());
7773 if (getDerived().AlwaysRebuild() ||
7781 NewStmt = getDerived().RebuildCXXForRangeStmt(S->
getForLoc(),
7786 Inc.
get(), LoopVar.
get(),
7799 NewStmt = getDerived().RebuildCXXForRangeStmt(S->
getForLoc(),
7804 Inc.
get(), LoopVar.
get(),
7810 if (NewStmt.
get() == S)
7813 return FinishCXXForRangeStmt(NewStmt.
get(), Body.
get());
7816 template<
typename Derived>
7832 NameInfo = getDerived().TransformDeclarationNameInfo(NameInfo);
7838 if (!getDerived().AlwaysRebuild() &&
7845 SS.
Adopt(QualifierLoc);
7846 bool Dependent =
false;
7847 switch (getSema().CheckMicrosoftIfExistsSymbol(
nullptr, SS, NameInfo)) {
7848 case Sema::IER_Exists:
7854 case Sema::IER_DoesNotExist:
7860 case Sema::IER_Dependent:
7864 case Sema::IER_Error:
7878 return getDerived().RebuildMSDependentExistsStmt(S->
getKeywordLoc(),
7885 template<
typename Derived>
7905 return new (SemaRef.getASTContext())
7907 SemaRef.getASTContext().PseudoObjectTy,
VK_LValue,
7911 template <
typename Derived>
7915 if (BaseRes.isInvalid())
7917 auto IdxRes = getDerived().TransformExpr(E->
getIdx());
7918 if (IdxRes.isInvalid())
7921 if (!getDerived().AlwaysRebuild() &&
7922 BaseRes.get() == E->
getBase() &&
7923 IdxRes.get() == E->
getIdx())
7926 return getDerived().RebuildArraySubscriptExpr(
7930 template <
typename Derived>
7940 if (!getDerived().AlwaysRebuild() && TryBlock.
get() == S->
getTryBlock() &&
7945 TryBlock.
get(), Handler.
get());
7948 template <
typename Derived>
7954 return getDerived().RebuildSEHFinallyStmt(S->
getFinallyLoc(), Block.
get());
7957 template <
typename Derived>
7967 return getDerived().RebuildSEHExceptStmt(S->
getExceptLoc(), FilterExpr.
get(),
7971 template <
typename Derived>
7973 if (isa<SEHFinallyStmt>(Handler))
7974 return getDerived().TransformSEHFinallyStmt(cast<SEHFinallyStmt>(Handler));
7976 return getDerived().TransformSEHExceptStmt(cast<SEHExceptStmt>(Handler));
7979 template<
typename Derived>
7988 template <
typename Derived>
7995 TClauses.reserve(Clauses.size());
7999 getDerived().getSema().StartOpenMPClause((*I)->getClauseKind());
8000 OMPClause *Clause = getDerived().TransformOMPClause(*I);
8001 getDerived().getSema().EndOpenMPClause();
8003 TClauses.push_back(Clause);
8005 TClauses.push_back(
nullptr);
8016 Body = getDerived().TransformStmt(CS);
8019 getDerived().getSema().ActOnOpenMPRegionEnd(Body, TClauses);
8024 if (TClauses.size() != Clauses.size()) {
8031 DirName = cast<OMPCriticalDirective>(D)->getDirectiveName();
8032 DirName = getDerived().TransformDeclarationNameInfo(DirName);
8036 CancelRegion = cast<OMPCancellationPointDirective>(D)->getCancelRegion();
8038 CancelRegion = cast<OMPCancelDirective>(D)->getCancelRegion();
8041 return getDerived().RebuildOMPExecutableDirective(
8046 template <
typename Derived>
8050 getDerived().getSema().StartOpenMPDSABlock(OMPD_parallel, DirName,
nullptr,
8052 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8053 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8057 template <
typename Derived>
8061 getDerived().getSema().StartOpenMPDSABlock(OMPD_simd, DirName,
nullptr,
8063 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8064 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8068 template <
typename Derived>
8072 getDerived().getSema().StartOpenMPDSABlock(OMPD_for, DirName,
nullptr,
8074 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8075 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8079 template <
typename Derived>
8083 getDerived().getSema().StartOpenMPDSABlock(OMPD_for_simd, DirName,
nullptr,
8085 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8086 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8090 template <
typename Derived>
8094 getDerived().getSema().StartOpenMPDSABlock(OMPD_sections, DirName,
nullptr,
8096 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8097 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8101 template <
typename Derived>
8105 getDerived().getSema().StartOpenMPDSABlock(OMPD_section, DirName,
nullptr,
8107 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8108 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8112 template <
typename Derived>
8116 getDerived().getSema().StartOpenMPDSABlock(OMPD_single, DirName,
nullptr,
8118 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8119 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8123 template <
typename Derived>
8127 getDerived().getSema().StartOpenMPDSABlock(OMPD_master, DirName,
nullptr,
8129 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8130 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8134 template <
typename Derived>
8139 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8140 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8144 template <
typename Derived>
8148 getDerived().getSema().StartOpenMPDSABlock(OMPD_parallel_for, DirName,
8150 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8151 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8155 template <
typename Derived>
8159 getDerived().getSema().StartOpenMPDSABlock(OMPD_parallel_for_simd, DirName,
8161 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8162 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8166 template <
typename Derived>
8170 getDerived().getSema().StartOpenMPDSABlock(OMPD_parallel_master, DirName,
8172 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8173 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8177 template <
typename Derived>
8181 getDerived().getSema().StartOpenMPDSABlock(OMPD_parallel_sections, DirName,
8183 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8184 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8188 template <
typename Derived>
8192 getDerived().getSema().StartOpenMPDSABlock(OMPD_task, DirName,
nullptr,
8194 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8195 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8199 template <
typename Derived>
8203 getDerived().getSema().StartOpenMPDSABlock(OMPD_taskyield, DirName,
nullptr,
8205 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8206 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8210 template <
typename Derived>
8214 getDerived().getSema().StartOpenMPDSABlock(OMPD_barrier, DirName,
nullptr,
8216 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8217 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8221 template <
typename Derived>
8225 getDerived().getSema().StartOpenMPDSABlock(OMPD_taskwait, DirName,
nullptr,
8227 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8228 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8232 template <
typename Derived>
8236 getDerived().getSema().StartOpenMPDSABlock(OMPD_taskgroup, DirName,
nullptr,
8238 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8239 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8243 template <
typename Derived>
8247 getDerived().getSema().StartOpenMPDSABlock(OMPD_flush, DirName,
nullptr,
8249 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8250 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8254 template <
typename Derived>
8258 getDerived().getSema().StartOpenMPDSABlock(OMPD_ordered, DirName,
nullptr,
8260 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8261 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8265 template <
typename Derived>
8269 getDerived().getSema().StartOpenMPDSABlock(OMPD_atomic, DirName,
nullptr,
8271 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8272 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8276 template <
typename Derived>
8280 getDerived().getSema().StartOpenMPDSABlock(OMPD_target, DirName,
nullptr,
8282 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8283 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8287 template <
typename Derived>
8291 getDerived().getSema().StartOpenMPDSABlock(OMPD_target_data, DirName,
nullptr,
8293 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8294 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8298 template <
typename Derived>
8302 getDerived().getSema().StartOpenMPDSABlock(OMPD_target_enter_data, DirName,
8304 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8305 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8309 template <
typename Derived>
8313 getDerived().getSema().StartOpenMPDSABlock(OMPD_target_exit_data, DirName,
8315 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8316 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8320 template <
typename Derived>
8324 getDerived().getSema().StartOpenMPDSABlock(OMPD_target_parallel, DirName,
8326 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8327 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8331 template <
typename Derived>
8335 getDerived().getSema().StartOpenMPDSABlock(OMPD_target_parallel_for, DirName,
8337 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8338 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8342 template <
typename Derived>
8346 getDerived().getSema().StartOpenMPDSABlock(OMPD_target_update, DirName,
8348 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8349 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8353 template <
typename Derived>
8357 getDerived().getSema().StartOpenMPDSABlock(OMPD_teams, DirName,
nullptr,
8359 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8360 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8364 template <
typename Derived>
8368 getDerived().getSema().StartOpenMPDSABlock(OMPD_cancellation_point, DirName,
8370 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8371 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8375 template <
typename Derived>
8379 getDerived().getSema().StartOpenMPDSABlock(OMPD_cancel, DirName,
nullptr,
8381 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8382 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8386 template <
typename Derived>
8390 getDerived().getSema().StartOpenMPDSABlock(OMPD_taskloop, DirName,
nullptr,
8392 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8393 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8397 template <
typename Derived>
8401 getDerived().getSema().StartOpenMPDSABlock(OMPD_taskloop_simd, DirName,
8403 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8404 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8408 template <
typename Derived>
8412 getDerived().getSema().StartOpenMPDSABlock(OMPD_master_taskloop, DirName,
8414 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8415 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8419 template <
typename Derived>
8423 getDerived().getSema().StartOpenMPDSABlock(OMPD_master_taskloop_simd, DirName,
8425 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8426 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8430 template <
typename Derived>
8434 getDerived().getSema().StartOpenMPDSABlock(
8435 OMPD_parallel_master_taskloop, DirName,
nullptr, D->
getBeginLoc());
8436 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8437 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8441 template <
typename Derived>
8446 getDerived().getSema().StartOpenMPDSABlock(
8447 OMPD_parallel_master_taskloop_simd, DirName,
nullptr, D->
getBeginLoc());
8448 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8449 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8453 template <
typename Derived>
8457 getDerived().getSema().StartOpenMPDSABlock(OMPD_distribute, DirName,
nullptr,
8459 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8460 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8464 template <
typename Derived>
8468 getDerived().getSema().StartOpenMPDSABlock(
8469 OMPD_distribute_parallel_for, DirName,
nullptr, D->
getBeginLoc());
8470 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8471 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8475 template <
typename Derived>
8480 getDerived().getSema().StartOpenMPDSABlock(
8481 OMPD_distribute_parallel_for_simd, DirName,
nullptr, D->
getBeginLoc());
8482 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8483 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8487 template <
typename Derived>
8491 getDerived().getSema().StartOpenMPDSABlock(OMPD_distribute_simd, DirName,
8493 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8494 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8498 template <
typename Derived>
8502 getDerived().getSema().StartOpenMPDSABlock(
8503 OMPD_target_parallel_for_simd, DirName,
nullptr, D->
getBeginLoc());
8504 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8505 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8509 template <
typename Derived>
8513 getDerived().getSema().StartOpenMPDSABlock(OMPD_target_simd, DirName,
nullptr,
8515 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8516 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8520 template <
typename Derived>
8524 getDerived().getSema().StartOpenMPDSABlock(OMPD_teams_distribute, DirName,
8526 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8527 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8531 template <
typename Derived>
8535 getDerived().getSema().StartOpenMPDSABlock(
8536 OMPD_teams_distribute_simd, DirName,
nullptr, D->
getBeginLoc());
8537 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8538 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8542 template <
typename Derived>
8546 getDerived().getSema().StartOpenMPDSABlock(
8547 OMPD_teams_distribute_parallel_for_simd, DirName,
nullptr,
8549 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8550 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8554 template <
typename Derived>
8558 getDerived().getSema().StartOpenMPDSABlock(
8559 OMPD_teams_distribute_parallel_for, DirName,
nullptr, D->
getBeginLoc());
8560 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8561 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8565 template <
typename Derived>
8569 getDerived().getSema().StartOpenMPDSABlock(OMPD_target_teams, DirName,
8571 auto Res = getDerived().TransformOMPExecutableDirective(D);
8572 getDerived().getSema().EndOpenMPDSABlock(Res.get());
8576 template <
typename Derived>
8580 getDerived().getSema().StartOpenMPDSABlock(
8581 OMPD_target_teams_distribute, DirName,
nullptr, D->
getBeginLoc());
8582 auto Res = getDerived().TransformOMPExecutableDirective(D);
8583 getDerived().getSema().EndOpenMPDSABlock(Res.get());
8587 template <
typename Derived>
8592 getDerived().getSema().StartOpenMPDSABlock(
8593 OMPD_target_teams_distribute_parallel_for, DirName,
nullptr,
8595 auto Res = getDerived().TransformOMPExecutableDirective(D);
8596 getDerived().getSema().EndOpenMPDSABlock(Res.get());
8600 template <
typename Derived>
8605 getDerived().getSema().StartOpenMPDSABlock(
8606 OMPD_target_teams_distribute_parallel_for_simd, DirName,
nullptr,
8608 auto Res = getDerived().TransformOMPExecutableDirective(D);
8609 getDerived().getSema().EndOpenMPDSABlock(Res.get());
8613 template <
typename Derived>
8618 getDerived().getSema().StartOpenMPDSABlock(
8619 OMPD_target_teams_distribute_simd, DirName,
nullptr, D->
getBeginLoc());
8620 auto Res = getDerived().TransformOMPExecutableDirective(D);
8621 getDerived().getSema().EndOpenMPDSABlock(Res.get());
8629 template <
typename Derived>
8634 return getDerived().RebuildOMPIfClause(
8639 template <
typename Derived>
8644 return getDerived().RebuildOMPFinalClause(Cond.
get(), C->
getBeginLoc(),
8648 template <
typename Derived>
8654 return getDerived().RebuildOMPNumThreadsClause(
8658 template <
typename Derived>
8664 return getDerived().RebuildOMPSafelenClause(
8668 template <
typename Derived>
8674 return getDerived().RebuildOMPAllocatorClause(
8678 template <
typename Derived>
8684 return getDerived().RebuildOMPSimdlenClause(
8688 template <
typename Derived>
8694 return getDerived().RebuildOMPCollapseClause(
8698 template <
typename Derived>
8706 template <
typename Derived>
8714 template <
typename Derived>
8720 return getDerived().RebuildOMPScheduleClause(
8727 template <
typename Derived>
8732 E = getDerived().TransformExpr(Num);
8740 template <
typename Derived>
8747 template <
typename Derived>
8754 template <
typename Derived>
8761 template <
typename Derived>
8767 template <
typename Derived>
8773 template <
typename Derived>
8780 template <
typename Derived>
8787 template <
typename Derived>
8794 template <
typename Derived>
8801 template <
typename Derived>
8807 template <
typename Derived>
8814 template <
typename Derived>
8817 llvm_unreachable(
"unified_address clause cannot appear in dependent context");
8820 template <
typename Derived>
8824 "unified_shared_memory clause cannot appear in dependent context");
8827 template <
typename Derived>
8830 llvm_unreachable(
"reverse_offload clause cannot appear in dependent context");
8833 template <
typename Derived>
8837 "dynamic_allocators clause cannot appear in dependent context");
8840 template <
typename Derived>
8844 "atomic_default_mem_order clause cannot appear in dependent context");
8847 template <
typename Derived>
8853 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8856 Vars.push_back(EVar.
get());
8858 return getDerived().RebuildOMPPrivateClause(
8862 template <
typename Derived>
8868 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8871 Vars.push_back(EVar.
get());
8873 return getDerived().RebuildOMPFirstprivateClause(
8877 template <
typename Derived>
8883 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8886 Vars.push_back(EVar.
get());
8888 return getDerived().RebuildOMPLastprivateClause(
8893 template <
typename Derived>
8899 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8902 Vars.push_back(EVar.
get());
8904 return getDerived().RebuildOMPSharedClause(Vars, C->
getBeginLoc(),
8908 template <
typename Derived>
8914 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8917 Vars.push_back(EVar.
get());
8924 NameInfo = getDerived().TransformDeclarationNameInfo(NameInfo);
8934 auto *ULE = cast<UnresolvedLookupExpr>(E);
8936 for (
auto *D : ULE->decls()) {
8938 cast<NamedDecl>(getDerived().TransformDecl(E->
getExprLoc(), D));
8939 Decls.addDecl(InstD, InstD->
getAccess());
8941 UnresolvedReductions.push_back(
8943 SemaRef.Context,
nullptr,
8945 NameInfo,
true, ULE->isOverloaded(),
8946 Decls.begin(), Decls.end()));
8948 UnresolvedReductions.push_back(
nullptr);
8950 return getDerived().RebuildOMPReductionClause(
8952 C->
getEndLoc(), ReductionIdScopeSpec, NameInfo, UnresolvedReductions);
8955 template <
typename Derived>
8961 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8964 Vars.push_back(EVar.
get());
8971 NameInfo = getDerived().TransformDeclarationNameInfo(NameInfo);
8981 auto *ULE = cast<UnresolvedLookupExpr>(E);
8983 for (
auto *D : ULE->decls()) {
8985 cast<NamedDecl>(getDerived().TransformDecl(E->
getExprLoc(), D));
8986 Decls.addDecl(InstD, InstD->
getAccess());
8989 SemaRef.Context,
nullptr,
8991 true, ULE->isOverloaded(), Decls.begin(), Decls.end()));
8993 UnresolvedReductions.push_back(
nullptr);
8995 return getDerived().RebuildOMPTaskReductionClause(
8997 C->
getEndLoc(), ReductionIdScopeSpec, NameInfo, UnresolvedReductions);
9000 template <
typename Derived>
9006 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
9009 Vars.push_back(EVar.
get());
9016 NameInfo = getDerived().TransformDeclarationNameInfo(NameInfo);
9026 auto *ULE = cast<UnresolvedLookupExpr>(E);
9028 for (
auto *D : ULE->decls()) {
9030 cast<NamedDecl>(getDerived().TransformDecl(E->
getExprLoc(), D));
9031 Decls.addDecl(InstD, InstD->
getAccess());
9034 SemaRef.Context,
nullptr,
9036 true, ULE->isOverloaded(), Decls.begin(), Decls.end()));
9038 UnresolvedReductions.push_back(
nullptr);
9040 return getDerived().RebuildOMPInReductionClause(
9042 C->
getEndLoc(), ReductionIdScopeSpec, NameInfo, UnresolvedReductions);
9045 template <
typename Derived>
9051 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
9054 Vars.push_back(EVar.
get());
9059 return getDerived().RebuildOMPLinearClause(
9061 C->getModifierLoc(), C->getColonLoc(), C->
getEndLoc());
9064 template <
typename Derived>
9068 Vars.reserve(C->varlist_size());
9069 for (
auto *VE : C->varlists()) {
9070 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
9073 Vars.push_back(EVar.
get());
9078 return getDerived().RebuildOMPAlignedClause(
9079 Vars, Alignment.
get(), C->getBeginLoc(), C->getLParenLoc(),
9083 template <
typename Derived>
9087 Vars.reserve(C->varlist_size());
9088 for (
auto *VE : C->varlists()) {
9089 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
9092 Vars.push_back(EVar.
get());
9094 return getDerived().RebuildOMPCopyinClause(Vars, C->getBeginLoc(),
9095 C->getLParenLoc(), C->getEndLoc());
9098 template <
typename Derived>
9102 Vars.reserve(C->varlist_size());
9103 for (
auto *VE : C->varlists()) {
9104 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
9107 Vars.push_back(EVar.
get());
9109 return getDerived().RebuildOMPCopyprivateClause(
9110 Vars, C->getBeginLoc(), C->getLParenLoc(), C->getEndLoc());
9113 template <
typename Derived>
9116 Vars.reserve(C->varlist_size());
9117 for (
auto *VE : C->varlists()) {
9118 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
9121 Vars.push_back(EVar.
get());
9123 return getDerived().RebuildOMPFlushClause(Vars, C->getBeginLoc(),
9124 C->getLParenLoc(), C->getEndLoc());
9127 template <
typename Derived>
9131 Vars.reserve(C->varlist_size());
9132 for (
auto *VE : C->varlists()) {
9133 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
9136 Vars.push_back(EVar.
get());
9138 return getDerived().RebuildOMPDependClause(
9140 C->getBeginLoc(), C->getLParenLoc(), C->getEndLoc());
9143 template <
typename Derived>
9149 return getDerived().RebuildOMPDeviceClause(E.
get(), C->getBeginLoc(),
9153 template <
typename Derived,
class T>
9160 Vars.reserve(C->varlist_size());
9161 for (
auto *VE : C->varlists()) {
9165 Vars.push_back(EVar.
get());
9170 QualifierLoc = TT.
getDerived().TransformNestedNameSpecifierLoc(
9175 MapperIdScopeSpec.
Adopt(QualifierLoc);
9178 MapperIdInfo = TT.
getDerived().TransformDeclarationNameInfo(MapperIdInfo);
9187 auto *ULE = cast<UnresolvedLookupExpr>(E);
9189 for (
auto *D : ULE->decls()) {
9192 Decls.addDecl(InstD, InstD->
getAccess());
9195 TT.
getSema().Context,
nullptr,
9197 MapperIdInfo,
true, ULE->isOverloaded(), Decls.begin(),
9200 UnresolvedMappers.push_back(
nullptr);
9206 template <
typename Derived>
9208 OMPVarListLocTy Locs(C->getBeginLoc(), C->getLParenLoc(), C->getEndLoc());
9213 if (transformOMPMappableExprListClause<Derived, OMPMapClause>(
9214 *
this, C, Vars, MapperIdScopeSpec, MapperIdInfo, UnresolvedMappers))
9216 return getDerived().RebuildOMPMapClause(
9222 template <
typename Derived>
9227 ExprResult AllocatorRes = getDerived().TransformExpr(Allocator);
9230 Allocator = AllocatorRes.
get();
9235 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
9238 Vars.push_back(EVar.
get());
9240 return getDerived().RebuildOMPAllocateClause(
9245 template <
typename Derived>
9251 return getDerived().RebuildOMPNumTeamsClause(
9255 template <
typename Derived>
9261 return getDerived().RebuildOMPThreadLimitClause(
9265 template <
typename Derived>
9271 return getDerived().RebuildOMPPriorityClause(
9275 template <
typename Derived>
9281 return getDerived().RebuildOMPGrainsizeClause(
9285 template <
typename Derived>
9291 return getDerived().RebuildOMPNumTasksClause(
9295 template <
typename Derived>
9300 return getDerived().RebuildOMPHintClause(E.
get(), C->getBeginLoc(),
9304 template <
typename Derived>
9310 return getDerived().RebuildOMPDistScheduleClause(
9315 template <
typename Derived>
9329 template <
typename Derived>
9331 OMPVarListLocTy Locs(C->getBeginLoc(), C->getLParenLoc(), C->getEndLoc());
9336 if (transformOMPMappableExprListClause<Derived, OMPToClause>(
9337 *
this, C, Vars, MapperIdScopeSpec, MapperIdInfo, UnresolvedMappers))
9339 return getDerived().RebuildOMPToClause(Vars, MapperIdScopeSpec, MapperIdInfo,
9340 Locs, UnresolvedMappers);
9343 template <
typename Derived>
9345 OMPVarListLocTy Locs(C->getBeginLoc(), C->getLParenLoc(), C->getEndLoc());
9350 if (transformOMPMappableExprListClause<Derived, OMPFromClause>(
9351 *
this, C, Vars, MapperIdScopeSpec, MapperIdInfo, UnresolvedMappers))
9353 return getDerived().RebuildOMPFromClause(
9354 Vars, MapperIdScopeSpec, MapperIdInfo, Locs, UnresolvedMappers);
9357 template <
typename Derived>
9361 Vars.reserve(C->varlist_size());
9362 for (
auto *VE : C->varlists()) {
9363 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
9366 Vars.push_back(EVar.
get());
9368 OMPVarListLocTy Locs(C->getBeginLoc(), C->getLParenLoc(), C->getEndLoc());
9369 return getDerived().RebuildOMPUseDevicePtrClause(Vars, Locs);
9372 template <
typename Derived>
9376 Vars.reserve(C->varlist_size());
9377 for (
auto *VE : C->varlists()) {
9378 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
9381 Vars.push_back(EVar.
get());
9383 OMPVarListLocTy Locs(C->getBeginLoc(), C->getLParenLoc(), C->getEndLoc());
9384 return getDerived().RebuildOMPIsDevicePtrClause(Vars, Locs);
9387 template <
typename Derived>
9391 Vars.reserve(C->varlist_size());
9392 for (
auto *VE : C->varlists()) {
9393 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
9396 Vars.push_back(EVar.
get());
9398 return getDerived().RebuildOMPNontemporalClause(
9399 Vars, C->getBeginLoc(), C->getLParenLoc(), C->getEndLoc());
9405 template<
typename Derived>
9411 template<
typename Derived>
9417 return getDerived().RebuildPredefinedExpr(E->
getLocation(),
9421 template<
typename Derived>
9433 = cast_or_null<ValueDecl>(getDerived().TransformDecl(E->
getLocation(),
9440 Found = cast_or_null<NamedDecl>(
9448 NameInfo = getDerived().TransformDeclarationNameInfo(NameInfo);
9453 if (!getDerived().AlwaysRebuild() &&
9462 SemaRef.MarkDeclRefReferenced(E);
9469 TemplateArgs = &TransArgs;
9478 return getDerived().RebuildDeclRefExpr(QualifierLoc, ND, NameInfo,
9479 Found, TemplateArgs);
9482 template<
typename Derived>
9488 template <
typename Derived>
9494 template<
typename Derived>
9500 template<
typename Derived>
9506 template<
typename Derived>
9512 template<
typename Derived>
9518 template<
typename Derived>
9522 SemaRef.MarkFunctionReferenced(E->
getBeginLoc(), FD);
9523 return SemaRef.MaybeBindToTemporary(E);
9526 template<
typename Derived>
9542 AssocTypes.push_back(AssocType);
9544 AssocTypes.push_back(
nullptr);
9548 getDerived().TransformExpr(Assoc.getAssociationExpr());
9551 AssocExprs.push_back(AssocExpr.
get());
9554 return getDerived().RebuildGenericSelectionExpr(E->
getGenericLoc(),
9557 ControllingExpr.
get(),
9562 template<
typename Derived>
9569 if (!getDerived().AlwaysRebuild() && SubExpr.
get() == E->
getSubExpr())
9572 return getDerived().RebuildParenExpr(SubExpr.
get(), E->
getLParen(),
9579 template<
typename Derived>
9585 return getDerived().TransformExpr(E);
9588 template<
typename Derived>
9593 SubExpr = TransformAddressOfOperand(E->
getSubExpr());
9599 if (!getDerived().AlwaysRebuild() && SubExpr.
get() == E->
getSubExpr())
9607 template<
typename Derived>
9621 bool ExprChanged =
false;
9627 Comp.isBrackets =
true;
9631 case OffsetOfNode::Array: {
9633 ExprResult Index = getDerived().TransformExpr(FromIndex);
9637 ExprChanged = ExprChanged || Index.
get() != FromIndex;
9638 Comp.isBrackets =
true;
9639 Comp.U.E = Index.
get();
9643 case OffsetOfNode::Field:
9645 Comp.isBrackets =
false;
9647 if (!Comp.U.IdentInfo)
9652 case OffsetOfNode::Base:
9657 Components.push_back(Comp);
9661 if (!getDerived().AlwaysRebuild() &&
9667 return getDerived().RebuildOffsetOfExpr(E->
getOperatorLoc(), Type,
9671 template<
typename Derived>
9675 "opaque value expression requires transformation");
9679 template<
typename Derived>
9685 template<
typename Derived>
9694 Expr *newSyntacticForm = SemaRef.recreateSyntacticForm(E);
9695 ExprResult result = getDerived().TransformExpr(newSyntacticForm);
9701 if (result.
get()->hasPlaceholderType(BuiltinType::PseudoObject))
9702 result = SemaRef.checkPseudoObjectRValue(result.
get());
9707 template<
typename Derived>
9718 if (!getDerived().AlwaysRebuild() && OldT == NewT)
9721 return getDerived().RebuildUnaryExprOrTypeTrait(NewT, E->
getOperatorLoc(),
9730 SemaRef, Sema::ExpressionEvaluationContext::Unevaluated,
9731 Sema::ReuseLambdaContextDecl);
9739 PE ? dyn_cast<DependentScopeDeclRefExpr>(PE->getSubExpr()) :
nullptr)
9740 SubExpr = getDerived().TransformParenDependentScopeDeclRefExpr(
9741 PE, DRE,
false, &RecoveryTSI);
9746 return getDerived().RebuildUnaryExprOrTypeTrait(
9754 return getDerived().RebuildUnaryExprOrTypeTrait(SubExpr.
get(),
9760 template<
typename Derived>
9772 if (!getDerived().AlwaysRebuild() &&
9777 return getDerived().RebuildArraySubscriptExpr(
9782 template <
typename Derived>
9791 LowerBound = getDerived().TransformExpr(E->
getLowerBound());
9798 Length = getDerived().TransformExpr(E->
getLength());
9803 if (!getDerived().AlwaysRebuild() && Base.
get() == E->
getBase() &&
9807 return getDerived().RebuildOMPArraySectionExpr(
9812 template<
typename Derived>
9821 bool ArgChanged =
false;
9827 if (!getDerived().AlwaysRebuild() &&
9830 return SemaRef.MaybeBindToTemporary(E);
9835 return getDerived().RebuildCallExpr(Callee.
get(), FakeLParenLoc,
9840 template<
typename Derived>
9858 = cast_or_null<ValueDecl>(getDerived().TransformDecl(E->
getMemberLoc(),
9867 FoundDecl = cast_or_null<NamedDecl>(
9868 getDerived().TransformDecl(E->
getMemberLoc(), FoundDecl));
9873 if (!getDerived().AlwaysRebuild() &&
9882 SemaRef.MarkMemberReferenced(E);
9905 NamedDecl *FirstQualifierInScope =
nullptr;
9907 if (MemberNameInfo.
getName()) {
9908 MemberNameInfo = getDerived().TransformDeclarationNameInfo(MemberNameInfo);
9909 if (!MemberNameInfo.
getName())
9913 return getDerived().RebuildMemberExpr(Base.
get(), FakeOperatorLoc,
9921 ? &TransArgs :
nullptr),
9922 FirstQualifierInScope);
9925 template<
typename Derived>
9936 if (!getDerived().AlwaysRebuild() &&
9948 template <
typename Derived>
9953 ExprResult LHS = getDerived().TransformExpr(const_cast<Expr*>(Decomp.
LHS));
9957 ExprResult RHS = getDerived().TransformExpr(const_cast<Expr*>(Decomp.
RHS));
9961 if (!getDerived().AlwaysRebuild() &&
9962 LHS.
get() == Decomp.
LHS &&
9971 for (
Expr *PossibleBinOp : PossibleBinOps) {
9975 auto *Callee = dyn_cast<
DeclRefExpr>(Op->getCallee()->IgnoreImplicit());
9976 if (!Callee || isa<CXXMethodDecl>(Callee->getDecl()))
9981 NamedDecl *Found = cast_or_null<NamedDecl>(getDerived().TransformDecl(
9988 return getDerived().RebuildCXXRewrittenBinaryOperator(
9992 template<
typename Derived>
9996 return getDerived().TransformBinaryOperator(E);
9999 template<
typename Derived>
10013 if (!getDerived().AlwaysRebuild() &&
10018 return getDerived().RebuildConditionalOperator(commonExpr.
get(),
10025 template<
typename Derived>
10040 if (!getDerived().AlwaysRebuild() &&
10046 return getDerived().RebuildConditionalOperator(Cond.
get(),
10053 template<
typename Derived>
10061 template<
typename Derived>
10073 if (!getDerived().AlwaysRebuild() &&
10078 return getDerived().RebuildCStyleCastExpr(E->
getLParenLoc(),
10084 template<
typename Derived>
10096 if (!getDerived().AlwaysRebuild() &&
10099 return SemaRef.MaybeBindToTemporary(E);
10105 return getDerived().RebuildCompoundLiteralExpr(
10110 template<
typename Derived>
10117 if (!getDerived().AlwaysRebuild() &&
10124 return getDerived().RebuildExtVectorElementExpr(Base.
get(), FakeOperatorLoc,
10129 template<
typename Derived>
10135 bool InitChanged =
false;
10138 getSema(), EnterExpressionEvaluationContext::InitList);
10142 Inits, &InitChanged))
10145 if (!getDerived().AlwaysRebuild() && !InitChanged) {
10156 template<
typename Derived>
10168 bool ExprChanged =
false;
10170 if (D.isFieldDesignator()) {
10174 if (D.getField()) {
10175 FieldDecl *Field = cast_or_null<FieldDecl>(
10176 getDerived().TransformDecl(D.getFieldLoc(), D.getField()));
10177 if (Field != D.getField())
10180 ExprChanged =
true;
10185 ExprChanged =
true;
10190 if (D.isArrayDesignator()) {
10196 Designator::getArray(Index.
get(), D.getLBracketLoc()));
10199 ArrayExprs.push_back(Index.
get());
10203 assert(D.isArrayRangeDesignator() &&
"New kind of designator?");
10206 if (Start.isInvalid())
10215 D.getLBracketLoc(),
10216 D.getEllipsisLoc()));
10221 ArrayExprs.push_back(Start.get());
10222 ArrayExprs.push_back(End.
get());
10225 if (!getDerived().AlwaysRebuild() &&
10230 return getDerived().RebuildDesignatedInitExpr(Desig, ArrayExprs,
10237 template<
typename Derived>
10241 llvm_unreachable(
"Unexpected DesignatedInitUpdateExpr in syntactic form of " 10246 template<
typename Derived>
10250 llvm_unreachable(
"Unexpected NoInitExpr in syntactic form of initializer");
10254 template<
typename Derived>
10257 llvm_unreachable(
"Unexpected ArrayInitLoopExpr outside of initializer");
10261 template<
typename Derived>
10264 llvm_unreachable(
"Unexpected ArrayInitIndexExpr outside of initializer");
10268 template<
typename Derived>
10280 if (!getDerived().AlwaysRebuild() &&
10284 return getDerived().RebuildImplicitValueInitExpr(T);
10287 template<
typename Derived>
10298 if (!getDerived().AlwaysRebuild() &&
10307 template<
typename Derived>
10310 bool ArgumentChanged =
false;
10316 return getDerived().RebuildParenListExpr(E->
getLParenLoc(),
10326 template<
typename Derived>
10335 cast<LabelDecl>(LD));
10338 template<
typename Derived>
10341 SemaRef.ActOnStartStmtExpr();
10343 = getDerived().TransformCompoundStmt(E->
getSubStmt(),
true);
10345 SemaRef.ActOnStmtExprError();
10349 if (!getDerived().AlwaysRebuild() &&
10352 SemaRef.ActOnStmtExprError();
10353 return SemaRef.MaybeBindToTemporary(E);
10356 return getDerived().RebuildStmtExpr(E->
getLParenLoc(),
10361 template<
typename Derived>
10376 if (!getDerived().AlwaysRebuild() &&
10387 template<
typename Derived>
10393 template<
typename Derived>
10400 case OO_Array_Delete:
10401 llvm_unreachable(
"new and delete operators cannot use CXXOperatorCallExpr");
10405 assert(E->
getNumArgs() >= 1 &&
"Object call is missing arguments");
10409 if (Object.isInvalid())
10414 static_cast<Expr *>(Object.get())->getEndLoc());
10422 return getDerived().RebuildCallExpr(Object.get(), FakeLParenLoc, Args,
10426 #define OVERLOADED_OPERATOR(Name,Spelling,Token,Unary,Binary,MemberOnly) \ 10428 #define OVERLOADED_OPERATOR_MULTI(Name,Spelling,Unary,Binary,MemberOnly) 10429 #include "clang/Basic/OperatorKinds.def" 10434 case OO_Conditional:
10435 llvm_unreachable(
"conditional operator is not actually overloadable");
10439 llvm_unreachable(
"not an overloaded operator?");
10448 First = getDerived().TransformAddressOfOperand(E->
getArg(0));
10450 First = getDerived().TransformExpr(E->
getArg(0));
10456 Second = getDerived().TransformExpr(E->
getArg(1));
10461 if (!getDerived().AlwaysRebuild() &&
10465 return SemaRef.MaybeBindToTemporary(E);
10470 return getDerived().RebuildCXXOperatorCallExpr(E->
getOperator(),
10477 template<
typename Derived>
10480 return getDerived().TransformCallExpr(E);
10483 template <
typename Derived>
10488 if (!getDerived().AlwaysRebuild() && !NeedRebuildFunc)
10493 getSema().CurContext);
10496 template<
typename Derived>
10510 bool ArgChanged =
false;
10516 if (!getDerived().AlwaysRebuild() &&
10519 return SemaRef.MaybeBindToTemporary(E);
10524 return getDerived().RebuildCallExpr(Callee.
get(), FakeLParenLoc,
10529 template<
typename Derived>
10541 if (!getDerived().AlwaysRebuild() &&
10545 return getDerived().RebuildCXXNamedCastExpr(
10552 template<
typename Derived>
10564 return getDerived().RebuildBuiltinBitCastExpr(BCE->
getBeginLoc(), TSI,
10568 template<
typename Derived>
10574 template<
typename Derived>
10580 template<
typename Derived>
10587 template<
typename Derived>
10593 template<
typename Derived>
10607 if (!getDerived().AlwaysRebuild() &&
10612 return getDerived().RebuildCXXFunctionalCastExpr(Type,
10619 template<
typename Derived>
10628 if (!getDerived().AlwaysRebuild() &&
10641 SemaRef, Sema::ExpressionEvaluationContext::Unevaluated,
10642 Sema::ReuseLambdaContextDecl);
10648 if (!getDerived().AlwaysRebuild() &&
10656 template<
typename Derived>
10665 if (!getDerived().AlwaysRebuild() &&
10674 SemaRef, Sema::ExpressionEvaluationContext::Unevaluated);
10680 if (!getDerived().AlwaysRebuild() &&
10688 template<
typename Derived>
10694 template<
typename Derived>
10701 template<
typename Derived>
10704 QualType T = getSema().getCurrentThisType();
10706 if (!getDerived().AlwaysRebuild() && T == E->
getType()) {
10709 getSema().MarkThisReferenced(E);
10716 template<
typename Derived>
10723 if (!getDerived().AlwaysRebuild() &&
10727 return getDerived().RebuildCXXThrowExpr(E->
getThrowLoc(), SubExpr.
get(),
10731 template<
typename Derived>
10739 if (!getDerived().AlwaysRebuild() && Param == E->
getParam() &&
10743 return getDerived().RebuildCXXDefaultArgExpr(E->
getUsedLocation(), Param);
10746 template<
typename Derived>
10749 FieldDecl *Field = cast_or_null<FieldDecl>(
10754 if (!getDerived().AlwaysRebuild() && Field == E->
getField() &&
10758 return getDerived().RebuildCXXDefaultInitExpr(E->
getExprLoc(), Field);
10761 template<
typename Derived>
10769 if (!getDerived().AlwaysRebuild() &&
10773 return getDerived().RebuildCXXScalarValueInitExpr(T,
10778 template<
typename Derived>
10784 if (!AllocTypeInfo)
10791 if (*OldArraySize) {
10792 NewArraySize = getDerived().TransformExpr(*OldArraySize);
10796 ArraySize = NewArraySize.
get();
10800 bool ArgumentChanged =
false;
10804 PlacementArgs, &ArgumentChanged))
10811 NewInit = getDerived().TransformInitializer(OldInit,
true);
10818 OperatorNew = cast_or_null<FunctionDecl>(
10826 OperatorDelete = cast_or_null<FunctionDecl>(
10828 if (!OperatorDelete)
10832 if (!getDerived().AlwaysRebuild() &&
10835 NewInit.
get() == OldInit &&
10838 !ArgumentChanged) {
10842 SemaRef.MarkFunctionReferenced(E->
getBeginLoc(), OperatorNew);
10843 if (OperatorDelete)
10844 SemaRef.MarkFunctionReferenced(E->
getBeginLoc(), OperatorDelete);
10850 CXXRecordDecl *Record = cast<CXXRecordDecl>(RecordT->getDecl());
10852 SemaRef.MarkFunctionReferenced(E->
getBeginLoc(), Destructor);
10867 const ArrayType *ArrayT = SemaRef.Context.getAsArrayType(AllocType);
10871 = dyn_cast<ConstantArrayType>(ArrayT)) {
10873 SemaRef.Context.getSizeType(),
10875 AllocType = ConsArrayT->getElementType();
10877 = dyn_cast<DependentSizedArrayType>(ArrayT)) {
10878 if (DepArrayT->getSizeExpr()) {
10879 ArraySize = DepArrayT->getSizeExpr();
10880 AllocType = DepArrayT->getElementType();
10885 return getDerived().RebuildCXXNewExpr(
10892 template<
typename Derived>
10902 OperatorDelete = cast_or_null<FunctionDecl>(
10904 if (!OperatorDelete)
10908 if (!getDerived().AlwaysRebuild() &&
10913 if (OperatorDelete)
10914 SemaRef.MarkFunctionReferenced(E->
getBeginLoc(), OperatorDelete);
10917 QualType Destroyed = SemaRef.Context.getBaseElementType(
10920 CXXRecordDecl *Record = cast<CXXRecordDecl>(DestroyedRec->getDecl());
10922 SemaRef.LookupDestructor(Record));
10929 return getDerived().RebuildCXXDeleteExpr(
10933 template<
typename Derived>
10942 bool MayBePseudoDestructor =
false;
10943 Base = SemaRef.ActOnStartCXXMemberReference(
nullptr, Base.
get(),
10945 E->
isArrow()? tok::arrow : tok::period,
10947 MayBePseudoDestructor);
10951 QualType ObjectType = ObjectTypePtr.get();
10953 if (QualifierLoc) {
10955 = getDerived().TransformNestedNameSpecifierLoc(QualifierLoc, ObjectType);
10960 SS.
Adopt(QualifierLoc);
10966 ObjectType,
nullptr, SS);
10967 if (!DestroyedTypeInfo)
10969 Destroyed = DestroyedTypeInfo;
10987 = SemaRef.Context.getTrivialTypeSourceInfo(SemaRef.GetTypeFromParser(T),
10994 ScopeTypeInfo = getDerived().TransformTypeInObjectScope(
10996 if (!ScopeTypeInfo)
11000 return getDerived().RebuildCXXPseudoDestructorExpr(Base.
get(),
11010 template <
typename Derived>
11015 bool AllEmptyPacks =
true;
11016 for (
auto *OldD : Old->
decls()) {
11017 Decl *InstD = getDerived().TransformDecl(Old->
getNameLoc(), OldD);
11021 if (isa<UsingShadowDecl>(OldD))
11030 NamedDecl *SingleDecl = cast<NamedDecl>(InstD);
11032 if (
auto *UPD = dyn_cast<UsingPackDecl>(InstD))
11033 Decls = UPD->expansions();
11036 for (
auto *D : Decls) {
11037 if (
auto *UD = dyn_cast<UsingDecl>(D)) {
11038 for (
auto *SD : UD->shadows())
11045 AllEmptyPacks &= Decls.empty();
11054 if (AllEmptyPacks && !RequiresADL) {
11055 getSema().Diag(Old->
getNameLoc(), diag::err_using_pack_expansion_empty)
11056 << isa<UnresolvedMemberExpr>(Old) << Old->
getName();
11066 template<
typename Derived>
11071 Sema::LookupOrdinaryName);
11074 if (TransformOverloadExprDecls(Old, Old->
requiresADL(), R))
11081 = getDerived().TransformNestedNameSpecifierLoc(Old->
getQualifierLoc());
11085 SS.
Adopt(QualifierLoc);
11090 = cast_or_null<CXXRecordDecl>(getDerived().TransformDecl(
11093 if (!NamingClass) {
11098 R.setNamingClass(NamingClass);
11111 return SemaRef.BuildPossibleImplicitMemberExpr(SS, TemplateKWLoc, R,
11116 return getDerived().RebuildDeclarationNameExpr(SS, R, Old->
requiresADL());
11130 return getDerived().RebuildTemplateIdExpr(SS, TemplateKWLoc, R,
11134 template<
typename Derived>
11137 bool ArgChanged =
false;
11139 for (
unsigned I = 0, N = E->
getNumArgs(); I != N; ++I) {
11145 QualType To = getDerived().TransformType(TLB, FromTL);
11150 Args.push_back(From);
11164 SemaRef.collectUnexpandedParameterPacks(PatternTL, Unexpanded);
11168 bool Expand =
true;
11169 bool RetainExpansion =
false;
11173 if (getDerived().TryExpandParameterPacks(ExpansionTL.
getEllipsisLoc(),
11174 PatternTL.getSourceRange(),
11176 Expand, RetainExpansion,
11189 QualType To = getDerived().TransformType(TLB, PatternTL);
11193 To = getDerived().RebuildPackExpansionType(To,
11194 PatternTL.getSourceRange(),
11209 for (
unsigned I = 0; I != *NumExpansions; ++I) {
11212 TLB.
reserve(PatternTL.getFullDataSize());
11213 QualType To = getDerived().TransformType(TLB, PatternTL);
11218 To = getDerived().RebuildPackExpansionType(To,
11219 PatternTL.getSourceRange(),
11233 if (!RetainExpansion)
11238 ForgetPartiallySubstitutedPackRAII Forget(getDerived());
11243 QualType To = getDerived().TransformType(TLB, PatternTL);
11247 To = getDerived().RebuildPackExpansionType(To,
11248 PatternTL.getSourceRange(),
11260 if (!getDerived().AlwaysRebuild() && !ArgChanged)
11267 template<
typename Derived>
11277 return getDerived().RebuildConceptSpecializationExpr(
11283 template<
typename Derived>
11293 SemaRef, Sema::ExpressionEvaluationContext::Unevaluated);
11305 TransParamTypes, &TransParams,
11310 Param->setDeclContext(Body);
11313 if (getDerived().TransformRequiresExprRequirements(E->
getRequirements(),
11318 if (
auto *ER = dyn_cast<concepts::ExprRequirement>(Req)) {
11319 if (ER->getReturnTypeRequirement().isTypeConstraint()) {
11320 ER->getReturnTypeRequirement()
11321 .getTypeConstraintTemplateParameterList()->getParam(0)
11322 ->setDeclContext(Body);
11328 TransParams, TransReqs,
11332 template<
typename Derived>
11338 if (
auto *TypeReq = dyn_cast<concepts::TypeRequirement>(Req))
11339 TransReq = getDerived().TransformTypeRequirement(TypeReq);
11340 else if (
auto *ExprReq = dyn_cast<concepts::ExprRequirement>(Req))
11341 TransReq = getDerived().TransformExprRequirement(ExprReq);
11343 TransReq = getDerived().TransformNestedRequirement(
11344 cast<concepts::NestedRequirement>(Req));
11347 Transformed.push_back(TransReq);
11352 template<
typename Derived>
11357 if (getDerived().AlwaysRebuild())
11365 return getDerived().RebuildTypeRequirement(TransType);
11368 template<
typename Derived>
11371 llvm::PointerUnion<Expr *, concepts::Requirement::SubstitutionDiagnostic *> TransExpr;
11378 TransExpr = TransExprRes.
get();
11383 if (RetReq.isEmpty())
11384 TransRetReq.emplace();
11385 else if (RetReq.isSubstitutionFailure())
11386 TransRetReq.emplace(RetReq.getSubstitutionDiagnostic());
11387 else if (RetReq.isTypeConstraint()) {
11389 RetReq.getTypeConstraintTemplateParameterList();
11391 getDerived().TransformTemplateParameterList(OrigTPL);
11394 TransRetReq.emplace(TPL);
11396 assert(TransRetReq.hasValue() &&
11397 "All code paths leading here must set TransRetReq");
11398 if (
Expr *E = TransExpr.dyn_cast<
Expr *>())
11399 return getDerived().RebuildExprRequirement(E, Req->
isSimple(),
11401 std::move(*TransRetReq));
11402 return getDerived().RebuildExprRequirement(
11407 template<
typename Derived>
11412 if (getDerived().AlwaysRebuild())
11421 return getDerived().RebuildNestedRequirement(TransConstraint.
get());
11424 template<
typename Derived>
11431 if (!getDerived().AlwaysRebuild() &&
11438 SemaRef, Sema::ExpressionEvaluationContext::Unevaluated);
11451 template<
typename Derived>
11457 SemaRef, Sema::ExpressionEvaluationContext::Unevaluated);
11470 template <
typename Derived>
11474 ExprResult NewDRE = getDerived().TransformDependentScopeDeclRefExpr(
11475 DRE, AddrTaken, RecoveryTSI);
11482 if (!getDerived().AlwaysRebuild() && NewDRE.
get() == DRE)
11484 return getDerived().RebuildParenExpr(NewDRE.
get(), PE->
getLParen(),
11488 template <
typename Derived>
11491 return TransformDependentScopeDeclRefExpr(E,
false,
11495 template<
typename Derived>
11499 bool IsAddressOfOperand,
11503 = getDerived().TransformNestedNameSpecifierLoc(E->
getQualifierLoc());
11513 = getDerived().TransformDeclarationNameInfo(E->
getNameInfo());
11518 if (!getDerived().AlwaysRebuild() &&
11525 return getDerived().RebuildDependentScopeDeclRefExpr(
11526 QualifierLoc, TemplateKWLoc, NameInfo,
nullptr,
11527 IsAddressOfOperand, RecoveryTSI);
11536 return getDerived().RebuildDependentScopeDeclRefExpr(
11537 QualifierLoc, TemplateKWLoc, NameInfo, &TransArgs, IsAddressOfOperand,
11541 template<
typename Derived>
11549 (!getDerived().DropCallArgument(E->
getArg(0))) &&
11564 bool ArgumentChanged =
false;
11568 getSema(), EnterExpressionEvaluationContext::InitList,
11575 if (!getDerived().AlwaysRebuild() &&
11578 !ArgumentChanged) {
11581 SemaRef.MarkFunctionReferenced(E->
getBeginLoc(), Constructor);
11585 return getDerived().RebuildCXXConstructExpr(
11592 template<
typename Derived>
11604 if (!getDerived().AlwaysRebuild() &&
11609 SemaRef.MarkFunctionReferenced(E->
getBeginLoc(), Constructor);
11613 return getDerived().RebuildCXXInheritedCtorInitExpr(
11622 template<
typename Derived>
11633 template<
typename Derived>
11639 template<
typename Derived>
11653 bool ArgumentChanged =
false;
11658 getSema(), EnterExpressionEvaluationContext::InitList,
11665 if (!getDerived().AlwaysRebuild() &&
11668 !ArgumentChanged) {
11670 SemaRef.MarkFunctionReferenced(E->
getBeginLoc(), Constructor);
11671 return SemaRef.MaybeBindToTemporary(E);
11677 return getDerived().RebuildCXXTemporaryObjectExpr(
11682 template<
typename Derived>
11687 typedef std::pair<ExprResult, QualType> InitCaptureInfoTy;
11688 struct TransformedInitCapture {
11702 TransformedInitCapture &Result = InitCaptures[C - E->
capture_begin()];
11703 VarDecl *OldVD = C->getCapturedVar();
11707 ExprResult NewExprInitResult = getDerived().TransformInitializer(
11714 Expr *NewExprInit = NewExprInitResult.
get();
11717 getSema().buildLambdaInitCaptureInitialization(
11720 C->getCapturedVar()->getInitStyle() != VarDecl::CInit,
11722 Result.Expansions.push_back(
11723 InitCaptureInfoTy(NewExprInit, NewInitCaptureType));
11732 SemaRef.collectUnexpandedParameterPacks(OldVD->
getInit(), Unexpanded);
11736 bool Expand =
true;
11737 bool RetainExpansion =
false;
11741 if (getDerived().TryExpandParameterPacks(
11744 RetainExpansion, NumExpansions))
11747 for (
unsigned I = 0; I != *NumExpansions; ++I) {
11752 if (!Expand || RetainExpansion) {
11753 ForgetPartiallySubstitutedPackRAII Forget(getDerived());
11767 auto TPL = getDerived().TransformTemplateParameterList(
11784 QualType NewCallOpType = TransformFunctionProtoType(
11785 NewCallOpTLBuilder, OldCallOpFPTL,
nullptr,
Qualifiers(),
11788 ExceptionStorage, Changed);
11790 if (NewCallOpType.
isNull())
11792 NewCallOpTSI = NewCallOpTLBuilder.getTypeSourceInfo(getSema().Context,
11801 NewTrailingRequiresClause = getDerived().TransformExpr(TRC);
11810 getDerived().transformedLocalDecl(OldClass, {Class});
11813 if (getDerived().ReplacingOriginal())
11819 CXXMethodDecl *NewCallOperator = getSema().startLambdaDefinition(
11824 NewTrailingRequiresClause.
get());
11828 for (
unsigned I = 0, NumParams = NewCallOperator->getNumParams();
11829 I != NumParams; ++I) {
11830 auto *
P = NewCallOperator->getParamDecl(I);
11831 if (
P->hasUninstantiatedDefaultArg()) {
11834 Sema::ExpressionEvaluationContext::PotentiallyEvaluatedIfUsed,
P);
11837 P->setDefaultArg(R.
get());
11842 getDerived().transformedLocalDecl(E->
getCallOperator(), {NewCallOperator});
11845 getSema().handleLambdaNumbering(Class, NewCallOperator, Mangling);
11852 getSema().buildLambdaScope(LSI, NewCallOperator,
11860 bool Invalid =
false;
11868 if (C->isImplicit())
11872 if (C->capturesThis()) {
11873 getSema().CheckCXXThisCapture(C->getLocation(), C->isExplicit(),
11880 if (C->capturesVLAType())
11885 TransformedInitCapture &NewC = InitCaptures[C - E->
capture_begin()];
11887 VarDecl *OldVD = C->getCapturedVar();
11890 for (InitCaptureInfoTy &Info : NewC.Expansions) {
11892 QualType InitQualType = Info.second;
11897 VarDecl *NewVD = getSema().createLambdaInitCaptureVarDecl(
11898 OldVD->
getLocation(), InitQualType, NewC.EllipsisLoc,
11904 NewVDs.push_back(NewVD);
11905 getSema().addInitCapture(LSI, NewVD);
11911 getDerived().transformedLocalDecl(OldVD, NewVDs);
11915 assert(C->capturesVariable() &&
"unexpected kind of lambda capture");
11919 = C->isImplicit()? Sema::TryCapture_Implicit
11921 ? Sema::TryCapture_ExplicitByVal
11922 : Sema::TryCapture_ExplicitByRef;
11924 if (C->isPackExpansion()) {
11926 bool ShouldExpand =
false;
11927 bool RetainExpansion =
false;
11929 if (getDerived().TryExpandParameterPacks(C->getEllipsisLoc(),
11932 ShouldExpand, RetainExpansion,
11938 if (ShouldExpand) {
11942 VarDecl *Pack = C->getCapturedVar();
11943 for (
unsigned I = 0; I != *NumExpansions; ++I) {
11946 = cast_or_null<VarDecl>(getDerived().TransformDecl(C->getLocation(),
11948 if (!CapturedVar) {
11954 getSema().tryCaptureVariable(CapturedVar, C->getLocation(),
Kind);
11962 EllipsisLoc = C->getEllipsisLoc();
11967 = cast_or_null<VarDecl>(getDerived().TransformDecl(C->getLocation(),
11968 C->getCapturedVar()));
11975 getSema().tryCaptureVariable(CapturedVar, C->getLocation(),
Kind,
11978 getSema().finishLambdaExplicitCaptures(LSI);
11982 getSema().PushExpressionEvaluationContext(
11983 Sema::ExpressionEvaluationContext::PotentiallyEvaluated);
11987 Invalid ?
StmtError() : getDerived().TransformLambdaBody(E, E->
getBody());
11993 SavedContext.
pop();
11994 getSema().ActOnLambdaError(E->
getBeginLoc(),
nullptr,
12002 auto LSICopy = *LSI;
12003 getSema().ActOnFinishFunctionBody(NewCallOperator, Body.
get(),
12005 SavedContext.
pop();
12007 return getSema().BuildLambdaExpr(E->
getBeginLoc(), Body.
get()->getEndLoc(),
12011 template<
typename Derived>
12014 return TransformStmt(S);
12017 template<
typename Derived>
12026 if (!C->isImplicit())
12030 if (C->capturesThis()) {
12031 getSema().CheckCXXThisCapture(C->getLocation(), C->isExplicit(),
12038 if (C->capturesVLAType())
12041 assert(C->capturesVariable() &&
"unexpected kind of lambda capture");
12045 VarDecl *CapturedVar = cast_or_null<VarDecl>(
12046 getDerived().TransformDecl(C->getLocation(), C->getCapturedVar()));
12047 if (!CapturedVar || CapturedVar->isInvalidDecl())
12051 getSema().tryCaptureVariable(CapturedVar, C->getLocation());
12057 template<
typename Derived>
12066 bool ArgumentChanged =
false;
12071 getSema(), EnterExpressionEvaluationContext::InitList,
12078 if (!getDerived().AlwaysRebuild() &&
12084 return getDerived().RebuildCXXUnresolvedConstructExpr(
12088 template<
typename Derived>
12099 Base = getDerived().TransformExpr(OldBase);
12105 bool MayBePseudoDestructor =
false;
12106 Base = SemaRef.ActOnStartCXXMemberReference(
nullptr, Base.
get(),
12108 E->
isArrow()? tok::arrow : tok::period,
12110 MayBePseudoDestructor);
12114 ObjectType = ObjectTy.get();
12115 BaseType = ((
Expr*) Base.
get())->getType();
12118 BaseType = getDerived().TransformType(E->
getBaseType());
12125 = getDerived().TransformFirstQualifierInScope(
12134 FirstQualifierInScope);
12153 if (!getDerived().AlwaysRebuild() &&
12154 Base.
get() == OldBase &&
12161 return getDerived().RebuildCXXDependentScopeMemberExpr(Base.
get(),
12167 FirstQualifierInScope,
12178 return getDerived().RebuildCXXDependentScopeMemberExpr(Base.
get(),
12184 FirstQualifierInScope,
12189 template<
typename Derived>
12196 Base = getDerived().TransformExpr(Old->
getBase());
12199 Base = getSema().PerformMemberExprBaseConversion(Base.
get(),
12203 BaseType = Base.
get()->getType();
12205 BaseType = getDerived().TransformType(Old->
getBaseType());
12211 = getDerived().TransformNestedNameSpecifierLoc(Old->
getQualifierLoc());
12219 Sema::LookupOrdinaryName);
12222 if (TransformOverloadExprDecls(Old,
false, R))
12228 = cast_or_null<CXXRecordDecl>(getDerived().TransformDecl(
12234 R.setNamingClass(NamingClass);
12251 NamedDecl *FirstQualifierInScope =
nullptr;
12253 return getDerived().RebuildUnresolvedMemberExpr(Base.
get(),
12259 FirstQualifierInScope,
12262 ? &TransArgs :
nullptr));
12265 template<
typename Derived>
12269 SemaRef, Sema::ExpressionEvaluationContext::Unevaluated);
12274 if (!getDerived().AlwaysRebuild() && SubExpr.
get() == E->
getOperand())
12280 template<
typename Derived>
12287 if (!getDerived().AlwaysRebuild() && Pattern.
get() == E->
getPattern())
12294 template<
typename Derived>
12303 getSema(), Sema::ExpressionEvaluationContext::Unevaluated);
12313 bool ShouldExpand =
false;
12314 bool RetainExpansion =
false;
12318 ShouldExpand, RetainExpansion,
12324 if (ShouldExpand) {
12326 if (
auto *TTPD = dyn_cast<TemplateTypeParmDecl>(Pack)) {
12327 ArgStorage = getSema().Context.getPackExpansionType(
12328 getSema().Context.getTypeDeclType(TTPD), None);
12329 }
else if (
auto *TTPD = dyn_cast<TemplateTemplateParmDecl>(Pack)) {
12332 auto *VD = cast<ValueDecl>(Pack);
12333 ExprResult DRE = getSema().BuildDeclRefExpr(
12334 VD, VD->getType().getNonLValueExprType(getSema().Context),
12337 if (DRE.isInvalid())
12340 getSema().Context.DependentTy, DRE.get(), E->
getPackLoc(), None);
12342 PackArgs = ArgStorage;
12347 if (!PackArgs.size()) {
12348 auto *Pack = cast_or_null<NamedDecl>(
12352 return getDerived().RebuildSizeOfPackExpr(E->
getOperatorLoc(), Pack,
12360 if (!Arg.isPackExpansion()) {
12361 Result = *Result + 1;
12366 InventTemplateArgumentLoc(Arg, ArgLoc);
12372 getSema().getTemplateArgumentPackExpansionPattern(ArgLoc, Ellipsis,
12373 OrigNumExpansions);
12378 if (getDerived().TransformTemplateArgument(Pattern, OutPattern,
12384 getSema().getFullyPackExpandedSize(OutPattern.
getArgument());
12385 if (!NumExpansions) {
12392 Result = *Result + *NumExpansions;
12408 if (TransformTemplateArguments(PackLocIterator(*
this, PackArgs.begin()),
12409 PackLocIterator(*
this, PackArgs.end()),
12410 TransformedPackArgs,
true))
12417 bool PartialSubstitution =
false;
12418 for (
auto &Loc : TransformedPackArgs.arguments()) {
12419 Args.push_back(Loc.getArgument());
12420 if (Loc.getArgument().isPackExpansion())
12421 PartialSubstitution =
true;
12424 if (PartialSubstitution)
12431 Args.size(), None);
12434 template<
typename Derived>
12442 template<
typename Derived>
12450 template<
typename Derived>
12457 template<
typename Derived>
12464 template<
typename Derived>
12470 getSema().collectUnexpandedParameterPacks(Pattern, Unexpanded);
12471 assert(!Unexpanded.empty() &&
"Pack expansion without parameter packs?");
12475 bool Expand =
true;
12476 bool RetainExpansion =
false;
12478 NumExpansions = OrigNumExpansions;
12482 Expand, RetainExpansion,
12501 if (!getDerived().AlwaysRebuild() &&
12505 return getDerived().RebuildCXXFoldExpr(
12519 if (!LeftFold && RetainExpansion) {
12520 ForgetPartiallySubstitutedPackRAII Forget(getDerived());
12522 ExprResult Out = getDerived().TransformExpr(Pattern);
12526 Result = getDerived().RebuildCXXFoldExpr(
12533 for (
unsigned I = 0; I != *NumExpansions; ++I) {
12535 getSema(), LeftFold ? I : *NumExpansions - I - 1);
12536 ExprResult Out = getDerived().TransformExpr(Pattern);
12540 if (Out.
get()->containsUnexpandedParameterPack()) {
12542 Result = getDerived().RebuildCXXFoldExpr(
12546 OrigNumExpansions);
12549 Result = getDerived().RebuildBinaryOperator(
12551 LeftFold ? Result.
get() : Out.
get(),
12552 LeftFold ? Out.
get() : Result.
get());
12562 if (LeftFold && RetainExpansion) {
12563 ForgetPartiallySubstitutedPackRAII Forget(getDerived());
12565 ExprResult Out = getDerived().TransformExpr(Pattern);
12569 Result = getDerived().RebuildCXXFoldExpr(
12579 return getDerived().RebuildEmptyCXXFoldExpr(E->
getEllipsisLoc(),
12585 template<
typename Derived>
12592 template<
typename Derived>
12595 return SemaRef.MaybeBindToTemporary(E);
12598 template<
typename Derived>
12604 template<
typename Derived>
12611 if (!getDerived().AlwaysRebuild() &&
12618 template<
typename Derived>
12623 bool ArgChanged =
false;
12625 false, Elements, &ArgChanged))
12628 if (!getDerived().AlwaysRebuild() && !ArgChanged)
12629 return SemaRef.MaybeBindToTemporary(E);
12631 return getDerived().RebuildObjCArrayLiteral(E->
getSourceRange(),
12636 template<
typename Derived>
12642 bool ArgChanged =
false;
12649 getSema().collectUnexpandedParameterPacks(OrigElement.
Key, Unexpanded);
12650 getSema().collectUnexpandedParameterPacks(OrigElement.
Value, Unexpanded);
12651 assert(!Unexpanded.empty() &&
"Pack expansion without parameter packs?");
12655 bool Expand =
true;
12656 bool RetainExpansion =
false;
12661 if (getDerived().TryExpandParameterPacks(OrigElement.
EllipsisLoc,
12662 PatternRange, Unexpanded, Expand,
12663 RetainExpansion, NumExpansions))
12671 ExprResult Key = getDerived().TransformExpr(OrigElement.
Key);
12675 if (Key.
get() != OrigElement.
Key)
12682 if (Value.
get() != OrigElement.
Value)
12688 Elements.push_back(Expansion);
12698 for (
unsigned I = 0; I != *NumExpansions; ++I) {
12700 ExprResult Key = getDerived().TransformExpr(OrigElement.
Key);
12715 if (Key.
get()->containsUnexpandedParameterPack() ||
12716 Value.
get()->containsUnexpandedParameterPack())
12719 Elements.push_back(Element);
12729 ExprResult Key = getDerived().TransformExpr(OrigElement.
Key);
12733 if (Key.
get() != OrigElement.
Key)
12738 = getDerived().TransformExpr(OrigElement.
Value);
12742 if (Value.
get() != OrigElement.
Value)
12748 Elements.push_back(Element);
12751 if (!getDerived().AlwaysRebuild() && !ArgChanged)
12752 return SemaRef.MaybeBindToTemporary(E);
12754 return getDerived().RebuildObjCDictionaryLiteral(E->
getSourceRange(),
12758 template<
typename Derived>
12763 if (!EncodedTypeInfo)
12766 if (!getDerived().AlwaysRebuild() &&
12770 return getDerived().RebuildObjCEncodeExpr(E->
getAtLoc(),
12775 template<
typename Derived>
12785 template<
typename Derived>
12797 if (!getDerived().AlwaysRebuild() &&
12807 template <
typename Derived>
12813 template<
typename Derived>
12817 bool ArgChanged =
false;
12828 if (!ReceiverTypeInfo)
12832 if (!getDerived().AlwaysRebuild() &&
12834 return SemaRef.MaybeBindToTemporary(E);
12839 return getDerived().RebuildObjCMessageExpr(ReceiverTypeInfo,
12855 return getDerived().RebuildObjCMessageExpr(E->
getSuperLoc(),
12867 "Only class and instance messages may be instantiated");
12870 if (Receiver.isInvalid())
12874 if (!getDerived().AlwaysRebuild() &&
12876 return SemaRef.MaybeBindToTemporary(E);
12881 return getDerived().RebuildObjCMessageExpr(Receiver.get(),
12890 template<
typename Derived>
12896 template<
typename Derived>
12902 template<
typename Derived>
12913 if (!getDerived().AlwaysRebuild() &&
12917 return getDerived().RebuildObjCIvarRefExpr(Base.
get(), E->
getDecl(),
12922 template<
typename Derived>
12938 if (!getDerived().AlwaysRebuild() &&
12943 return getDerived().RebuildObjCPropertyRefExpr(Base.
get(),
12947 return getDerived().RebuildObjCPropertyRefExpr(Base.
get(),
12948 SemaRef.Context.PseudoObjectTy,
12954 template<
typename Derived>
12968 if (!getDerived().AlwaysRebuild() &&
12972 return getDerived().RebuildObjCSubscriptRefExpr(E->
getRBracket(),
12978 template<
typename Derived>
12987 if (!getDerived().AlwaysRebuild() &&
12996 template<
typename Derived>
12999 bool ArgumentChanged =
false;
13003 SubExprs, &ArgumentChanged))
13006 if (!getDerived().AlwaysRebuild() &&
13010 return getDerived().RebuildShuffleVectorExpr(E->
getBuiltinLoc(),
13015 template<
typename Derived>
13026 if (!getDerived().AlwaysRebuild() &&
13031 return getDerived().RebuildConvertVectorExpr(E->
getBuiltinLoc(),
13032 SrcExpr.
get(), Type,
13036 template<
typename Derived>
13055 if (getDerived().TransformFunctionTypeParams(
13064 getDerived().TransformType(exprFunctionType->
getReturnType());
13070 getDerived().RebuildFunctionProtoType(exprResultType, paramTypes, epi);
13074 if (!params.empty())
13092 if (!SemaRef.getDiagnostics().hasErrorOccurred()) {
13093 for (
const auto &I : oldBlock->
captures()) {
13094 VarDecl *oldCapture = I.getVariable();
13103 assert(blockScope->
CaptureMap.count(newCapture));
13113 template<
typename Derived>
13116 llvm_unreachable(
"Cannot transform asType expressions yet");
13119 template<
typename Derived>
13122 bool ArgumentChanged =
false;
13126 SubExprs, &ArgumentChanged))
13129 if (!getDerived().AlwaysRebuild() &&
13133 return getDerived().RebuildAtomicExpr(E->
getBuiltinLoc(), SubExprs,
13141 template<
typename Derived>
13144 return SemaRef.BuildPointerType(PointeeType, Star,
13145 getDerived().getBaseEntity());
13148 template<
typename Derived>
13151 return SemaRef.BuildBlockPointerType(PointeeType, Star,
13152 getDerived().getBaseEntity());
13155 template<
typename Derived>
13158 bool WrittenAsLValue,
13160 return SemaRef.BuildReferenceType(ReferentType, WrittenAsLValue,
13161 Sigil, getDerived().getBaseEntity());
13164 template<
typename Derived>
13169 return SemaRef.BuildMemberPointerType(PointeeType, ClassType, Sigil,
13170 getDerived().getBaseEntity());
13173 template<
typename Derived>
13180 return SemaRef.BuildObjCTypeParamType(Decl,
13181 ProtocolLAngleLoc, Protocols,
13182 ProtocolLocs, ProtocolRAngleLoc,
13186 template<
typename Derived>
13197 return SemaRef.BuildObjCObjectType(BaseType, Loc, TypeArgsLAngleLoc,
13198 TypeArgs, TypeArgsRAngleLoc,
13199 ProtocolLAngleLoc, Protocols, ProtocolLocs,
13204 template<
typename Derived>
13208 return SemaRef.Context.getObjCObjectPointerType(PointeeType);
13211 template<
typename Derived>
13217 unsigned IndexTypeQuals,
13219 if (SizeExpr || !Size)
13220 return SemaRef.BuildArrayType(ElementType, SizeMod, SizeExpr,
13221 IndexTypeQuals, BracketsRange,
13222 getDerived().getBaseEntity());
13225 SemaRef.Context.UnsignedCharTy, SemaRef.Context.UnsignedShortTy,
13226 SemaRef.Context.UnsignedIntTy, SemaRef.Context.UnsignedLongTy,
13227 SemaRef.Context.UnsignedLongLongTy, SemaRef.Context.UnsignedInt128Ty
13229 const unsigned NumTypes = llvm::array_lengthof(Types);
13231 for (
unsigned I = 0; I != NumTypes; ++I)
13232 if (Size->getBitWidth() == SemaRef.Context.getIntWidth(Types[I])) {
13233 SizeType = Types[I];
13242 return SemaRef.BuildArrayType(ElementType, SizeMod, ArraySize,
13243 IndexTypeQuals, BracketsRange,
13244 getDerived().getBaseEntity());
13247 template<
typename Derived>
13253 unsigned IndexTypeQuals,
13255 return getDerived().
RebuildArrayType(ElementType, SizeMod, &Size, SizeExpr,
13256 IndexTypeQuals, BracketsRange);
13259 template<
typename Derived>
13263 unsigned IndexTypeQuals,
13265 return getDerived().
RebuildArrayType(ElementType, SizeMod,
nullptr,
nullptr,
13266 IndexTypeQuals, BracketsRange);
13269 template<
typename Derived>
13274 unsigned IndexTypeQuals,
13278 IndexTypeQuals, BracketsRange);
13281 template<
typename Derived>
13286 unsigned IndexTypeQuals,
13290 IndexTypeQuals, BracketsRange);
13293 template <
typename Derived>
13296 return SemaRef.BuildAddressSpaceAttr(PointeeType, AddrSpaceExpr,
13300 template <
typename Derived>
13303 unsigned NumElements,
13306 return SemaRef.Context.getVectorType(ElementType, NumElements, VecKind);
13309 template <
typename Derived>
13313 return SemaRef.BuildVectorType(ElementType, SizeExpr, AttributeLoc);
13316 template<
typename Derived>
13318 unsigned NumElements,
13320 llvm::APInt numElements(SemaRef.Context.getIntWidth(SemaRef.Context.IntTy),
13321 NumElements,
true);
13325 return SemaRef.BuildExtVectorType(ElementType, VectorSize, AttributeLoc);
13328 template<
typename Derived>
13333 return SemaRef.BuildExtVectorType(ElementType, SizeExpr, AttributeLoc);
13336 template<
typename Derived>
13341 return SemaRef.BuildFunctionType(T, ParamTypes,
13342 getDerived().getBaseLocation(),
13343 getDerived().getBaseEntity(),
13347 template<
typename Derived>
13349 return SemaRef.Context.getFunctionNoProtoType(T);
13352 template<
typename Derived>
13355 assert(D &&
"no decl found");
13360 if (
auto *UPD = dyn_cast<UsingPackDecl>(D)) {
13364 if (UPD->expansions().empty()) {
13365 getSema().Diag(Loc, diag::err_using_pack_expansion_empty)
13375 for (
auto *E : UPD->expansions()) {
13376 QualType ThisT = RebuildUnresolvedUsingType(Loc, E);
13384 assert(getSema().Context.hasSameType(ThisT, T) &&
13385 "mismatched resolved types in using pack expansion");
13387 return T.
isNull() ? FallbackT : T;
13388 }
else if (
auto *Using = dyn_cast<UsingDecl>(D)) {
13389 assert(Using->hasTypename() &&
13390 "UnresolvedUsingTypenameDecl transformed to non-typename using");
13393 assert(++Using->shadow_begin() == Using->shadow_end());
13394 Ty = cast<TypeDecl>((*Using->shadow_begin())->getTargetDecl());
13396 assert(isa<UnresolvedUsingTypenameDecl>(D) &&
13397 "UnresolvedUsingTypenameDecl transformed to non-using decl");
13398 Ty = cast<UnresolvedUsingTypenameDecl>(D);
13401 return SemaRef.Context.getTypeDeclType(Ty);
13404 template<
typename Derived>
13407 return SemaRef.BuildTypeofExprType(E, Loc);
13410 template<
typename Derived>
13412 return SemaRef.Context.getTypeOfType(Underlying);
13415 template<
typename Derived>
13418 return SemaRef.BuildDecltypeType(E, Loc);
13421 template<
typename Derived>
13425 return SemaRef.BuildUnaryTransformType(BaseType, UKind, Loc);
13428 template<
typename Derived>
13433 return SemaRef.CheckTemplateIdType(Template, TemplateNameLoc, TemplateArgs);
13436 template<
typename Derived>
13439 return SemaRef.BuildAtomicType(ValueType, KWLoc);
13442 template<
typename Derived>
13446 return isReadPipe ? SemaRef.BuildReadPipeType(ValueType, KWLoc)
13447 : SemaRef.BuildWritePipeType(ValueType, KWLoc);
13450 template<
typename Derived>
13455 return SemaRef.Context.getQualifiedTemplateName(SS.
getScopeRep(), TemplateKW,
13459 template<
typename Derived>
13467 bool AllowInjectedClassName) {
13471 getSema().ActOnDependentTemplateName(
nullptr,
13472 SS, TemplateKWLoc, TemplateName,
13473 ParsedType::make(ObjectType),
13475 Template, AllowInjectedClassName);
13476 return Template.
get();
13479 template<
typename Derived>
13486 bool AllowInjectedClassName) {
13489 SourceLocation SymbolLocations[3] = { NameLoc, NameLoc, NameLoc };
13492 getSema().ActOnDependentTemplateName(
nullptr,
13493 SS, TemplateKWLoc, Name,
13494 ParsedType::make(ObjectType),
13496 Template, AllowInjectedClassName);
13497 return Template.
get();
13500 template<
typename Derived>
13508 bool isPostIncDec = Second && (Op == OO_PlusPlus || Op == OO_MinusMinus);
13512 if (BinaryOperator::isAssignmentOp(Opc))
13513 return SemaRef.checkPseudoObjectAssignment(
nullptr, OpLoc, Opc,
13515 ExprResult Result = SemaRef.CheckPlaceholderExpr(First);
13518 First = Result.
get();
13522 ExprResult Result = SemaRef.CheckPlaceholderExpr(Second);
13525 Second = Result.
get();
13529 if (Op == OO_Subscript) {
13532 return getSema().CreateBuiltinArraySubscriptExpr(
13534 }
else if (Op == OO_Arrow) {
13536 return SemaRef.BuildOverloadedArrowExpr(
nullptr, First, OpLoc);
13537 }
else if (Second ==
nullptr || isPostIncDec) {
13539 (Op == OO_Amp && getSema().isQualifiedMemberAccess(First))) {
13544 = UnaryOperator::getOverloadedOpcode(Op, isPostIncDec);
13546 return getSema().CreateBuiltinUnaryOp(OpLoc, Opc, First);
13555 = SemaRef.CreateBuiltinBinOp(OpLoc, Opc, First, Second);
13569 Functions.
append(ULE->decls_begin(), ULE->decls_end());
13573 RequiresADL = ULE->requiresADL();
13578 NamedDecl *ND = cast<DeclRefExpr>(Callee)->getDecl();
13579 if (!isa<CXXMethodDecl>(ND))
13581 RequiresADL =
false;
13585 Expr *Args[2] = { First, Second };
13586 unsigned NumArgs = 1 + (Second !=
nullptr);
13589 if (NumArgs == 1 || isPostIncDec) {
13591 = UnaryOperator::getOverloadedOpcode(Op, isPostIncDec);
13592 return SemaRef.CreateOverloadedUnaryOp(OpLoc, Opc, Functions, First,
13596 if (Op == OO_Subscript) {
13600 if (
DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(Callee)) {
13602 LBrace = SourceLocation::getFromRawEncoding(
13604 RBrace = SourceLocation::getFromRawEncoding(
13611 return SemaRef.CreateOverloadedArraySubscriptExpr(LBrace, RBrace,
13617 ExprResult Result = SemaRef.CreateOverloadedBinOp(
13618 OpLoc, Opc, Functions, Args[0], Args[1], RequiresADL);
13625 template<
typename Derived>
13640 ->template getAs<RecordType>())){
13642 return SemaRef.BuildPseudoDestructorExpr(
13643 Base, OperatorLoc, isArrow ? tok::arrow : tok::period, SS, ScopeType,
13644 CCLoc, TildeLoc, Destroyed);
13648 DeclarationName Name(SemaRef.Context.DeclarationNames.getCXXDestructorName(
13649 SemaRef.Context.getCanonicalType(DestroyedType->
getType())));
13658 diag::err_expected_class_or_namespace)
13659 << ScopeType->
getType() << getSema().getLangOpts().CPlusPlus;
13667 return getSema().BuildMemberReferenceExpr(Base, BaseType,
13668 OperatorLoc, isArrow,
13676 template<
typename Derived>
13684 for (
unsigned I = 0; I < NumParams; ++I) {
13685 if (I != ContextParamPos) {
13691 Params.push_back(std::make_pair(StringRef(),
QualType()));
13694 getSema().ActOnCapturedRegionStart(Loc,
nullptr,
13703 getSema().ActOnCapturedRegionError();
13707 return getSema().ActOnCapturedRegionEnd(Body.
get());
13712 #endif // LLVM_CLANG_LIB_SEMA_TREETRANSFORM_H SourceLocation getRParenLoc() const
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
const Expr * getSubExpr() const
ObjCIndirectCopyRestoreExpr - Represents the passing of a function argument by indirect copy-restore ...
A call to an overloaded operator written using operator syntax.
Represents a single C99 designator.
SourceLocation getLoc() const
getLoc - Returns the main location of the declaration name.
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
SourceLocation 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...
SourceLocation getBeginLoc() const
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
Optional< unsigned > getNumExpansions() const
NamedDecl * getFoundDecl()
Get the NamedDecl through which this reference occurred.
helper_expr_const_range reduction_ops() const
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.
bool hasExplicitTemplateArgs() const
Determines whether this expression had explicit template arguments.
IdentifierInfo * getLabelIdentifier(unsigned i) const
unsigned getNumInputs() const
SourceLocation getOpLoc() const
SourceLocation getRParenLoc() const
ObjCDictionaryElement getKeyValueElement(unsigned Index) const
const TemplateArgumentLoc * getTemplateArgs() const
Retrieve the template arguments provided as part of this template-id.
const FunctionProtoType * getFunctionType() const
getFunctionType - Return the underlying function type for this block.
CompoundStmt * getBlock() const
friend bool operator==(const TemplateArgumentLocInventIterator &X, const TemplateArgumentLocInventIterator &Y)
Smart pointer class that efficiently represents Objective-C method names.
TemplateArgumentLoc reference
SourceLocation getForLoc() const
This represents clause 'copyin' in the '#pragma omp ...' directives.
const TypeClass * getTypePtr() const
PointerType - C99 6.7.5.1 - Pointer Declarators.
QualType getPointeeType() const
void MakeSuper(ASTContext &Context, CXXRecordDecl *RD, SourceLocation SuperLoc, SourceLocation ColonColonLoc)
Turns this (empty) nested-name-specifier into '__super' nested-name-specifier.
SourceLocation getUsedLocation() const
Retrieve the location where this default argument was actually used.
Represents the dependent type named by a dependently-scoped typename using declaration, e.g.
Stores the type being destroyed by a pseudo-destructor expression.
A (possibly-)qualified type.
Keeps information about an identifier in a nested-name-spec.
SourceLocation getBeginLoc() const
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()
llvm::omp::ProcBindKind getProcBindKind() const
Returns kind of the clause.
Expr * getArg(unsigned Arg)
getArg - Return the specified argument.
ObjCMethodDecl * getAtIndexMethodDecl() const
Selector getSelector() const
SourceRange getSourceRange() const
SourceLocation getEllipsisLoc() const
Get the location of the ... in a case statement of the form LHS ... RHS.
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
A requires-expression requirement which queries the validity and properties of an expression ('simple...
TemplateParameterList * GLTemplateParameterList
If this is a generic lambda, and the template parameter list has been created (from the TemplateParam...
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.
ArrayRef< ParmVarDecl * > getLocalParameters() const
unsigned getNumArgs() const
CompoundStmt * getSubStmt()
OpenMPDefaultmapClauseKind
OpenMP attributes for 'defaultmap' clause.
This represents 'atomic_default_mem_order' clause in the '#pragma omp requires' directive.
TemplateArgumentLoc operator*() const
bool isListInitialization() const
Determine whether this expression models list-initialization.
const DeclContext * getParentContext() const
If the SourceLocExpr has been resolved return the subexpression representing the resolved value...
SourceLocation getKWLoc() const
NestedNameSpecifierLoc getTemplateQualifierLoc() const
Expr * getControllingExpr()
Return the controlling expression of this generic selection expression.
ArrayRef< TemplateArgument > getTypeConstraintArguments() const
Expr * getUnderlyingExpr() const
void setKWLoc(SourceLocation Loc)
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.
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
void setConceptNameLoc(SourceLocation Loc)
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
Represents a qualified type name for which the type name is dependent.
SourceLocation getEndLoc() const LLVM_READONLY
This represents '#pragma omp for simd' directive.
SourceLocation getLParenLoc() const
Returns the location of '('.
Expr * getAllocator() const
Returns allocator.
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.
This represents '#pragma omp teams distribute parallel for' composite directive.
Stmt * getHandlerBlock() const
SourceLocation getBeginLoc() const
Returns starting location of directive kind.
SourceLocation getBeginLoc() 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.
This represents '#pragma omp parallel master' directive.
CapturedStmt * getInnermostCapturedStmt()
Get innermost captured statement for the construct.
Represents a C++11 auto or C++14 decltype(auto) type, possibly constrained by a type-constraint.
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
bool hasExplicitTemplateArgs() const
Determines whether this declaration reference was followed by an explicit template argument list...
void setLAngleLoc(SourceLocation Loc)
void setTemplateKeywordLoc(SourceLocation Loc)
Represents an array type, per C99 6.7.5.2 - Array Declarators.
Represent a C++ namespace.
SourceLocation getKeywordLoc() const
Represents a call to a C++ constructor.
SourceLocation getBeginLoc() const LLVM_READONLY
ObjCSubscriptRefExpr - used for array and dictionary subscripting.
Wrapper for source info for typedefs.
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 getEndLoc() const LLVM_READONLY
SourceLocation getLParenLoc() const
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.
SourceLocation getBeginLoc() const LLVM_READONLY
Wrapper for void* pointer.
constexpr XRayInstrMask Function
Expr * getCondition() const
Returns condition.
SourceLocation getAttributeLoc() const
This represents '#pragma omp parallel for' directive.
MS property subscript expression.
IdentKind getIdentKind() const
SourceLocation getBeginLoc() const LLVM_READONLY
SourceLocation getGotoLoc() const
unsigned location_size() const
Retrieve the size of the data associated with source-location information.
bool isSubstitutionFailure() const
SourceLocation getOperatorLoc() const
Determine the location of the 'sizeof' keyword.
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.
LLVM_ATTRIBUTE_REINITIALIZES void clear()
Clears out any current state.
Represents a prvalue temporary that is written into memory so that a reference can bind to it...
OpenMPDefaultmapClauseModifier
OpenMP modifiers for 'defaultmap' clause.
SourceLocation getAccessorLoc() const
SubstitutionDiagnostic * getSubstitutionDiagnostic() 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
TemplateName getTemplateName() const
Retrieve the name of the template that we are deducing.
SourceLocation getCoawaitLoc() const
Expr * getIndexExpr(unsigned Idx)
Stmt * getExceptionHandler() const
SourceLocation getEndLoc() const
Returns ending location of directive.
SourceLocation getRParenLoc() const
Expr * getDeallocate() const
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.
SubstitutionDiagnostic * getExprSubstitutionDiagnostic() const
void setRAngleLoc(SourceLocation Loc)
This represents 'read' clause in the '#pragma omp atomic' directive.
SourceLocation getBeginLoc() const LLVM_READONLY
SourceLocation getBeginLoc() const LLVM_READONLY
RAII object that enters a new expression evaluation context.
SourceLocation getExpansionLoc() const
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.
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.
bool This(InterpState &S, CodePtr OpPC)
SourceLocation getBeginLoc() const LLVM_READONLY
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.
Extra information about a function prototype.
This represents 'defaultmap' clause in the '#pragma omp ...' directive.
DecomposedForm getDecomposedForm() const LLVM_READONLY
Decompose this operator into its syntactic form.
Stmt * getResultDecl() const
SourceLocation getStarLoc() const
This represents clauses with a list of expressions that are mappable.
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...
Represents an explicit template argument list in C++, e.g., the "<int>" in "sort<int>".
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.
concepts::TypeRequirement * BuildTypeRequirement(TypeSourceInfo *Type)
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 ...
This represents 'reverse_offload' clause in the '#pragma omp requires' directive. ...
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.
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.
SourceLocation getBeginLoc() const LLVM_READONLY
CXXRecordDecl * getLambdaClass() const
Retrieve the class that corresponds to the lambda.
void setTypeArgTInfo(unsigned i, TypeSourceInfo *TInfo)
This represents 'allocator' clause in the '#pragma omp ...' directive.
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.
SourceLocation getEndLoc() const LLVM_READONLY
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
NamedDecl * getFoundDecl() const
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
TypeSourceInfo * getEncodedTypeSourceInfo() const
Expr * getSemanticForm()
Get an equivalent semantic form for this expression.
TypeSourceInfo * getScopeTypeInfo() const
Retrieve the scope type in a qualified pseudo-destructor expression.
SourceLocation getKeywordLoc() const
SourceLocation getLParenLoc() const
Returns the location of '('.
One of these records is kept for each identifier that is lexed.
void setLocalRangeEnd(SourceLocation L)
SourceLocation getTildeLoc() const
Retrieve the location of the '~'.
SourceLocation getRParenLoc() const
Represents a function call to one of __builtin_LINE(), __builtin_COLUMN(), __builtin_FUNCTION(), or __builtin_FILE().
An element in an Objective-C dictionary literal.
C++2a [expr.prim.req]: A requires-expression provides a concise way to express requirements on templa...
This represents '#pragma omp parallel' directive.
SourceLocation getBegin() const
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
ConstexprSpecKind getConstexprKind() const
QualType BuildParenType(QualType T)
Build a paren type including T.
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
bool isSpelledAsLValue() const
SourceLocation getAmpAmpLoc() const
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
SourceLocation getBeginLoc() const LLVM_READONLY
NameKind getNameKind() const
Determine what kind of name this is.
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.
This represents clause 'lastprivate' in the '#pragma omp ...' directives.
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.
This represents clause 'allocate' in the '#pragma omp ...' directives.
Represents a place-holder for an object not to be initialized by anything.
SourceLocation getBeginLoc() const
SourceLocation getEndLoc() const LLVM_READONLY
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 '('.
Stmt * getStmtExprResult()
UnaryExprOrTypeTrait
Names for the "expression or type" traits.
CompoundStmt * getBody() const
Retrieve the body of the lambda.
SourceLocation getProtocolLAngleLoc() const
ExprResult ActOnDesignatedInitializer(Designation &Desig, SourceLocation EqualOrColonLoc, bool GNUSyntax, ExprResult Init)
unsigned getArrayExprIndex() const
For an array element node, returns the index into the array of expressions.
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.
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.
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...
This represents '#pragma omp critical' directive.
LambdaCaptureDefault getCaptureDefault() const
Determine the default capture kind for this lambda.
bool hasKnownLambdaInternalLinkage() const
The lambda is known to has internal linkage no matter whether it has name mangling number...
bool hasExplicitTemplateArgs() const
Determines whether this lookup had explicit template arguments.
SourceLocation getLParenLoc() const
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...
ArrayRef< SourceLocation > getMapTypeModifiersLoc() const LLVM_READONLY
Fetches ArrayRef of location of map-type-modifiers.
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
Optional< Expr * > getArraySize()
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 setAttr(const Attr *A)
void setNameLoc(SourceLocation Loc)
Represents the results of name lookup.
NestedNameSpecifierLoc getQualifierLoc() const
Gets the nested name specifier.
SourceLocation getLParenLoc() const
FunctionDecl * getOperatorDelete() const
void setExpansionLoc(SourceLocation Loc)
friend bool operator!=(const TemplateArgumentLocInventIterator &X, const TemplateArgumentLocInventIterator &Y)
Expr * getBaseExpr() const
bool isElidable() const
Whether this construction is elidable.
void setRAngleLoc(SourceLocation Loc)
Expr * getOperand() const
const Expr * getThrowExpr() const
Wrapper for source info for injected class names of class templates.
< Capturing the *this object by copy
SourceLocation getDefaultmapKindLoc()
Get kind location.
unsigned getNumProtocols() const
SourceLocation getProtocolLoc(unsigned i) const
SourceLocation getSigilLoc() const
A convenient class for passing around template argument information.
SourceLocation getRequiresKWLoc() const
SourceLocation getLocation() const
Expr * getConstraintExpr() const
LabelDecl * getDecl() const
SourceLocation getEndLoc() const LLVM_READONLY
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 isConstrained() const
concepts::NestedRequirement * BuildNestedRequirement(Expr *E)
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 RAngleLoc
The source location of the right angle bracket ('>').
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...
LangAS getAddressSpace() const
A set of unresolved declarations.
Expr * getOutputExpr(unsigned i)
SourceLocation getLParenLoc() const
void setRParenLoc(SourceLocation Loc)
SourceLocation getThrowLoc() const
const StringLiteral * getInputConstraintLiteral(unsigned i) const
TemplateArgumentLocContainerIterator & operator++()
const Type * getClass() const
CXXForRangeStmt - This represents C++0x [stmt.ranged]'s ranged for statement, represented as 'for (ra...
CXXRecordDecl * getDecl() const
ConceptDecl * getNamedConcept() const
This represents '#pragma omp cancellation point' directive.
This represents 'default' clause in the '#pragma omp ...' directive.
Expr * IgnoreParenCasts() LLVM_READONLY
Skip past any parentheses and casts which might surround this expression until reaching a fixed point...
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
CaseStmt - Represent a case statement.
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
IdentKind getIdentKind() const
SubstitutionDiagnostic * getSubstitutionDiagnostic() const
This represents '#pragma omp teams' directive.
OpenMPDependClauseKind getDependencyKind() const
Get dependency type.
void append(iterator I, iterator E)
SourceLocation getEndLoc() const
Represents a C++ nested-name-specifier or a global scope specifier.
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.
AssociationTy< false > Association
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)
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
SourceLocation getDefaultmapModifierLoc() const
Get the modifier location.
CXXRecordDecl * getNamingClass()
Gets the 'naming class' (in the sense of C++0x [class.access.base]p5) of the lookup.
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.
SourceLocation getBeginLoc() const
Default argument expressions have no representation in the source, so they have an empty source range...
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.
bool isInitCapture(const LambdaCapture *Capture) const
Determine whether one of this lambda's captures is an init-capture.
llvm::omp::Directive OpenMPDirectiveKind
OpenMP directives.
const Stmt * getBody() const
unsigned getNumArgs() const
TypeSourceInfo * getTypeSourceInfo() const
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
A default argument (C++ [dcl.fct.default]).
void setStmt(LabelStmt *T)
void setAttrNameLoc(SourceLocation loc)
QualType getPointeeTypeAsWritten() const
bool isTypeOperand() const
Expr * getSizeExpr() const
Stmt * getReturnStmt() const
QualType getElementType() const
SourceLocation getMemberLoc() const
Retrieve the location of the name of the member that this expression refers to.
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++.
SourceLocation getBeginLoc() const LLVM_READONLY
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].
This represents 'dynamic_allocators' clause in the '#pragma omp requires' directive.
unsigned getLambdaManglingNumber() const
If this is the closure type of a lambda expression, retrieve the number to be used for name mangling ...
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]).
SourceLocation getBeginLoc() const LLVM_READONLY
CompoundStmt - This represents a group of statements like { stmt stmt }.
OpenMPDefaultClauseKind getDefaultKind() const
Returns kind of the clause.
A requires-expression requirement which queries the existence of a type name or type template special...
Represents a prototype with parameter type info, e.g.
SourceLocation getRBracket() const
This represents 'threads' clause in the '#pragma omp ...' directive.
NestedNameSpecifierLoc getMapperQualifierLoc() const
Gets the nested name specifier for associated user-defined mapper.
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.
SourceLocation getEndLoc() const
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 '('.
ConstantExpr - An expression that occurs in a constant context and optionally the result of evaluatin...
ObjCTypeParamDecl * getDecl() const
Represents a call to the builtin function __builtin_va_arg.
void setArgLocInfo(unsigned i, TemplateArgumentLocInfo AI)
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.
SourceLocation getLabelLoc() const
bool isImplicitAccess() const
True if this is an implicit access, i.e.
SourceLocation getThrowLoc() const LLVM_READONLY
static unsigned getNumSubExprs(AtomicOp Op)
Determine the number of arguments the specified atomic builtin should have.
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...
Represents an array type in C++ whose size is a value-dependent expression.
SourceLocation getDestroyedTypeLoc() const
Retrieve the starting location of the type being destroyed.
SourceLocation getBeginLoc() const
Get the begin source location.
SourceLocation getFinallyLoc() const
OpenMPLastprivateModifier
OpenMP 'lastprivate' clause modifier.
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().
OpenMPLastprivateModifier getKind() const
Lastprivate kind.
Type source information for an attributed type.
QualType getCXXNameType() const
If this name is one of the C++ names (of a constructor, destructor, or conversion function)...
SourceLocation getBeginLoc() const LLVM_READONLY
Represents a block literal declaration, which is like an unnamed FunctionDecl.
unsigned getFunctionScopeDepth() const
void setQualifierLoc(NestedNameSpecifierLoc QualifierLoc)
llvm::MutableArrayRef< Designator > designators()
NamespaceDecl * getAsNamespace() const
Retrieve the namespace stored in this nested name specifier.
This represents 'proc_bind' clause in the '#pragma omp ...' directive.
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 ...
This represents one expression.
SourceLocation getLocalRangeEnd() const
SourceLocation getElseLoc() const
The "typename" keyword precedes the qualified type name, e.g., typename T::type.
Represents the body of a requires-expression.
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 '...
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
This represents '#pragma omp master taskloop' directive.
unsigned NumTemplateArgs
The number of template arguments in TemplateArgs.
UnqualTypeLoc getUnqualifiedLoc() const
Skips past any qualifiers, if this is qualified.
SourceRange getBracketsRange() const
SourceLocation getLAngleLoc() 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...
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
void setFoundDecl(NamedDecl *D)
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
TemplateArgumentLocInventIterator & operator++()
This represents '#pragma omp target teams distribute parallel for simd' combined directive.
bool isIfNotExists() const
Determine whether this is an __if_exists statement.
SourceLocation getLParenLoc() const
Returns the location of '('.
bool isSubstitutionFailure() const
bool isArrow() const
Determine whether this pseudo-destructor expression was written using an '->' (otherwise, it used a '.
Expr * getAllocator() const
Returns the allocator expression or nullptr, if no allocator is specified.
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)
FunctionDecl * getDirectCallee()
If the callee is a FunctionDecl, return it. Otherwise return null.
void setTemplateKWLoc(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
This represents 'ordered' clause in the '#pragma omp ...' directive.
AutoType * getContainedAutoType() const
Get the AutoType whose type will be deduced for a variable with an initializer of this type...
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 getOperatorLoc() const LLVM_READONLY
SourceLocation getColonLoc() const
Get colon location.
An RAII helper that pops function a function scope on exit.
TypeSourceInfo * getType() const
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.
const DeclarationNameInfo & getConceptNameInfo() const
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;...
void setNestedNameSpecifierLoc(NestedNameSpecifierLoc NNS)
This represents '#pragma omp target teams' directive.
void setHasBaseTypeAsWritten(bool HasBaseType)
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
SourceLocation getEndLoc() const LLVM_READONLY
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.
TypeLoc getInnerLoc() const
bool isPackExpansion() const
Determine whether this template argument is a pack expansion.
SourceLocation getCommaLoc()
Get location of ','.
const NestedNameSpecifierLoc & getNestedNameSpecifierLoc() const
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.
bool isNull() const
Return true if this QualType doesn't point to a type yet.
InitializationStyle getInitStyle() const
The style of initialization for this declaration.
const DeclContext * getUsedContext() const
Expr * getLHS()
An array access can be written A[4] or 4[A] (both are equivalent).
concepts::ExprRequirement * BuildExprRequirement(Expr *E, bool IsSatisfied, SourceLocation NoexceptLoc, concepts::ExprRequirement::ReturnTypeRequirement ReturnTypeRequirement)
const ASTTemplateArgumentListInfo * getTemplateArgsAsWritten() const
TypeLoc getReturnLoc() const
This file defines OpenMP AST classes for clauses.
ImaginaryLiteral - We support imaginary integer and floating point literals, like "1...
ExprResult BuildInitList(SourceLocation LBraceLoc, MultiExprArg InitArgList, SourceLocation RBraceLoc)
This represents '#pragma omp flush' directive.
ArrayRef< concepts::Requirement * > getRequirements() const
SourceLocation getEndLoc() const LLVM_READONLY
This represents '#pragma omp parallel for simd' directive.
ExprObjectKind getObjectKind() const
getObjectKind - The object kind that this expression produces.
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.
This represents 'untied' clause in the '#pragma omp ...' directive.
TemplateArgumentLocInventIterator operator++(int)
mapperlist_range mapperlists()
ExprResult BuildCXXNoexceptExpr(SourceLocation KeyLoc, Expr *Operand, SourceLocation RParen)
SourceLocation getLParenLoc() const
Retrieve the location of the left parentheses ('(') that precedes the argument list.
bool hasTrailingReturn() const
Whether this function prototype has a trailing return type.
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.
This represents '#pragma omp parallel master taskloop' directive.
void setTypeofLoc(SourceLocation Loc)
This represents 'unified_address' clause in the '#pragma omp requires' directive. ...
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 '('.
Expr * getTrailingRequiresClause()
Get the constraint-expression introduced by the trailing requires-clause in the function/member decla...
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 '#pragma omp master taskloop simd' directive.
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...
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
TypeLoc getPatternLoc() const
A reference to an overloaded function set, either an UnresolvedLookupExpr or an UnresolvedMemberExpr...
This captures a statement into a function.
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
const Attr * getAttr() const
The type attribute.
TemplateArgumentLocInventIterator()
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
Return the number of expressions in this paren list.
This represents '#pragma omp single' directive.
Encodes a location in the source.
SourceLocation getStarLoc() const
SourceLocation getEndLoc() const LLVM_READONLY
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.
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
LangAS getAddressSpace() const
Return the address space of this type.
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.
static bool Ret(InterpState &S, CodePtr &PC, APValue &Result)
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)"...
SourceLocation getBeginLoc() const
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.
Represents the declaration of a struct/union/class/enum.
Represents a C++2a __builtin_bit_cast(T, v) expression.
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.
Represents a call to a member function that may be written either with member call syntax (e...
NamedDecl * getFoundDecl() const
SourceLocation getExceptLoc() const
SourceRange getSourceRange() const LLVM_READONLY
QualType getElementType() const
DeclStmt - Adaptor class for mixing declarations with statements and expressions. ...
bool transformOMPMappableExprListClause(TreeTransform< Derived > &TT, OMPMappableExprListClause< T > *C, llvm::SmallVectorImpl< Expr *> &Vars, CXXScopeSpec &MapperIdScopeSpec, DeclarationNameInfo &MapperIdInfo, llvm::SmallVectorImpl< Expr *> &UnresolvedMappers)
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 getEndLoc() const LLVM_READONLY
SourceLocation getProcBindKindKwLoc() const
Returns location of clause kind.
DeclarationNameInfo getDirectiveName() const
Return name of the directive.
SourceLocation getLBraceLoc() const
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>::".
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
SourceLocation getLocation() const
SourceLocation getNoexceptLoc() const
void reserve(size_t Requested)
Ensures that this buffer has at least as much capacity as described.
SourceLocation getKindLoc() const
Returns the location of the lastprivate kind.
This is a basic class for representing single OpenMP clause.
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
SourceLocation getColonLoc() const
Returns the location of the ':' delimiter.
SourceLocation getRAngleLoc() 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 getRBraceLoc() const
SourceLocation getNameModifierLoc() const
Return the location of directive name modifier.
const StringLiteral * getOutputConstraintLiteral(unsigned i) const
Represents one property declaration in an Objective-C interface.
void setElaboratedKeywordLoc(SourceLocation Loc)
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Stmt * getCapturedStmt()
Retrieve the statement being captured.
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 getColonLoc() const
Returns the location of the ':' symbol, if any.
Expr * getNumForLoops() const
Return the number of associated for-loops.
void setLBracketLoc(SourceLocation Loc)
AutoTypeKeyword getKeyword() const
SourceLocation getEndLoc() const
Expr * getArrayRangeStart(const Designator &D) const
SourceLocation getRAngleLoc() const
An expression trait intrinsic.
SourceLocation getBeginLoc() const LLVM_READONLY
EnumDecl * getDecl() const
const ObjCMethodDecl * getMethodDecl() const
A static requirement that can be used in a requires-expression to check properties of types and expre...
VarDecl * getConditionVariable()
Retrieve the variable declared in this "switch" statement, if any.
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.
CXXRecordDecl * getNamingClass()
Retrieve the naming class of this lookup.
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
This represents '#pragma omp parallel master taskloop simd' directive.
SourceLocation getBeginLoc() const LLVM_READONLY
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.
const TemplateArgumentLoc * getTemplateArgs() const
Retrieve the template arguments.
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 or init-capture pack that has been substituted bu...
Represents a template argument.
ArrayRef< OpenMPMapModifierKind > getMapTypeModifiers() const LLVM_READONLY
Fetches ArrayRef of map-type-modifiers.
SourceLocation getMemberLoc() const
TypeSourceInfo * getDestroyedTypeInfo() const
Retrieve the source location information for the type being destroyed.
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.
Optional< types::ID > Type
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
bool isNull() const
Determine whether this template name is NULL.
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.
int ArgumentPackSubstitutionIndex
The current index into pack expansion arguments that will be used for substitution of parameter packs...
OpenMPDefaultmapClauseKind getDefaultmapKind() const
Get kind of the clause.
const TemplateArgumentLoc * getTemplateArgs() const
Retrieve the template arguments provided as part of this template-id.
Stmt * getReturnStmtOnAllocFailure() const
VarDecl * getConditionVariable()
Retrieve the variable declared in this "while" statement, if any.
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
RequiresExprBodyDecl * getBody() const
Represents a delete expression for memory deallocation and destructor calls, e.g. ...
ArrayRef< Capture > captures() const
IdentifierInfo * getOutputIdentifier(unsigned i) const
The base class of all kinds of template declarations (e.g., class, function, etc.).
OverloadedOperatorKind getOperator() const
Returns the kind of overloaded operator that this expression refers to.
SourceLocation ModifierLoc
Location of linear modifier if any.
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
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.
ArrayRef< const Attr * > getAttrs() const
bool hasDependentPromiseType() const
This represents '#pragma omp section' directive.
This represents '#pragma omp teams distribute' directive.
Expr * getReturnValueInit() const
Expr * getSourceExpression() const
Interesting information about a specific parameter that can't simply be reflected in parameter's type...
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.
const Expr * getInit() const
AccessSpecifier getAccess() const
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
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.
SourceLocation getLParenLoc()
Get location of '('.
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 'unified_shared_memory' clause in the '#pragma omp requires' directive.
This represents clause 'linear' in the '#pragma omp ...' directives.
const NestedNameSpecifierLoc & getNestedNameSpecifierLoc() const
SourceLocation LAngleLoc
The source location of the left angle bracket ('<').
const Expr * getSynchExpr() const
Stmt * getInitSuspendStmt() const
A pointer to member type per C++ 8.3.3 - Pointers to members.
bool isParameterPack() const
Determine whether this variable is actually a function parameter pack or init-capture pack...
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.
SourceLocation getBeginLoc() const LLVM_READONLY
SourceLocation getBeginLoc() const
NestedNameSpecifierLoc getQualifierLoc() const
llvm::ArrayRef< TemplateArgumentLoc > arguments() 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...
OpenMPDefaultmapClauseModifier getDefaultmapModifier() const
Get the modifier of the clause.
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.
bool isExprSubstitutionFailure() const
SourceLocation getBeginLoc() const
Returns the starting location of the clause.
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
NestedNameSpecifierLoc getQualifierLoc() const
Represents a __leave statement.
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
SourceLocation getEndLoc() const
Returns the ending location of the clause.
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.
SourceLocation getBeginLoc() const
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
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 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
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.
AddrLabelExpr * getLabelExpr(unsigned i) const
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.
const Expr * getSizeExpr() const
ImplicitParamDecl * getParam(unsigned i) const
TypeLocClass getTypeLocClass() const
void setTypeArgsRAngleLoc(SourceLocation Loc)
Wrapper for source info for record types.
SourceLocation getLBracketLoc() const
Represents Objective-C's @finally statement.
SourceLocation getDefaultLoc() const
ExceptionSpecificationType
The various types of exception specifications that exist in C++11.
Wraps an ObjCPointerType with source location information.
Holds information about the various types of exception specification.
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
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.
SourceLocation getColonLoc() const
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
void setRAngleLoc(SourceLocation Loc)
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 '('.
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)
TemplateDecl * getCXXDeductionGuideTemplate() const
If this name is the name of a C++ deduction guide, return the template associated with that name...
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...
VarDecl * getConditionVariable()
Retrieve the variable declared in this "if" statement, if any.
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.
Defines Expressions and AST nodes for C++2a concepts.
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.
Stmt * getFallthroughHandler() const
SourceLocation getColonLoc() const
Represents a C array with an unspecified size.
void setArgLocInfo(unsigned i, TemplateArgumentLocInfo AI)
A requires-expression requirement which is satisfied when a general constraint expression is satisfie...
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)
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.
Represents the specialization of a concept - evaluates to a prvalue of type bool. ...
QualType getMacroQualifiedType(QualType UnderlyingTy, const IdentifierInfo *MacroII) const
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
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 '::'.
const DeclContext * getUsedContext() const
CompoundStmt * getTryBlock()
Decl * getLambdaContextDecl() const
Retrieve the declaration that provides additional context for a lambda, when the normal declaration c...
SourceLocation getCaseLoc() const
TypeLoc getTypeLoc() const
For a nested-name-specifier that refers to a type, retrieve the type with source-location information...
SourceLocation getEllipsisLoc() const
const IdentifierInfo * getMacroIdentifier() const
Represents Objective-C's @try ... @catch ... @finally statement.
SourceLocation getTemplateKWLoc() const
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
SourceLocation getTemplateKWLoc() 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.
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 rewritten comparison expression that was originally written using operator syntax.
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
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
unsigned getNumLabels() 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
bool Null(InterpState &S, CodePtr OpPC)
attr::Kind getAttrKind() const
This structure contains most locations needed for by an OMPVarListClause.
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
Return the number of arguments to the constructor call.
Wrapper for template type parameters.
const Expr * getBase() const
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 '('.
SourceLocation getBeginLoc() const LLVM_READONLY
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
void setBlockMissingReturnType(bool val=true)
const ExtParameterInfo * getExtParameterInfosOrNull() const
Return a pointer to the beginning of the array of extra parameter information, if present...
SourceLocation getRightLoc() const
ConceptDecl * getTypeConstraintConcept() const
attr::Kind getKind() const
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
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.
Wrapper for source info for pointers.
const DeclarationNameInfo & getMapperIdInfo() const
Gets the name info for associated user-defined mapper.
SourceLocation getBegin() const
TypeSourceInfo * getTypeSourceInfo() const
getTypeSourceInfo - Return the destination type.
Expr * getSubExpr() const
Retrieve the temporary-generating subexpression whose value will be materialized into a glvalue...
QualType CheckTypenameType(ElaboratedTypeKeyword Keyword, SourceLocation KeywordLoc, NestedNameSpecifierLoc QualifierLoc, const IdentifierInfo &II, SourceLocation IILoc, TypeSourceInfo **TSI, bool DeducedTSTContext)
BinaryOperatorKind getOperator() const
SourceLocation ColonLoc
Location of ':'.
SourceLocation getRParenLoc() const
Return the location of the right parentheses.
This represents clause 'nontemporal' in the '#pragma omp ...' directives.
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
QualType getAutoType(QualType DeducedType, AutoTypeKeyword Keyword, bool IsDependent, bool IsPack=false, ConceptDecl *TypeConstraintConcept=nullptr, ArrayRef< TemplateArgument > TypeConstraintArgs={}) const
C++11 deduced auto type.
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
Represents an implicitly-generated value initialization of an object of a given type.
CompoundStmt * getBlock() const
SourceLocation getConceptNameLoc() const
SourceLocation getReturnLoc() const
bool Sub(InterpState &S, CodePtr OpPC)
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.
association_range associations()
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
static OMPLinearClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, OpenMPLinearClauseKind Modifier, SourceLocation ModifierLoc, SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef< Expr *> VL, ArrayRef< Expr *> PL, ArrayRef< Expr *> IL, Expr *Step, Expr *CalcStep, Stmt *PreInit, Expr *PostUpdate)
Creates clause with a list of variables VL and a linear step Step.
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...
SourceLocation getEndLoc() const LLVM_READONLY
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.
const ReturnTypeRequirement & getReturnTypeRequirement() const
This represents '#pragma omp taskloop' directive.