13 #ifndef LLVM_CLANG_LIB_SEMA_TREETRANSFORM_H 14 #define LLVM_CLANG_LIB_SEMA_TREETRANSFORM_H 36 #include "llvm/ADT/ArrayRef.h" 37 #include "llvm/Support/ErrorHandling.h" 94 template<
typename Derived>
99 class ForgetPartiallySubstitutedPackRAII {
104 ForgetPartiallySubstitutedPackRAII(Derived &Self) : Self(Self) {
105 Old = Self.ForgetPartiallySubstitutedPack();
108 ~ForgetPartiallySubstitutedPackRAII() {
109 Self.RememberPartiallySubstitutedPack(Old);
126 Derived &
getDerived() {
return static_cast<Derived&
>(*this); }
130 return static_cast<const Derived&
>(*this);
188 OldLocation = Self.
getDerived().getBaseLocation();
189 OldEntity = Self.
getDerived().getBaseEntity();
196 Self.
getDerived().setBase(OldLocation, OldEntity);
262 bool &RetainExpansion,
264 ShouldExpand =
false;
362 const Attr *TransformAttr(
const Attr *S);
371 #define PRAGMA_SPELLING_ATTR(X) \ 372 const X##Attr *Transform##X##Attr(const X##Attr *R) { return R; } 373 #include "clang/Basic/AttrList.inc" 392 ExprResult TransformInitializer(Expr *Init,
bool NotCopyInit);
417 bool TransformExprs(Expr *
const *Inputs,
unsigned NumInputs,
bool IsCall,
418 SmallVectorImpl<Expr *> &Outputs,
419 bool *ArgChanged =
nullptr);
428 llvm::DenseMap<Decl *, Decl *>::iterator Known
429 = TransformedLocalDecls.find(D);
430 if (Known != TransformedLocalDecls.end())
431 return Known->second;
459 assert(New.size() == 1 &&
460 "must override transformedLocalDecl if performing pack expansion");
461 TransformedLocalDecls[Old] = New.front();
469 return getDerived().TransformDecl(Loc, D);
482 return cast_or_null<NamedDecl>(getDerived().TransformDecl(Loc, D));
486 bool TransformOverloadExprDecls(
OverloadExpr *Old,
bool RequiresADL,
498 NamedDecl *FirstQualifierInScope =
nullptr);
533 NamedDecl *FirstQualifierInScope =
nullptr,
534 bool AllowInjectedClassName =
false);
546 bool Uneval =
false);
569 bool Uneval =
false) {
570 return TransformTemplateArguments(Inputs, Inputs + NumInputs, Outputs,
588 template<
typename InputIterator>
589 bool TransformTemplateArguments(InputIterator
First,
592 bool Uneval =
false);
601 getDerived().getBaseLocation());
604 #define ABSTRACT_TYPELOC(CLASS, PARENT) 605 #define TYPELOC(CLASS, PARENT) \ 606 QualType Transform##CLASS##Type(TypeLocBuilder &TLB, CLASS##TypeLoc T); 607 #include "clang/AST/TypeLocNodes.def" 609 template<
typename Fn>
610 QualType TransformFunctionProtoType(TypeLocBuilder &TLB,
611 FunctionProtoTypeLoc TL,
612 CXXRecordDecl *ThisContext,
613 Qualifiers ThisTypeQuals,
614 Fn TransformExceptionSpec);
616 bool TransformExceptionSpec(SourceLocation Loc,
617 FunctionProtoType::ExceptionSpecInfo &ESI,
618 SmallVectorImpl<QualType> &Exceptions,
621 StmtResult TransformSEHHandler(Stmt *Handler);
624 TransformTemplateSpecializationType(TypeLocBuilder &TLB,
625 TemplateSpecializationTypeLoc TL,
626 TemplateName Template);
629 TransformDependentTemplateSpecializationType(TypeLocBuilder &TLB,
630 DependentTemplateSpecializationTypeLoc TL,
631 TemplateName Template,
634 QualType TransformDependentTemplateSpecializationType(
635 TypeLocBuilder &TLB, DependentTemplateSpecializationTypeLoc TL,
636 NestedNameSpecifierLoc QualifierLoc);
645 bool TransformFunctionTypeParams(
646 SourceLocation Loc, ArrayRef<ParmVarDecl *> Params,
647 const QualType *ParamTypes,
648 const FunctionProtoType::ExtParameterInfo *ParamInfos,
649 SmallVectorImpl<QualType> &PTypes, SmallVectorImpl<ParmVarDecl *> *PVars,
650 Sema::ExtParameterInfoBuilder &PInfos);
657 ParmVarDecl *TransformFunctionTypeParam(ParmVarDecl *OldParm,
659 Optional<unsigned> NumExpansions,
660 bool ExpectParameterPack);
663 StmtResult TransformLambdaBody(LambdaExpr *E, Stmt *Body);
666 StmtResult SkipLambdaBody(LambdaExpr *E, Stmt *Body);
668 QualType TransformReferenceType(TypeLocBuilder &TLB, ReferenceTypeLoc TL);
670 StmtResult TransformCompoundStmt(CompoundStmt *S,
bool IsStmtExpr);
671 ExprResult TransformCXXNamedCastExpr(CXXNamedCastExpr *E);
681 bool IsAddressOfOperand,
684 ExprResult TransformParenDependentScopeDeclRefExpr(
692 #define STMT(Node, Parent) \ 693 LLVM_ATTRIBUTE_NOINLINE \ 694 StmtResult Transform##Node(Node *S); 695 #define VALUESTMT(Node, Parent) \ 696 LLVM_ATTRIBUTE_NOINLINE \ 697 StmtResult Transform##Node(Node *S, StmtDiscardKind SDK); 698 #define EXPR(Node, Parent) \ 699 LLVM_ATTRIBUTE_NOINLINE \ 700 ExprResult Transform##Node(Node *E); 701 #define ABSTRACT_STMT(Stmt) 702 #include "clang/AST/StmtNodes.inc" 704 #define OPENMP_CLAUSE(Name, Class) \ 705 LLVM_ATTRIBUTE_NOINLINE \ 706 OMPClause *Transform ## Class(Class *S); 707 #include "clang/Basic/OpenMPKinds.def" 715 QualType RebuildQualifiedType(QualType T, QualifiedTypeLoc TL);
721 QualType RebuildPointerType(QualType PointeeType, SourceLocation Sigil);
727 QualType RebuildBlockPointerType(QualType PointeeType, SourceLocation Sigil);
737 QualType RebuildReferenceType(QualType ReferentType,
739 SourceLocation Sigil);
746 QualType RebuildMemberPointerType(QualType PointeeType, QualType ClassType,
747 SourceLocation Sigil);
749 QualType RebuildObjCTypeParamType(
const ObjCTypeParamDecl *Decl,
750 SourceLocation ProtocolLAngleLoc,
751 ArrayRef<ObjCProtocolDecl *> Protocols,
752 ArrayRef<SourceLocation> ProtocolLocs,
753 SourceLocation ProtocolRAngleLoc);
759 QualType RebuildObjCObjectType(QualType BaseType,
761 SourceLocation TypeArgsLAngleLoc,
762 ArrayRef<TypeSourceInfo *> TypeArgs,
763 SourceLocation TypeArgsRAngleLoc,
764 SourceLocation ProtocolLAngleLoc,
765 ArrayRef<ObjCProtocolDecl *> Protocols,
766 ArrayRef<SourceLocation> ProtocolLocs,
767 SourceLocation ProtocolRAngleLoc);
773 QualType RebuildObjCObjectPointerType(QualType PointeeType,
774 SourceLocation Star);
783 QualType RebuildArrayType(QualType ElementType,
785 const llvm::APInt *Size,
787 unsigned IndexTypeQuals,
788 SourceRange BracketsRange);
795 QualType RebuildConstantArrayType(QualType ElementType,
797 const llvm::APInt &Size,
798 unsigned IndexTypeQuals,
799 SourceRange BracketsRange);
806 QualType RebuildIncompleteArrayType(QualType ElementType,
808 unsigned IndexTypeQuals,
809 SourceRange BracketsRange);
816 QualType RebuildVariableArrayType(QualType ElementType,
819 unsigned IndexTypeQuals,
820 SourceRange BracketsRange);
827 QualType RebuildDependentSizedArrayType(QualType ElementType,
830 unsigned IndexTypeQuals,
831 SourceRange BracketsRange);
838 QualType RebuildVectorType(QualType ElementType,
unsigned NumElements,
846 QualType RebuildDependentVectorType(QualType ElementType, Expr *SizeExpr,
847 SourceLocation AttributeLoc,
855 QualType RebuildExtVectorType(QualType ElementType,
unsigned NumElements,
856 SourceLocation AttributeLoc);
863 QualType RebuildDependentSizedExtVectorType(QualType ElementType,
865 SourceLocation AttributeLoc);
875 QualType RebuildDependentAddressSpaceType(QualType PointeeType,
877 SourceLocation AttributeLoc);
883 QualType RebuildFunctionProtoType(QualType T,
884 MutableArrayRef<QualType> ParamTypes,
885 const FunctionProtoType::ExtProtoInfo &EPI);
888 QualType RebuildFunctionNoProtoType(QualType ResultType);
892 QualType RebuildUnresolvedUsingType(SourceLocation NameLoc, Decl *D);
953 Template, Deduced,
false);
999 bool AllowInjectedClassName) {
1003 SS.
Adopt(QualifierLoc);
1004 TemplateName InstName = getDerived().RebuildTemplateName(
1005 SS, TemplateKWLoc, *Name, NameLoc,
QualType(),
nullptr,
1006 AllowInjectedClassName);
1021 getDerived().RebuildTemplateSpecializationType(InstName, NameLoc, Args);
1042 bool DeducedTSTContext) {
1044 SS.
Adopt(QualifierLoc);
1059 if (!DeducedTSTContext) {
1060 if (
auto *Deduced = dyn_cast_or_null<DeducedTemplateSpecializationType>(
1062 SemaRef.
Diag(IdLoc, diag::err_dependent_deduced_tst)
1064 Deduced->getTemplateName())
1066 if (
auto *TD = Deduced->getTemplateName().getAsTemplateDecl())
1067 SemaRef.
Diag(TD->getLocation(), diag::note_template_decl_here);
1100 llvm_unreachable(
"Tag lookup cannot find non-tags");
1118 SemaRef.
Diag(IdLoc, diag::err_tag_reference_non_tag) << SomeDecl
1124 SemaRef.
Diag(IdLoc, diag::err_not_tag_in_scope)
1133 SemaRef.
Diag(KeywordLoc, diag::err_use_with_wrong_tag) <<
Id;
1153 return getSema().CheckPackExpansion(Pattern, PatternRange, EllipsisLoc,
1189 bool AllowInjectedClassName);
1202 bool AllowInjectedClassName);
1213 return getSema().Context.getSubstTemplateTemplateParmPack(Param, ArgPack);
1224 return getSema().ActOnCompoundStmt(LBraceLoc, RBraceLoc, Statements,
1237 return getSema().ActOnCaseStmt(CaseLoc, LHS, EllipsisLoc, RHS,
1246 getSema().ActOnCaseStmtBody(S, Body);
1257 return getSema().ActOnDefaultStmt(DefaultLoc, ColonLoc, SubStmt,
1287 return getSema().ActOnIfStmt(IfLoc, IsConstexpr, Init, Cond, Then,
1297 return getSema().ActOnStartOfSwitchStmt(SwitchLoc, Init, Cond);
1306 return getSema().ActOnFinishSwitchStmt(SwitchLoc, Switch, Body);
1315 return getSema().ActOnWhileStmt(WhileLoc, Cond, Body);
1325 return getSema().ActOnDoStmt(DoLoc, Body, WhileLoc, LParenLoc,
1337 return getSema().ActOnForStmt(ForLoc, LParenLoc, Init, Cond,
1338 Inc, RParenLoc, Body);
1347 return getSema().ActOnGotoStmt(GotoLoc, LabelLoc, Label);
1357 return getSema().ActOnIndirectGotoStmt(GotoLoc, StarLoc, Target);
1365 return getSema().BuildReturnStmt(ReturnLoc, Result);
1375 return getSema().ActOnDeclStmt(DG, StartLoc, EndLoc);
1383 bool IsVolatile,
unsigned NumOutputs,
1389 return getSema().ActOnGCCAsmStmt(AsmLoc, IsSimple, IsVolatile, NumOutputs,
1390 NumInputs, Names, Constraints, Exprs,
1391 AsmString, Clobbers, NumLabels, RParenLoc);
1400 StringRef AsmString,
1401 unsigned NumOutputs,
unsigned NumInputs,
1406 return getSema().ActOnMSAsmStmt(AsmLoc, LBraceLoc, AsmToks, AsmString,
1407 NumOutputs, NumInputs,
1408 Constraints, Clobbers, Exprs, EndLoc);
1417 return getSema().BuildCoreturnStmt(CoreturnLoc, Result, IsImplicit);
1426 return getSema().BuildResolvedCoawaitExpr(CoawaitLoc, Result, IsImplicit);
1436 return getSema().BuildUnresolvedCoawaitExpr(CoawaitLoc, Result, Lookup);
1444 return getSema().BuildCoyieldExpr(CoyieldLoc, Result);
1448 return getSema().BuildCoroutineBodyStmt(Args);
1459 return getSema().ActOnObjCAtTryStmt(AtLoc, TryBody, CatchStmts,
1469 return getSema().BuildObjCExceptionDecl(TInfo, T,
1483 return getSema().ActOnObjCAtCatchStmt(AtLoc, RParenLoc,
1493 return getSema().ActOnObjCAtFinallyStmt(AtLoc, Body);
1502 return getSema().BuildObjCAtThrowStmt(AtLoc, Operand);
1515 return getSema().ActOnOpenMPExecutableDirective(
1516 Kind, DirName, CancelRegion, Clauses, AStmt, StartLoc, EndLoc);
1529 return getSema().ActOnOpenMPIfClause(NameModifier, Condition, StartLoc,
1530 LParenLoc, NameModifierLoc, ColonLoc,
1541 return getSema().ActOnOpenMPFinalClause(Condition, StartLoc, LParenLoc,
1553 return getSema().ActOnOpenMPNumThreadsClause(NumThreads, StartLoc,
1564 return getSema().ActOnOpenMPSafelenClause(Len, StartLoc, LParenLoc, EndLoc);
1574 return getSema().ActOnOpenMPSimdlenClause(Len, StartLoc, LParenLoc, EndLoc);
1584 return getSema().ActOnOpenMPAllocatorClause(A, StartLoc, LParenLoc, EndLoc);
1594 return getSema().ActOnOpenMPCollapseClause(Num, StartLoc, LParenLoc,
1607 return getSema().ActOnOpenMPDefaultClause(Kind, KindKwLoc,
1608 StartLoc, LParenLoc, EndLoc);
1620 return getSema().ActOnOpenMPProcBindClause(Kind, KindKwLoc,
1621 StartLoc, LParenLoc, EndLoc);
1633 return getSema().ActOnOpenMPScheduleClause(
1634 M1, M2, Kind, ChunkSize, StartLoc, LParenLoc, M1Loc, M2Loc, KindLoc,
1645 return getSema().ActOnOpenMPOrderedClause(StartLoc, EndLoc, LParenLoc, Num);
1656 return getSema().ActOnOpenMPPrivateClause(VarList, StartLoc, LParenLoc,
1668 return getSema().ActOnOpenMPFirstprivateClause(VarList, StartLoc, LParenLoc,
1680 return getSema().ActOnOpenMPLastprivateClause(VarList, StartLoc, LParenLoc,
1692 return getSema().ActOnOpenMPSharedClause(VarList, StartLoc, LParenLoc,
1708 return getSema().ActOnOpenMPReductionClause(
1709 VarList, StartLoc, LParenLoc, ColonLoc, EndLoc, ReductionIdScopeSpec,
1710 ReductionId, UnresolvedReductions);
1723 return getSema().ActOnOpenMPTaskReductionClause(
1724 VarList, StartLoc, LParenLoc, ColonLoc, EndLoc, ReductionIdScopeSpec,
1725 ReductionId, UnresolvedReductions);
1739 return getSema().ActOnOpenMPInReductionClause(
1740 VarList, StartLoc, LParenLoc, ColonLoc, EndLoc, ReductionIdScopeSpec,
1741 ReductionId, UnresolvedReductions);
1755 return getSema().ActOnOpenMPLinearClause(VarList, Step, StartLoc, LParenLoc,
1756 Modifier, ModifierLoc, ColonLoc,
1769 return getSema().ActOnOpenMPAlignedClause(VarList, Alignment, StartLoc,
1770 LParenLoc, ColonLoc, EndLoc);
1781 return getSema().ActOnOpenMPCopyinClause(VarList, StartLoc, LParenLoc,
1793 return getSema().ActOnOpenMPCopyprivateClause(VarList, StartLoc, LParenLoc,
1805 return getSema().ActOnOpenMPFlushClause(VarList, StartLoc, LParenLoc,
1818 return getSema().ActOnOpenMPDependClause(DepKind, DepLoc, ColonLoc, VarList,
1819 StartLoc, LParenLoc, EndLoc);
1829 return getSema().ActOnOpenMPDeviceClause(Device, StartLoc, LParenLoc,
1844 return getSema().ActOnOpenMPMapClause(MapTypeModifiers, MapTypeModifiersLoc,
1845 MapperIdScopeSpec, MapperId, MapType,
1846 IsMapTypeImplicit, MapLoc, ColonLoc,
1847 VarList, Locs, UnresolvedMappers);
1859 return getSema().ActOnOpenMPAllocateClause(Allocate, VarList, StartLoc,
1860 LParenLoc, ColonLoc, EndLoc);
1870 return getSema().ActOnOpenMPNumTeamsClause(NumTeams, StartLoc, LParenLoc,
1882 return getSema().ActOnOpenMPThreadLimitClause(ThreadLimit, StartLoc,
1893 return getSema().ActOnOpenMPPriorityClause(Priority, StartLoc, LParenLoc,
1904 return getSema().ActOnOpenMPGrainsizeClause(Grainsize, StartLoc, LParenLoc,
1915 return getSema().ActOnOpenMPNumTasksClause(NumTasks, StartLoc, LParenLoc,
1926 return getSema().ActOnOpenMPHintClause(Hint, StartLoc, LParenLoc, EndLoc);
1938 return getSema().ActOnOpenMPDistScheduleClause(
1939 Kind, ChunkSize, StartLoc, LParenLoc, KindLoc, CommaLoc, EndLoc);
1951 return getSema().ActOnOpenMPToClause(VarList, MapperIdScopeSpec, MapperId,
1952 Locs, UnresolvedMappers);
1964 return getSema().ActOnOpenMPFromClause(VarList, MapperIdScopeSpec, MapperId,
1965 Locs, UnresolvedMappers);
1974 return getSema().ActOnOpenMPUseDevicePtrClause(VarList, Locs);
1983 return getSema().ActOnOpenMPIsDevicePtrClause(VarList, Locs);
1992 return getSema().ActOnObjCAtSynchronizedOperand(atLoc,
object);
2001 return getSema().ActOnObjCAtSynchronizedStmt(AtLoc, Object, Body);
2010 return getSema().ActOnObjCAutoreleasePoolStmt(AtLoc, Body);
2022 StmtResult ForEachStmt = getSema().ActOnObjCForCollectionStmt(ForLoc,
2029 return getSema().FinishObjCForCollectionStmt(ForEachStmt.
get(), Body);
2041 VarDecl *Var = getSema().BuildExceptionDeclaration(
nullptr, Declarator,
2042 StartLoc, IdLoc, Id);
2044 getSema().CurContext->addDecl(Var);
2055 return Owned(
new (getSema().Context)
CXXCatchStmt(CatchLoc, ExceptionDecl,
2065 return getSema().ActOnCXXTryBlock(TryLoc, TryBlock, Handlers);
2080 if (
DeclStmt *RangeStmt = dyn_cast<DeclStmt>(Range)) {
2081 if (RangeStmt->isSingleDecl()) {
2082 if (
VarDecl *RangeVar = dyn_cast<VarDecl>(RangeStmt->getSingleDecl())) {
2083 if (RangeVar->isInvalidDecl())
2086 Expr *RangeExpr = RangeVar->getInit();
2093 diag::err_objc_for_range_init_stmt)
2096 return getSema().ActOnObjCForCollectionStmt(ForLoc, LoopVar,
2097 RangeExpr, RParenLoc);
2103 return getSema().BuildCXXForRangeStmt(ForLoc, CoawaitLoc, Init, ColonLoc,
2104 Range, Begin, End, Cond, Inc, LoopVar,
2117 return getSema().BuildMSDependentExistsStmt(KeywordLoc, IsIfExists,
2118 QualifierLoc, NameInfo, Nested);
2126 return getSema().FinishCXXForRangeStmt(ForRange, Body);
2131 return getSema().ActOnSEHTryBlock(IsCXXTry, TryLoc, TryBlock, Handler);
2136 return getSema().ActOnSEHExceptBlock(Loc, FilterExpr, Block);
2149 return getSema().BuildPredefinedExpr(Loc, IK);
2159 return getSema().BuildDeclarationNameExpr(SS, R, RequiresADL);
2172 SS.
Adopt(QualifierLoc);
2176 return getSema().BuildDeclarationNameExpr(SS, NameInfo, VD);
2185 return getSema().ActOnParenExpr(LParen, RParen, SubExpr);
2208 return getSema().BuildUnaryOp(
nullptr, OpLoc, Opc, SubExpr);
2219 return getSema().BuildBuiltinOffsetOf(OperatorLoc, Type, Components,
2232 return getSema().CreateUnaryExprOrTypeTraitExpr(TInfo, OpLoc, ExprKind, R);
2244 = getSema().CreateUnaryExprOrTypeTraitExpr(SubExpr, OpLoc, ExprKind);
2259 return getSema().ActOnArraySubscriptExpr(
nullptr, LHS,
2272 return getSema().ActOnOMPArraySectionExpr(Base, LBracketLoc, LowerBound,
2273 ColonLoc, Length, RBracketLoc);
2283 Expr *ExecConfig =
nullptr) {
2284 return getSema().BuildCallExpr(
nullptr, Callee, LParenLoc, Args,
2285 RParenLoc, ExecConfig);
2308 "unnamed member not of record type?");
2311 getSema().PerformObjectMemberConversion(BaseResult.get(),
2314 if (BaseResult.isInvalid())
2316 Base = BaseResult.get();
2319 return getSema().BuildFieldReferenceExpr(
2320 Base, isArrow, OpLoc, EmptySS, cast<FieldDecl>(Member),
2325 SS.
Adopt(QualifierLoc);
2327 Base = BaseResult.
get();
2339 return getSema().BuildMemberReferenceExpr(Base, BaseType, OpLoc, isArrow,
2341 FirstQualifierInScope,
2342 R, ExplicitTemplateArgs,
2353 return getSema().BuildBinOp(
nullptr, OpLoc, Opc, LHS, RHS);
2365 return getSema().ActOnConditionalOp(QuestionLoc, ColonLoc, Cond,
2377 return getSema().BuildCStyleCastExpr(LParenLoc, TInfo, RParenLoc,
2389 return getSema().BuildCompoundLiteralExpr(LParenLoc, TInfo, RParenLoc,
2404 return getSema().BuildMemberReferenceExpr(Base, Base->
getType(),
2457 return getSema().BuildVAArgExpr(BuiltinLoc,
2469 return getSema().ActOnParenListExpr(LParenLoc, RParenLoc, SubExprs);
2479 return getSema().ActOnAddrLabel(AmpAmpLoc, LabelLoc, Label);
2489 return getSema().ActOnStmtExpr(LParenLoc, SubStmt, RParenLoc);
2511 Expr *ControllingExpr,
2514 return getSema().CreateGenericSelectionExpr(KeyLoc, DefaultLoc, RParenLoc,
2515 ControllingExpr, Types, Exprs);
2547 case Stmt::CXXStaticCastExprClass:
2548 return getDerived().RebuildCXXStaticCastExpr(OpLoc, LAngleLoc, TInfo,
2549 RAngleLoc, LParenLoc,
2550 SubExpr, RParenLoc);
2552 case Stmt::CXXDynamicCastExprClass:
2553 return getDerived().RebuildCXXDynamicCastExpr(OpLoc, LAngleLoc, TInfo,
2554 RAngleLoc, LParenLoc,
2555 SubExpr, RParenLoc);
2557 case Stmt::CXXReinterpretCastExprClass:
2558 return getDerived().RebuildCXXReinterpretCastExpr(OpLoc, LAngleLoc, TInfo,
2559 RAngleLoc, LParenLoc,
2563 case Stmt::CXXConstCastExprClass:
2564 return getDerived().RebuildCXXConstCastExpr(OpLoc, LAngleLoc, TInfo,
2565 RAngleLoc, LParenLoc,
2566 SubExpr, RParenLoc);
2569 llvm_unreachable(
"Invalid C++ named cast");
2584 return getSema().BuildCXXNamedCast(OpLoc, tok::kw_static_cast,
2601 return getSema().BuildCXXNamedCast(OpLoc, tok::kw_dynamic_cast,
2618 return getSema().BuildCXXNamedCast(OpLoc, tok::kw_reinterpret_cast,
2635 return getSema().BuildCXXNamedCast(OpLoc, tok::kw_const_cast,
2649 bool ListInitialization) {
2650 return getSema().BuildCXXTypeConstructExpr(TInfo, LParenLoc,
2652 ListInitialization);
2662 return getSema().BuildBuiltinBitCastExpr(KWLoc, TSI, Sub, RParenLoc);
2673 return getSema().BuildCXXTypeId(TypeInfoType, TypeidLoc, Operand,
2686 return getSema().BuildCXXTypeId(TypeInfoType, TypeidLoc, Operand,
2698 return getSema().BuildCXXUuidof(TypeInfoType, TypeidLoc, Operand,
2710 return getSema().BuildCXXUuidof(TypeInfoType, TypeidLoc, Operand,
2722 return getSema().BuildCXXThisExpr(ThisLoc, ThisType, isImplicit);
2730 bool IsThrownVariableInScope) {
2731 return getSema().BuildCXXThrow(ThrowLoc, Sub, IsThrownVariableInScope);
2741 getSema().CurContext);
2752 getSema().CurContext);
2762 return getSema().BuildCXXTypeConstructExpr(
2763 TSInfo, LParenLoc, None, RParenLoc,
false);
2780 Expr *Initializer) {
2781 return getSema().BuildCXXNew(StartLoc, UseGlobal,
2798 bool IsGlobalDelete,
2801 return getSema().ActOnCXXDelete(StartLoc, IsGlobalDelete, IsArrayForm,
2813 return getSema().BuildTypeTrait(Trait, StartLoc, Args, RParenLoc);
2825 return getSema().BuildArrayTypeTrait(Trait, StartLoc, TSInfo, DimExpr, RParenLoc);
2836 return getSema().BuildExpressionTrait(Trait, StartLoc, Queried, RParenLoc);
2849 bool IsAddressOfOperand,
2852 SS.
Adopt(QualifierLoc);
2854 if (TemplateArgs || TemplateKWLoc.
isValid())
2855 return getSema().BuildQualifiedTemplateIdExpr(SS, TemplateKWLoc, NameInfo,
2858 return getSema().BuildQualifiedDeclarationNameExpr(
2859 SS, NameInfo, IsAddressOfOperand,
nullptr, RecoveryTSI);
2871 return getSema().BuildTemplateIdExpr(SS, TemplateKWLoc, R, RequiresADL,
2884 bool HadMultipleCandidates,
2885 bool ListInitialization,
2886 bool StdInitListInitialization,
2887 bool RequiresZeroInit,
2891 if (getSema().CompleteConstructorCall(Constructor, Args, Loc,
2895 return getSema().BuildCXXConstructExpr(Loc, T, Constructor,
2898 HadMultipleCandidates,
2900 StdInitListInitialization,
2901 RequiresZeroInit, ConstructKind,
2909 bool ConstructsVBase,
2910 bool InheritedFromVBase) {
2912 Loc, T, Constructor, ConstructsVBase, InheritedFromVBase);
2923 bool ListInitialization) {
2924 return getSema().BuildCXXTypeConstructExpr(
2925 TSInfo, LParenOrBraceLoc, Args, RParenOrBraceLoc, ListInitialization);
2936 bool ListInitialization) {
2937 return getSema().BuildCXXTypeConstructExpr(TSInfo, LParenLoc, Args,
2938 RParenLoc, ListInitialization);
2955 SS.
Adopt(QualifierLoc);
2958 OperatorLoc, IsArrow,
2960 FirstQualifierInScope,
2962 TemplateArgs,
nullptr);
2978 SS.
Adopt(QualifierLoc);
2981 OperatorLoc, IsArrow,
2983 FirstQualifierInScope,
2984 R, TemplateArgs,
nullptr);
3003 RParenLoc, Length, PartialArgs);
3015 return getSema().BuildSourceLocExpr(Kind, BuiltinLoc, RPLoc, ParentContext);
3023 return getSema().BuildObjCBoxedExpr(SR, ValueExpr);
3031 Expr **Elements,
unsigned NumElements) {
3032 return getSema().BuildObjCArrayLiteral(Range,
3040 return getSema().BuildObjCSubscriptExpression(RB, Base, Key,
3041 getterMethod, setterMethod);
3050 return getSema().BuildObjCDictionaryLiteral(Range, Elements);
3074 Sel, Method, LBracLoc, SelectorLocs,
3089 Sel, Method, LBracLoc, SelectorLocs,
3105 Sel, Method, LBracLoc, SelectorLocs,
3110 Sel, Method, LBracLoc, SelectorLocs,
3122 bool IsArrow,
bool IsFreeIvar) {
3125 ExprResult Result = getSema().BuildMemberReferenceExpr(
3131 if (IsFreeIvar && Result.isUsable())
3132 cast<ObjCIvarRefExpr>(Result.get())->setIsFreeIvar(IsFreeIvar);
3145 return getSema().BuildMemberReferenceExpr(BaseArg, BaseArg->
getType(),
3168 PropertyLoc, Base));
3179 return getSema().BuildMemberReferenceExpr(BaseArg, BaseArg->
getType(),
3200 assert(!Lookup.
empty() &&
"No __builtin_shufflevector?");
3209 CK_BuiltinFnToFnPtr).
get();
3213 SemaRef.
Context, Callee, SubExprs, Builtin->getCallResultType(),
3225 BuiltinLoc, RParenLoc);
3240 EllipsisLoc, NumExpansions);
3261 llvm_unreachable(
"Pack expansion pattern has no parameter packs");
3283 return getSema().CheckPackExpansion(Pattern, EllipsisLoc, NumExpansions);
3295 return getSema().BuildCXXFoldExpr(LParenLoc, LHS, Operator, EllipsisLoc,
3296 RHS, RParenLoc, NumExpansions);
3305 return getSema().BuildEmptyCXXFoldExpr(EllipsisLoc, Operator);
3341 bool DeducibleTSTContext);
3344 template <
typename Derived>
3354 #define STMT(Node, Parent) \ 3355 case Stmt::Node##Class: return getDerived().Transform##Node(cast<Node>(S)); 3356 #define VALUESTMT(Node, Parent) \ 3357 case Stmt::Node##Class: \ 3358 return getDerived().Transform##Node(cast<Node>(S), SDK); 3359 #define ABSTRACT_STMT(Node) 3360 #define EXPR(Node, Parent) 3361 #include "clang/AST/StmtNodes.inc" 3364 #define STMT(Node, Parent) 3365 #define ABSTRACT_STMT(Stmt) 3366 #define EXPR(Node, Parent) case Stmt::Node##Class: 3367 #include "clang/AST/StmtNodes.inc" 3369 ExprResult E = getDerived().TransformExpr(cast<Expr>(S));
3371 if (SDK == SDK_StmtExprResult)
3372 E = getSema().ActOnStmtExprResult(E);
3373 return getSema().ActOnExprStmt(E, SDK == SDK_Discarded);
3380 template<
typename Derived>
3388 #define OPENMP_CLAUSE(Name, Class) \ 3389 case OMPC_ ## Name : \ 3390 return getDerived().Transform ## Class(cast<Class>(S)); 3391 #include "clang/Basic/OpenMPKinds.def" 3398 template<
typename Derived>
3405 #define STMT(Node, Parent) case Stmt::Node##Class: break; 3406 #define ABSTRACT_STMT(Stmt) 3407 #define EXPR(Node, Parent) \ 3408 case Stmt::Node##Class: return getDerived().Transform##Node(cast<Node>(E)); 3409 #include "clang/AST/StmtNodes.inc" 3415 template<
typename Derived>
3423 if (
auto *FE = dyn_cast<FullExpr>(Init))
3424 Init = FE->getSubExpr();
3426 if (
auto *AIL = dyn_cast<ArrayInitLoopExpr>(Init))
3427 Init = AIL->getCommonExpr();
3430 Init = MTE->GetTemporaryExpr();
3433 Init = Binder->getSubExpr();
3436 Init = ICE->getSubExprAsWritten();
3439 dyn_cast<CXXStdInitializerListExpr>(Init))
3440 return TransformInitializer(ILE->getSubExpr(), NotCopyInit);
3446 if (!NotCopyInit && !(Construct && Construct->isListInitialization()))
3447 return getDerived().TransformExpr(Init);
3452 return getDerived().RebuildParenListExpr(Parens.
getBegin(), None,
3457 if (isa<ImplicitValueInitExpr>(Init))
3463 if (!Construct || isa<CXXTemporaryObjectExpr>(Construct))
3464 return getDerived().TransformExpr(Init);
3468 if (Construct && Construct->isStdInitListInitialization())
3469 return TransformInitializer(Construct->getArg(0), NotCopyInit);
3474 Construct->isListInitialization());
3477 bool ArgChanged =
false;
3478 if (getDerived().TransformExprs(Construct->getArgs(), Construct->getNumArgs(),
3479 true, NewArgs, &ArgChanged))
3483 if (Construct->isListInitialization())
3484 return getDerived().RebuildInitList(Construct->getBeginLoc(), NewArgs,
3485 Construct->getEndLoc());
3488 SourceRange Parens = Construct->getParenOrBraceRange();
3492 assert(NewArgs.empty() &&
3493 "no parens or braces but have direct init with arguments?");
3496 return getDerived().RebuildParenListExpr(Parens.
getBegin(), NewArgs,
3500 template<
typename Derived>
3506 for (
unsigned I = 0; I != NumInputs; ++I) {
3508 if (IsCall && getDerived().DropCallArgument(Inputs[I])) {
3516 Expr *Pattern = Expansion->getPattern();
3519 getSema().collectUnexpandedParameterPacks(Pattern, Unexpanded);
3520 assert(!Unexpanded.empty() &&
"Pack expansion without parameter packs?");
3525 bool RetainExpansion =
false;
3528 if (getDerived().TryExpandParameterPacks(Expansion->getEllipsisLoc(),
3531 Expand, RetainExpansion,
3540 ExprResult OutPattern = getDerived().TransformExpr(Pattern);
3544 ExprResult Out = getDerived().RebuildPackExpansion(OutPattern.
get(),
3545 Expansion->getEllipsisLoc(),
3552 Outputs.push_back(Out.
get());
3558 if (ArgChanged) *ArgChanged =
true;
3562 for (
unsigned I = 0; I != *NumExpansions; ++I) {
3564 ExprResult Out = getDerived().TransformExpr(Pattern);
3568 if (Out.
get()->containsUnexpandedParameterPack()) {
3569 Out = getDerived().RebuildPackExpansion(
3570 Out.
get(), Expansion->getEllipsisLoc(), OrigNumExpansions);
3575 Outputs.push_back(Out.
get());
3580 if (RetainExpansion) {
3581 ForgetPartiallySubstitutedPackRAII Forget(getDerived());
3583 ExprResult Out = getDerived().TransformExpr(Pattern);
3587 Out = getDerived().RebuildPackExpansion(
3588 Out.
get(), Expansion->getEllipsisLoc(), OrigNumExpansions);
3592 Outputs.push_back(Out.
get());
3599 IsCall ? getDerived().TransformInitializer(Inputs[I],
false)
3600 : getDerived().TransformExpr(Inputs[I]);
3604 if (Result.
get() != Inputs[I] && ArgChanged)
3607 Outputs.push_back(Result.
get());
3613 template <
typename Derived>
3617 VarDecl *ConditionVar = cast_or_null<VarDecl>(
3618 getDerived().TransformDefinition(Var->
getLocation(), Var));
3623 return getSema().ActOnConditionVariable(ConditionVar, Loc, Kind);
3627 ExprResult CondExpr = getDerived().TransformExpr(Expr);
3632 return getSema().ActOnCondition(
nullptr, Loc, CondExpr.
get(),
Kind);
3638 template<
typename Derived>
3647 Qualifiers.push_back(Qualifier);
3650 while (!Qualifiers.empty()) {
3658 if (SemaRef.BuildCXXNestedNameSpecifier(
nullptr, IdInfo,
false,
3659 SS, FirstQualifierInScope,
false))
3666 = cast_or_null<NamespaceDecl>(
3667 getDerived().TransformDecl(
3676 = cast_or_null<NamespaceAliasDecl>(
3692 cast_or_null<CXXRecordDecl>(getDerived().TransformDecl(
3701 FirstQualifierInScope, SS);
3707 (SemaRef.getLangOpts().CPlusPlus11 &&
3710 "Can't get cv-qualifiers here");
3713 diag::warn_cxx98_compat_enum_nested_name_spec);
3722 SemaRef.Diag(TL.
getBeginLoc(), diag::err_nested_name_spec_non_tag)
3730 FirstQualifierInScope =
nullptr;
3736 !getDerived().AlwaysRebuild())
3749 template<
typename Derived>
3769 TemplateDecl *NewTemplate = cast_or_null<TemplateDecl>(
3770 getDerived().TransformDecl(NameInfo.
getLoc(), OldTemplate));
3776 SemaRef.Context.DeclarationNames.getCXXDeductionGuideName(NewTemplate));
3786 NewTInfo = getDerived().TransformType(OldTInfo);
3789 NewCanTy = SemaRef.Context.getCanonicalType(NewTInfo->
getType());
3797 NewCanTy = SemaRef.Context.getCanonicalType(NewT);
3801 = SemaRef.Context.DeclarationNames.getCXXSpecialName(Name.
getNameKind(),
3810 llvm_unreachable(
"Unknown name kind.");
3813 template<
typename Derived>
3820 bool AllowInjectedClassName) {
3823 assert(Template &&
"qualified template name must refer to a template");
3826 = cast_or_null<TemplateDecl>(getDerived().TransformDecl(NameLoc,
3831 if (!getDerived().AlwaysRebuild() &&
3833 TransTemplate == Template)
3836 return getDerived().RebuildTemplateName(SS, QTN->hasTemplateKeyword(),
3844 FirstQualifierInScope =
nullptr;
3847 if (!getDerived().AlwaysRebuild() &&
3855 if (DTN->isIdentifier()) {
3856 return getDerived().RebuildTemplateName(SS,
3858 *DTN->getIdentifier(),
3861 FirstQualifierInScope,
3862 AllowInjectedClassName);
3865 return getDerived().RebuildTemplateName(SS, TemplateKWLoc,
3866 DTN->getOperator(), NameLoc,
3867 ObjectType, AllowInjectedClassName);
3872 = cast_or_null<TemplateDecl>(getDerived().TransformDecl(NameLoc,
3877 if (!getDerived().AlwaysRebuild() &&
3878 TransTemplate == Template)
3887 = cast_or_null<TemplateTemplateParmDecl>(
3888 getDerived().TransformDecl(NameLoc, SubstPack->getParameterPack()));
3892 if (!getDerived().AlwaysRebuild() &&
3893 TransParam == SubstPack->getParameterPack())
3896 return getDerived().RebuildTemplateName(TransParam,
3897 SubstPack->getArgumentPack());
3901 llvm_unreachable(
"overloaded function decl survived to here");
3904 template<
typename Derived>
3911 llvm_unreachable(
"null template argument in TreeTransform");
3916 SemaRef.Context.getTrivialTypeSourceInfo(Arg.
getAsType(), Loc));
3925 Builder.
MakeTrivial(SemaRef.Context, DTN->getQualifier(), Loc);
3927 Builder.
MakeTrivial(SemaRef.Context, QTN->getQualifier(), Loc);
3954 template<
typename Derived>
3965 llvm_unreachable(
"Unexpected TemplateArgument");
3972 DI = getDerived().TransformType(DI);
3973 if (!DI)
return true;
3982 QualifierLoc = getDerived().TransformNestedNameSpecifierLoc(QualifierLoc);
3988 SS.
Adopt(QualifierLoc);
3990 = getDerived().TransformTemplateName(SS, Arg.
getAsTemplate(),
4001 llvm_unreachable(
"Caller should expand pack expansions");
4015 ExprResult E = getDerived().TransformExpr(InputExpr);
4016 E = SemaRef.ActOnConstantExpression(E);
4029 template<
typename Derived,
typename InputIterator>
4037 typedef typename std::iterator_traits<InputIterator>::difference_type
4054 : Self(Self), Iter(Iter) { }
4077 return X.Iter == Y.Iter;
4082 return X.Iter != Y.Iter;
4086 template<
typename Derived>
4087 template<
typename InputIterator>
4091 for (; First != Last; ++First) {
4104 if (TransformTemplateArguments(PackLocIterator(*
this,
4106 PackLocIterator(*
this,
4120 = getSema().getTemplateArgumentPackExpansionPattern(
4121 In, Ellipsis, OrigNumExpansions);
4124 getSema().collectUnexpandedParameterPacks(Pattern, Unexpanded);
4125 assert(!Unexpanded.empty() &&
"Pack expansion without parameter packs?");
4130 bool RetainExpansion =
false;
4132 if (getDerived().TryExpandParameterPacks(Ellipsis,
4146 if (getDerived().TransformTemplateArgument(Pattern, OutPattern, Uneval))
4149 Out = getDerived().RebuildPackExpansion(OutPattern, Ellipsis,
4160 for (
unsigned I = 0; I != *NumExpansions; ++I) {
4163 if (getDerived().TransformTemplateArgument(Pattern, Out, Uneval))
4167 Out = getDerived().RebuildPackExpansion(Out, Ellipsis,
4178 if (RetainExpansion) {
4179 ForgetPartiallySubstitutedPackRAII Forget(getDerived());
4181 if (getDerived().TransformTemplateArgument(Pattern, Out, Uneval))
4184 Out = getDerived().RebuildPackExpansion(Out, Ellipsis,
4196 if (getDerived().TransformTemplateArgument(In, Out, Uneval))
4210 template<
typename Derived>
4212 if (getDerived().AlreadyTransformed(T))
4217 TypeSourceInfo *DI = getSema().Context.getTrivialTypeSourceInfo(T,
4218 getDerived().getBaseLocation());
4228 template<
typename Derived>
4232 getDerived().getBaseEntity());
4233 if (getDerived().AlreadyTransformed(DI->
getType()))
4241 QualType Result = getDerived().TransformType(TLB, TL);
4248 template<
typename Derived>
4252 #define ABSTRACT_TYPELOC(CLASS, PARENT) 4253 #define TYPELOC(CLASS, PARENT) \ 4254 case TypeLoc::CLASS: \ 4255 return getDerived().Transform##CLASS##Type(TLB, \ 4256 T.castAs<CLASS##TypeLoc>()); 4257 #include "clang/AST/TypeLocNodes.def" 4260 llvm_unreachable(
"unhandled type loc!");
4263 template<
typename Derived>
4265 if (!isa<DependentNameType>(T))
4266 return TransformType(T);
4268 if (getDerived().AlreadyTransformed(T))
4270 TypeSourceInfo *DI = getSema().Context.getTrivialTypeSourceInfo(T,
4271 getDerived().getBaseLocation());
4272 TypeSourceInfo *NewDI = getDerived().TransformTypeWithDeducedTST(DI);
4276 template<
typename Derived>
4279 if (!isa<DependentNameType>(DI->
getType()))
4280 return TransformType(DI);
4284 getDerived().getBaseEntity());
4285 if (getDerived().AlreadyTransformed(DI->
getType()))
4299 QualType Result = getDerived().TransformDependentNameType(
4301 if (Result.isNull())
4305 Result = getDerived().RebuildQualifiedType(Result, QTL);
4306 if (Result.isNull())
4314 template<
typename Derived>
4322 Result = getDerived().RebuildQualifiedType(Result, T);
4335 template <
typename Derived>
4345 SemaRef.Diag(Loc, diag::err_address_space_mismatch_templ_inst)
4354 T = SemaRef.getASTContext().getAddrSpaceQualType(T,
4382 = dyn_cast<SubstTemplateTypeParmType>(T)) {
4383 QualType Replacement = SubstTypeParam->getReplacementType();
4386 Replacement = SemaRef.Context.getQualifiedType(
4388 T = SemaRef.Context.getSubstTemplateTypeParmType(
4389 SubstTypeParam->getReplacedParameter(), Replacement);
4390 }
else if ((AutoTy = dyn_cast<AutoType>(T)) && AutoTy->
isDeduced()) {
4397 T = SemaRef.Context.getAutoType(Deduced, AutoTy->
getKeyword(),
4403 SemaRef.Diag(Loc, diag::err_attr_objc_ownership_redundant) << T;
4409 return SemaRef.BuildQualifiedType(T, Loc, Quals);
4412 template<
typename Derived>
4418 if (getDerived().AlreadyTransformed(TL.
getType()))
4422 TransformTSIInObjectScope(TL, ObjectType, UnqualLookup, SS);
4428 template<
typename Derived>
4434 if (getDerived().AlreadyTransformed(TSInfo->
getType()))
4437 return TransformTSIInObjectScope(TSInfo->
getTypeLoc(), ObjectType,
4441 template <
typename Derived>
4446 assert(!getDerived().AlreadyTransformed(T));
4451 if (isa<TemplateSpecializationType>(T)) {
4455 TemplateName Template = getDerived().TransformTemplateName(
4457 ObjectType, UnqualLookup,
true);
4458 if (Template.isNull())
4461 Result = getDerived().TransformTemplateSpecializationType(TLB, SpecTL,
4463 }
else if (isa<DependentTemplateSpecializationType>(T)) {
4468 = getDerived().RebuildTemplateName(SS,
4472 ObjectType, UnqualLookup,
4474 if (Template.isNull())
4477 Result = getDerived().TransformDependentTemplateSpecializationType(TLB,
4483 Result = getDerived().TransformType(TLB, TL);
4492 template <
class TyLoc>
static inline 4494 TyLoc NewT = TLB.
push<TyLoc>(T.getType());
4495 NewT.setNameLoc(T.getNameLoc());
4499 template<
typename Derived>
4509 template<
typename Derived>
4516 template <
typename Derived>
4523 template<
typename Derived>
4527 if (OriginalType.
isNull())
4531 if (getDerived().AlwaysRebuild() ||
4533 Result = SemaRef.Context.getDecayedType(OriginalType);
4547 template<
typename Derived>
4552 if (PointeeType.
isNull())
4555 if (SemaRef.getLangOpts().OpenCL)
4564 Result = SemaRef.Context.getObjCObjectPointerType(PointeeType);
4571 if (getDerived().AlwaysRebuild() ||
4573 Result = getDerived().RebuildPointerType(PointeeType, TL.
getSigilLoc());
4587 template<
typename Derived>
4593 if (PointeeType.
isNull())
4596 if (SemaRef.getLangOpts().OpenCL)
4600 if (getDerived().AlwaysRebuild() ||
4602 Result = getDerived().RebuildBlockPointerType(PointeeType,
4617 template<
typename Derived>
4625 if (PointeeType.
isNull())
4628 if (SemaRef.getLangOpts().OpenCL)
4632 if (getDerived().AlwaysRebuild() ||
4634 Result = getDerived().RebuildReferenceType(PointeeType,
4648 if (isa<LValueReferenceType>(Result))
4657 template<
typename Derived>
4661 return TransformReferenceType(TLB, TL);
4664 template<
typename Derived>
4668 return TransformReferenceType(TLB, TL);
4671 template<
typename Derived>
4676 if (PointeeType.
isNull())
4682 NewClsTInfo = getDerived().TransformType(OldClsTInfo);
4691 NewClsType = NewClsTInfo->
getType();
4693 NewClsType = getDerived().TransformType(OldClsType);
4694 if (NewClsType.isNull())
4699 if (getDerived().AlwaysRebuild() ||
4701 NewClsType != OldClsType) {
4702 Result = getDerived().RebuildMemberPointerType(PointeeType, NewClsType,
4718 NewTL.setClassTInfo(NewClsTInfo);
4723 template<
typename Derived>
4729 if (ElementType.
isNull())
4733 if (getDerived().AlwaysRebuild() ||
4735 Result = getDerived().RebuildConstantArrayType(ElementType,
4756 Size = getDerived().TransformExpr(Size).template getAs<Expr>();
4757 Size = SemaRef.ActOnConstantExpression(Size).get();
4764 template<
typename Derived>
4770 if (ElementType.
isNull())
4774 if (getDerived().AlwaysRebuild() ||
4776 Result = getDerived().RebuildIncompleteArrayType(ElementType,
4792 template<
typename Derived>
4798 if (ElementType.
isNull())
4805 SizeResult = getDerived().TransformExpr(T->
getSizeExpr());
4810 SemaRef.ActOnFinishFullExpr(SizeResult.
get(),
false);
4814 Expr *Size = SizeResult.
get();
4817 if (getDerived().AlwaysRebuild() ||
4820 Result = getDerived().RebuildVariableArrayType(ElementType,
4839 template<
typename Derived>
4845 if (ElementType.
isNull())
4857 = getDerived().TransformExpr(origSize);
4858 sizeResult = SemaRef.ActOnConstantExpression(sizeResult);
4862 Expr *size = sizeResult.
get();
4865 if (getDerived().AlwaysRebuild() ||
4868 Result = getDerived().RebuildDependentSizedArrayType(ElementType,
4887 template <
typename Derived>
4892 if (ElementType.
isNull())
4899 Size = SemaRef.ActOnConstantExpression(Size);
4904 if (getDerived().AlwaysRebuild() || ElementType != T->
getElementType() ||
4906 Result = getDerived().RebuildDependentVectorType(
4913 if (isa<DependentVectorType>(Result)) {
4925 template<
typename Derived>
4933 if (ElementType.
isNull())
4941 Size = SemaRef.ActOnConstantExpression(Size);
4946 if (getDerived().AlwaysRebuild() ||
4949 Result = getDerived().RebuildDependentSizedExtVectorType(ElementType,
4957 if (isa<DependentSizedExtVectorType>(Result)) {
4969 template <
typename Derived>
4976 if (pointeeType.
isNull())
4984 AddrSpace = SemaRef.ActOnConstantExpression(AddrSpace);
4989 if (getDerived().AlwaysRebuild() || pointeeType != T->
getPointeeType() ||
4991 Result = getDerived().RebuildDependentAddressSpaceType(
4998 if (isa<DependentAddressSpaceType>(Result)) {
5008 Result, getDerived().getBaseLocation());
5015 template <
typename Derived>
5020 if (ElementType.
isNull())
5024 if (getDerived().AlwaysRebuild() ||
5026 Result = getDerived().RebuildVectorType(ElementType, T->
getNumElements(),
5038 template<
typename Derived>
5043 if (ElementType.
isNull())
5047 if (getDerived().AlwaysRebuild() ||
5049 Result = getDerived().RebuildExtVectorType(ElementType,
5062 template <
typename Derived>
5065 bool ExpectParameterPack) {
5069 if (NumExpansions && isa<PackExpansionType>(OldDI->
getType())) {
5079 QualType Result = getDerived().TransformType(TLB,
5084 Result = RebuildPackExpansionType(Result,
5094 NewDI = TLB.getTypeSourceInfo(SemaRef.Context, Result);
5096 NewDI = getDerived().TransformType(OldDI);
5100 if (NewDI == OldDI && indexAdjustment == 0)
5117 template <
typename Derived>
5125 int indexAdjustment = 0;
5127 unsigned NumParams = Params.size();
5128 for (
unsigned i = 0;
i != NumParams; ++
i) {
5130 assert(OldParm->getFunctionScopeIndex() ==
i);
5134 if (OldParm->isParameterPack()) {
5139 TypeLoc TL = OldParm->getTypeSourceInfo()->getTypeLoc();
5142 SemaRef.collectUnexpandedParameterPacks(Pattern, Unexpanded);
5143 assert(Unexpanded.size() > 0 &&
"Could not find parameter packs!");
5146 bool ShouldExpand =
false;
5147 bool RetainExpansion =
false;
5150 NumExpansions = OrigNumExpansions;
5151 if (getDerived().TryExpandParameterPacks(ExpansionTL.
getEllipsisLoc(),
5152 Pattern.getSourceRange(),
5163 getDerived().ExpandingFunctionParameterPack(OldParm);
5164 for (
unsigned I = 0; I != *NumExpansions; ++I) {
5167 = getDerived().TransformFunctionTypeParam(OldParm,
5175 PInfos.
set(OutParamTypes.size(), ParamInfos[
i]);
5176 OutParamTypes.push_back(NewParm->
getType());
5178 PVars->push_back(NewParm);
5183 if (RetainExpansion) {
5184 ForgetPartiallySubstitutedPackRAII Forget(getDerived());
5186 = getDerived().TransformFunctionTypeParam(OldParm,
5194 PInfos.
set(OutParamTypes.size(), ParamInfos[
i]);
5195 OutParamTypes.push_back(NewParm->
getType());
5197 PVars->push_back(NewParm);
5213 NewParm = getDerived().TransformFunctionTypeParam(OldParm,
5218 NewParm = getDerived().TransformFunctionTypeParam(
5219 OldParm, indexAdjustment, None,
false);
5226 PInfos.
set(OutParamTypes.size(), ParamInfos[
i]);
5227 OutParamTypes.push_back(NewParm->
getType());
5229 PVars->push_back(NewParm);
5236 bool IsPackExpansion =
false;
5240 = dyn_cast<PackExpansionType>(OldType)) {
5242 QualType Pattern = Expansion->getPattern();
5244 getSema().collectUnexpandedParameterPacks(Pattern, Unexpanded);
5247 bool ShouldExpand =
false;
5248 bool RetainExpansion =
false;
5249 if (getDerived().TryExpandParameterPacks(Loc,
SourceRange(),
5260 for (
unsigned I = 0; I != *NumExpansions; ++I) {
5262 QualType NewType = getDerived().TransformType(Pattern);
5268 getSema().getASTContext().getPackExpansionType(NewType, None);
5275 PInfos.
set(OutParamTypes.size(), ParamInfos[
i]);
5276 OutParamTypes.push_back(NewType);
5278 PVars->push_back(
nullptr);
5287 if (RetainExpansion) {
5288 ForgetPartiallySubstitutedPackRAII Forget(getDerived());
5289 QualType NewType = getDerived().TransformType(Pattern);
5294 PInfos.
set(OutParamTypes.size(), ParamInfos[
i]);
5295 OutParamTypes.push_back(NewType);
5297 PVars->push_back(
nullptr);
5302 OldType = Expansion->getPattern();
5303 IsPackExpansion =
true;
5305 NewType = getDerived().TransformType(OldType);
5307 NewType = getDerived().TransformType(OldType);
5313 if (IsPackExpansion)
5314 NewType = getSema().Context.getPackExpansionType(NewType,
5318 PInfos.
set(OutParamTypes.size(), ParamInfos[
i]);
5319 OutParamTypes.push_back(NewType);
5321 PVars->push_back(
nullptr);
5326 for (
unsigned i = 0, e = PVars->size();
i != e; ++
i)
5328 assert(parm->getFunctionScopeIndex() ==
i);
5335 template<
typename Derived>
5345 ExceptionStorage, Changed);
5349 template<
typename Derived>
template<
typename Fn>
5352 Qualifiers ThisTypeQuals, Fn TransformExceptionSpec) {
5369 if (getDerived().TransformFunctionTypeParams(
5373 ParamTypes, &ParamDecls, ExtParamInfos))
5385 ResultType = getDerived().TransformType(TLB, TL.
getReturnLoc());
5391 ResultType = getDerived().TransformType(TLB, TL.
getReturnLoc());
5395 if (getDerived().TransformFunctionTypeParams(
5399 ParamTypes, &ParamDecls, ExtParamInfos))
5405 bool EPIChanged =
false;
5410 if (
auto NewExtParamInfos =
5414 != llvm::makeArrayRef(NewExtParamInfos, ParamTypes.size())) {
5424 if (getDerived().AlwaysRebuild() || ResultType != T->
getReturnType() ||
5425 T->
getParamTypes() != llvm::makeArrayRef(ParamTypes) || EPIChanged) {
5426 Result = getDerived().RebuildFunctionProtoType(ResultType, ParamTypes, EPI);
5443 template<
typename Derived>
5459 getSema().ActOnNoexceptSpec(Loc, NoexceptExpr.
get(), EST);
5480 SemaRef.collectUnexpandedParameterPacks(PackExpansion->getPattern(),
5482 assert(!Unexpanded.empty() &&
"Pack expansion without parameter packs?");
5487 bool Expand =
false;
5488 bool RetainExpansion =
false;
5492 if (getDerived().TryExpandParameterPacks(
5494 RetainExpansion, NumExpansions))
5502 QualType U = getDerived().TransformType(PackExpansion->getPattern());
5506 U = SemaRef.Context.getPackExpansionType(U, NumExpansions);
5507 Exceptions.push_back(U);
5513 for (
unsigned ArgIdx = 0; ArgIdx != *NumExpansions; ++ArgIdx) {
5516 QualType U = getDerived().TransformType(PackExpansion->getPattern());
5517 if (U.
isNull() || SemaRef.CheckSpecifiedExceptionType(U, Loc))
5520 Exceptions.push_back(U);
5523 QualType U = getDerived().TransformType(T);
5524 if (U.
isNull() || SemaRef.CheckSpecifiedExceptionType(U, Loc))
5529 Exceptions.push_back(U);
5539 template<
typename Derived>
5549 if (getDerived().AlwaysRebuild() || ResultType != T->
getReturnType())
5550 Result = getDerived().RebuildFunctionNoProtoType(ResultType);
5561 template<
typename Derived>
QualType 5570 if (getDerived().AlwaysRebuild() || D != T->
getDecl()) {
5571 Result = getDerived().RebuildUnresolvedUsingType(TL.
getNameLoc(), D);
5584 template<
typename Derived>
5589 = cast_or_null<TypedefNameDecl>(getDerived().TransformDecl(TL.
getNameLoc(),
5595 if (getDerived().AlwaysRebuild() ||
5597 Result = getDerived().RebuildTypedefType(Typedef);
5608 template<
typename Derived>
5620 E = SemaRef.HandleExprEvaluationContextForTypeof(E.
get());
5625 if (getDerived().AlwaysRebuild() ||
5627 Result = getDerived().RebuildTypeOfExprType(E.
get(), TL.
getTypeofLoc());
5641 template<
typename Derived>
5645 TypeSourceInfo* New_Under_TI = getDerived().TransformType(Old_Under_TI);
5650 if (getDerived().AlwaysRebuild() || New_Under_TI != Old_Under_TI) {
5651 Result = getDerived().RebuildTypeOfType(New_Under_TI->
getType());
5665 template<
typename Derived>
5679 E = getSema().ActOnDecltypeExpression(E.
get());
5684 if (getDerived().AlwaysRebuild() ||
5686 Result = getDerived().RebuildDecltypeType(E.
get(), TL.
getNameLoc());
5698 template<
typename Derived>
5707 Result = getDerived().RebuildUnaryTransformType(NewBase,
5721 template<
typename Derived>
5727 if (!OldDeduced.
isNull()) {
5728 NewDeduced = getDerived().TransformType(OldDeduced);
5734 if (getDerived().AlwaysRebuild() || NewDeduced != OldDeduced ||
5736 Result = getDerived().RebuildAutoType(NewDeduced, T->
getKeyword());
5747 template<
typename Derived>
5755 if (TemplateName.
isNull())
5760 if (!OldDeduced.
isNull()) {
5761 NewDeduced = getDerived().TransformType(OldDeduced);
5766 QualType Result = getDerived().RebuildDeducedTemplateSpecializationType(
5767 TemplateName, NewDeduced);
5778 template<
typename Derived>
5783 = cast_or_null<RecordDecl>(getDerived().TransformDecl(TL.
getNameLoc(),
5789 if (getDerived().AlwaysRebuild() ||
5791 Result = getDerived().RebuildRecordType(Record);
5802 template<
typename Derived>
5807 = cast_or_null<EnumDecl>(getDerived().TransformDecl(TL.
getNameLoc(),
5813 if (getDerived().AlwaysRebuild() ||
5815 Result = getDerived().RebuildEnumType(Enum);
5826 template<
typename Derived>
5834 QualType T = SemaRef.Context.getTypeDeclType(cast<TypeDecl>(D));
5839 template<
typename Derived>
5846 template<
typename Derived>
5857 if (Replacement.isNull())
5874 template<
typename Derived>
5881 template<
typename Derived>
5896 return getDerived().TransformTemplateSpecializationType(TLB, TL, Template);
5899 template<
typename Derived>
5907 if (getDerived().AlwaysRebuild() ||
5909 Result = getDerived().RebuildAtomicType(ValueType, TL.
getKWLoc());
5922 template <
typename Derived>
5933 Result = getDerived().RebuildPipeType(ValueType, TL.
getKWLoc(), isReadPipe);
5949 template<
typename ArgLocContainer>
5951 ArgLocContainer *Container;
5976 : Container(&Container), Index(Index) { }
5990 return Container->getArgLoc(Index);
5994 return pointer(Container->getArgLoc(Index));
5999 return X.Container == Y.Container && X.Index == Y.Index;
6009 template <
typename Derived>
6019 if (getDerived().TransformTemplateArguments(ArgIterator(TL, 0),
6027 getDerived().RebuildTemplateSpecializationType(Template,
6036 if (isa<DependentTemplateSpecializationType>(Result)) {
6045 for (
unsigned i = 0, e = NewTemplateArgs.
size();
i != e; ++
i)
6056 for (
unsigned i = 0, e = NewTemplateArgs.
size();
i != e; ++
i)
6063 template <
typename Derived>
6074 if (getDerived().TransformTemplateArguments(ArgIterator(TL, 0),
6083 = getSema().Context.getDependentTemplateSpecializationType(
6085 DTN->getQualifier(),
6086 DTN->getIdentifier(),
6097 for (
unsigned i = 0, e = NewTemplateArgs.
size();
i != e; ++
i)
6103 = getDerived().RebuildTemplateSpecializationType(Template,
6115 for (
unsigned i = 0, e = NewTemplateArgs.
size();
i != e; ++
i)
6122 template<
typename Derived>
6152 diag::err_tag_reference_non_tag)
6155 SemaRef.Diag(TAT->getLocation(), diag::note_declared_at);
6161 if (getDerived().AlwaysRebuild() ||
6166 QualifierLoc, NamedT);
6177 template<
typename Derived>
6183 if (modifiedType.
isNull())
6188 const Attr *newAttr = oldAttr ? getDerived().TransformAttr(oldAttr) :
nullptr;
6189 if (oldAttr && !newAttr)
6195 if (getDerived().AlwaysRebuild() ||
6201 if (equivalentType.
isNull())
6209 diag::err_nullability_nonpointer)
6215 result = SemaRef.Context.getAttributedType(TL.
getAttrKind(),
6225 template<
typename Derived>
6234 if (getDerived().AlwaysRebuild() ||
6236 Result = getDerived().RebuildParenType(Inner);
6247 template <
typename Derived>
6268 template<
typename Derived>
6271 return TransformDependentNameType(TLB, TL,
false);
6274 template<
typename Derived>
6285 = getDerived().RebuildDependentNameType(T->
getKeyword(),
6295 QualType NamedT = ElabT->getNamedType();
6310 template<
typename Derived>
6323 .TransformDependentTemplateSpecializationType(TLB, TL, QualifierLoc);
6326 template<
typename Derived>
6339 if (getDerived().TransformTemplateArguments(ArgIterator(TL, 0),
6344 QualType Result = getDerived().RebuildDependentTemplateSpecializationType(
6351 if (
const ElaboratedType *ElabT = dyn_cast<ElaboratedType>(Result)) {
6352 QualType NamedT = ElabT->getNamedType();
6361 for (
unsigned I = 0, E = NewTemplateArgs.
size(); I != E; ++I)
6368 }
else if (isa<DependentTemplateSpecializationType>(Result)) {
6377 for (
unsigned I = 0, E = NewTemplateArgs.
size(); I != E; ++I)
6386 for (
unsigned I = 0, E = NewTemplateArgs.
size(); I != E; ++I)
6392 template<
typename Derived>
6401 if (getDerived().AlwaysRebuild() ||
6403 Result = getDerived().RebuildPackExpansionType(Pattern,
6416 template<
typename Derived>
6425 template<
typename Derived>
6436 if (getDerived().AlwaysRebuild() ||
6438 Result = getDerived().RebuildObjCTypeParamType(OTP,
6458 template<
typename Derived>
6479 const auto *PackExpansion = PackExpansionLoc.getType()
6482 SemaRef.collectUnexpandedParameterPacks(PackExpansion->getPattern(),
6484 assert(!Unexpanded.empty() &&
"Pack expansion without parameter packs?");
6488 TypeLoc PatternLoc = PackExpansionLoc.getPatternLoc();
6489 bool Expand =
false;
6490 bool RetainExpansion =
false;
6492 if (getDerived().TryExpandParameterPacks(
6493 PackExpansionLoc.getEllipsisLoc(), PatternLoc.getSourceRange(),
6494 Unexpanded, Expand, RetainExpansion, NumExpansions))
6504 TypeArgBuilder.
reserve(PatternLoc.getFullDataSize());
6505 QualType NewPatternType = getDerived().TransformType(TypeArgBuilder,
6507 if (NewPatternType.
isNull())
6510 QualType NewExpansionType = SemaRef.Context.getPackExpansionType(
6511 NewPatternType, NumExpansions);
6513 NewExpansionLoc.
setEllipsisLoc(PackExpansionLoc.getEllipsisLoc());
6514 NewTypeArgInfos.push_back(
6521 for (
unsigned ArgIdx = 0; ArgIdx != *NumExpansions; ++ArgIdx) {
6525 TypeArgBuilder.
reserve(PatternLoc.getFullDataSize());
6527 QualType NewTypeArg = getDerived().TransformType(TypeArgBuilder,
6532 NewTypeArgInfos.push_back(
6541 QualType NewTypeArg = getDerived().TransformType(TypeArgBuilder, TypeArgLoc);
6546 if (NewTypeArg == TypeArg) {
6547 NewTypeArgInfos.push_back(TypeArgInfo);
6551 NewTypeArgInfos.push_back(
6557 if (getDerived().AlwaysRebuild() || AnyChanged) {
6559 Result = getDerived().RebuildObjCObjectType(
6582 template<
typename Derived>
6587 if (PointeeType.
isNull())
6591 if (getDerived().AlwaysRebuild() ||
6593 Result = getDerived().RebuildObjCObjectPointerType(PointeeType,
6607 template<
typename Derived>
6613 template<
typename Derived>
6616 return getDerived().TransformCompoundStmt(S,
false);
6619 template<
typename Derived>
6626 bool SubStmtInvalid =
false;
6627 bool SubStmtChanged =
false;
6629 for (
auto *B : S->
body()) {
6630 StmtResult Result = getDerived().TransformStmt(
6631 B, IsStmtExpr && B == ExprResult ? SDK_StmtExprResult : SDK_Discarded);
6636 if (isa<DeclStmt>(B))
6640 SubStmtInvalid =
true;
6644 SubStmtChanged = SubStmtChanged || Result.
get() != B;
6645 Statements.push_back(Result.
getAs<
Stmt>());
6651 if (!getDerived().AlwaysRebuild() &&
6655 return getDerived().RebuildCompoundStmt(S->
getLBracLoc(),
6661 template<
typename Derived>
6670 LHS = getDerived().TransformExpr(S->
getLHS());
6671 LHS = SemaRef.ActOnCaseExpr(S->
getCaseLoc(), LHS);
6676 RHS = getDerived().TransformExpr(S->
getRHS());
6677 RHS = SemaRef.ActOnCaseExpr(S->
getCaseLoc(), RHS);
6700 return getDerived().RebuildCaseStmtBody(Case.
get(), SubStmt.
get());
6703 template <
typename Derived>
6716 template<
typename Derived>
6735 return getDerived().RebuildLabelStmt(S->
getIdentLoc(),
6740 template <
typename Derived>
6748 #define PRAGMA_SPELLING_ATTR(X) \ 6750 return getDerived().Transform##X##Attr(cast<X##Attr>(R)); 6751 #include "clang/Basic/AttrList.inc" 6757 template <
typename Derived>
6761 bool AttrsChanged =
false;
6765 for (
const auto *I : S->
getAttrs()) {
6766 const Attr *R = getDerived().TransformAttr(I);
6767 AttrsChanged |= (I != R);
6778 return getDerived().RebuildAttributedStmt(S->
getAttrLoc(), Attrs,
6782 template<
typename Derived>
6805 if (!ConstexprConditionValue || *ConstexprConditionValue) {
6806 Then = getDerived().TransformStmt(S->
getThen());
6815 if (!ConstexprConditionValue || !*ConstexprConditionValue) {
6816 Else = getDerived().TransformStmt(S->
getElse());
6821 if (!getDerived().AlwaysRebuild() &&
6833 template<
typename Derived>
6850 = getDerived().RebuildSwitchStmtStart(S->
getSwitchLoc(), Init.
get(), Cond);
6860 return getDerived().RebuildSwitchStmtBody(S->
getSwitchLoc(), Switch.
get(),
6864 template<
typename Derived>
6879 if (!getDerived().AlwaysRebuild() &&
6884 return getDerived().RebuildWhileStmt(S->
getWhileLoc(), Cond, Body.
get());
6887 template<
typename Derived>
6900 if (!getDerived().AlwaysRebuild() &&
6910 template<
typename Derived>
6913 if (getSema().getLangOpts().OpenMP)
6914 getSema().startOpenMPLoop();
6923 if (getSema().getLangOpts().OpenMP && Init.
isUsable())
6924 getSema().ActOnOpenMPLoopInitialization(S->
getForLoc(), Init.
get());
6947 if (!getDerived().AlwaysRebuild() &&
6955 Init.
get(), Cond, FullInc,
6959 template<
typename Derived>
6969 cast<LabelDecl>(LD));
6972 template<
typename Derived>
6978 Target = SemaRef.MaybeCreateExprWithCleanups(Target.
get());
6980 if (!getDerived().AlwaysRebuild() &&
6988 template<
typename Derived>
6994 template<
typename Derived>
7000 template<
typename Derived>
7010 return getDerived().RebuildReturnStmt(S->
getReturnLoc(), Result.
get());
7013 template<
typename Derived>
7016 bool DeclChanged =
false;
7018 for (
auto *D : S->
decls()) {
7019 Decl *Transformed = getDerived().TransformDefinition(D->getLocation(), D);
7023 if (Transformed != D)
7026 Decls.push_back(Transformed);
7029 if (!getDerived().AlwaysRebuild() && !DeclChanged)
7035 template<
typename Derived>
7046 bool ExprsChanged =
false;
7057 ExprResult Result = getDerived().TransformExpr(OutputExpr);
7061 ExprsChanged |= Result.
get() != OutputExpr;
7063 Exprs.push_back(Result.
get());
7067 for (
unsigned I = 0, E = S->
getNumInputs(); I != E; ++I) {
7075 ExprResult Result = getDerived().TransformExpr(InputExpr);
7079 ExprsChanged |= Result.
get() != InputExpr;
7081 Exprs.push_back(Result.
get());
7085 for (
unsigned I = 0, E = S->
getNumLabels(); I != E; ++I) {
7092 Exprs.push_back(Result.
get());
7094 if (!getDerived().AlwaysRebuild() && !ExprsChanged)
7106 Constraints, Exprs, AsmString.
get(),
7111 template<
typename Derived>
7117 bool HadError =
false, HadChange =
false;
7121 TransformedExprs.reserve(SrcExprs.size());
7122 for (
unsigned i = 0, e = SrcExprs.size();
i != e; ++
i) {
7123 ExprResult Result = getDerived().TransformExpr(SrcExprs[
i]);
7127 HadChange |= (Result.
get() != SrcExprs[
i]);
7128 TransformedExprs.push_back(Result.
get());
7133 if (!HadChange && !getDerived().AlwaysRebuild())
7145 template<
typename Derived>
7148 auto *ScopeInfo = SemaRef.getCurFunction();
7149 auto *FD = cast<FunctionDecl>(SemaRef.CurContext);
7150 assert(FD && ScopeInfo && !ScopeInfo->CoroutinePromise &&
7151 ScopeInfo->NeedsCoroutineSuspends &&
7152 ScopeInfo->CoroutineSuspends.first ==
nullptr &&
7153 ScopeInfo->CoroutineSuspends.second ==
nullptr &&
7154 "expected clean scope info");
7158 ScopeInfo->setNeedsCoroutineSuspends(
false);
7162 if (!SemaRef.buildCoroutineParameterMoves(FD->getLocation()))
7164 auto *Promise = SemaRef.buildCoroutinePromise(FD->getLocation());
7167 getDerived().transformedLocalDecl(S->
getPromiseDecl(), {Promise});
7168 ScopeInfo->CoroutinePromise = Promise;
7179 ScopeInfo->setCoroutineSuspends(InitSuspend.
get(), FinalSuspend.
get());
7180 assert(isa<Expr>(InitSuspend.
get()) && isa<Expr>(FinalSuspend.
get()));
7187 if (Builder.isInvalid())
7191 assert(ReturnObject &&
"the return object is expected to be valid");
7192 ExprResult Res = getDerived().TransformInitializer(ReturnObject,
7196 Builder.ReturnValue = Res.
get();
7205 auto *MD = dyn_cast_or_null<CXXMethodDecl>(FD);
7206 if (!MD || !MD->getParent()->isGenericLambda()) {
7207 assert(!Promise->getType()->isDependentType() &&
7208 "the promise type must no longer be dependent");
7211 "these nodes should not have been built yet");
7212 if (!Builder.buildDependentStatements())
7217 StmtResult Res = getDerived().TransformStmt(OnFallthrough);
7220 Builder.OnFallthrough = Res.
get();
7224 StmtResult Res = getDerived().TransformStmt(OnException);
7227 Builder.OnException = Res.
get();
7231 StmtResult Res = getDerived().TransformStmt(OnAllocFailure);
7234 Builder.ReturnStmtOnAllocFailure = Res.
get();
7239 "allocation and deallocation calls must already be built");
7241 if (AllocRes.isInvalid())
7243 Builder.Allocate = AllocRes.get();
7248 Builder.Deallocate = DeallocRes.
get();
7250 assert(S->
getResultDecl() &&
"ResultDecl must already be built");
7252 if (ResultDecl.isInvalid())
7254 Builder.ResultDecl = ResultDecl.get();
7260 Builder.ReturnStmt = Res.
get();
7264 return getDerived().RebuildCoroutineBodyStmt(Builder);
7267 template<
typename Derived>
7281 template<
typename Derived>
7295 template <
typename Derived>
7311 return getDerived().RebuildDependentCoawaitExpr(
7313 cast<UnresolvedLookupExpr>(LookupResult.
get()));
7316 template<
typename Derived>
7331 template<
typename Derived>
7340 bool AnyCatchChanged =
false;
7347 AnyCatchChanged =
true;
7348 CatchStmts.push_back(Catch.
get());
7360 if (!getDerived().AlwaysRebuild() &&
7367 return getDerived().RebuildObjCAtTryStmt(S->
getAtTryLoc(), TryBody.
get(),
7368 CatchStmts, Finally.
get());
7371 template<
typename Derived>
7378 if (FromVar->getTypeSourceInfo()) {
7379 TSInfo = getDerived().TransformType(FromVar->getTypeSourceInfo());
7388 T = getDerived().TransformType(FromVar->getType());
7393 Var = getDerived().RebuildObjCExceptionDecl(FromVar, TSInfo, T);
7402 return getDerived().RebuildObjCAtCatchStmt(S->
getAtCatchLoc(),
7407 template<
typename Derived>
7416 if (!getDerived().AlwaysRebuild() &&
7425 template<
typename Derived>
7430 Operand = getDerived().TransformExpr(S->
getThrowExpr());
7435 if (!getDerived().AlwaysRebuild() &&
7439 return getDerived().RebuildObjCAtThrowStmt(S->
getThrowLoc(), Operand.
get());
7442 template<
typename Derived>
7462 if (!getDerived().AlwaysRebuild() &&
7469 Object.
get(), Body.
get());
7472 template<
typename Derived>
7482 if (!getDerived().AlwaysRebuild() &&
7487 return getDerived().RebuildObjCAutoreleasePoolStmt(
7491 template<
typename Derived>
7497 getDerived().TransformStmt(S->
getElement(), SDK_NotDiscarded);
7512 if (!getDerived().AlwaysRebuild() &&
7519 return getDerived().RebuildObjCForCollectionStmt(S->
getForLoc(),
7526 template <
typename Derived>
7532 getDerived().TransformType(ExceptionDecl->getTypeSourceInfo());
7536 Var = getDerived().RebuildExceptionDecl(
7537 ExceptionDecl, T, ExceptionDecl->getInnerLocStart(),
7538 ExceptionDecl->getLocation(), ExceptionDecl->getIdentifier());
7548 if (!getDerived().AlwaysRebuild() && !Var &&
7552 return getDerived().RebuildCXXCatchStmt(S->
getCatchLoc(), Var, Handler.
get());
7555 template <
typename Derived>
7563 bool HandlerChanged =
false;
7570 HandlerChanged = HandlerChanged || Handler.
get() != S->
getHandler(I);
7571 Handlers.push_back(Handler.
getAs<
Stmt>());
7574 if (!getDerived().AlwaysRebuild() && TryBlock.
get() == S->
getTryBlock() &&
7578 return getDerived().RebuildCXXTryStmt(S->
getTryLoc(), TryBlock.
get(),
7582 template<
typename Derived>
7605 Cond = SemaRef.CheckBooleanCondition(S->
getColonLoc(), Cond.
get());
7609 Cond = SemaRef.MaybeCreateExprWithCleanups(Cond.
get());
7615 Inc = SemaRef.MaybeCreateExprWithCleanups(Inc.
get());
7622 if (getDerived().AlwaysRebuild() ||
7630 NewStmt = getDerived().RebuildCXXForRangeStmt(S->
getForLoc(),
7635 Inc.
get(), LoopVar.
get(),
7648 NewStmt = getDerived().RebuildCXXForRangeStmt(S->
getForLoc(),
7653 Inc.
get(), LoopVar.
get(),
7659 if (NewStmt.
get() == S)
7662 return FinishCXXForRangeStmt(NewStmt.
get(), Body.
get());
7665 template<
typename Derived>
7681 NameInfo = getDerived().TransformDeclarationNameInfo(NameInfo);
7687 if (!getDerived().AlwaysRebuild() &&
7694 SS.
Adopt(QualifierLoc);
7695 bool Dependent =
false;
7696 switch (getSema().CheckMicrosoftIfExistsSymbol(
nullptr, SS, NameInfo)) {
7727 return getDerived().RebuildMSDependentExistsStmt(S->
getKeywordLoc(),
7734 template<
typename Derived>
7754 return new (SemaRef.getASTContext())
7756 SemaRef.getASTContext().PseudoObjectTy,
VK_LValue,
7760 template <
typename Derived>
7764 if (BaseRes.isInvalid())
7766 auto IdxRes = getDerived().TransformExpr(E->
getIdx());
7767 if (IdxRes.isInvalid())
7770 if (!getDerived().AlwaysRebuild() &&
7771 BaseRes.get() == E->
getBase() &&
7772 IdxRes.get() == E->
getIdx())
7775 return getDerived().RebuildArraySubscriptExpr(
7779 template <
typename Derived>
7789 if (!getDerived().AlwaysRebuild() && TryBlock.
get() == S->
getTryBlock() &&
7794 TryBlock.
get(), Handler.
get());
7797 template <
typename Derived>
7803 return getDerived().RebuildSEHFinallyStmt(S->
getFinallyLoc(), Block.
get());
7806 template <
typename Derived>
7816 return getDerived().RebuildSEHExceptStmt(S->
getExceptLoc(), FilterExpr.
get(),
7820 template <
typename Derived>
7822 if (isa<SEHFinallyStmt>(Handler))
7823 return getDerived().TransformSEHFinallyStmt(cast<SEHFinallyStmt>(Handler));
7825 return getDerived().TransformSEHExceptStmt(cast<SEHExceptStmt>(Handler));
7828 template<
typename Derived>
7837 template <
typename Derived>
7844 TClauses.reserve(Clauses.size());
7848 getDerived().getSema().StartOpenMPClause((*I)->getClauseKind());
7849 OMPClause *Clause = getDerived().TransformOMPClause(*I);
7850 getDerived().getSema().EndOpenMPClause();
7852 TClauses.push_back(Clause);
7854 TClauses.push_back(
nullptr);
7865 Body = getDerived().TransformStmt(CS);
7868 getDerived().getSema().ActOnOpenMPRegionEnd(Body, TClauses);
7873 if (TClauses.size() != Clauses.size()) {
7880 DirName = cast<OMPCriticalDirective>(D)->getDirectiveName();
7881 DirName = getDerived().TransformDeclarationNameInfo(DirName);
7885 CancelRegion = cast<OMPCancellationPointDirective>(D)->getCancelRegion();
7887 CancelRegion = cast<OMPCancelDirective>(D)->getCancelRegion();
7890 return getDerived().RebuildOMPExecutableDirective(
7895 template <
typename Derived>
7899 getDerived().getSema().StartOpenMPDSABlock(OMPD_parallel, DirName,
nullptr,
7901 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7902 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7906 template <
typename Derived>
7910 getDerived().getSema().StartOpenMPDSABlock(OMPD_simd, DirName,
nullptr,
7912 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7913 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7917 template <
typename Derived>
7921 getDerived().getSema().StartOpenMPDSABlock(OMPD_for, DirName,
nullptr,
7923 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7924 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7928 template <
typename Derived>
7932 getDerived().getSema().StartOpenMPDSABlock(OMPD_for_simd, DirName,
nullptr,
7934 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7935 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7939 template <
typename Derived>
7943 getDerived().getSema().StartOpenMPDSABlock(OMPD_sections, DirName,
nullptr,
7945 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7946 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7950 template <
typename Derived>
7954 getDerived().getSema().StartOpenMPDSABlock(OMPD_section, DirName,
nullptr,
7956 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7957 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7961 template <
typename Derived>
7965 getDerived().getSema().StartOpenMPDSABlock(OMPD_single, DirName,
nullptr,
7967 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7968 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7972 template <
typename Derived>
7976 getDerived().getSema().StartOpenMPDSABlock(OMPD_master, DirName,
nullptr,
7978 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7979 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7983 template <
typename Derived>
7988 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7989 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7993 template <
typename Derived>
7997 getDerived().getSema().StartOpenMPDSABlock(OMPD_parallel_for, DirName,
7999 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8000 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8004 template <
typename Derived>
8008 getDerived().getSema().StartOpenMPDSABlock(OMPD_parallel_for_simd, DirName,
8010 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8011 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8015 template <
typename Derived>
8019 getDerived().getSema().StartOpenMPDSABlock(OMPD_parallel_sections, DirName,
8021 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8022 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8026 template <
typename Derived>
8030 getDerived().getSema().StartOpenMPDSABlock(OMPD_task, DirName,
nullptr,
8032 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8033 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8037 template <
typename Derived>
8041 getDerived().getSema().StartOpenMPDSABlock(OMPD_taskyield, DirName,
nullptr,
8043 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8044 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8048 template <
typename Derived>
8052 getDerived().getSema().StartOpenMPDSABlock(OMPD_barrier, DirName,
nullptr,
8054 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8055 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8059 template <
typename Derived>
8063 getDerived().getSema().StartOpenMPDSABlock(OMPD_taskwait, DirName,
nullptr,
8065 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8066 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8070 template <
typename Derived>
8074 getDerived().getSema().StartOpenMPDSABlock(OMPD_taskgroup, DirName,
nullptr,
8076 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8077 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8081 template <
typename Derived>
8085 getDerived().getSema().StartOpenMPDSABlock(OMPD_flush, DirName,
nullptr,
8087 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8088 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8092 template <
typename Derived>
8096 getDerived().getSema().StartOpenMPDSABlock(OMPD_ordered, DirName,
nullptr,
8098 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8099 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8103 template <
typename Derived>
8107 getDerived().getSema().StartOpenMPDSABlock(OMPD_atomic, DirName,
nullptr,
8109 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8110 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8114 template <
typename Derived>
8118 getDerived().getSema().StartOpenMPDSABlock(OMPD_target, DirName,
nullptr,
8120 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8121 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8125 template <
typename Derived>
8129 getDerived().getSema().StartOpenMPDSABlock(OMPD_target_data, DirName,
nullptr,
8131 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8132 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8136 template <
typename Derived>
8140 getDerived().getSema().StartOpenMPDSABlock(OMPD_target_enter_data, DirName,
8142 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8143 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8147 template <
typename Derived>
8151 getDerived().getSema().StartOpenMPDSABlock(OMPD_target_exit_data, DirName,
8153 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8154 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8158 template <
typename Derived>
8162 getDerived().getSema().StartOpenMPDSABlock(OMPD_target_parallel, DirName,
8164 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8165 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8169 template <
typename Derived>
8173 getDerived().getSema().StartOpenMPDSABlock(OMPD_target_parallel_for, DirName,
8175 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8176 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8180 template <
typename Derived>
8184 getDerived().getSema().StartOpenMPDSABlock(OMPD_target_update, DirName,
8186 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8187 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8191 template <
typename Derived>
8195 getDerived().getSema().StartOpenMPDSABlock(OMPD_teams, DirName,
nullptr,
8197 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8198 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8202 template <
typename Derived>
8206 getDerived().getSema().StartOpenMPDSABlock(OMPD_cancellation_point, DirName,
8208 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8209 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8213 template <
typename Derived>
8217 getDerived().getSema().StartOpenMPDSABlock(OMPD_cancel, DirName,
nullptr,
8219 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8220 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8224 template <
typename Derived>
8228 getDerived().getSema().StartOpenMPDSABlock(OMPD_taskloop, DirName,
nullptr,
8230 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8231 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8235 template <
typename Derived>
8239 getDerived().getSema().StartOpenMPDSABlock(OMPD_taskloop_simd, DirName,
8241 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8242 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8246 template <
typename Derived>
8250 getDerived().getSema().StartOpenMPDSABlock(OMPD_distribute, DirName,
nullptr,
8252 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8253 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8257 template <
typename Derived>
8261 getDerived().getSema().StartOpenMPDSABlock(
8262 OMPD_distribute_parallel_for, DirName,
nullptr, D->
getBeginLoc());
8263 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8264 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8268 template <
typename Derived>
8273 getDerived().getSema().StartOpenMPDSABlock(
8274 OMPD_distribute_parallel_for_simd, DirName,
nullptr, D->
getBeginLoc());
8275 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8276 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8280 template <
typename Derived>
8284 getDerived().getSema().StartOpenMPDSABlock(OMPD_distribute_simd, DirName,
8286 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8287 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8291 template <
typename Derived>
8295 getDerived().getSema().StartOpenMPDSABlock(
8296 OMPD_target_parallel_for_simd, DirName,
nullptr, D->
getBeginLoc());
8297 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8298 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8302 template <
typename Derived>
8306 getDerived().getSema().StartOpenMPDSABlock(OMPD_target_simd, DirName,
nullptr,
8308 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8309 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8313 template <
typename Derived>
8317 getDerived().getSema().StartOpenMPDSABlock(OMPD_teams_distribute, DirName,
8319 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8320 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8324 template <
typename Derived>
8328 getDerived().getSema().StartOpenMPDSABlock(
8329 OMPD_teams_distribute_simd, DirName,
nullptr, D->
getBeginLoc());
8330 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8331 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8335 template <
typename Derived>
8339 getDerived().getSema().StartOpenMPDSABlock(
8340 OMPD_teams_distribute_parallel_for_simd, DirName,
nullptr,
8342 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8343 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8347 template <
typename Derived>
8351 getDerived().getSema().StartOpenMPDSABlock(
8352 OMPD_teams_distribute_parallel_for, DirName,
nullptr, D->
getBeginLoc());
8353 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8354 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8358 template <
typename Derived>
8362 getDerived().getSema().StartOpenMPDSABlock(OMPD_target_teams, DirName,
8364 auto Res = getDerived().TransformOMPExecutableDirective(D);
8365 getDerived().getSema().EndOpenMPDSABlock(Res.get());
8369 template <
typename Derived>
8373 getDerived().getSema().StartOpenMPDSABlock(
8374 OMPD_target_teams_distribute, DirName,
nullptr, D->
getBeginLoc());
8375 auto Res = getDerived().TransformOMPExecutableDirective(D);
8376 getDerived().getSema().EndOpenMPDSABlock(Res.get());
8380 template <
typename Derived>
8385 getDerived().getSema().StartOpenMPDSABlock(
8386 OMPD_target_teams_distribute_parallel_for, DirName,
nullptr,
8388 auto Res = getDerived().TransformOMPExecutableDirective(D);
8389 getDerived().getSema().EndOpenMPDSABlock(Res.get());
8393 template <
typename Derived>
8398 getDerived().getSema().StartOpenMPDSABlock(
8399 OMPD_target_teams_distribute_parallel_for_simd, DirName,
nullptr,
8401 auto Res = getDerived().TransformOMPExecutableDirective(D);
8402 getDerived().getSema().EndOpenMPDSABlock(Res.get());
8406 template <
typename Derived>
8411 getDerived().getSema().StartOpenMPDSABlock(
8412 OMPD_target_teams_distribute_simd, DirName,
nullptr, D->
getBeginLoc());
8413 auto Res = getDerived().TransformOMPExecutableDirective(D);
8414 getDerived().getSema().EndOpenMPDSABlock(Res.get());
8422 template <
typename Derived>
8427 return getDerived().RebuildOMPIfClause(
8432 template <
typename Derived>
8437 return getDerived().RebuildOMPFinalClause(Cond.
get(), C->
getBeginLoc(),
8441 template <
typename Derived>
8447 return getDerived().RebuildOMPNumThreadsClause(
8451 template <
typename Derived>
8457 return getDerived().RebuildOMPSafelenClause(
8461 template <
typename Derived>
8467 return getDerived().RebuildOMPAllocatorClause(
8471 template <
typename Derived>
8477 return getDerived().RebuildOMPSimdlenClause(
8481 template <
typename Derived>
8487 return getDerived().RebuildOMPCollapseClause(
8491 template <
typename Derived>
8499 template <
typename Derived>
8507 template <
typename Derived>
8513 return getDerived().RebuildOMPScheduleClause(
8520 template <
typename Derived>
8525 E = getDerived().TransformExpr(Num);
8533 template <
typename Derived>
8540 template <
typename Derived>
8547 template <
typename Derived>
8554 template <
typename Derived>
8560 template <
typename Derived>
8566 template <
typename Derived>
8573 template <
typename Derived>
8580 template <
typename Derived>
8587 template <
typename Derived>
8594 template <
typename Derived>
8600 template <
typename Derived>
8607 template <
typename Derived>
8610 llvm_unreachable(
"unified_address clause cannot appear in dependent context");
8613 template <
typename Derived>
8617 "unified_shared_memory clause cannot appear in dependent context");
8620 template <
typename Derived>
8623 llvm_unreachable(
"reverse_offload clause cannot appear in dependent context");
8626 template <
typename Derived>
8630 "dynamic_allocators clause cannot appear in dependent context");
8633 template <
typename Derived>
8637 "atomic_default_mem_order clause cannot appear in dependent context");
8640 template <
typename Derived>
8646 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8649 Vars.push_back(EVar.
get());
8651 return getDerived().RebuildOMPPrivateClause(
8655 template <
typename Derived>
8661 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8664 Vars.push_back(EVar.
get());
8666 return getDerived().RebuildOMPFirstprivateClause(
8670 template <
typename Derived>
8676 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8679 Vars.push_back(EVar.
get());
8681 return getDerived().RebuildOMPLastprivateClause(
8685 template <
typename Derived>
8691 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8694 Vars.push_back(EVar.
get());
8696 return getDerived().RebuildOMPSharedClause(Vars, C->
getBeginLoc(),
8700 template <
typename Derived>
8706 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8709 Vars.push_back(EVar.
get());
8716 NameInfo = getDerived().TransformDeclarationNameInfo(NameInfo);
8726 auto *ULE = cast<UnresolvedLookupExpr>(E);
8728 for (
auto *D : ULE->decls()) {
8730 cast<NamedDecl>(getDerived().TransformDecl(E->
getExprLoc(), D));
8731 Decls.addDecl(InstD, InstD->
getAccess());
8733 UnresolvedReductions.push_back(
8735 SemaRef.Context,
nullptr,
8737 NameInfo,
true, ULE->isOverloaded(),
8738 Decls.begin(), Decls.end()));
8740 UnresolvedReductions.push_back(
nullptr);
8742 return getDerived().RebuildOMPReductionClause(
8744 C->
getEndLoc(), ReductionIdScopeSpec, NameInfo, UnresolvedReductions);
8747 template <
typename Derived>
8753 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8756 Vars.push_back(EVar.
get());
8763 NameInfo = getDerived().TransformDeclarationNameInfo(NameInfo);
8773 auto *ULE = cast<UnresolvedLookupExpr>(E);
8775 for (
auto *D : ULE->decls()) {
8777 cast<NamedDecl>(getDerived().TransformDecl(E->
getExprLoc(), D));
8778 Decls.addDecl(InstD, InstD->
getAccess());
8781 SemaRef.Context,
nullptr,
8783 true, ULE->isOverloaded(), Decls.begin(), Decls.end()));
8785 UnresolvedReductions.push_back(
nullptr);
8787 return getDerived().RebuildOMPTaskReductionClause(
8789 C->
getEndLoc(), ReductionIdScopeSpec, NameInfo, UnresolvedReductions);
8792 template <
typename Derived>
8798 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8801 Vars.push_back(EVar.
get());
8808 NameInfo = getDerived().TransformDeclarationNameInfo(NameInfo);
8818 auto *ULE = cast<UnresolvedLookupExpr>(E);
8820 for (
auto *D : ULE->decls()) {
8822 cast<NamedDecl>(getDerived().TransformDecl(E->
getExprLoc(), D));
8823 Decls.addDecl(InstD, InstD->
getAccess());
8826 SemaRef.Context,
nullptr,
8828 true, ULE->isOverloaded(), Decls.begin(), Decls.end()));
8830 UnresolvedReductions.push_back(
nullptr);
8832 return getDerived().RebuildOMPInReductionClause(
8834 C->
getEndLoc(), ReductionIdScopeSpec, NameInfo, UnresolvedReductions);
8837 template <
typename Derived>
8843 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8846 Vars.push_back(EVar.
get());
8851 return getDerived().RebuildOMPLinearClause(
8853 C->getModifierLoc(), C->getColonLoc(), C->
getEndLoc());
8856 template <
typename Derived>
8860 Vars.reserve(C->varlist_size());
8861 for (
auto *VE : C->varlists()) {
8862 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8865 Vars.push_back(EVar.
get());
8870 return getDerived().RebuildOMPAlignedClause(
8871 Vars, Alignment.
get(), C->getBeginLoc(), C->getLParenLoc(),
8875 template <
typename Derived>
8879 Vars.reserve(C->varlist_size());
8880 for (
auto *VE : C->varlists()) {
8881 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8884 Vars.push_back(EVar.
get());
8886 return getDerived().RebuildOMPCopyinClause(Vars, C->getBeginLoc(),
8887 C->getLParenLoc(), C->getEndLoc());
8890 template <
typename Derived>
8894 Vars.reserve(C->varlist_size());
8895 for (
auto *VE : C->varlists()) {
8896 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8899 Vars.push_back(EVar.
get());
8901 return getDerived().RebuildOMPCopyprivateClause(
8902 Vars, C->getBeginLoc(), C->getLParenLoc(), C->getEndLoc());
8905 template <
typename Derived>
8908 Vars.reserve(C->varlist_size());
8909 for (
auto *VE : C->varlists()) {
8910 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8913 Vars.push_back(EVar.
get());
8915 return getDerived().RebuildOMPFlushClause(Vars, C->getBeginLoc(),
8916 C->getLParenLoc(), C->getEndLoc());
8919 template <
typename Derived>
8923 Vars.reserve(C->varlist_size());
8924 for (
auto *VE : C->varlists()) {
8925 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8928 Vars.push_back(EVar.
get());
8930 return getDerived().RebuildOMPDependClause(
8932 C->getBeginLoc(), C->getLParenLoc(), C->getEndLoc());
8935 template <
typename Derived>
8941 return getDerived().RebuildOMPDeviceClause(E.
get(), C->getBeginLoc(),
8945 template <
typename Derived,
class T>
8952 Vars.reserve(C->varlist_size());
8953 for (
auto *VE : C->varlists()) {
8957 Vars.push_back(EVar.
get());
8962 QualifierLoc = TT.
getDerived().TransformNestedNameSpecifierLoc(
8967 MapperIdScopeSpec.
Adopt(QualifierLoc);
8970 MapperIdInfo = TT.
getDerived().TransformDeclarationNameInfo(MapperIdInfo);
8979 auto *ULE = cast<UnresolvedLookupExpr>(E);
8981 for (
auto *D : ULE->decls()) {
8984 Decls.addDecl(InstD, InstD->
getAccess());
8987 TT.
getSema().Context,
nullptr,
8989 MapperIdInfo,
true, ULE->isOverloaded(), Decls.begin(),
8992 UnresolvedMappers.push_back(
nullptr);
8998 template <
typename Derived>
9000 OMPVarListLocTy Locs(C->getBeginLoc(), C->getLParenLoc(), C->getEndLoc());
9005 if (transformOMPMappableExprListClause<Derived, OMPMapClause>(
9006 *
this, C, Vars, MapperIdScopeSpec, MapperIdInfo, UnresolvedMappers))
9008 return getDerived().RebuildOMPMapClause(
9014 template <
typename Derived>
9019 ExprResult AllocatorRes = getDerived().TransformExpr(Allocator);
9022 Allocator = AllocatorRes.
get();
9027 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
9030 Vars.push_back(EVar.
get());
9032 return getDerived().RebuildOMPAllocateClause(
9037 template <
typename Derived>
9043 return getDerived().RebuildOMPNumTeamsClause(
9047 template <
typename Derived>
9053 return getDerived().RebuildOMPThreadLimitClause(
9057 template <
typename Derived>
9063 return getDerived().RebuildOMPPriorityClause(
9067 template <
typename Derived>
9073 return getDerived().RebuildOMPGrainsizeClause(
9077 template <
typename Derived>
9083 return getDerived().RebuildOMPNumTasksClause(
9087 template <
typename Derived>
9092 return getDerived().RebuildOMPHintClause(E.
get(), C->getBeginLoc(),
9096 template <
typename Derived>
9102 return getDerived().RebuildOMPDistScheduleClause(
9107 template <
typename Derived>
9113 template <
typename Derived>
9115 OMPVarListLocTy Locs(C->getBeginLoc(), C->getLParenLoc(), C->getEndLoc());
9120 if (transformOMPMappableExprListClause<Derived, OMPToClause>(
9121 *
this, C, Vars, MapperIdScopeSpec, MapperIdInfo, UnresolvedMappers))
9123 return getDerived().RebuildOMPToClause(Vars, MapperIdScopeSpec, MapperIdInfo,
9124 Locs, UnresolvedMappers);
9127 template <
typename Derived>
9129 OMPVarListLocTy Locs(C->getBeginLoc(), C->getLParenLoc(), C->getEndLoc());
9134 if (transformOMPMappableExprListClause<Derived, OMPFromClause>(
9135 *
this, C, Vars, MapperIdScopeSpec, MapperIdInfo, UnresolvedMappers))
9137 return getDerived().RebuildOMPFromClause(
9138 Vars, MapperIdScopeSpec, MapperIdInfo, Locs, UnresolvedMappers);
9141 template <
typename Derived>
9145 Vars.reserve(C->varlist_size());
9146 for (
auto *VE : C->varlists()) {
9147 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
9150 Vars.push_back(EVar.
get());
9152 OMPVarListLocTy Locs(C->getBeginLoc(), C->getLParenLoc(), C->getEndLoc());
9153 return getDerived().RebuildOMPUseDevicePtrClause(Vars, Locs);
9156 template <
typename Derived>
9160 Vars.reserve(C->varlist_size());
9161 for (
auto *VE : C->varlists()) {
9162 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
9165 Vars.push_back(EVar.
get());
9167 OMPVarListLocTy Locs(C->getBeginLoc(), C->getLParenLoc(), C->getEndLoc());
9168 return getDerived().RebuildOMPIsDevicePtrClause(Vars, Locs);
9174 template<
typename Derived>
9180 template<
typename Derived>
9186 return getDerived().RebuildPredefinedExpr(E->
getLocation(),
9190 template<
typename Derived>
9202 = cast_or_null<ValueDecl>(getDerived().TransformDecl(E->
getLocation(),
9209 NameInfo = getDerived().TransformDeclarationNameInfo(NameInfo);
9214 if (!getDerived().AlwaysRebuild() &&
9222 SemaRef.MarkDeclRefReferenced(E);
9229 TemplateArgs = &TransArgs;
9238 return getDerived().RebuildDeclRefExpr(QualifierLoc, ND, NameInfo,
9242 template<
typename Derived>
9248 template <
typename Derived>
9254 template<
typename Derived>
9260 template<
typename Derived>
9266 template<
typename Derived>
9272 template<
typename Derived>
9278 template<
typename Derived>
9282 SemaRef.MarkFunctionReferenced(E->
getBeginLoc(), FD);
9283 return SemaRef.MaybeBindToTemporary(E);
9286 template<
typename Derived>
9302 AssocTypes.push_back(AssocType);
9304 AssocTypes.push_back(
nullptr);
9308 getDerived().TransformExpr(Assoc.getAssociationExpr());
9311 AssocExprs.push_back(AssocExpr.
get());
9314 return getDerived().RebuildGenericSelectionExpr(E->
getGenericLoc(),
9317 ControllingExpr.
get(),
9322 template<
typename Derived>
9329 if (!getDerived().AlwaysRebuild() && SubExpr.
get() == E->
getSubExpr())
9332 return getDerived().RebuildParenExpr(SubExpr.
get(), E->
getLParen(),
9339 template<
typename Derived>
9343 return getDerived().TransformDependentScopeDeclRefExpr(DRE,
true,
nullptr);
9345 return getDerived().TransformExpr(E);
9348 template<
typename Derived>
9353 SubExpr = TransformAddressOfOperand(E->
getSubExpr());
9359 if (!getDerived().AlwaysRebuild() && SubExpr.
get() == E->
getSubExpr())
9367 template<
typename Derived>
9381 bool ExprChanged =
false;
9387 Comp.isBrackets =
true;
9393 ExprResult Index = getDerived().TransformExpr(FromIndex);
9397 ExprChanged = ExprChanged || Index.
get() != FromIndex;
9398 Comp.isBrackets =
true;
9399 Comp.U.E = Index.
get();
9405 Comp.isBrackets =
false;
9407 if (!Comp.U.IdentInfo)
9417 Components.push_back(Comp);
9421 if (!getDerived().AlwaysRebuild() &&
9427 return getDerived().RebuildOffsetOfExpr(E->
getOperatorLoc(), Type,
9431 template<
typename Derived>
9435 "opaque value expression requires transformation");
9439 template<
typename Derived>
9445 template<
typename Derived>
9454 Expr *newSyntacticForm = SemaRef.recreateSyntacticForm(E);
9461 if (result.
get()->hasPlaceholderType(BuiltinType::PseudoObject))
9462 result = SemaRef.checkPseudoObjectRValue(result.
get());
9467 template<
typename Derived>
9478 if (!getDerived().AlwaysRebuild() && OldT == NewT)
9481 return getDerived().RebuildUnaryExprOrTypeTrait(NewT, E->
getOperatorLoc(),
9499 PE ? dyn_cast<DependentScopeDeclRefExpr>(PE->getSubExpr()) :
nullptr)
9500 SubExpr = getDerived().TransformParenDependentScopeDeclRefExpr(
9501 PE, DRE,
false, &RecoveryTSI);
9506 return getDerived().RebuildUnaryExprOrTypeTrait(
9514 return getDerived().RebuildUnaryExprOrTypeTrait(SubExpr.
get(),
9520 template<
typename Derived>
9532 if (!getDerived().AlwaysRebuild() &&
9537 return getDerived().RebuildArraySubscriptExpr(
9542 template <
typename Derived>
9551 LowerBound = getDerived().TransformExpr(E->
getLowerBound());
9558 Length = getDerived().TransformExpr(E->
getLength());
9563 if (!getDerived().AlwaysRebuild() && Base.
get() == E->
getBase() &&
9567 return getDerived().RebuildOMPArraySectionExpr(
9572 template<
typename Derived>
9581 bool ArgChanged =
false;
9587 if (!getDerived().AlwaysRebuild() &&
9590 return SemaRef.MaybeBindToTemporary(E);
9595 return getDerived().RebuildCallExpr(Callee.
get(), FakeLParenLoc,
9600 template<
typename Derived>
9618 = cast_or_null<ValueDecl>(getDerived().TransformDecl(E->
getMemberLoc(),
9627 FoundDecl = cast_or_null<NamedDecl>(
9628 getDerived().TransformDecl(E->
getMemberLoc(), FoundDecl));
9633 if (!getDerived().AlwaysRebuild() &&
9642 SemaRef.MarkMemberReferenced(E);
9665 NamedDecl *FirstQualifierInScope =
nullptr;
9667 if (MemberNameInfo.
getName()) {
9668 MemberNameInfo = getDerived().TransformDeclarationNameInfo(MemberNameInfo);
9669 if (!MemberNameInfo.
getName())
9673 return getDerived().RebuildMemberExpr(Base.
get(), FakeOperatorLoc,
9681 ? &TransArgs :
nullptr),
9682 FirstQualifierInScope);
9685 template<
typename Derived>
9696 if (!getDerived().AlwaysRebuild() &&
9708 template<
typename Derived>
9712 return getDerived().TransformBinaryOperator(E);
9715 template<
typename Derived>
9729 if (!getDerived().AlwaysRebuild() &&
9734 return getDerived().RebuildConditionalOperator(commonExpr.
get(),
9741 template<
typename Derived>
9756 if (!getDerived().AlwaysRebuild() &&
9762 return getDerived().RebuildConditionalOperator(Cond.
get(),
9769 template<
typename Derived>
9777 template<
typename Derived>
9789 if (!getDerived().AlwaysRebuild() &&
9794 return getDerived().RebuildCStyleCastExpr(E->
getLParenLoc(),
9800 template<
typename Derived>
9812 if (!getDerived().AlwaysRebuild() &&
9815 return SemaRef.MaybeBindToTemporary(E);
9821 return getDerived().RebuildCompoundLiteralExpr(
9826 template<
typename Derived>
9833 if (!getDerived().AlwaysRebuild() &&
9840 return getDerived().RebuildExtVectorElementExpr(Base.
get(), FakeOperatorLoc,
9845 template<
typename Derived>
9851 bool InitChanged =
false;
9858 Inits, &InitChanged))
9861 if (!getDerived().AlwaysRebuild() && !InitChanged) {
9872 template<
typename Derived>
9884 bool ExprChanged =
false;
9886 if (D.isFieldDesignator()) {
9891 FieldDecl *Field = cast_or_null<FieldDecl>(
9892 getDerived().TransformDecl(D.getFieldLoc(), D.getField()));
9893 if (Field != D.getField())
9906 if (D.isArrayDesignator()) {
9915 ArrayExprs.push_back(Index.
get());
9919 assert(D.isArrayRangeDesignator() &&
"New kind of designator?");
9922 if (Start.isInvalid())
9932 D.getEllipsisLoc()));
9937 ArrayExprs.push_back(Start.get());
9938 ArrayExprs.push_back(End.
get());
9941 if (!getDerived().AlwaysRebuild() &&
9946 return getDerived().RebuildDesignatedInitExpr(Desig, ArrayExprs,
9953 template<
typename Derived>
9957 llvm_unreachable(
"Unexpected DesignatedInitUpdateExpr in syntactic form of " 9962 template<
typename Derived>
9966 llvm_unreachable(
"Unexpected NoInitExpr in syntactic form of initializer");
9970 template<
typename Derived>
9973 llvm_unreachable(
"Unexpected ArrayInitLoopExpr outside of initializer");
9977 template<
typename Derived>
9980 llvm_unreachable(
"Unexpected ArrayInitIndexExpr outside of initializer");
9984 template<
typename Derived>
9996 if (!getDerived().AlwaysRebuild() &&
10000 return getDerived().RebuildImplicitValueInitExpr(T);
10003 template<
typename Derived>
10014 if (!getDerived().AlwaysRebuild() &&
10023 template<
typename Derived>
10026 bool ArgumentChanged =
false;
10032 return getDerived().RebuildParenListExpr(E->
getLParenLoc(),
10042 template<
typename Derived>
10051 cast<LabelDecl>(LD));
10054 template<
typename Derived>
10057 SemaRef.ActOnStartStmtExpr();
10059 = getDerived().TransformCompoundStmt(E->
getSubStmt(),
true);
10061 SemaRef.ActOnStmtExprError();
10065 if (!getDerived().AlwaysRebuild() &&
10068 SemaRef.ActOnStmtExprError();
10069 return SemaRef.MaybeBindToTemporary(E);
10072 return getDerived().RebuildStmtExpr(E->
getLParenLoc(),
10077 template<
typename Derived>
10092 if (!getDerived().AlwaysRebuild() &&
10103 template<
typename Derived>
10109 template<
typename Derived>
10116 case OO_Array_Delete:
10117 llvm_unreachable(
"new and delete operators cannot use CXXOperatorCallExpr");
10121 assert(E->
getNumArgs() >= 1 &&
"Object call is missing arguments");
10125 if (Object.isInvalid())
10130 static_cast<Expr *>(Object.get())->getEndLoc());
10138 return getDerived().RebuildCallExpr(Object.get(), FakeLParenLoc, Args,
10142 #define OVERLOADED_OPERATOR(Name,Spelling,Token,Unary,Binary,MemberOnly) \ 10144 #define OVERLOADED_OPERATOR_MULTI(Name,Spelling,Unary,Binary,MemberOnly) 10145 #include "clang/Basic/OperatorKinds.def" 10150 case OO_Conditional:
10151 llvm_unreachable(
"conditional operator is not actually overloadable");
10155 llvm_unreachable(
"not an overloaded operator?");
10164 First = getDerived().TransformAddressOfOperand(E->
getArg(0));
10166 First = getDerived().TransformExpr(E->
getArg(0));
10172 Second = getDerived().TransformExpr(E->
getArg(1));
10177 if (!getDerived().AlwaysRebuild() &&
10181 return SemaRef.MaybeBindToTemporary(E);
10186 return getDerived().RebuildCXXOperatorCallExpr(E->
getOperator(),
10193 template<
typename Derived>
10196 return getDerived().TransformCallExpr(E);
10199 template <
typename Derived>
10204 if (!getDerived().AlwaysRebuild() && !NeedRebuildFunc)
10209 getSema().CurContext);
10212 template<
typename Derived>
10226 bool ArgChanged =
false;
10232 if (!getDerived().AlwaysRebuild() &&
10235 return SemaRef.MaybeBindToTemporary(E);
10240 return getDerived().RebuildCallExpr(Callee.
get(), FakeLParenLoc,
10245 template<
typename Derived>
10257 if (!getDerived().AlwaysRebuild() &&
10261 return getDerived().RebuildCXXNamedCastExpr(
10268 template<
typename Derived>
10280 return getDerived().RebuildBuiltinBitCastExpr(BCE->
getBeginLoc(), TSI,
10284 template<
typename Derived>
10290 template<
typename Derived>
10296 template<
typename Derived>
10303 template<
typename Derived>
10309 template<
typename Derived>
10323 if (!getDerived().AlwaysRebuild() &&
10328 return getDerived().RebuildCXXFunctionalCastExpr(Type,
10335 template<
typename Derived>
10344 if (!getDerived().AlwaysRebuild() &&
10364 if (!getDerived().AlwaysRebuild() &&
10372 template<
typename Derived>
10381 if (!getDerived().AlwaysRebuild() &&
10396 if (!getDerived().AlwaysRebuild() &&
10404 template<
typename Derived>
10410 template<
typename Derived>
10417 template<
typename Derived>
10420 QualType T = getSema().getCurrentThisType();
10422 if (!getDerived().AlwaysRebuild() && T == E->
getType()) {
10425 getSema().MarkThisReferenced(E);
10432 template<
typename Derived>
10439 if (!getDerived().AlwaysRebuild() &&
10443 return getDerived().RebuildCXXThrowExpr(E->
getThrowLoc(), SubExpr.
get(),
10447 template<
typename Derived>
10455 if (!getDerived().AlwaysRebuild() && Param == E->
getParam() &&
10459 return getDerived().RebuildCXXDefaultArgExpr(E->
getUsedLocation(), Param);
10462 template<
typename Derived>
10465 FieldDecl *Field = cast_or_null<FieldDecl>(
10470 if (!getDerived().AlwaysRebuild() && Field == E->
getField() &&
10474 return getDerived().RebuildCXXDefaultInitExpr(E->
getExprLoc(), Field);
10477 template<
typename Derived>
10485 if (!getDerived().AlwaysRebuild() &&
10489 return getDerived().RebuildCXXScalarValueInitExpr(T,
10494 template<
typename Derived>
10500 if (!AllocTypeInfo)
10507 if (*OldArraySize) {
10508 NewArraySize = getDerived().TransformExpr(*OldArraySize);
10512 ArraySize = NewArraySize.
get();
10516 bool ArgumentChanged =
false;
10520 PlacementArgs, &ArgumentChanged))
10527 NewInit = getDerived().TransformInitializer(OldInit,
true);
10534 OperatorNew = cast_or_null<FunctionDecl>(
10542 OperatorDelete = cast_or_null<FunctionDecl>(
10544 if (!OperatorDelete)
10548 if (!getDerived().AlwaysRebuild() &&
10551 NewInit.
get() == OldInit &&
10554 !ArgumentChanged) {
10558 SemaRef.MarkFunctionReferenced(E->
getBeginLoc(), OperatorNew);
10559 if (OperatorDelete)
10560 SemaRef.MarkFunctionReferenced(E->
getBeginLoc(), OperatorDelete);
10566 CXXRecordDecl *Record = cast<CXXRecordDecl>(RecordT->getDecl());
10568 SemaRef.MarkFunctionReferenced(E->
getBeginLoc(), Destructor);
10583 const ArrayType *ArrayT = SemaRef.Context.getAsArrayType(AllocType);
10587 = dyn_cast<ConstantArrayType>(ArrayT)) {
10589 SemaRef.Context.getSizeType(),
10591 AllocType = ConsArrayT->getElementType();
10593 = dyn_cast<DependentSizedArrayType>(ArrayT)) {
10594 if (DepArrayT->getSizeExpr()) {
10595 ArraySize = DepArrayT->getSizeExpr();
10596 AllocType = DepArrayT->getElementType();
10601 return getDerived().RebuildCXXNewExpr(
10608 template<
typename Derived>
10618 OperatorDelete = cast_or_null<FunctionDecl>(
10620 if (!OperatorDelete)
10624 if (!getDerived().AlwaysRebuild() &&
10629 if (OperatorDelete)
10630 SemaRef.MarkFunctionReferenced(E->
getBeginLoc(), OperatorDelete);
10633 QualType Destroyed = SemaRef.Context.getBaseElementType(
10636 CXXRecordDecl *Record = cast<CXXRecordDecl>(DestroyedRec->getDecl());
10638 SemaRef.LookupDestructor(Record));
10645 return getDerived().RebuildCXXDeleteExpr(
10649 template<
typename Derived>
10658 bool MayBePseudoDestructor =
false;
10659 Base = SemaRef.ActOnStartCXXMemberReference(
nullptr, Base.
get(),
10661 E->
isArrow()? tok::arrow : tok::period,
10663 MayBePseudoDestructor);
10667 QualType ObjectType = ObjectTypePtr.get();
10669 if (QualifierLoc) {
10671 = getDerived().TransformNestedNameSpecifierLoc(QualifierLoc, ObjectType);
10676 SS.
Adopt(QualifierLoc);
10682 ObjectType,
nullptr, SS);
10683 if (!DestroyedTypeInfo)
10685 Destroyed = DestroyedTypeInfo;
10703 = SemaRef.Context.getTrivialTypeSourceInfo(SemaRef.GetTypeFromParser(T),
10710 ScopeTypeInfo = getDerived().TransformTypeInObjectScope(
10712 if (!ScopeTypeInfo)
10716 return getDerived().RebuildCXXPseudoDestructorExpr(Base.
get(),
10726 template <
typename Derived>
10731 bool AllEmptyPacks =
true;
10732 for (
auto *OldD : Old->
decls()) {
10733 Decl *InstD = getDerived().TransformDecl(Old->
getNameLoc(), OldD);
10737 if (isa<UsingShadowDecl>(OldD))
10746 NamedDecl *SingleDecl = cast<NamedDecl>(InstD);
10748 if (
auto *UPD = dyn_cast<UsingPackDecl>(InstD))
10749 Decls = UPD->expansions();
10752 for (
auto *D : Decls) {
10753 if (
auto *UD = dyn_cast<UsingDecl>(D)) {
10754 for (
auto *SD : UD->shadows())
10761 AllEmptyPacks &= Decls.empty();
10770 if (AllEmptyPacks && !RequiresADL) {
10771 getSema().Diag(Old->
getNameLoc(), diag::err_using_pack_expansion_empty)
10772 << isa<UnresolvedMemberExpr>(Old) << Old->
getName();
10782 template<
typename Derived>
10790 if (TransformOverloadExprDecls(Old, Old->
requiresADL(), R))
10797 = getDerived().TransformNestedNameSpecifierLoc(Old->
getQualifierLoc());
10801 SS.
Adopt(QualifierLoc);
10806 = cast_or_null<CXXRecordDecl>(getDerived().TransformDecl(
10809 if (!NamingClass) {
10814 R.setNamingClass(NamingClass);
10827 return SemaRef.BuildPossibleImplicitMemberExpr(SS, TemplateKWLoc, R,
10832 return getDerived().RebuildDeclarationNameExpr(SS, R, Old->
requiresADL());
10846 return getDerived().RebuildTemplateIdExpr(SS, TemplateKWLoc, R,
10850 template<
typename Derived>
10853 bool ArgChanged =
false;
10855 for (
unsigned I = 0, N = E->
getNumArgs(); I != N; ++I) {
10861 QualType To = getDerived().TransformType(TLB, FromTL);
10866 Args.push_back(From);
10880 SemaRef.collectUnexpandedParameterPacks(PatternTL, Unexpanded);
10884 bool Expand =
true;
10885 bool RetainExpansion =
false;
10889 if (getDerived().TryExpandParameterPacks(ExpansionTL.
getEllipsisLoc(),
10890 PatternTL.getSourceRange(),
10892 Expand, RetainExpansion,
10905 QualType To = getDerived().TransformType(TLB, PatternTL);
10909 To = getDerived().RebuildPackExpansionType(To,
10910 PatternTL.getSourceRange(),
10925 for (
unsigned I = 0; I != *NumExpansions; ++I) {
10928 TLB.
reserve(PatternTL.getFullDataSize());
10929 QualType To = getDerived().TransformType(TLB, PatternTL);
10934 To = getDerived().RebuildPackExpansionType(To,
10935 PatternTL.getSourceRange(),
10949 if (!RetainExpansion)
10954 ForgetPartiallySubstitutedPackRAII Forget(getDerived());
10959 QualType To = getDerived().TransformType(TLB, PatternTL);
10963 To = getDerived().RebuildPackExpansionType(To,
10964 PatternTL.getSourceRange(),
10976 if (!getDerived().AlwaysRebuild() && !ArgChanged)
10983 template<
typename Derived>
10990 if (!getDerived().AlwaysRebuild() &&
11010 template<
typename Derived>
11029 template <
typename Derived>
11033 ExprResult NewDRE = getDerived().TransformDependentScopeDeclRefExpr(
11034 DRE, AddrTaken, RecoveryTSI);
11041 if (!getDerived().AlwaysRebuild() && NewDRE.
get() == DRE)
11043 return getDerived().RebuildParenExpr(NewDRE.
get(), PE->
getLParen(),
11047 template <
typename Derived>
11050 return TransformDependentScopeDeclRefExpr(E,
false,
11054 template<
typename Derived>
11058 bool IsAddressOfOperand,
11062 = getDerived().TransformNestedNameSpecifierLoc(E->
getQualifierLoc());
11072 = getDerived().TransformDeclarationNameInfo(E->
getNameInfo());
11077 if (!getDerived().AlwaysRebuild() &&
11084 return getDerived().RebuildDependentScopeDeclRefExpr(
11085 QualifierLoc, TemplateKWLoc, NameInfo,
nullptr,
11086 IsAddressOfOperand, RecoveryTSI);
11095 return getDerived().RebuildDependentScopeDeclRefExpr(
11096 QualifierLoc, TemplateKWLoc, NameInfo, &TransArgs, IsAddressOfOperand,
11100 template<
typename Derived>
11108 (!getDerived().DropCallArgument(E->
getArg(0))) &&
11123 bool ArgumentChanged =
false;
11134 if (!getDerived().AlwaysRebuild() &&
11137 !ArgumentChanged) {
11140 SemaRef.MarkFunctionReferenced(E->
getBeginLoc(), Constructor);
11144 return getDerived().RebuildCXXConstructExpr(
11151 template<
typename Derived>
11163 if (!getDerived().AlwaysRebuild() &&
11168 SemaRef.MarkFunctionReferenced(E->
getBeginLoc(), Constructor);
11172 return getDerived().RebuildCXXInheritedCtorInitExpr(
11181 template<
typename Derived>
11192 template<
typename Derived>
11198 template<
typename Derived>
11212 bool ArgumentChanged =
false;
11224 if (!getDerived().AlwaysRebuild() &&
11227 !ArgumentChanged) {
11229 SemaRef.MarkFunctionReferenced(E->
getBeginLoc(), Constructor);
11230 return SemaRef.MaybeBindToTemporary(E);
11236 return getDerived().RebuildCXXTemporaryObjectExpr(
11241 template<
typename Derived>
11246 typedef std::pair<ExprResult, QualType> InitCaptureInfoTy;
11247 struct TransformedInitCapture {
11261 TransformedInitCapture &Result = InitCaptures[C - E->
capture_begin()];
11262 VarDecl *OldVD = C->getCapturedVar();
11266 ExprResult NewExprInitResult = getDerived().TransformInitializer(
11273 Expr *NewExprInit = NewExprInitResult.
get();
11276 getSema().buildLambdaInitCaptureInitialization(
11281 Result.Expansions.push_back(
11282 InitCaptureInfoTy(NewExprInit, NewInitCaptureType));
11291 SemaRef.collectUnexpandedParameterPacks(OldVD->
getInit(), Unexpanded);
11295 bool Expand =
true;
11296 bool RetainExpansion =
false;
11300 if (getDerived().TryExpandParameterPacks(
11303 RetainExpansion, NumExpansions))
11306 for (
unsigned I = 0; I != *NumExpansions; ++I) {
11311 if (!Expand || RetainExpansion) {
11312 ForgetPartiallySubstitutedPackRAII Forget(getDerived());
11323 auto TPL = getDerived().TransformTemplateParameterList(
11339 QualType NewCallOpType = TransformFunctionProtoType(
11340 NewCallOpTLBuilder, OldCallOpFPTL,
nullptr,
Qualifiers(),
11343 ExceptionStorage, Changed);
11345 if (NewCallOpType.
isNull())
11347 NewCallOpTSI = NewCallOpTLBuilder.getTypeSourceInfo(getSema().Context,
11362 getDerived().transformedLocalDecl(OldClass, {Class});
11365 if (getDerived().ReplacingOriginal())
11370 CXXMethodDecl *NewCallOperator = getSema().startLambdaDefinition(
11378 for (
unsigned I = 0, NumParams = NewCallOperator->getNumParams();
11379 I != NumParams; ++I) {
11380 auto *
P = NewCallOperator->getParamDecl(I);
11381 if (
P->hasUninstantiatedDefaultArg()) {
11387 P->setDefaultArg(R.
get());
11392 getDerived().transformedLocalDecl(E->
getCallOperator(), {NewCallOperator});
11399 getSema().buildLambdaScope(LSI, NewCallOperator,
11407 bool Invalid =
false;
11415 if (C->isImplicit())
11419 if (C->capturesThis()) {
11420 getSema().CheckCXXThisCapture(C->getLocation(), C->isExplicit(),
11427 if (C->capturesVLAType())
11432 TransformedInitCapture &NewC = InitCaptures[C - E->
capture_begin()];
11434 VarDecl *OldVD = C->getCapturedVar();
11437 for (InitCaptureInfoTy &Info : NewC.Expansions) {
11439 QualType InitQualType = Info.second;
11444 VarDecl *NewVD = getSema().createLambdaInitCaptureVarDecl(
11445 OldVD->
getLocation(), InitQualType, NewC.EllipsisLoc,
11451 NewVDs.push_back(NewVD);
11452 getSema().addInitCapture(LSI, NewVD);
11458 getDerived().transformedLocalDecl(OldVD, NewVDs);
11462 assert(C->capturesVariable() &&
"unexpected kind of lambda capture");
11471 if (C->isPackExpansion()) {
11473 bool ShouldExpand =
false;
11474 bool RetainExpansion =
false;
11476 if (getDerived().TryExpandParameterPacks(C->getEllipsisLoc(),
11479 ShouldExpand, RetainExpansion,
11485 if (ShouldExpand) {
11489 VarDecl *Pack = C->getCapturedVar();
11490 for (
unsigned I = 0; I != *NumExpansions; ++I) {
11493 = cast_or_null<VarDecl>(getDerived().TransformDecl(C->getLocation(),
11495 if (!CapturedVar) {
11501 getSema().tryCaptureVariable(CapturedVar, C->getLocation(),
Kind);
11509 EllipsisLoc = C->getEllipsisLoc();
11514 = cast_or_null<VarDecl>(getDerived().TransformDecl(C->getLocation(),
11515 C->getCapturedVar()));
11522 getSema().tryCaptureVariable(CapturedVar, C->getLocation(),
Kind,
11525 getSema().finishLambdaExplicitCaptures(LSI);
11529 getSema().PushExpressionEvaluationContext(
11534 Invalid ?
StmtError() : getDerived().TransformLambdaBody(E, E->
getBody());
11540 SavedContext.
pop();
11541 getSema().ActOnLambdaError(E->
getBeginLoc(),
nullptr,
11549 auto LSICopy = *LSI;
11550 getSema().ActOnFinishFunctionBody(NewCallOperator, Body.
get(),
11552 SavedContext.
pop();
11554 return getSema().BuildLambdaExpr(E->
getBeginLoc(), Body.
get()->getEndLoc(),
11558 template<
typename Derived>
11561 return TransformStmt(S);
11564 template<
typename Derived>
11573 if (!C->isImplicit())
11577 if (C->capturesThis()) {
11578 getSema().CheckCXXThisCapture(C->getLocation(), C->isExplicit(),
11585 if (C->capturesVLAType())
11588 assert(C->capturesVariable() &&
"unexpected kind of lambda capture");
11592 VarDecl *CapturedVar = cast_or_null<VarDecl>(
11593 getDerived().TransformDecl(C->getLocation(), C->getCapturedVar()));
11594 if (!CapturedVar || CapturedVar->isInvalidDecl())
11598 getSema().tryCaptureVariable(CapturedVar, C->getLocation());
11604 template<
typename Derived>
11613 bool ArgumentChanged =
false;
11625 if (!getDerived().AlwaysRebuild() &&
11631 return getDerived().RebuildCXXUnresolvedConstructExpr(
11635 template<
typename Derived>
11646 Base = getDerived().TransformExpr(OldBase);
11652 bool MayBePseudoDestructor =
false;
11653 Base = SemaRef.ActOnStartCXXMemberReference(
nullptr, Base.
get(),
11655 E->
isArrow()? tok::arrow : tok::period,
11657 MayBePseudoDestructor);
11661 ObjectType = ObjectTy.get();
11662 BaseType = ((
Expr*) Base.
get())->getType();
11665 BaseType = getDerived().TransformType(E->
getBaseType());
11672 = getDerived().TransformFirstQualifierInScope(
11681 FirstQualifierInScope);
11700 if (!getDerived().AlwaysRebuild() &&
11701 Base.
get() == OldBase &&
11708 return getDerived().RebuildCXXDependentScopeMemberExpr(Base.
get(),
11714 FirstQualifierInScope,
11725 return getDerived().RebuildCXXDependentScopeMemberExpr(Base.
get(),
11731 FirstQualifierInScope,
11736 template<
typename Derived>
11743 Base = getDerived().TransformExpr(Old->
getBase());
11746 Base = getSema().PerformMemberExprBaseConversion(Base.
get(),
11750 BaseType = Base.
get()->getType();
11752 BaseType = getDerived().TransformType(Old->
getBaseType());
11758 = getDerived().TransformNestedNameSpecifierLoc(Old->
getQualifierLoc());
11769 if (TransformOverloadExprDecls(Old,
false, R))
11775 = cast_or_null<CXXRecordDecl>(getDerived().TransformDecl(
11781 R.setNamingClass(NamingClass);
11798 NamedDecl *FirstQualifierInScope =
nullptr;
11800 return getDerived().RebuildUnresolvedMemberExpr(Base.
get(),
11806 FirstQualifierInScope,
11809 ? &TransArgs :
nullptr));
11812 template<
typename Derived>
11821 if (!getDerived().AlwaysRebuild() && SubExpr.
get() == E->
getOperand())
11827 template<
typename Derived>
11834 if (!getDerived().AlwaysRebuild() && Pattern.
get() == E->
getPattern())
11841 template<
typename Derived>
11860 bool ShouldExpand =
false;
11861 bool RetainExpansion =
false;
11865 ShouldExpand, RetainExpansion,
11871 if (ShouldExpand) {
11873 if (
auto *TTPD = dyn_cast<TemplateTypeParmDecl>(Pack)) {
11874 ArgStorage = getSema().Context.getPackExpansionType(
11875 getSema().Context.getTypeDeclType(TTPD), None);
11876 }
else if (
auto *TTPD = dyn_cast<TemplateTemplateParmDecl>(Pack)) {
11879 auto *VD = cast<ValueDecl>(Pack);
11880 ExprResult DRE = getSema().BuildDeclRefExpr(
11881 VD, VD->getType().getNonLValueExprType(getSema().Context),
11884 if (DRE.isInvalid())
11887 getSema().Context.DependentTy, DRE.get(), E->
getPackLoc(), None);
11889 PackArgs = ArgStorage;
11894 if (!PackArgs.size()) {
11895 auto *Pack = cast_or_null<NamedDecl>(
11899 return getDerived().RebuildSizeOfPackExpr(E->
getOperatorLoc(), Pack,
11907 if (!Arg.isPackExpansion()) {
11908 Result = *Result + 1;
11913 InventTemplateArgumentLoc(Arg, ArgLoc);
11919 getSema().getTemplateArgumentPackExpansionPattern(ArgLoc, Ellipsis,
11920 OrigNumExpansions);
11925 if (getDerived().TransformTemplateArgument(Pattern, OutPattern,
11931 getSema().getFullyPackExpandedSize(OutPattern.
getArgument());
11932 if (!NumExpansions) {
11939 Result = *Result + *NumExpansions;
11955 if (TransformTemplateArguments(PackLocIterator(*
this, PackArgs.begin()),
11956 PackLocIterator(*
this, PackArgs.end()),
11957 TransformedPackArgs,
true))
11964 bool PartialSubstitution =
false;
11965 for (
auto &Loc : TransformedPackArgs.arguments()) {
11966 Args.push_back(Loc.getArgument());
11967 if (Loc.getArgument().isPackExpansion())
11968 PartialSubstitution =
true;
11971 if (PartialSubstitution)
11978 Args.size(), None);
11981 template<
typename Derived>
11989 template<
typename Derived>
11997 template<
typename Derived>
12004 template<
typename Derived>
12011 template<
typename Derived>
12017 getSema().collectUnexpandedParameterPacks(Pattern, Unexpanded);
12018 assert(!Unexpanded.empty() &&
"Pack expansion without parameter packs?");
12022 bool Expand =
true;
12023 bool RetainExpansion =
false;
12025 NumExpansions = OrigNumExpansions;
12029 Expand, RetainExpansion,
12048 if (!getDerived().AlwaysRebuild() &&
12052 return getDerived().RebuildCXXFoldExpr(
12066 if (!LeftFold && RetainExpansion) {
12067 ForgetPartiallySubstitutedPackRAII Forget(getDerived());
12069 ExprResult Out = getDerived().TransformExpr(Pattern);
12073 Result = getDerived().RebuildCXXFoldExpr(
12080 for (
unsigned I = 0; I != *NumExpansions; ++I) {
12082 getSema(), LeftFold ? I : *NumExpansions - I - 1);
12083 ExprResult Out = getDerived().TransformExpr(Pattern);
12087 if (Out.
get()->containsUnexpandedParameterPack()) {
12089 Result = getDerived().RebuildCXXFoldExpr(
12093 OrigNumExpansions);
12096 Result = getDerived().RebuildBinaryOperator(
12098 LeftFold ? Result.
get() : Out.
get(),
12099 LeftFold ? Out.
get() : Result.
get());
12109 if (LeftFold && RetainExpansion) {
12110 ForgetPartiallySubstitutedPackRAII Forget(getDerived());
12112 ExprResult Out = getDerived().TransformExpr(Pattern);
12116 Result = getDerived().RebuildCXXFoldExpr(
12126 return getDerived().RebuildEmptyCXXFoldExpr(E->
getEllipsisLoc(),
12132 template<
typename Derived>
12139 template<
typename Derived>
12142 return SemaRef.MaybeBindToTemporary(E);
12145 template<
typename Derived>
12151 template<
typename Derived>
12158 if (!getDerived().AlwaysRebuild() &&
12165 template<
typename Derived>
12170 bool ArgChanged =
false;
12172 false, Elements, &ArgChanged))
12175 if (!getDerived().AlwaysRebuild() && !ArgChanged)
12176 return SemaRef.MaybeBindToTemporary(E);
12178 return getDerived().RebuildObjCArrayLiteral(E->
getSourceRange(),
12183 template<
typename Derived>
12189 bool ArgChanged =
false;
12196 getSema().collectUnexpandedParameterPacks(OrigElement.
Key, Unexpanded);
12197 getSema().collectUnexpandedParameterPacks(OrigElement.
Value, Unexpanded);
12198 assert(!Unexpanded.empty() &&
"Pack expansion without parameter packs?");
12202 bool Expand =
true;
12203 bool RetainExpansion =
false;
12208 if (getDerived().TryExpandParameterPacks(OrigElement.
EllipsisLoc,
12209 PatternRange, Unexpanded, Expand,
12210 RetainExpansion, NumExpansions))
12218 ExprResult Key = getDerived().TransformExpr(OrigElement.
Key);
12222 if (Key.
get() != OrigElement.
Key)
12229 if (Value.
get() != OrigElement.
Value)
12235 Elements.push_back(Expansion);
12245 for (
unsigned I = 0; I != *NumExpansions; ++I) {
12247 ExprResult Key = getDerived().TransformExpr(OrigElement.
Key);
12262 if (Key.
get()->containsUnexpandedParameterPack() ||
12263 Value.
get()->containsUnexpandedParameterPack())
12266 Elements.push_back(Element);
12276 ExprResult Key = getDerived().TransformExpr(OrigElement.
Key);
12280 if (Key.
get() != OrigElement.
Key)
12285 = getDerived().TransformExpr(OrigElement.
Value);
12289 if (Value.
get() != OrigElement.
Value)
12295 Elements.push_back(Element);
12298 if (!getDerived().AlwaysRebuild() && !ArgChanged)
12299 return SemaRef.MaybeBindToTemporary(E);
12301 return getDerived().RebuildObjCDictionaryLiteral(E->
getSourceRange(),
12305 template<
typename Derived>
12310 if (!EncodedTypeInfo)
12313 if (!getDerived().AlwaysRebuild() &&
12317 return getDerived().RebuildObjCEncodeExpr(E->
getAtLoc(),
12322 template<
typename Derived>
12332 template<
typename Derived>
12344 if (!getDerived().AlwaysRebuild() &&
12354 template <
typename Derived>
12360 template<
typename Derived>
12364 bool ArgChanged =
false;
12375 if (!ReceiverTypeInfo)
12379 if (!getDerived().AlwaysRebuild() &&
12381 return SemaRef.MaybeBindToTemporary(E);
12386 return getDerived().RebuildObjCMessageExpr(ReceiverTypeInfo,
12402 return getDerived().RebuildObjCMessageExpr(E->
getSuperLoc(),
12414 "Only class and instance messages may be instantiated");
12417 if (Receiver.isInvalid())
12421 if (!getDerived().AlwaysRebuild() &&
12423 return SemaRef.MaybeBindToTemporary(E);
12428 return getDerived().RebuildObjCMessageExpr(Receiver.get(),
12437 template<
typename Derived>
12443 template<
typename Derived>
12449 template<
typename Derived>
12460 if (!getDerived().AlwaysRebuild() &&
12464 return getDerived().RebuildObjCIvarRefExpr(Base.
get(), E->
getDecl(),
12469 template<
typename Derived>
12485 if (!getDerived().AlwaysRebuild() &&
12490 return getDerived().RebuildObjCPropertyRefExpr(Base.
get(),
12494 return getDerived().RebuildObjCPropertyRefExpr(Base.
get(),
12495 SemaRef.Context.PseudoObjectTy,
12501 template<
typename Derived>
12515 if (!getDerived().AlwaysRebuild() &&
12519 return getDerived().RebuildObjCSubscriptRefExpr(E->
getRBracket(),
12525 template<
typename Derived>
12534 if (!getDerived().AlwaysRebuild() &&
12543 template<
typename Derived>
12546 bool ArgumentChanged =
false;
12550 SubExprs, &ArgumentChanged))
12553 if (!getDerived().AlwaysRebuild() &&
12557 return getDerived().RebuildShuffleVectorExpr(E->
getBuiltinLoc(),
12562 template<
typename Derived>
12573 if (!getDerived().AlwaysRebuild() &&
12578 return getDerived().RebuildConvertVectorExpr(E->
getBuiltinLoc(),
12579 SrcExpr.
get(), Type,
12583 template<
typename Derived>
12602 if (getDerived().TransformFunctionTypeParams(
12611 getDerived().TransformType(exprFunctionType->
getReturnType());
12617 getDerived().RebuildFunctionProtoType(exprResultType, paramTypes, epi);
12621 if (!params.empty())
12639 if (!SemaRef.getDiagnostics().hasErrorOccurred()) {
12640 for (
const auto &I : oldBlock->
captures()) {
12641 VarDecl *oldCapture = I.getVariable();
12650 assert(blockScope->
CaptureMap.count(newCapture));
12660 template<
typename Derived>
12663 llvm_unreachable(
"Cannot transform asType expressions yet");
12666 template<
typename Derived>
12670 bool ArgumentChanged =
false;
12674 SubExprs, &ArgumentChanged))
12677 if (!getDerived().AlwaysRebuild() &&
12681 return getDerived().RebuildAtomicExpr(E->
getBuiltinLoc(), SubExprs,
12689 template<
typename Derived>
12692 return SemaRef.BuildPointerType(PointeeType, Star,
12693 getDerived().getBaseEntity());
12696 template<
typename Derived>
12699 return SemaRef.BuildBlockPointerType(PointeeType, Star,
12700 getDerived().getBaseEntity());
12703 template<
typename Derived>
12706 bool WrittenAsLValue,
12708 return SemaRef.BuildReferenceType(ReferentType, WrittenAsLValue,
12709 Sigil, getDerived().getBaseEntity());
12712 template<
typename Derived>
12717 return SemaRef.BuildMemberPointerType(PointeeType, ClassType, Sigil,
12718 getDerived().getBaseEntity());
12721 template<
typename Derived>
12728 return SemaRef.BuildObjCTypeParamType(Decl,
12729 ProtocolLAngleLoc, Protocols,
12730 ProtocolLocs, ProtocolRAngleLoc,
12734 template<
typename Derived>
12745 return SemaRef.BuildObjCObjectType(BaseType, Loc, TypeArgsLAngleLoc,
12746 TypeArgs, TypeArgsRAngleLoc,
12747 ProtocolLAngleLoc, Protocols, ProtocolLocs,
12752 template<
typename Derived>
12756 return SemaRef.Context.getObjCObjectPointerType(PointeeType);
12759 template<
typename Derived>
12763 const llvm::APInt *Size,
12765 unsigned IndexTypeQuals,
12767 if (SizeExpr || !Size)
12768 return SemaRef.BuildArrayType(ElementType, SizeMod, SizeExpr,
12769 IndexTypeQuals, BracketsRange,
12770 getDerived().getBaseEntity());
12773 SemaRef.Context.UnsignedCharTy, SemaRef.Context.UnsignedShortTy,
12774 SemaRef.Context.UnsignedIntTy, SemaRef.Context.UnsignedLongTy,
12775 SemaRef.Context.UnsignedLongLongTy, SemaRef.Context.UnsignedInt128Ty
12777 const unsigned NumTypes = llvm::array_lengthof(Types);
12779 for (
unsigned I = 0; I != NumTypes; ++I)
12780 if (Size->getBitWidth() == SemaRef.Context.getIntWidth(Types[I])) {
12781 SizeType = Types[I];
12790 return SemaRef.BuildArrayType(ElementType, SizeMod, ArraySize,
12791 IndexTypeQuals, BracketsRange,
12792 getDerived().getBaseEntity());
12795 template<
typename Derived>
12799 const llvm::APInt &Size,
12800 unsigned IndexTypeQuals,
12802 return getDerived().RebuildArrayType(ElementType, SizeMod, &Size,
nullptr,
12803 IndexTypeQuals, BracketsRange);
12806 template<
typename Derived>
12810 unsigned IndexTypeQuals,
12812 return getDerived().RebuildArrayType(ElementType, SizeMod,
nullptr,
nullptr,
12813 IndexTypeQuals, BracketsRange);
12816 template<
typename Derived>
12821 unsigned IndexTypeQuals,
12823 return getDerived().RebuildArrayType(ElementType, SizeMod,
nullptr,
12825 IndexTypeQuals, BracketsRange);
12828 template<
typename Derived>
12833 unsigned IndexTypeQuals,
12835 return getDerived().RebuildArrayType(ElementType, SizeMod,
nullptr,
12837 IndexTypeQuals, BracketsRange);
12840 template <
typename Derived>
12843 return SemaRef.BuildAddressSpaceAttr(PointeeType, AddrSpaceExpr,
12847 template <
typename Derived>
12850 unsigned NumElements,
12853 return SemaRef.Context.getVectorType(ElementType, NumElements, VecKind);
12856 template <
typename Derived>
12860 return SemaRef.BuildVectorType(ElementType, SizeExpr, AttributeLoc);
12863 template<
typename Derived>
12865 unsigned NumElements,
12867 llvm::APInt numElements(SemaRef.Context.getIntWidth(SemaRef.Context.IntTy),
12868 NumElements,
true);
12872 return SemaRef.BuildExtVectorType(ElementType, VectorSize, AttributeLoc);
12875 template<
typename Derived>
12880 return SemaRef.BuildExtVectorType(ElementType, SizeExpr, AttributeLoc);
12883 template<
typename Derived>
12888 return SemaRef.BuildFunctionType(T, ParamTypes,
12889 getDerived().getBaseLocation(),
12890 getDerived().getBaseEntity(),
12894 template<
typename Derived>
12896 return SemaRef.Context.getFunctionNoProtoType(T);
12899 template<
typename Derived>
12902 assert(D &&
"no decl found");
12907 if (
auto *UPD = dyn_cast<UsingPackDecl>(D)) {
12911 if (UPD->expansions().empty()) {
12912 getSema().Diag(Loc, diag::err_using_pack_expansion_empty)
12922 for (
auto *E : UPD->expansions()) {
12923 QualType ThisT = RebuildUnresolvedUsingType(Loc, E);
12931 assert(getSema().Context.hasSameType(ThisT, T) &&
12932 "mismatched resolved types in using pack expansion");
12934 return T.
isNull() ? FallbackT : T;
12935 }
else if (
auto *Using = dyn_cast<UsingDecl>(D)) {
12936 assert(Using->hasTypename() &&
12937 "UnresolvedUsingTypenameDecl transformed to non-typename using");
12940 assert(++Using->shadow_begin() == Using->shadow_end());
12941 Ty = cast<TypeDecl>((*Using->shadow_begin())->getTargetDecl());
12943 assert(isa<UnresolvedUsingTypenameDecl>(D) &&
12944 "UnresolvedUsingTypenameDecl transformed to non-using decl");
12945 Ty = cast<UnresolvedUsingTypenameDecl>(D);
12948 return SemaRef.Context.getTypeDeclType(Ty);
12951 template<
typename Derived>
12954 return SemaRef.BuildTypeofExprType(E, Loc);
12957 template<
typename Derived>
12959 return SemaRef.Context.getTypeOfType(Underlying);
12962 template<
typename Derived>
12965 return SemaRef.BuildDecltypeType(E, Loc);
12968 template<
typename Derived>
12972 return SemaRef.BuildUnaryTransformType(BaseType, UKind, Loc);
12975 template<
typename Derived>
12980 return SemaRef.CheckTemplateIdType(Template, TemplateNameLoc, TemplateArgs);
12983 template<
typename Derived>
12986 return SemaRef.BuildAtomicType(ValueType, KWLoc);
12989 template<
typename Derived>
12993 return isReadPipe ? SemaRef.BuildReadPipeType(ValueType, KWLoc)
12994 : SemaRef.BuildWritePipeType(ValueType, KWLoc);
12997 template<
typename Derived>
13002 return SemaRef.Context.getQualifiedTemplateName(SS.
getScopeRep(), TemplateKW,
13006 template<
typename Derived>
13014 bool AllowInjectedClassName) {
13018 getSema().ActOnDependentTemplateName(
nullptr,
13019 SS, TemplateKWLoc, TemplateName,
13022 Template, AllowInjectedClassName);
13023 return Template.
get();
13026 template<
typename Derived>
13033 bool AllowInjectedClassName) {
13036 SourceLocation SymbolLocations[3] = { NameLoc, NameLoc, NameLoc };
13039 getSema().ActOnDependentTemplateName(
nullptr,
13040 SS, TemplateKWLoc, Name,
13043 Template, AllowInjectedClassName);
13044 return Template.
get();
13047 template<
typename Derived>
13055 bool isPostIncDec = Second && (Op == OO_PlusPlus || Op == OO_MinusMinus);
13060 return SemaRef.checkPseudoObjectAssignment(
nullptr, OpLoc, Opc,
13062 ExprResult Result = SemaRef.CheckPlaceholderExpr(First);
13065 First = Result.
get();
13069 ExprResult Result = SemaRef.CheckPlaceholderExpr(Second);
13072 Second = Result.
get();
13076 if (Op == OO_Subscript) {
13079 return getSema().CreateBuiltinArraySubscriptExpr(
13081 }
else if (Op == OO_Arrow) {
13083 return SemaRef.BuildOverloadedArrowExpr(
nullptr, First, OpLoc);
13084 }
else if (Second ==
nullptr || isPostIncDec) {
13086 (Op == OO_Amp && getSema().isQualifiedMemberAccess(First))) {
13093 return getSema().CreateBuiltinUnaryOp(OpLoc, Opc, First);
13102 = SemaRef.CreateBuiltinBinOp(OpLoc, Opc, First, Second);
13116 Functions.
append(ULE->decls_begin(), ULE->decls_end());
13120 RequiresADL = ULE->requiresADL();
13125 NamedDecl *ND = cast<DeclRefExpr>(Callee)->getDecl();
13126 if (!isa<CXXMethodDecl>(ND))
13128 RequiresADL =
false;
13132 Expr *Args[2] = { First, Second };
13133 unsigned NumArgs = 1 + (Second !=
nullptr);
13136 if (NumArgs == 1 || isPostIncDec) {
13139 return SemaRef.CreateOverloadedUnaryOp(OpLoc, Opc, Functions, First,
13143 if (Op == OO_Subscript) {
13147 if (
DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(Callee)) {
13158 return SemaRef.CreateOverloadedArraySubscriptExpr(LBrace, RBrace,
13164 ExprResult Result = SemaRef.CreateOverloadedBinOp(
13165 OpLoc, Opc, Functions, Args[0], Args[1], RequiresADL);
13172 template<
typename Derived>
13187 ->template getAs<RecordType>())){
13189 return SemaRef.BuildPseudoDestructorExpr(
13190 Base, OperatorLoc, isArrow ? tok::arrow : tok::period, SS, ScopeType,
13191 CCLoc, TildeLoc, Destroyed);
13195 DeclarationName Name(SemaRef.Context.DeclarationNames.getCXXDestructorName(
13196 SemaRef.Context.getCanonicalType(DestroyedType->
getType())));
13205 diag::err_expected_class_or_namespace)
13206 << ScopeType->
getType() << getSema().getLangOpts().CPlusPlus;
13214 return getSema().BuildMemberReferenceExpr(Base, BaseType,
13215 OperatorLoc, isArrow,
13223 template<
typename Derived>
13231 for (
unsigned I = 0; I < NumParams; ++I) {
13232 if (I != ContextParamPos) {
13238 Params.push_back(std::make_pair(StringRef(),
QualType()));
13241 getSema().ActOnCapturedRegionStart(Loc,
nullptr,
13250 getSema().ActOnCapturedRegionError();
13254 return getSema().ActOnCapturedRegionEnd(Body.
get());
13259 #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.
The receiver is the instance of the superclass object.
Represents a single C99 designator.
SourceLocation getLoc() const
getLoc - Returns the main location of the declaration name.
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
SourceLocation getRBracLoc() const
QualType getAddrSpaceQualType(QualType T, LangAS AddressSpace) const
Return the uniqued reference to the type for an address space qualified type with the specified type ...
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
helper_expr_const_range reduction_ops() const
Name lookup found a set of overloaded functions that met the criteria.
This represents 'thread_limit' clause in the '#pragma omp ...' directive.
std::pair< llvm::PointerUnion< const TemplateTypeParmType *, NamedDecl * >, SourceLocation > UnexpandedParameterPack
Expr ** getArgs()
Retrieve the call arguments.
The receiver is an object instance.
bool hasExplicitTemplateArgs() const
Determines whether this expression had explicit template arguments.
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()
Expr * getArg(unsigned Arg)
getArg - Return the specified argument.
ObjCMethodDecl * getAtIndexMethodDecl() const
Instantiation or recovery rebuild of a for-range statement.
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
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.
Ordinary name lookup, which finds ordinary names (functions, variables, typedefs, etc...
CompoundStmt * getSubStmt()
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.
Expr * getUnderlyingExpr() const
void setKWLoc(SourceLocation Loc)
static ConditionResult ConditionError()
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
ObjCMethodDecl * setAtIndexMethodDecl() const
QualType ReturnType
ReturnType - The target type of return statements in this context, or null if unknown.
StorageClass getStorageClass() const
Returns the storage class as written in the source.
unsigned getNumOutputs() const
Microsoft's '__super' specifier, stored as a CXXRecordDecl* of the class it appeared in...
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 '('.
The template argument is an expression, and we've not resolved it to one of the other forms yet...
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.
ObjCMethodDecl * getImplicitPropertySetter() const
Represents the index of the current element of an array being initialized by an ArrayInitLoopExpr.
FunctionDecl * getOperatorNew() const
WrittenBuiltinSpecs & getWrittenBuiltinSpecs()
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
This represents 'if' clause in the '#pragma omp ...' directive.
QualType getDeducedTemplateSpecializationType(TemplateName Template, QualType DeducedType, bool IsDependent) const
C++17 deduced class template specialization type.
const Expr * getSubExpr() const
DeclarationNameInfo getNameInfo() const
Retrieve the name of the entity we're testing for, along with location information.
Defines the C++ template declaration subclasses.
CapturedStmt * getInnermostCapturedStmt()
Get innermost captured statement for the construct.
Represents a C++11 auto or C++14 decltype(auto) type.
SourceLocation getIdentLoc() const
Represents an attribute applied to a statement.
ParenExpr - This represents a parethesized expression, e.g.
const AstTypeMatcher< FunctionType > functionType
Matches FunctionType nodes.
bool hasQualifier() const
Determines whether this member expression actually had a C++ nested-name-specifier prior to the name ...
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies this name, if any.
Expr * getLowerBound()
Get lower bound of array section.
This represents 'priority' clause in the '#pragma omp ...' directive.
The base class of the type hierarchy.
This represents '#pragma omp target teams distribute' combined directive.
Represents Objective-C's @throw statement.
bool requiresZeroInitialization() const
Whether this construction first requires zero-initialization before the initializer is called...
void setParams(ArrayRef< ParmVarDecl *> NewParamInfo)
reference operator*() const
const IdentifierInfo * getField() const
bool hasExplicitTemplateArgs() const
Determines whether this declaration reference was followed by an explicit template argument list...
void setTemplateKeywordLoc(SourceLocation Loc)
Represents an array type, per C99 6.7.5.2 - Array Declarators.
The template argument is a declaration that was provided for a pointer, reference, or pointer to member non-type template parameter.
Represent a C++ namespace.
SourceLocation getKeywordLoc() const
Represents a call to a C++ constructor.
SourceLocation getBeginLoc() const LLVM_READONLY
ObjCSubscriptRefExpr - used for array and dictionary subscripting.
Wrapper for source info for typedefs.
static ExprValueKind getValueKindForType(QualType T)
getValueKindForType - Given a formal return or parameter type, give its value kind.
TypeSourceInfo * getTypeInfoAsWritten() const
getTypeInfoAsWritten - Returns the type source info for the type that this expression is casting to...
FPOptions getFPFeatures() const
An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent...
TypeLoc getOriginalLoc() const
SourceLocation 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.
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.
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...
SourceLocation getAccessorLoc() const
Expr * getAlignment()
Returns alignment.
SourceLocation getLocalBeginLoc() const
Retrieve the location of the beginning of this component of the nested-name-specifier.
Expr * getNumForLoops() const
Return the number of associated for-loops.
SourceLocation getRParenLoc() const
getRParenLoc - Return the location of final right parenthesis.
SourceLocation getEndLoc() const
Get the end source location.
SourceLocation getSecondScheduleModifierLoc() const
Get the second modifier location.
QualType getElementType() const
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
An identifier, stored as an IdentifierInfo*.
This represents '#pragma omp target exit data' directive.
void Adopt(NestedNameSpecifierLoc Other)
Adopt an existing nested-name-specifier (with source-range information).
SourceLocation getDependencyLoc() const
Get dependency type location.
void setRAngleLoc(SourceLocation Loc)
This represents 'read' clause in the '#pragma omp atomic' directive.
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.
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.
Represents an empty template argument, e.g., one that has not been deduced.
Extra information about a function prototype.
This represents 'defaultmap' clause in the '#pragma omp ...' directive.
Stmt * getResultDecl() const
SourceLocation getStarLoc() const
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...
A namespace, stored as a NamespaceDecl*.
SourceLocation getColonLoc() const
Return the location of ':'.
DeclarationName getName() const
Gets the name looked up.
Implicit construction of a std::initializer_list<T> object from an array temporary within list-initia...
TypeLoc getNamedTypeLoc() const
bool isInvalidDecl() const
SourceLocation getIfLoc() const
void setAttrOperandParensRange(SourceRange range)
void setProtocolRAngleLoc(SourceLocation Loc)
Stores a list of template parameters for a TemplateDecl and its derived classes.
unsigned getContextParamPosition() const
unsigned getNumPlacementArgs() const
TypeSourceInfo * getArgumentTypeInfo() const
bool requiresADL() const
True if this declaration should be extended by argument-dependent lookup.
This represents implicit clause 'flush' for the '#pragma omp flush' directive.
Defines the Objective-C statement AST node classes.
SourceRange getSourceRange() const LLVM_READONLY
Retrieve the source range that covers this offsetof node.
static CXXDefaultInitExpr * Create(const ASTContext &Ctx, SourceLocation Loc, FieldDecl *Field, DeclContext *UsedContext)
Field is the non-static data member whose default initializer is used by this expression.
const DeclarationNameInfo & getNameInfo() const
Gets the name info for specified reduction identifier.
SpecifierKind getKind() const
Determine what kind of nested name specifier is stored.
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will call.
A C++ throw-expression (C++ [except.throw]).
Expr * getExprOperand() const
Represents an expression – generally a full-expression – that introduces cleanups to be run at the ...
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
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
TypeSourceInfo * getEncodedTypeSourceInfo() const
TypeSourceInfo * getScopeTypeInfo() const
Retrieve the scope type in a qualified pseudo-destructor expression.
SourceLocation getKeywordLoc() const
SourceLocation getLParenLoc() const
Returns the location of '('.
One of these records is kept for each identifier that is lexed.
Expr * GetTemporaryExpr() const
Retrieve the temporary-generating subexpression whose value will be materialized into a glvalue...
void setLocalRangeEnd(SourceLocation L)
Name lookup results in an ambiguity; use getAmbiguityKind to figure out what kind of ambiguity we hav...
SourceLocation getTildeLoc() const
Retrieve the location of the '~'.
SourceLocation getRParenLoc() const
Represents a function call to one of __builtin_LINE(), __builtin_COLUMN(), __builtin_FUNCTION(), or __builtin_FILE().
An element in an Objective-C dictionary literal.
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.
The template argument is an integral value stored in an llvm::APSInt that was provided for an integra...
void setBuiltinLoc(SourceLocation Loc)
void setArgLocInfo(unsigned i, TemplateArgumentLocInfo AI)
TemplateDecl * getAsTemplateDecl() const
Retrieve the underlying template declaration that this template name refers to, if known...
TemplateArgumentLoc value_type
TypeSourceInfo * getUnderlyingTInfo() const
bool isExplicitProperty() const
bool isSpelledAsLValue() const
SourceLocation getAmpAmpLoc() const
static SourceLocation getFromRawEncoding(unsigned Encoding)
Turn a raw encoding of a SourceLocation object into a real SourceLocation.
void setRBracketLoc(SourceLocation Loc)
TypeSourceInfo * getTypeSourceInfo(ASTContext &Context, QualType T)
Creates a TypeSourceInfo for the given type.
QualType getDependentNameType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier *NNS, const IdentifierInfo *Name, QualType Canon=QualType()) const
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.
const Type * getAsType() const
Retrieve the type stored in this nested name specifier.
This represents clause 'lastprivate' in the '#pragma omp ...' directives.
The current expression is potentially evaluated at run time, which means that code may be generated t...
SubstTemplateTemplateParmPackStorage * getAsSubstTemplateTemplateParmPack() const
Retrieve the substituted template template parameter pack, if known.
Expr * getBase()
Retrieve the base object of this member expressions, e.g., the x in x.m.
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
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.
bool isAssignmentOp() const
LambdaCaptureDefault getCaptureDefault() const
Determine the default capture kind for this lambda.
No entity found met the criteria within the current instantiation,, but there were dependent base cla...
bool hasExplicitTemplateArgs() const
Determines whether this lookup had explicit template arguments.
SourceLocation getLParenLoc() const
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
static DeclAccessPair make(NamedDecl *D, AccessSpecifier AS)
bool isElidable() const
Whether this construction is elidable.
void setRAngleLoc(SourceLocation Loc)
Expr * getOperand() const
const Expr * getThrowExpr() const
Wrapper for source info for injected class names of class templates.
< Capturing the *this object by copy
unsigned getNumProtocols() const
SourceLocation getProtocolLoc(unsigned i) const
SourceLocation getSigilLoc() const
A convenient class for passing around template argument information.
SourceLocation getLocation() const
ExprResult ActOnDesignatedInitializer(Designation &Desig, SourceLocation Loc, bool GNUSyntax, ExprResult Init)
LabelDecl * getDecl() const
SourceLocation 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 containsUnexpandedParameterPack() const
Whether this type is or contains an unexpanded parameter pack, used to support C++0x variadic templat...
QualType FunctionType
BlockType - The function type of the block, if one was given.
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
Represents a declaration of a type.
A builtin binary operation expression such as "x + y" or "x <= y".
Wrapper for substituted template type parameters.
SourceLocation getColonLoc() const
Gets location of ':' symbol in clause.
bool constructsVBase() const
Determine whether this constructor is actually constructing a base class (rather than a complete obje...
LangAS getAddressSpace() const
Expr * getOutputExpr(unsigned i)
SourceLocation getLParenLoc() const
void setRParenLoc(SourceLocation Loc)
SourceLocation getThrowLoc() const
const StringLiteral * getInputConstraintLiteral(unsigned i) const
TemplateArgumentLocContainerIterator & operator++()
const Type * getClass() const
CXXForRangeStmt - This represents C++0x [stmt.ranged]'s ranged for statement, represented as 'for (ra...
CXXRecordDecl * getDecl() const
This represents '#pragma omp cancellation point' directive.
This represents 'default' clause in the '#pragma omp ...' directive.
Expr * IgnoreParenCasts() LLVM_READONLY
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
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...
CXXRecordDecl * getNamingClass()
Gets the 'naming class' (in the sense of C++0x [class.access.base]p5) of the lookup.
static IntegerLiteral * Create(const ASTContext &C, const llvm::APInt &V, QualType type, SourceLocation l)
Returns a new integer literal with value 'V' and type 'type'.
NestedNameSpecifierLoc getQualifierLoc() const
If the name was qualified, retrieves the nested-name-specifier that precedes the name, with source-location information.
bool isTypeDependent() const
isTypeDependent - Determines whether this expression is type-dependent (C++ [temp.dep.expr]), which means that its type could change from one template instantiation to the next.
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.
Member name lookup, which finds the names of class/struct/union members.
bool isInitCapture(const LambdaCapture *Capture) const
Determine whether one of this lambda's captures is an init-capture.
const Stmt * getBody() const
static UnresolvedLookupExpr * Create(const ASTContext &Context, CXXRecordDecl *NamingClass, NestedNameSpecifierLoc QualifierLoc, const DeclarationNameInfo &NameInfo, bool RequiresADL, bool Overloaded, UnresolvedSetIterator Begin, UnresolvedSetIterator End)
unsigned getNumArgs() const
TypeSourceInfo * getTypeSourceInfo() const
The current context is "potentially evaluated" in C++11 terms, but the expression is evaluated at com...
SourceLocation getProtocolRAngleLoc() const
NestedNameSpecifierLoc getWithLocInContext(ASTContext &Context) const
Retrieve a nested-name-specifier with location information, copied into the given AST context...
SourceLocation getElaboratedKeywordLoc() const
Expr * getSizeExpr() const
static Opcode getOverloadedOpcode(OverloadedOperatorKind OO, bool Postfix)
Retrieve the unary opcode that corresponds to the given overloaded operator.
A default argument (C++ [dcl.fct.default]).
void 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.
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.
OpenMPProcBindClauseKind getProcBindKind() const
Returns kind of the clause.
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
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().
static CallExpr * Create(const ASTContext &Ctx, Expr *Fn, ArrayRef< Expr *> Args, QualType Ty, ExprValueKind VK, SourceLocation RParenLoc, unsigned MinNumArgs=0, ADLCallKind UsesADL=NotADL)
Create a call expression.
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.
The current expression is potentially evaluated, but any declarations referenced inside that expressi...
This represents 'capture' clause in the '#pragma omp atomic' directive.
DeclAccessPair getFoundDecl() const
Retrieves the declaration found by lookup.
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
This represents one expression.
SourceLocation getLocalRangeEnd() const
SourceLocation getElseLoc() const
The "typename" keyword precedes the qualified type name, e.g., typename T::type.
SourceLocation getCaptureDefaultLoc() const
Retrieve the location of this lambda's capture-default, if any.
TemplateArgumentLoc const * getTemplateArgs() const
ArrayRef< StringRef > getClobbers() const
IdentifierInfo * getFieldName() const
For a field or identifier offsetof node, returns the name of the field.
SourceLocation getMapLoc() const LLVM_READONLY
Fetches location of clause mapping kind.
bool isArrow() const
Determine whether this member expression used the '->' operator; otherwise, it used the '...
This represents 'simdlen' clause in the '#pragma omp ...' directive.
Expr * getNumTasks() const
Return safe iteration space distance.
SourceLocation getDefaultLoc() const
static void deduceOpenCLPointeeAddrSpace(Sema &SemaRef, QualType &PointeeType)
Helper to deduce addr space of a pointee type in OpenCL mode.
SourceLocation getScheduleKindLoc()
Get kind location.
TemplateArgumentLocInventIterator(TreeTransform< Derived > &Self, InputIterator Iter)
bool isImplicitAccess() const
True if this is an implicit access, i.e., one in which the member being accessed was not written in t...
SourceLocation getWhileLoc() const
UnqualTypeLoc getUnqualifiedLoc() const
Skips past any qualifiers, if this is qualified.
SourceRange getBracketsRange() const
const T * castAs() const
Member-template castAs<specific type>.
Represents a C++ functional cast expression that builds a temporary object.
ElaboratedTypeKeyword
The elaboration keyword that precedes a qualified type name or introduces an elaborated-type-specifie...
The template argument is a null pointer or null pointer to member that was provided for a non-type te...
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
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 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.
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
A namespace alias, stored as a NamespaceAliasDecl*.
This represents 'ordered' clause in the '#pragma omp ...' directive.
The current expression and its subexpressions occur within an unevaluated operand (C++11 [expr]p7)...
SourceRange getAngleBrackets() const LLVM_READONLY
Kind getKind() const
Determine what kind of offsetof node this is.
void setLParenLoc(SourceLocation Loc)
SourceLocation getLAngleLoc() const
Retrieve the location of the left angle bracket starting the explicit template argument list followin...
SourceLocation getColonLoc() const
Get colon location.
An RAII helper that pops function a function scope on exit.
SourceLocation getLocalRangeBegin() const
SourceLocation getKeywordLoc() const
Retrieve the location of the __if_exists or __if_not_exists keyword.
Wrapper for source info for enum types.
This represents '#pragma omp for' directive.
static QualType TransformTypeSpecType(TypeLocBuilder &TLB, TyLoc T)
SourceLocation getProtocolLAngleLoc() const
Expr * getPattern() const
Get the pattern, that is, the operand that contains an unexpanded pack.
Optional< unsigned > NumExpansions
The number of elements this pack expansion will expand to, if this is a pack expansion and is known...
SourceLocation getSwitchLoc() const
void setEllipsisLoc(SourceLocation Loc)
void setAttrExprOperand(Expr *e)
Declaration of an alias template.
LabelDecl * getLabel() const
const Stmt * getTryBody() const
Retrieve the @try body.
Represents a folding of a pack over an operator.
ProtocolLAngleLoc, ProtocolRAngleLoc, and the source locations for protocol qualifiers are stored aft...
ReturnStmt - This represents a return, optionally of an expression: return; return 4;...
This represents '#pragma omp target teams' directive.
void setHasBaseTypeAsWritten(bool HasBaseType)
A boolean condition, from 'if', 'while', 'for', or 'do'.
An expression that sends a message to the given Objective-C object or class.
This represents a Microsoft inline-assembly statement extension.
SourceLocation getDoLoc() const
SourceLocation getAtLoc() const
ObjCMethodDecl * getImplicitPropertyGetter() const
Expr * getSubExprAsWritten()
Retrieve the cast subexpression as it was written in the source code, looking through any implicit ca...
SourceLocation getRBracketLoc() const
SourceLocation getEnd() const
UnaryOperator - This represents the unary-expression's (except sizeof and alignof), the postinc/postdec operators from postfix-expression, and various extensions.
bool isInstanceMethod() const
SourceLocation getMemberLoc() const
getMemberLoc - Return the location of the "member", in X->F, it is the location of 'F'...
Represents a GCC generic vector type.
ReceiverKind getReceiverKind() const
Determine the kind of receiver that this message is being sent to.
ArraySizeModifier getSizeModifier() const
bool usesGNUSyntax() const
Determines whether this designated initializer used the deprecated GNU syntax for designated initiali...
struct CXXOpName CXXOperatorName
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 ','.
SourceLocation getLocation() const
SourceLocation getRParenLoc() const
QualType getTypeDeclType(const TypeDecl *Decl, const TypeDecl *PrevDecl=nullptr) const
Return the unique reference to the type for the specified type declaration.
SourceLocation getForLoc() const
QualType getDestroyedType() const
Retrieve the type being destroyed.
const Expr * getSubExpr() const
ObjCBridgeCastKind getBridgeKind() const
Determine which kind of bridge is being performed via this cast.
const Expr * getSubExpr() const
void setQualifierLoc(NestedNameSpecifierLoc QualifierLoc)
CStyleCastExpr - An explicit cast in C (C99 6.5.4) or a C-style cast in C++ (C++ [expr.cast]), which uses the syntax (Type)expr.
SourceLocation getPackLoc() const
Determine the location of the parameter pack.
CXXMethodDecl * getCallOperator() const
Retrieve the function call operator associated with this lambda expression.
OpenMPProcBindClauseKind
OpenMP attributes for 'proc_bind' clause.
bool isNull() const
Return true if this QualType doesn't point to a type yet.
A type, stored as a Type*.
InitializationStyle getInitStyle() const
The style of initialization for this declaration.
const DeclContext * getUsedContext() const
Expr * getLHS()
An array access can be written A[4] or 4[A] (both are equivalent).
TypeLoc getReturnLoc() const
ImaginaryLiteral - We support imaginary integer and floating point literals, like "1...
This represents '#pragma omp flush' directive.
SourceLocation getEndLoc() const LLVM_READONLY
This represents '#pragma omp parallel for simd' directive.
ExprObjectKind getObjectKind() const
getObjectKind - The object kind that this expression produces.
static SEHFinallyStmt * Create(const ASTContext &C, SourceLocation FinallyLoc, Stmt *Block)
DoStmt - This represents a 'do/while' stmt.
This represents 'seq_cst' clause in the '#pragma omp atomic' directive.
SourceLocation getOperatorLoc() const
Retrieve the location of the '->' or '.' operator.
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.
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 '('.
static Opcode getOverloadedOpcode(OverloadedOperatorKind OO)
Retrieve the binary opcode that corresponds to the given overloaded operator.
char * location_data() const
Retrieve the data associated with the source-location information.
friend bool operator==(const TemplateArgumentLocContainerIterator &X, const TemplateArgumentLocContainerIterator &Y)
Wrapper for source info for arrays.
bool isComputedNoexcept(ExceptionSpecificationType ESpecType)
SourceLocation getColonLoc() const
Returns the location of ':'.
This represents 'num_teams' clause in the '#pragma omp ...' directive.
A C++ dynamic_cast expression (C++ [expr.dynamic.cast]).
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class...
SourceLocation getTemplateNameLoc() const
ConvertVectorExpr - Clang builtin function __builtin_convertvector This AST node provides support for...
unsigned getNumArgs() const
Return the number of actual arguments in this message, not counting the receiver. ...
SourceLocation getLParenLoc() const
Tag name lookup, which finds the names of enums, classes, structs, and unions.
TypeLoc getPatternLoc() const
A reference to an overloaded function set, either an UnresolvedLookupExpr or an UnresolvedMemberExpr...
This captures a statement into a function.
A field in a dependent type, known only by its name.
Expr * getInit() const
Get the operand that doesn't contain a pack, for a binary fold.
QualType getCanonicalType() const
Represents a call to an inherited base class constructor from an inheriting constructor.
ExpressionTrait getTrait() const
ActionResult - This structure is used while parsing/acting on expressions, stmts, etc...
ExceptionSpecificationType Type
The kind of exception specification this is.
Expr ** getPlacementArgs()
SourceLocation getLParenLoc()
Get location of '('.
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
QualType getElaboratedType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier *NNS, QualType NamedType, TagDecl *OwnedTagDecl=nullptr) const
void setLAngleLoc(SourceLocation Loc)
SourceLocation getRAngleLoc() const
Retrieve the location of the right angle bracket ending the explicit template argument list following...
ElaboratedTypeKeyword getKeyword() const
ExtProtoInfo getExtProtoInfo() const
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.
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.
QualType CheckTypenameType(ElaboratedTypeKeyword Keyword, SourceLocation KeywordLoc, NestedNameSpecifierLoc QualifierLoc, const IdentifierInfo &II, SourceLocation IILoc)
Build the type that describes a C++ typename specifier, e.g., "typename T::type". ...
static SizeOfPackExpr * Create(ASTContext &Context, SourceLocation OperatorLoc, NamedDecl *Pack, SourceLocation PackLoc, SourceLocation RParenLoc, Optional< unsigned > Length=None, ArrayRef< TemplateArgument > PartialArgs=None)
Represents a call to a member function that may be written either with member call syntax (e...
SourceLocation getExceptLoc() const
SourceRange getSourceRange() const LLVM_READONLY
QualType getElementType() const
DeclStmt - Adaptor class for mixing declarations with statements and expressions. ...
bool transformOMPMappableExprListClause(TreeTransform< Derived > &TT, OMPMappableExprListClause< T > *C, llvm::SmallVectorImpl< Expr *> &Vars, CXXScopeSpec &MapperIdScopeSpec, DeclarationNameInfo &MapperIdInfo, llvm::SmallVectorImpl< Expr *> &UnresolvedMappers)
OpenMPDirectiveKind
OpenMP directives.
Represents the declaration of a label.
SourceLocation getLParenLoc() const
Returns the location of '('.
This represents clause 'shared' in the '#pragma omp ...' directives.
Represents a vector type where either the type or size is dependent.
void setProtocolRAngleLoc(SourceLocation Loc)
SourceLocation 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>::".
C-style initialization with assignment.
pointer operator->() const
SourceLocation getSuperLoc() const
Retrieve the location of the 'super' keyword for a class or instance message to 'super', otherwise an invalid source location.
SourceLocation getAtLoc() const
This represents '#pragma omp taskwait' directive.
QualType getAllocatedType() const
OpenMPMapClauseKind getMapType() const LLVM_READONLY
Fetches mapping kind for the clause.
SourceLocation getRParenLoc() const
const ParmVarDecl * getParamDecl(unsigned i) const
SourceLocation getLocation() const
Name lookup found an unresolvable value declaration and cannot yet complete.
void reserve(size_t Requested)
Ensures that this buffer has at least as much capacity as described.
This is a basic class for representing single OpenMP clause.
ExprResult ActOnInitList(SourceLocation LBraceLoc, MultiExprArg InitArgList, SourceLocation RBraceLoc)
QualType getEquivalentType() const
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load, __atomic_store, and __atomic_compare_exchange_*, for the similarly-named C++11 instructions, and __c11 variants for <stdatomic.h>, and corresponding __opencl_atomic_* for OpenCL 2.0.
UnaryExprOrTypeTrait getKind() const
SourceLocation getColonLoc() const
Returns the location of the ':' delimiter.
void addDecl(NamedDecl *D)
ObjCProtocolExpr used for protocol expression in Objective-C.
SourceLocation getStarLoc() const
bool isValueDependent() const
isValueDependent - Determines whether this expression is value-dependent (C++ [temp.dep.constexpr]).
QualType getReceiverType() const
Retrieve the receiver type to which this message is being directed.
SourceLocation getLParenLoc() const
SourceLocation getGotoLoc() const
SourceLocation getAtFinallyLoc() const
bool isObjCObjectPointerType() const
SourceLocation getNameModifierLoc() const
Return the location of directive name modifier.
const StringLiteral * getOutputConstraintLiteral(unsigned i) const
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.
Expr * getNumForLoops() const
Return the number of associated for-loops.
void setLBracketLoc(SourceLocation Loc)
No entity found met the criteria.
AutoTypeKeyword getKeyword() const
SourceLocation getEndLoc() const
Expr * getArrayRangeStart(const Designator &D) const
SourceLocation getRAngleLoc() const
The name is a dependent name, so the results will differ from one instantiation to the next...
An expression trait intrinsic.
SourceLocation getBeginLoc() const LLVM_READONLY
EnumDecl * getDecl() const
const ObjCMethodDecl * getMethodDecl() const
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.
static TagTypeKind getTagTypeKindForKeyword(ElaboratedTypeKeyword Keyword)
Converts an elaborated type keyword into a TagTypeKind.
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
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.
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.
TagTypeKind
The kind of a tag type.
NullStmt - This is the null statement ";": C99 6.8.3p3.
bool isMutable() const
Determine whether the lambda is mutable, meaning that any captures values can be modified.
OpenMPScheduleClauseModifier
OpenMP modifiers for 'schedule' clause.
bool isTypeOperand() const
static ParmVarDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, QualType T, TypeSourceInfo *TInfo, StorageClass S, Expr *DefArg)
bool isNull() const
Determine whether this template name is NULL.
Dataflow Directional Tag Classes.
SourceLocation getColonLoc() const
Get colon location.
This represents 'device' clause in the '#pragma omp ...' directive.
NestedNameSpecifier * getNestedNameSpecifier() const
Retrieve the nested-name-specifier to which this instance refers.
bool containsUnexpandedParameterPack() const
Whether this template argument contains an unexpanded parameter pack.
bool isValid() const
Return true if this is a valid SourceLocation object.
DeducedType * getContainedDeducedType() const
Get the DeducedType whose type will be deduced for a variable with an initializer of this type...
int ArgumentPackSubstitutionIndex
The current index into pack expansion arguments that will be used for substitution of parameter packs...
const TemplateArgumentLoc * getTemplateArgs() const
Retrieve the template arguments provided as part of this template-id.
Stmt * getReturnStmtOnAllocFailure() const
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
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.
The template argument is a pack expansion of a template name that was provided for a template templat...
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 constant boolean condition from 'if constexpr'.
A runtime availability query.
TemplateArgumentLocContainerIterator(ArgLocContainer &Container, unsigned Index)
bool hasLocalQualifiers() const
Determine whether this particular QualType instance has any qualifiers, without looking through any t...
A C++ reinterpret_cast expression (C++ [expr.reinterpret.cast]).
This represents '#pragma omp simd' directive.
TypeSourceInfo * getTypeSourceInfo() const
Stmt * getHandler() const
SourceLocation getRAngleLoc() const
Represents a 'co_yield' expression.
DeclarationName getMember() const
Retrieve the name of the member that this expression refers to.
SourceLocation getLBraceLoc() const
The name of a declaration.
StmtClass getStmtClass() const
Represents the declaration of an Objective-C type parameter.
VectorKind getVectorKind() const
SourceRange getIntroducerRange() const
Retrieve the source range covering the lambda introducer, which contains the explicit capture list su...
bool isCXXClassMember() const
Determine whether this declaration is a C++ class member.
Expr * getOperand() const
Retrieve the operand of the 'co_return' statement.
Represents a C++11 pack expansion that produces a sequence of expressions.
bool isListInitialization() const
Whether this constructor call was written as list-initialization.
This represents 'unified_shared_memory' clause in the '#pragma omp requires' directive.
This represents clause 'linear' in the '#pragma omp ...' directives.
const Expr * getSynchExpr() const
Stmt * getInitSuspendStmt() const
A pointer to member type per C++ 8.3.3 - Pointers to members.
bool 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
const DeclarationNameInfo & getMemberNameInfo() const
Retrieve the full name info for the member that this expression refers to.
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspnd...
TemplateArgumentLoc value_type
TemplateParameterList * getTemplateParameterList() const
If this is a generic lambda expression, retrieve the template parameter list associated with it...
This represents '#pragma omp atomic' directive.
SourceLocation getBeginLoc() const
Returns the starting location of the clause.
A type that was preceded by the 'template' keyword, stored as a Type*.
pack_iterator pack_begin() const
Iterator referencing the first argument of a template argument pack.
const TemplateTypeParmType * getReplacedParameter() const
Gets the template parameter that was substituted for.
bool isNull() const
Determine whether this template argument has no value.
SourceLocation getLParenLoc() const
Returns the location of '('.
SourceLocation getLParenLoc() const
ExprResult SemaConvertVectorExpr(Expr *E, TypeSourceInfo *TInfo, SourceLocation BuiltinLoc, SourceLocation RParenLoc)
SemaConvertVectorExpr - Handle __builtin_convertvector.
bool isImplicitMapType() const LLVM_READONLY
Is this an implicit map type? We have to capture 'IsMapTypeImplicit' from the parser for more informa...
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
Expr * getArrayRangeEnd(const Designator &D) const
TemplateNameKindForDiagnostics getTemplateNameKindForDiagnostics(TemplateName Name)
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.
Name lookup found a single declaration that met the criteria.
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
An implicit indirection through a C++ base class, when the field found is in a base class...
const llvm::APInt & getSize() const
void setTemplateNameLoc(SourceLocation Loc)
Represents a call to a CUDA kernel function.
bool isFunctionType() const
SourceLocation getRParenLoc() const
Represents a 'co_await' expression.
SourceLocation getLParenLoc() const
Returns the location of '('.
std::iterator_traits< InputIterator >::difference_type difference_type
TypeSourceInfo * getTypeSourceInfo() const
SourceLocation getColonLoc() const
Gets location of ':' symbol in clause.
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.
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
The template argument is a type.
ExceptionSpecificationType
The various types of exception specifications that exist in C++11.
Wraps an ObjCPointerType with source location information.
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
The template argument is actually a parameter pack.
llvm::DenseMap< VarDecl *, unsigned > CaptureMap
CaptureMap - A map of captured variables to (index+1) into Captures.
bool isArrow() const
Determine whether this member expression used the '->' operator; otherwise, it used the '...
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
const DeclarationNameInfo & getNameInfo() const
Gets the name info for specified reduction identifier.
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
llvm::iterator_range< decls_iterator > decls() const
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
SourceLocation getAsmLoc() const
GotoStmt - This represents a direct goto.
A use of a default initializer in a constructor or in aggregate initialization.
VectorType::VectorKind getVectorKind() const
TypeLoc getTypeLoc() const
Return the TypeLoc wrapper for the type source info.
bool isListInitialization() const
Determine whether this expression models list-initialization.
Expr * getSrcExpr() const
getSrcExpr - Return the Expr to be converted.
SourceLocation getLAngleLoc() const
Retrieve the location of the left angle bracket starting the explicit template argument list followin...
TypedefNameDecl * getDecl() const
X
Add a minimal nested name specifier fixit hint to allow lookup of a tag name from an outer enclosing ...
SourceLocation getLAngleLoc() const
void * getOpaqueData() const
Retrieve the opaque pointer that refers to source-location data.
SourceLocation getTypeArgsLAngleLoc() const
pack_iterator pack_end() const
Iterator referencing one past the last argument of a template argument pack.
Expr * NoexceptExpr
Noexcept expression, if this is a computed noexcept specification.
void AddDesignator(Designator D)
AddDesignator - Add a designator to the end of this list.
SourceLocation getLParenLoc() const
Returns the location of '('.
An integral condition for a 'switch' statement.
CapturedDecl * getCapturedDecl()
Retrieve the outlined function declaration.
ArgKind getKind() const
Return the kind of stored template argument.
An attributed type is a type to which a type attribute has been applied.
pointer(TemplateArgumentLoc Arg)
void setKWLoc(SourceLocation Loc)
TemplateDecl * getCXXDeductionGuideTemplate() const
If this name is the name of a C++ deduction guide, return the template associated with that name...
Call-style initialization (C++98)
const DeclarationNameInfo & getNameInfo() const
Gets the name info for specified reduction identifier.
Represents a type parameter type in Objective C.
void Extend(ASTContext &Context, SourceLocation TemplateKWLoc, TypeLoc TL, SourceLocation ColonColonLoc)
Extend the current nested-name-specifier by another nested-name-specifier component of the form 'type...
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.
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.
The template argument is a template name that was provided for a template template parameter...
Stmt * getFallthroughHandler() const
SourceLocation getColonLoc() const
Represents a C array with an unspecified size.
ChooseExpr - GNU builtin-in function __builtin_choose_expr.
Expr * getFilterExpr() const
SourceLocation getAttrLoc() const
BinaryConditionalOperator - The GNU extension to the conditional operator which allows the middle ope...
CXXCatchStmt - This represents a C++ catch block.
Represents an explicit C++ type conversion that uses "functional" notation (C++ [expr.type.conv]).
SourceLocation getRParenLoc() const
OpenMPScheduleClauseKind getScheduleKind() const
Get kind of the clause.
bool isPackExpansion() const
Determines whether this dictionary element is a pack expansion.
OpenMPMapClauseKind
OpenMP mapping kind for 'map' clause.
Qualifiers getQualifiers() const
Retrieve the set of qualifiers applied to this type.
Expr * getOperand() const
ObjCIvarDecl - Represents an ObjC instance variable.
void setParam(unsigned i, ParmVarDecl *VD)
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.
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.
static CXXDefaultArgExpr * Create(const ASTContext &C, SourceLocation Loc, ParmVarDecl *Param, DeclContext *UsedContext)
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.
static Qualifiers fromCVRMask(unsigned CVR)
This represents 'dist_schedule' clause in the '#pragma omp ...' directive.
SourceRange getAttrOperandParensRange() const
The location of the parentheses around the operand, if there is an operand.
bool blockMissingReturnType() const
capture_iterator capture_begin() const
Retrieve an iterator pointing to the first lambda capture.
Stmt * getBody() const
Retrieve the body of the coroutine as written.
unsigned getNumTypeArgs() const
Abstract class common to all of the C++ "named"/"keyword" casts.
unsigned getNumElements() const
SourceLocation getRAngleLoc() const
Retrieve the location of the right angle bracket ending the explicit template argument list following...
This represents '#pragma omp sections' directive.
Designation - Represent a full designation, which is a sequence of designators.
Expr * getHint() const
Returns number of threads.
static OpaquePtr make(QualType P)
NestedNameSpecifierLoc getQualifierLoc() const
Gets the nested name specifier.
ObjCBoolLiteralExpr - Objective-C Boolean Literal.
bool isObjectReceiver() const
The top declaration context.
unsigned getNumComponents() const
This represents '#pragma omp target data' directive.
const ParmVarDecl * getParam() const
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
QualType getAsType() const
Retrieve the type for a type template argument.
A reference to a declared variable, function, enum, etc.
Represents an extended address space qualifier where the input address space value is dependent...
Represents a type template specialization; the template must be a class template, a type alias templa...
ArrayRef< ParmVarDecl * > parameters() const
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.
QualType getAutoType(QualType DeducedType, AutoTypeKeyword Keyword, bool IsDependent, bool IsPack=false) const
C++11 deduced auto type.
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
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.
static Designator getArray(Expr *Index, SourceLocation LBracketLoc)
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
static Designator getArrayRange(Expr *Start, Expr *End, SourceLocation LBracketLoc, SourceLocation EllipsisLoc)
attr::Kind getKind() const
The receiver is a superclass.
SourceLocation getLParenLoc() const
Returns the location of '('.
NamedDecl * getRepresentativeDecl() const
Fetches a representative decl. Useful for lazy diagnostics.
SourceLocation getGenericLoc() const
void getSelectorLocs(SmallVectorImpl< SourceLocation > &SelLocs) const
The global specifier '::'. There is no stored value.
TemplateName getAsTemplateOrTemplatePattern() const
Retrieve the template argument as a template name; if the argument is a pack expansion, return the pattern as a template name.
void pushFullCopy(TypeLoc L)
Pushes a copy of the given TypeLoc onto this builder.
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.
BinaryOperatorKind getOperator() const
SourceLocation ColonLoc
Location of ':'.
SourceLocation getRParenLoc() const
Return the location of the right parentheses.
SourceLocation getInnerLocStart() const
Return start of source range ignoring outer template declarations.
NamedDecl * getPack() const
Retrieve the parameter pack.
Wrapper for source info for block pointers.
Represents Objective-C's @autoreleasepool Statement.
llvm::Optional< NullabilityKind > getImmediateNullability() const
SourceLocation getKeywordLoc() const
Represents the canonical version of C arrays with a specified constant size.
CompoundStmt * getTryBlock() const
ExceptionSpecInfo ExceptionSpec
QualType getBaseType() const
TemplateArgumentLocContainerIterator()
InitListExpr * getSyntacticForm() const
Expr * getBaseExpr() const
The symbol does not exist.
Represents an implicitly-generated value initialization of an object of a given type.
CompoundStmt * getBlock() const
SourceLocation getReturnLoc() const
Stmt * getFinalSuspendStmt() const
void setElaboratedKeywordLoc(SourceLocation Loc)
CapturedRegionKind getCapturedRegionKind() const
Retrieve the captured region kind.
This represents '#pragma omp target parallel for' directive.
Attr - This represents one attribute.
SourceLocation getLocation() const
This represents clause 'use_device_ptr' in the '#pragma omp ...' directives.
SourceLocation getTypeArgsRAngleLoc() const
QualType getPointeeType() const
QualType getType() const
Return the type wrapped by this type source info.
TypeTrait getTrait() const
Determine which type trait this expression uses.
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
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.
This represents '#pragma omp taskloop' directive.