14 #ifndef LLVM_CLANG_LIB_SEMA_TREETRANSFORM_H 15 #define LLVM_CLANG_LIB_SEMA_TREETRANSFORM_H 37 #include "llvm/ADT/ArrayRef.h" 38 #include "llvm/Support/ErrorHandling.h" 95 template<
typename Derived>
100 class ForgetPartiallySubstitutedPackRAII {
105 ForgetPartiallySubstitutedPackRAII(Derived &Self) : Self(Self) {
106 Old = Self.ForgetPartiallySubstitutedPack();
109 ~ForgetPartiallySubstitutedPackRAII() {
110 Self.RememberPartiallySubstitutedPack(Old);
127 Derived &
getDerived() {
return static_cast<Derived&
>(*this); }
131 return static_cast<const Derived&
>(*this);
184 OldLocation = Self.
getDerived().getBaseLocation();
185 OldEntity = Self.
getDerived().getBaseEntity();
192 Self.
getDerived().setBase(OldLocation, OldEntity);
258 bool &RetainExpansion,
260 ShouldExpand =
false;
351 const Attr *TransformAttr(
const Attr *S);
360 #define PRAGMA_SPELLING_ATTR(X) \ 361 const X##Attr *Transform##X##Attr(const X##Attr *R) { return R; } 362 #include "clang/Basic/AttrList.inc" 381 ExprResult TransformInitializer(Expr *Init,
bool NotCopyInit);
406 bool TransformExprs(Expr *
const *Inputs,
unsigned NumInputs,
bool IsCall,
407 SmallVectorImpl<Expr *> &Outputs,
408 bool *ArgChanged =
nullptr);
417 llvm::DenseMap<Decl *, Decl *>::iterator Known
418 = TransformedLocalDecls.find(D);
419 if (Known != TransformedLocalDecls.end())
420 return Known->second;
448 TransformedLocalDecls[Old] = New;
456 return getDerived().TransformDecl(Loc, D);
469 return cast_or_null<NamedDecl>(getDerived().TransformDecl(Loc, D));
473 bool TransformOverloadExprDecls(
OverloadExpr *Old,
bool RequiresADL,
485 NamedDecl *FirstQualifierInScope =
nullptr);
520 NamedDecl *FirstQualifierInScope =
nullptr,
521 bool AllowInjectedClassName =
false);
533 bool Uneval =
false);
556 bool Uneval =
false) {
557 return TransformTemplateArguments(Inputs, Inputs + NumInputs, Outputs,
575 template<
typename InputIterator>
576 bool TransformTemplateArguments(InputIterator
First,
579 bool Uneval =
false);
588 getDerived().getBaseLocation());
591 #define ABSTRACT_TYPELOC(CLASS, PARENT) 592 #define TYPELOC(CLASS, PARENT) \ 593 QualType Transform##CLASS##Type(TypeLocBuilder &TLB, CLASS##TypeLoc T); 594 #include "clang/AST/TypeLocNodes.def" 596 template<
typename Fn>
597 QualType TransformFunctionProtoType(TypeLocBuilder &TLB,
598 FunctionProtoTypeLoc TL,
599 CXXRecordDecl *ThisContext,
600 Qualifiers ThisTypeQuals,
601 Fn TransformExceptionSpec);
603 bool TransformExceptionSpec(SourceLocation Loc,
604 FunctionProtoType::ExceptionSpecInfo &ESI,
605 SmallVectorImpl<QualType> &Exceptions,
608 StmtResult TransformSEHHandler(Stmt *Handler);
611 TransformTemplateSpecializationType(TypeLocBuilder &TLB,
612 TemplateSpecializationTypeLoc TL,
613 TemplateName Template);
616 TransformDependentTemplateSpecializationType(TypeLocBuilder &TLB,
617 DependentTemplateSpecializationTypeLoc TL,
618 TemplateName Template,
621 QualType TransformDependentTemplateSpecializationType(
622 TypeLocBuilder &TLB, DependentTemplateSpecializationTypeLoc TL,
623 NestedNameSpecifierLoc QualifierLoc);
632 bool TransformFunctionTypeParams(
633 SourceLocation Loc, ArrayRef<ParmVarDecl *> Params,
634 const QualType *ParamTypes,
635 const FunctionProtoType::ExtParameterInfo *ParamInfos,
636 SmallVectorImpl<QualType> &PTypes, SmallVectorImpl<ParmVarDecl *> *PVars,
637 Sema::ExtParameterInfoBuilder &PInfos);
644 ParmVarDecl *TransformFunctionTypeParam(ParmVarDecl *OldParm,
646 Optional<unsigned> NumExpansions,
647 bool ExpectParameterPack);
649 QualType TransformReferenceType(TypeLocBuilder &TLB, ReferenceTypeLoc TL);
651 StmtResult TransformCompoundStmt(CompoundStmt *S,
bool IsStmtExpr);
652 ExprResult TransformCXXNamedCastExpr(CXXNamedCastExpr *E);
662 bool IsAddressOfOperand,
665 ExprResult TransformParenDependentScopeDeclRefExpr(
673 #define STMT(Node, Parent) \ 674 LLVM_ATTRIBUTE_NOINLINE \ 675 StmtResult Transform##Node(Node *S); 676 #define EXPR(Node, Parent) \ 677 LLVM_ATTRIBUTE_NOINLINE \ 678 ExprResult Transform##Node(Node *E); 679 #define ABSTRACT_STMT(Stmt) 680 #include "clang/AST/StmtNodes.inc" 682 #define OPENMP_CLAUSE(Name, Class) \ 683 LLVM_ATTRIBUTE_NOINLINE \ 684 OMPClause *Transform ## Class(Class *S); 685 #include "clang/Basic/OpenMPKinds.def" 693 QualType RebuildQualifiedType(QualType T, QualifiedTypeLoc TL);
699 QualType RebuildPointerType(QualType PointeeType, SourceLocation Sigil);
705 QualType RebuildBlockPointerType(QualType PointeeType, SourceLocation Sigil);
715 QualType RebuildReferenceType(QualType ReferentType,
717 SourceLocation Sigil);
724 QualType RebuildMemberPointerType(QualType PointeeType, QualType ClassType,
725 SourceLocation Sigil);
727 QualType RebuildObjCTypeParamType(
const ObjCTypeParamDecl *Decl,
728 SourceLocation ProtocolLAngleLoc,
729 ArrayRef<ObjCProtocolDecl *> Protocols,
730 ArrayRef<SourceLocation> ProtocolLocs,
731 SourceLocation ProtocolRAngleLoc);
737 QualType RebuildObjCObjectType(QualType BaseType,
739 SourceLocation TypeArgsLAngleLoc,
740 ArrayRef<TypeSourceInfo *> TypeArgs,
741 SourceLocation TypeArgsRAngleLoc,
742 SourceLocation ProtocolLAngleLoc,
743 ArrayRef<ObjCProtocolDecl *> Protocols,
744 ArrayRef<SourceLocation> ProtocolLocs,
745 SourceLocation ProtocolRAngleLoc);
751 QualType RebuildObjCObjectPointerType(QualType PointeeType,
752 SourceLocation Star);
761 QualType RebuildArrayType(QualType ElementType,
763 const llvm::APInt *Size,
765 unsigned IndexTypeQuals,
766 SourceRange BracketsRange);
773 QualType RebuildConstantArrayType(QualType ElementType,
775 const llvm::APInt &Size,
776 unsigned IndexTypeQuals,
777 SourceRange BracketsRange);
784 QualType RebuildIncompleteArrayType(QualType ElementType,
786 unsigned IndexTypeQuals,
787 SourceRange BracketsRange);
794 QualType RebuildVariableArrayType(QualType ElementType,
797 unsigned IndexTypeQuals,
798 SourceRange BracketsRange);
805 QualType RebuildDependentSizedArrayType(QualType ElementType,
808 unsigned IndexTypeQuals,
809 SourceRange BracketsRange);
816 QualType RebuildVectorType(QualType ElementType,
unsigned NumElements,
824 QualType RebuildDependentVectorType(QualType ElementType, Expr *SizeExpr,
825 SourceLocation AttributeLoc,
833 QualType RebuildExtVectorType(QualType ElementType,
unsigned NumElements,
834 SourceLocation AttributeLoc);
841 QualType RebuildDependentSizedExtVectorType(QualType ElementType,
843 SourceLocation AttributeLoc);
853 QualType RebuildDependentAddressSpaceType(QualType PointeeType,
855 SourceLocation AttributeLoc);
861 QualType RebuildFunctionProtoType(QualType T,
862 MutableArrayRef<QualType> ParamTypes,
863 const FunctionProtoType::ExtProtoInfo &EPI);
866 QualType RebuildFunctionNoProtoType(QualType ResultType);
870 QualType RebuildUnresolvedUsingType(SourceLocation NameLoc, Decl *D);
925 Template, Deduced,
false);
971 bool AllowInjectedClassName) {
975 SS.
Adopt(QualifierLoc);
976 TemplateName InstName = getDerived().RebuildTemplateName(
977 SS, TemplateKWLoc, *Name, NameLoc,
QualType(),
nullptr,
978 AllowInjectedClassName);
993 getDerived().RebuildTemplateSpecializationType(InstName, NameLoc, Args);
1014 bool DeducedTSTContext) {
1016 SS.
Adopt(QualifierLoc);
1031 if (!DeducedTSTContext) {
1032 if (
auto *Deduced = dyn_cast_or_null<DeducedTemplateSpecializationType>(
1034 SemaRef.
Diag(IdLoc, diag::err_dependent_deduced_tst)
1036 Deduced->getTemplateName())
1038 if (
auto *TD = Deduced->getTemplateName().getAsTemplateDecl())
1039 SemaRef.
Diag(TD->getLocation(), diag::note_template_decl_here);
1072 llvm_unreachable(
"Tag lookup cannot find non-tags");
1090 SemaRef.
Diag(IdLoc, diag::err_tag_reference_non_tag) << SomeDecl
1096 SemaRef.
Diag(IdLoc, diag::err_not_tag_in_scope)
1105 SemaRef.
Diag(KeywordLoc, diag::err_use_with_wrong_tag) <<
Id;
1125 return getSema().CheckPackExpansion(Pattern, PatternRange, EllipsisLoc,
1161 bool AllowInjectedClassName);
1174 bool AllowInjectedClassName);
1185 return getSema().Context.getSubstTemplateTemplateParmPack(Param, ArgPack);
1196 return getSema().ActOnCompoundStmt(LBraceLoc, RBraceLoc, Statements,
1209 return getSema().ActOnCaseStmt(CaseLoc, LHS, EllipsisLoc, RHS,
1218 getSema().ActOnCaseStmtBody(S, Body);
1229 return getSema().ActOnDefaultStmt(DefaultLoc, ColonLoc, SubStmt,
1259 return getSema().ActOnIfStmt(IfLoc, IsConstexpr, Init, Cond, Then,
1269 return getSema().ActOnStartOfSwitchStmt(SwitchLoc, Init, Cond);
1278 return getSema().ActOnFinishSwitchStmt(SwitchLoc, Switch, Body);
1287 return getSema().ActOnWhileStmt(WhileLoc, Cond, Body);
1297 return getSema().ActOnDoStmt(DoLoc, Body, WhileLoc, LParenLoc,
1309 return getSema().ActOnForStmt(ForLoc, LParenLoc, Init, Cond,
1310 Inc, RParenLoc, Body);
1319 return getSema().ActOnGotoStmt(GotoLoc, LabelLoc, Label);
1329 return getSema().ActOnIndirectGotoStmt(GotoLoc, StarLoc, Target);
1337 return getSema().BuildReturnStmt(ReturnLoc, Result);
1347 return getSema().ActOnDeclStmt(DG, StartLoc, EndLoc);
1355 bool IsVolatile,
unsigned NumOutputs,
1360 return getSema().ActOnGCCAsmStmt(AsmLoc, IsSimple, IsVolatile, NumOutputs,
1361 NumInputs, Names, Constraints, Exprs,
1362 AsmString, Clobbers, RParenLoc);
1371 StringRef AsmString,
1372 unsigned NumOutputs,
unsigned NumInputs,
1377 return getSema().ActOnMSAsmStmt(AsmLoc, LBraceLoc, AsmToks, AsmString,
1378 NumOutputs, NumInputs,
1379 Constraints, Clobbers, Exprs, EndLoc);
1388 return getSema().BuildCoreturnStmt(CoreturnLoc, Result, IsImplicit);
1397 return getSema().BuildResolvedCoawaitExpr(CoawaitLoc, Result, IsImplicit);
1407 return getSema().BuildUnresolvedCoawaitExpr(CoawaitLoc, Result, Lookup);
1415 return getSema().BuildCoyieldExpr(CoyieldLoc, Result);
1419 return getSema().BuildCoroutineBodyStmt(Args);
1430 return getSema().ActOnObjCAtTryStmt(AtLoc, TryBody, CatchStmts,
1440 return getSema().BuildObjCExceptionDecl(TInfo, T,
1454 return getSema().ActOnObjCAtCatchStmt(AtLoc, RParenLoc,
1464 return getSema().ActOnObjCAtFinallyStmt(AtLoc, Body);
1473 return getSema().BuildObjCAtThrowStmt(AtLoc, Operand);
1486 return getSema().ActOnOpenMPExecutableDirective(
1487 Kind, DirName, CancelRegion, Clauses, AStmt, StartLoc, EndLoc);
1500 return getSema().ActOnOpenMPIfClause(NameModifier, Condition, StartLoc,
1501 LParenLoc, NameModifierLoc, ColonLoc,
1512 return getSema().ActOnOpenMPFinalClause(Condition, StartLoc, LParenLoc,
1524 return getSema().ActOnOpenMPNumThreadsClause(NumThreads, StartLoc,
1535 return getSema().ActOnOpenMPSafelenClause(Len, StartLoc, LParenLoc, EndLoc);
1545 return getSema().ActOnOpenMPSimdlenClause(Len, StartLoc, LParenLoc, EndLoc);
1555 return getSema().ActOnOpenMPCollapseClause(Num, StartLoc, LParenLoc,
1568 return getSema().ActOnOpenMPDefaultClause(Kind, KindKwLoc,
1569 StartLoc, LParenLoc, EndLoc);
1581 return getSema().ActOnOpenMPProcBindClause(Kind, KindKwLoc,
1582 StartLoc, LParenLoc, EndLoc);
1594 return getSema().ActOnOpenMPScheduleClause(
1595 M1, M2, Kind, ChunkSize, StartLoc, LParenLoc, M1Loc, M2Loc, KindLoc,
1606 return getSema().ActOnOpenMPOrderedClause(StartLoc, EndLoc, LParenLoc, Num);
1617 return getSema().ActOnOpenMPPrivateClause(VarList, StartLoc, LParenLoc,
1629 return getSema().ActOnOpenMPFirstprivateClause(VarList, StartLoc, LParenLoc,
1641 return getSema().ActOnOpenMPLastprivateClause(VarList, StartLoc, LParenLoc,
1653 return getSema().ActOnOpenMPSharedClause(VarList, StartLoc, LParenLoc,
1669 return getSema().ActOnOpenMPReductionClause(
1670 VarList, StartLoc, LParenLoc, ColonLoc, EndLoc, ReductionIdScopeSpec,
1671 ReductionId, UnresolvedReductions);
1684 return getSema().ActOnOpenMPTaskReductionClause(
1685 VarList, StartLoc, LParenLoc, ColonLoc, EndLoc, ReductionIdScopeSpec,
1686 ReductionId, UnresolvedReductions);
1700 return getSema().ActOnOpenMPInReductionClause(
1701 VarList, StartLoc, LParenLoc, ColonLoc, EndLoc, ReductionIdScopeSpec,
1702 ReductionId, UnresolvedReductions);
1716 return getSema().ActOnOpenMPLinearClause(VarList, Step, StartLoc, LParenLoc,
1717 Modifier, ModifierLoc, ColonLoc,
1730 return getSema().ActOnOpenMPAlignedClause(VarList, Alignment, StartLoc,
1731 LParenLoc, ColonLoc, EndLoc);
1742 return getSema().ActOnOpenMPCopyinClause(VarList, StartLoc, LParenLoc,
1754 return getSema().ActOnOpenMPCopyprivateClause(VarList, StartLoc, LParenLoc,
1766 return getSema().ActOnOpenMPFlushClause(VarList, StartLoc, LParenLoc,
1779 return getSema().ActOnOpenMPDependClause(DepKind, DepLoc, ColonLoc, VarList,
1780 StartLoc, LParenLoc, EndLoc);
1790 return getSema().ActOnOpenMPDeviceClause(Device, StartLoc, LParenLoc,
1805 return getSema().ActOnOpenMPMapClause(MapTypeModifiers, MapTypeModifiersLoc,
1806 MapType, IsMapTypeImplicit, MapLoc,
1807 ColonLoc, VarList, StartLoc,
1818 return getSema().ActOnOpenMPNumTeamsClause(NumTeams, StartLoc, LParenLoc,
1830 return getSema().ActOnOpenMPThreadLimitClause(ThreadLimit, StartLoc,
1841 return getSema().ActOnOpenMPPriorityClause(Priority, StartLoc, LParenLoc,
1852 return getSema().ActOnOpenMPGrainsizeClause(Grainsize, StartLoc, LParenLoc,
1863 return getSema().ActOnOpenMPNumTasksClause(NumTasks, StartLoc, LParenLoc,
1874 return getSema().ActOnOpenMPHintClause(Hint, StartLoc, LParenLoc, EndLoc);
1886 return getSema().ActOnOpenMPDistScheduleClause(
1887 Kind, ChunkSize, StartLoc, LParenLoc, KindLoc, CommaLoc, EndLoc);
1898 return getSema().ActOnOpenMPToClause(VarList, StartLoc, LParenLoc, EndLoc);
1909 return getSema().ActOnOpenMPFromClause(VarList, StartLoc, LParenLoc,
1921 return getSema().ActOnOpenMPUseDevicePtrClause(VarList, StartLoc, LParenLoc,
1933 return getSema().ActOnOpenMPIsDevicePtrClause(VarList, StartLoc, LParenLoc,
1943 return getSema().ActOnObjCAtSynchronizedOperand(atLoc,
object);
1952 return getSema().ActOnObjCAtSynchronizedStmt(AtLoc, Object, Body);
1961 return getSema().ActOnObjCAutoreleasePoolStmt(AtLoc, Body);
1973 StmtResult ForEachStmt = getSema().ActOnObjCForCollectionStmt(ForLoc,
1980 return getSema().FinishObjCForCollectionStmt(ForEachStmt.
get(), Body);
1992 VarDecl *Var = getSema().BuildExceptionDeclaration(
nullptr, Declarator,
1993 StartLoc, IdLoc, Id);
1995 getSema().CurContext->addDecl(Var);
2006 return Owned(
new (getSema().Context)
CXXCatchStmt(CatchLoc, ExceptionDecl,
2016 return getSema().ActOnCXXTryBlock(TryLoc, TryBlock, Handlers);
2031 if (
DeclStmt *RangeStmt = dyn_cast<DeclStmt>(Range)) {
2032 if (RangeStmt->isSingleDecl()) {
2033 if (
VarDecl *RangeVar = dyn_cast<VarDecl>(RangeStmt->getSingleDecl())) {
2034 if (RangeVar->isInvalidDecl())
2037 Expr *RangeExpr = RangeVar->getInit();
2044 diag::err_objc_for_range_init_stmt)
2047 return getSema().ActOnObjCForCollectionStmt(ForLoc, LoopVar,
2048 RangeExpr, RParenLoc);
2054 return getSema().BuildCXXForRangeStmt(ForLoc, CoawaitLoc, Init, ColonLoc,
2055 Range, Begin, End, Cond, Inc, LoopVar,
2068 return getSema().BuildMSDependentExistsStmt(KeywordLoc, IsIfExists,
2069 QualifierLoc, NameInfo, Nested);
2077 return getSema().FinishCXXForRangeStmt(ForRange, Body);
2082 return getSema().ActOnSEHTryBlock(IsCXXTry, TryLoc, TryBlock, Handler);
2087 return getSema().ActOnSEHExceptBlock(Loc, FilterExpr, Block);
2100 return getSema().BuildPredefinedExpr(Loc, IK);
2110 return getSema().BuildDeclarationNameExpr(SS, R, RequiresADL);
2123 SS.
Adopt(QualifierLoc);
2127 return getSema().BuildDeclarationNameExpr(SS, NameInfo, VD);
2136 return getSema().ActOnParenExpr(LParen, RParen, SubExpr);
2159 return getSema().BuildUnaryOp(
nullptr, OpLoc, Opc, SubExpr);
2170 return getSema().BuildBuiltinOffsetOf(OperatorLoc, Type, Components,
2183 return getSema().CreateUnaryExprOrTypeTraitExpr(TInfo, OpLoc, ExprKind, R);
2195 = getSema().CreateUnaryExprOrTypeTraitExpr(SubExpr, OpLoc, ExprKind);
2210 return getSema().ActOnArraySubscriptExpr(
nullptr, LHS,
2223 return getSema().ActOnOMPArraySectionExpr(Base, LBracketLoc, LowerBound,
2224 ColonLoc, Length, RBracketLoc);
2234 Expr *ExecConfig =
nullptr) {
2235 return getSema().ActOnCallExpr(
nullptr, Callee, LParenLoc,
2236 Args, RParenLoc, ExecConfig);
2259 "unnamed member not of record type?");
2262 getSema().PerformObjectMemberConversion(BaseResult.get(),
2265 if (BaseResult.isInvalid())
2267 Base = BaseResult.get();
2270 return getSema().BuildFieldReferenceExpr(
2271 Base, isArrow, OpLoc, EmptySS, cast<FieldDecl>(Member),
2276 SS.
Adopt(QualifierLoc);
2278 Base = BaseResult.
get();
2290 return getSema().BuildMemberReferenceExpr(Base, BaseType, OpLoc, isArrow,
2292 FirstQualifierInScope,
2293 R, ExplicitTemplateArgs,
2304 return getSema().BuildBinOp(
nullptr, OpLoc, Opc, LHS, RHS);
2316 return getSema().ActOnConditionalOp(QuestionLoc, ColonLoc, Cond,
2328 return getSema().BuildCStyleCastExpr(LParenLoc, TInfo, RParenLoc,
2340 return getSema().BuildCompoundLiteralExpr(LParenLoc, TInfo, RParenLoc,
2355 return getSema().BuildMemberReferenceExpr(Base, Base->
getType(),
2408 return getSema().BuildVAArgExpr(BuiltinLoc,
2420 return getSema().ActOnParenListExpr(LParenLoc, RParenLoc, SubExprs);
2430 return getSema().ActOnAddrLabel(AmpAmpLoc, LabelLoc, Label);
2440 return getSema().ActOnStmtExpr(LParenLoc, SubStmt, RParenLoc);
2462 Expr *ControllingExpr,
2465 return getSema().CreateGenericSelectionExpr(KeyLoc, DefaultLoc, RParenLoc,
2466 ControllingExpr, Types, Exprs);
2498 case Stmt::CXXStaticCastExprClass:
2499 return getDerived().RebuildCXXStaticCastExpr(OpLoc, LAngleLoc, TInfo,
2500 RAngleLoc, LParenLoc,
2501 SubExpr, RParenLoc);
2503 case Stmt::CXXDynamicCastExprClass:
2504 return getDerived().RebuildCXXDynamicCastExpr(OpLoc, LAngleLoc, TInfo,
2505 RAngleLoc, LParenLoc,
2506 SubExpr, RParenLoc);
2508 case Stmt::CXXReinterpretCastExprClass:
2509 return getDerived().RebuildCXXReinterpretCastExpr(OpLoc, LAngleLoc, TInfo,
2510 RAngleLoc, LParenLoc,
2514 case Stmt::CXXConstCastExprClass:
2515 return getDerived().RebuildCXXConstCastExpr(OpLoc, LAngleLoc, TInfo,
2516 RAngleLoc, LParenLoc,
2517 SubExpr, RParenLoc);
2520 llvm_unreachable(
"Invalid C++ named cast");
2535 return getSema().BuildCXXNamedCast(OpLoc, tok::kw_static_cast,
2552 return getSema().BuildCXXNamedCast(OpLoc, tok::kw_dynamic_cast,
2569 return getSema().BuildCXXNamedCast(OpLoc, tok::kw_reinterpret_cast,
2586 return getSema().BuildCXXNamedCast(OpLoc, tok::kw_const_cast,
2600 bool ListInitialization) {
2601 return getSema().BuildCXXTypeConstructExpr(TInfo, LParenLoc,
2603 ListInitialization);
2614 return getSema().BuildCXXTypeId(TypeInfoType, TypeidLoc, Operand,
2627 return getSema().BuildCXXTypeId(TypeInfoType, TypeidLoc, Operand,
2639 return getSema().BuildCXXUuidof(TypeInfoType, TypeidLoc, Operand,
2651 return getSema().BuildCXXUuidof(TypeInfoType, TypeidLoc, Operand,
2663 getSema().CheckCXXThisCapture(ThisLoc);
2664 return new (getSema().Context)
CXXThisExpr(ThisLoc, ThisType, isImplicit);
2672 bool IsThrownVariableInScope) {
2673 return getSema().BuildCXXThrow(ThrowLoc, Sub, IsThrownVariableInScope);
2703 return getSema().BuildCXXTypeConstructExpr(
2704 TSInfo, LParenLoc, None, RParenLoc,
false);
2721 Expr *Initializer) {
2722 return getSema().BuildCXXNew(StartLoc, UseGlobal,
2739 bool IsGlobalDelete,
2742 return getSema().ActOnCXXDelete(StartLoc, IsGlobalDelete, IsArrayForm,
2754 return getSema().BuildTypeTrait(Trait, StartLoc, Args, RParenLoc);
2766 return getSema().BuildArrayTypeTrait(Trait, StartLoc, TSInfo, DimExpr, RParenLoc);
2777 return getSema().BuildExpressionTrait(Trait, StartLoc, Queried, RParenLoc);
2790 bool IsAddressOfOperand,
2793 SS.
Adopt(QualifierLoc);
2795 if (TemplateArgs || TemplateKWLoc.
isValid())
2796 return getSema().BuildQualifiedTemplateIdExpr(SS, TemplateKWLoc, NameInfo,
2799 return getSema().BuildQualifiedDeclarationNameExpr(
2800 SS, NameInfo, IsAddressOfOperand,
nullptr, RecoveryTSI);
2812 return getSema().BuildTemplateIdExpr(SS, TemplateKWLoc, R, RequiresADL,
2825 bool HadMultipleCandidates,
2826 bool ListInitialization,
2827 bool StdInitListInitialization,
2828 bool RequiresZeroInit,
2832 if (getSema().CompleteConstructorCall(Constructor, Args, Loc,
2836 return getSema().BuildCXXConstructExpr(Loc, T, Constructor,
2839 HadMultipleCandidates,
2841 StdInitListInitialization,
2842 RequiresZeroInit, ConstructKind,
2850 bool ConstructsVBase,
2851 bool InheritedFromVBase) {
2853 Loc, T, Constructor, ConstructsVBase, InheritedFromVBase);
2864 bool ListInitialization) {
2865 return getSema().BuildCXXTypeConstructExpr(
2866 TSInfo, LParenOrBraceLoc, Args, RParenOrBraceLoc, ListInitialization);
2877 bool ListInitialization) {
2878 return getSema().BuildCXXTypeConstructExpr(TSInfo, LParenLoc, Args,
2879 RParenLoc, ListInitialization);
2896 SS.
Adopt(QualifierLoc);
2899 OperatorLoc, IsArrow,
2901 FirstQualifierInScope,
2903 TemplateArgs,
nullptr);
2919 SS.
Adopt(QualifierLoc);
2922 OperatorLoc, IsArrow,
2924 FirstQualifierInScope,
2925 R, TemplateArgs,
nullptr);
2944 RParenLoc, Length, PartialArgs);
2952 return getSema().BuildObjCBoxedExpr(SR, ValueExpr);
2960 Expr **Elements,
unsigned NumElements) {
2961 return getSema().BuildObjCArrayLiteral(Range,
2969 return getSema().BuildObjCSubscriptExpression(RB, Base, Key,
2970 getterMethod, setterMethod);
2979 return getSema().BuildObjCDictionaryLiteral(Range, Elements);
3003 Sel, Method, LBracLoc, SelectorLocs,
3018 Sel, Method, LBracLoc, SelectorLocs,
3034 Sel, Method, LBracLoc, SelectorLocs,
3039 Sel, Method, LBracLoc, SelectorLocs,
3051 bool IsArrow,
bool IsFreeIvar) {
3054 ExprResult Result = getSema().BuildMemberReferenceExpr(
3060 if (IsFreeIvar && Result.isUsable())
3061 cast<ObjCIvarRefExpr>(Result.get())->setIsFreeIvar(IsFreeIvar);
3074 return getSema().BuildMemberReferenceExpr(BaseArg, BaseArg->
getType(),
3097 PropertyLoc, Base));
3108 return getSema().BuildMemberReferenceExpr(BaseArg, BaseArg->
getType(),
3129 assert(!Lookup.
empty() &&
"No __builtin_shufflevector?");
3138 CK_BuiltinFnToFnPtr).
get();
3142 SemaRef.
Context, Callee, SubExprs, Builtin->getCallResultType(),
3154 BuiltinLoc, RParenLoc);
3169 EllipsisLoc, NumExpansions);
3190 llvm_unreachable(
"Pack expansion pattern has no parameter packs");
3212 return getSema().CheckPackExpansion(Pattern, EllipsisLoc, NumExpansions);
3223 return getSema().BuildCXXFoldExpr(LParenLoc, LHS, Operator, EllipsisLoc,
3233 return getSema().BuildEmptyCXXFoldExpr(EllipsisLoc, Operator);
3269 bool DeducibleTSTContext);
3272 template <
typename Derived>
3281 #define STMT(Node, Parent) \ 3282 case Stmt::Node##Class: return getDerived().Transform##Node(cast<Node>(S)); 3283 #define ABSTRACT_STMT(Node) 3284 #define EXPR(Node, Parent) 3285 #include "clang/AST/StmtNodes.inc" 3288 #define STMT(Node, Parent) 3289 #define ABSTRACT_STMT(Stmt) 3290 #define EXPR(Node, Parent) case Stmt::Node##Class: 3291 #include "clang/AST/StmtNodes.inc" 3293 ExprResult E = getDerived().TransformExpr(cast<Expr>(S));
3297 return getSema().ActOnExprStmt(E, DiscardedValue);
3304 template<
typename Derived>
3312 #define OPENMP_CLAUSE(Name, Class) \ 3313 case OMPC_ ## Name : \ 3314 return getDerived().Transform ## Class(cast<Class>(S)); 3315 #include "clang/Basic/OpenMPKinds.def" 3322 template<
typename Derived>
3329 #define STMT(Node, Parent) case Stmt::Node##Class: break; 3330 #define ABSTRACT_STMT(Stmt) 3331 #define EXPR(Node, Parent) \ 3332 case Stmt::Node##Class: return getDerived().Transform##Node(cast<Node>(E)); 3333 #include "clang/AST/StmtNodes.inc" 3339 template<
typename Derived>
3347 if (
auto *FE = dyn_cast<FullExpr>(Init))
3348 Init = FE->getSubExpr();
3350 if (
auto *AIL = dyn_cast<ArrayInitLoopExpr>(Init))
3351 Init = AIL->getCommonExpr();
3354 Init = MTE->GetTemporaryExpr();
3357 Init = Binder->getSubExpr();
3360 Init = ICE->getSubExprAsWritten();
3363 dyn_cast<CXXStdInitializerListExpr>(Init))
3364 return TransformInitializer(ILE->getSubExpr(), NotCopyInit);
3370 if (!NotCopyInit && !(Construct && Construct->isListInitialization()))
3371 return getDerived().TransformExpr(Init);
3376 return getDerived().RebuildParenListExpr(Parens.
getBegin(), None,
3381 if (isa<ImplicitValueInitExpr>(Init))
3387 if (!Construct || isa<CXXTemporaryObjectExpr>(Construct))
3388 return getDerived().TransformExpr(Init);
3392 if (Construct && Construct->isStdInitListInitialization())
3393 return TransformInitializer(Construct->getArg(0), NotCopyInit);
3398 Construct->isListInitialization());
3401 bool ArgChanged =
false;
3402 if (getDerived().TransformExprs(Construct->getArgs(), Construct->getNumArgs(),
3403 true, NewArgs, &ArgChanged))
3407 if (Construct->isListInitialization())
3408 return getDerived().RebuildInitList(Construct->getBeginLoc(), NewArgs,
3409 Construct->getEndLoc());
3412 SourceRange Parens = Construct->getParenOrBraceRange();
3416 assert(NewArgs.empty() &&
3417 "no parens or braces but have direct init with arguments?");
3420 return getDerived().RebuildParenListExpr(Parens.
getBegin(), NewArgs,
3424 template<
typename Derived>
3430 for (
unsigned I = 0; I != NumInputs; ++I) {
3432 if (IsCall && getDerived().DropCallArgument(Inputs[I])) {
3440 Expr *Pattern = Expansion->getPattern();
3443 getSema().collectUnexpandedParameterPacks(Pattern, Unexpanded);
3444 assert(!Unexpanded.empty() &&
"Pack expansion without parameter packs?");
3449 bool RetainExpansion =
false;
3452 if (getDerived().TryExpandParameterPacks(Expansion->getEllipsisLoc(),
3455 Expand, RetainExpansion,
3464 ExprResult OutPattern = getDerived().TransformExpr(Pattern);
3468 ExprResult Out = getDerived().RebuildPackExpansion(OutPattern.
get(),
3469 Expansion->getEllipsisLoc(),
3476 Outputs.push_back(Out.
get());
3482 if (ArgChanged) *ArgChanged =
true;
3486 for (
unsigned I = 0; I != *NumExpansions; ++I) {
3488 ExprResult Out = getDerived().TransformExpr(Pattern);
3492 if (Out.
get()->containsUnexpandedParameterPack()) {
3493 Out = getDerived().RebuildPackExpansion(
3494 Out.
get(), Expansion->getEllipsisLoc(), OrigNumExpansions);
3499 Outputs.push_back(Out.
get());
3504 if (RetainExpansion) {
3505 ForgetPartiallySubstitutedPackRAII Forget(getDerived());
3507 ExprResult Out = getDerived().TransformExpr(Pattern);
3511 Out = getDerived().RebuildPackExpansion(
3512 Out.
get(), Expansion->getEllipsisLoc(), OrigNumExpansions);
3516 Outputs.push_back(Out.
get());
3523 IsCall ? getDerived().TransformInitializer(Inputs[I],
false)
3524 : getDerived().TransformExpr(Inputs[I]);
3528 if (Result.
get() != Inputs[I] && ArgChanged)
3531 Outputs.push_back(Result.
get());
3537 template <
typename Derived>
3541 VarDecl *ConditionVar = cast_or_null<VarDecl>(
3542 getDerived().TransformDefinition(Var->
getLocation(), Var));
3547 return getSema().ActOnConditionVariable(ConditionVar, Loc, Kind);
3551 ExprResult CondExpr = getDerived().TransformExpr(Expr);
3556 return getSema().ActOnCondition(
nullptr, Loc, CondExpr.
get(),
Kind);
3562 template<
typename Derived>
3571 Qualifiers.push_back(Qualifier);
3574 while (!Qualifiers.empty()) {
3582 if (SemaRef.BuildCXXNestedNameSpecifier(
nullptr, IdInfo,
false,
3583 SS, FirstQualifierInScope,
false))
3590 = cast_or_null<NamespaceDecl>(
3591 getDerived().TransformDecl(
3600 = cast_or_null<NamespaceAliasDecl>(
3616 cast_or_null<CXXRecordDecl>(getDerived().TransformDecl(
3625 FirstQualifierInScope, SS);
3631 (SemaRef.getLangOpts().CPlusPlus11 &&
3634 "Can't get cv-qualifiers here");
3637 diag::warn_cxx98_compat_enum_nested_name_spec);
3646 SemaRef.Diag(TL.
getBeginLoc(), diag::err_nested_name_spec_non_tag)
3654 FirstQualifierInScope =
nullptr;
3660 !getDerived().AlwaysRebuild())
3673 template<
typename Derived>
3693 TemplateDecl *NewTemplate = cast_or_null<TemplateDecl>(
3694 getDerived().TransformDecl(NameInfo.
getLoc(), OldTemplate));
3700 SemaRef.Context.DeclarationNames.getCXXDeductionGuideName(NewTemplate));
3710 NewTInfo = getDerived().TransformType(OldTInfo);
3713 NewCanTy = SemaRef.Context.getCanonicalType(NewTInfo->
getType());
3721 NewCanTy = SemaRef.Context.getCanonicalType(NewT);
3725 = SemaRef.Context.DeclarationNames.getCXXSpecialName(Name.
getNameKind(),
3734 llvm_unreachable(
"Unknown name kind.");
3737 template<
typename Derived>
3744 bool AllowInjectedClassName) {
3747 assert(Template &&
"qualified template name must refer to a template");
3750 = cast_or_null<TemplateDecl>(getDerived().TransformDecl(NameLoc,
3755 if (!getDerived().AlwaysRebuild() &&
3757 TransTemplate == Template)
3760 return getDerived().RebuildTemplateName(SS, QTN->hasTemplateKeyword(),
3768 FirstQualifierInScope =
nullptr;
3771 if (!getDerived().AlwaysRebuild() &&
3779 if (DTN->isIdentifier()) {
3780 return getDerived().RebuildTemplateName(SS,
3782 *DTN->getIdentifier(),
3785 FirstQualifierInScope,
3786 AllowInjectedClassName);
3789 return getDerived().RebuildTemplateName(SS, TemplateKWLoc,
3790 DTN->getOperator(), NameLoc,
3791 ObjectType, AllowInjectedClassName);
3796 = cast_or_null<TemplateDecl>(getDerived().TransformDecl(NameLoc,
3801 if (!getDerived().AlwaysRebuild() &&
3802 TransTemplate == Template)
3811 = cast_or_null<TemplateTemplateParmDecl>(
3812 getDerived().TransformDecl(NameLoc, SubstPack->getParameterPack()));
3816 if (!getDerived().AlwaysRebuild() &&
3817 TransParam == SubstPack->getParameterPack())
3820 return getDerived().RebuildTemplateName(TransParam,
3821 SubstPack->getArgumentPack());
3825 llvm_unreachable(
"overloaded function decl survived to here");
3828 template<
typename Derived>
3835 llvm_unreachable(
"null template argument in TreeTransform");
3840 SemaRef.Context.getTrivialTypeSourceInfo(Arg.
getAsType(), Loc));
3849 Builder.
MakeTrivial(SemaRef.Context, DTN->getQualifier(), Loc);
3851 Builder.
MakeTrivial(SemaRef.Context, QTN->getQualifier(), Loc);
3878 template<
typename Derived>
3893 llvm_unreachable(
"Unexpected TemplateArgument");
3900 DI = getDerived().TransformType(DI);
3901 if (!DI)
return true;
3910 QualifierLoc = getDerived().TransformNestedNameSpecifierLoc(QualifierLoc);
3916 SS.
Adopt(QualifierLoc);
3918 = getDerived().TransformTemplateName(SS, Arg.
getAsTemplate(),
3929 llvm_unreachable(
"Caller should expand pack expansions");
3941 ExprResult E = getDerived().TransformExpr(InputExpr);
3942 E = SemaRef.ActOnConstantExpression(E);
3955 template<
typename Derived,
typename InputIterator>
3963 typedef typename std::iterator_traits<InputIterator>::difference_type
3980 : Self(Self), Iter(Iter) { }
4003 return X.Iter == Y.Iter;
4008 return X.Iter != Y.Iter;
4012 template<
typename Derived>
4013 template<
typename InputIterator>
4017 for (; First != Last; ++First) {
4030 if (TransformTemplateArguments(PackLocIterator(*
this,
4032 PackLocIterator(*
this,
4046 = getSema().getTemplateArgumentPackExpansionPattern(
4047 In, Ellipsis, OrigNumExpansions);
4050 getSema().collectUnexpandedParameterPacks(Pattern, Unexpanded);
4051 assert(!Unexpanded.empty() &&
"Pack expansion without parameter packs?");
4056 bool RetainExpansion =
false;
4058 if (getDerived().TryExpandParameterPacks(Ellipsis,
4072 if (getDerived().TransformTemplateArgument(Pattern, OutPattern, Uneval))
4075 Out = getDerived().RebuildPackExpansion(OutPattern, Ellipsis,
4086 for (
unsigned I = 0; I != *NumExpansions; ++I) {
4089 if (getDerived().TransformTemplateArgument(Pattern, Out, Uneval))
4093 Out = getDerived().RebuildPackExpansion(Out, Ellipsis,
4104 if (RetainExpansion) {
4105 ForgetPartiallySubstitutedPackRAII Forget(getDerived());
4107 if (getDerived().TransformTemplateArgument(Pattern, Out, Uneval))
4110 Out = getDerived().RebuildPackExpansion(Out, Ellipsis,
4122 if (getDerived().TransformTemplateArgument(In, Out, Uneval))
4136 template<
typename Derived>
4138 if (getDerived().AlreadyTransformed(T))
4143 TypeSourceInfo *DI = getSema().Context.getTrivialTypeSourceInfo(T,
4144 getDerived().getBaseLocation());
4154 template<
typename Derived>
4158 getDerived().getBaseEntity());
4159 if (getDerived().AlreadyTransformed(DI->
getType()))
4167 QualType Result = getDerived().TransformType(TLB, TL);
4174 template<
typename Derived>
4178 #define ABSTRACT_TYPELOC(CLASS, PARENT) 4179 #define TYPELOC(CLASS, PARENT) \ 4180 case TypeLoc::CLASS: \ 4181 return getDerived().Transform##CLASS##Type(TLB, \ 4182 T.castAs<CLASS##TypeLoc>()); 4183 #include "clang/AST/TypeLocNodes.def" 4186 llvm_unreachable(
"unhandled type loc!");
4189 template<
typename Derived>
4191 if (!isa<DependentNameType>(T))
4192 return TransformType(T);
4194 if (getDerived().AlreadyTransformed(T))
4196 TypeSourceInfo *DI = getSema().Context.getTrivialTypeSourceInfo(T,
4197 getDerived().getBaseLocation());
4198 TypeSourceInfo *NewDI = getDerived().TransformTypeWithDeducedTST(DI);
4202 template<
typename Derived>
4205 if (!isa<DependentNameType>(DI->
getType()))
4206 return TransformType(DI);
4210 getDerived().getBaseEntity());
4211 if (getDerived().AlreadyTransformed(DI->
getType()))
4225 QualType Result = getDerived().TransformDependentNameType(
4227 if (Result.isNull())
4231 Result = getDerived().RebuildQualifiedType(Result, QTL);
4232 if (Result.isNull())
4240 template<
typename Derived>
4248 Result = getDerived().RebuildQualifiedType(Result, T);
4261 template <
typename Derived>
4271 SemaRef.Diag(Loc, diag::err_address_space_mismatch_templ_inst)
4280 T = SemaRef.getASTContext().getAddrSpaceQualType(T,
4308 = dyn_cast<SubstTemplateTypeParmType>(T)) {
4309 QualType Replacement = SubstTypeParam->getReplacementType();
4312 Replacement = SemaRef.Context.getQualifiedType(
4314 T = SemaRef.Context.getSubstTemplateTypeParmType(
4315 SubstTypeParam->getReplacedParameter(), Replacement);
4316 }
else if ((AutoTy = dyn_cast<AutoType>(T)) && AutoTy->
isDeduced()) {
4323 T = SemaRef.Context.getAutoType(Deduced, AutoTy->
getKeyword(),
4329 SemaRef.Diag(Loc, diag::err_attr_objc_ownership_redundant) << T;
4335 return SemaRef.BuildQualifiedType(T, Loc, Quals);
4338 template<
typename Derived>
4344 if (getDerived().AlreadyTransformed(TL.
getType()))
4348 TransformTSIInObjectScope(TL, ObjectType, UnqualLookup, SS);
4354 template<
typename Derived>
4360 if (getDerived().AlreadyTransformed(TSInfo->
getType()))
4363 return TransformTSIInObjectScope(TSInfo->
getTypeLoc(), ObjectType,
4367 template <
typename Derived>
4372 assert(!getDerived().AlreadyTransformed(T));
4377 if (isa<TemplateSpecializationType>(T)) {
4381 TemplateName Template = getDerived().TransformTemplateName(
4383 ObjectType, UnqualLookup,
true);
4384 if (Template.isNull())
4387 Result = getDerived().TransformTemplateSpecializationType(TLB, SpecTL,
4389 }
else if (isa<DependentTemplateSpecializationType>(T)) {
4394 = getDerived().RebuildTemplateName(SS,
4398 ObjectType, UnqualLookup,
4400 if (Template.isNull())
4403 Result = getDerived().TransformDependentTemplateSpecializationType(TLB,
4409 Result = getDerived().TransformType(TLB, TL);
4418 template <
class TyLoc>
static inline 4420 TyLoc NewT = TLB.
push<TyLoc>(T.getType());
4421 NewT.setNameLoc(T.getNameLoc());
4425 template<
typename Derived>
4435 template<
typename Derived>
4442 template <
typename Derived>
4449 template<
typename Derived>
4453 if (OriginalType.
isNull())
4457 if (getDerived().AlwaysRebuild() ||
4459 Result = SemaRef.Context.getDecayedType(OriginalType);
4465 template<
typename Derived>
4470 if (PointeeType.
isNull())
4479 Result = SemaRef.Context.getObjCObjectPointerType(PointeeType);
4486 if (getDerived().AlwaysRebuild() ||
4488 Result = getDerived().RebuildPointerType(PointeeType, TL.
getSigilLoc());
4502 template<
typename Derived>
4508 if (PointeeType.
isNull())
4512 if (getDerived().AlwaysRebuild() ||
4514 Result = getDerived().RebuildBlockPointerType(PointeeType,
4529 template<
typename Derived>
4537 if (PointeeType.
isNull())
4541 if (getDerived().AlwaysRebuild() ||
4543 Result = getDerived().RebuildReferenceType(PointeeType,
4557 if (isa<LValueReferenceType>(Result))
4566 template<
typename Derived>
4570 return TransformReferenceType(TLB, TL);
4573 template<
typename Derived>
4577 return TransformReferenceType(TLB, TL);
4580 template<
typename Derived>
4585 if (PointeeType.
isNull())
4591 NewClsTInfo = getDerived().TransformType(OldClsTInfo);
4600 NewClsType = NewClsTInfo->
getType();
4602 NewClsType = getDerived().TransformType(OldClsType);
4603 if (NewClsType.isNull())
4608 if (getDerived().AlwaysRebuild() ||
4610 NewClsType != OldClsType) {
4611 Result = getDerived().RebuildMemberPointerType(PointeeType, NewClsType,
4627 NewTL.setClassTInfo(NewClsTInfo);
4632 template<
typename Derived>
4638 if (ElementType.
isNull())
4642 if (getDerived().AlwaysRebuild() ||
4644 Result = getDerived().RebuildConstantArrayType(ElementType,
4665 Size = getDerived().TransformExpr(Size).template getAs<Expr>();
4666 Size = SemaRef.ActOnConstantExpression(Size).get();
4673 template<
typename Derived>
4679 if (ElementType.
isNull())
4683 if (getDerived().AlwaysRebuild() ||
4685 Result = getDerived().RebuildIncompleteArrayType(ElementType,
4701 template<
typename Derived>
4707 if (ElementType.
isNull())
4714 SizeResult = getDerived().TransformExpr(T->
getSizeExpr());
4719 SemaRef.ActOnFinishFullExpr(SizeResult.
get(),
false);
4723 Expr *Size = SizeResult.
get();
4726 if (getDerived().AlwaysRebuild() ||
4729 Result = getDerived().RebuildVariableArrayType(ElementType,
4748 template<
typename Derived>
4754 if (ElementType.
isNull())
4766 = getDerived().TransformExpr(origSize);
4767 sizeResult = SemaRef.ActOnConstantExpression(sizeResult);
4771 Expr *size = sizeResult.
get();
4774 if (getDerived().AlwaysRebuild() ||
4777 Result = getDerived().RebuildDependentSizedArrayType(ElementType,
4796 template <
typename Derived>
4801 if (ElementType.
isNull())
4808 Size = SemaRef.ActOnConstantExpression(Size);
4813 if (getDerived().AlwaysRebuild() || ElementType != T->
getElementType() ||
4815 Result = getDerived().RebuildDependentVectorType(
4822 if (isa<DependentVectorType>(Result)) {
4834 template<
typename Derived>
4842 if (ElementType.
isNull())
4850 Size = SemaRef.ActOnConstantExpression(Size);
4855 if (getDerived().AlwaysRebuild() ||
4858 Result = getDerived().RebuildDependentSizedExtVectorType(ElementType,
4866 if (isa<DependentSizedExtVectorType>(Result)) {
4878 template <
typename Derived>
4885 if (pointeeType.
isNull())
4893 AddrSpace = SemaRef.ActOnConstantExpression(AddrSpace);
4898 if (getDerived().AlwaysRebuild() || pointeeType != T->
getPointeeType() ||
4900 Result = getDerived().RebuildDependentAddressSpaceType(
4907 if (isa<DependentAddressSpaceType>(Result)) {
4917 Result, getDerived().getBaseLocation());
4924 template <
typename Derived>
4929 if (ElementType.
isNull())
4933 if (getDerived().AlwaysRebuild() ||
4935 Result = getDerived().RebuildVectorType(ElementType, T->
getNumElements(),
4947 template<
typename Derived>
4952 if (ElementType.
isNull())
4956 if (getDerived().AlwaysRebuild() ||
4958 Result = getDerived().RebuildExtVectorType(ElementType,
4971 template <
typename Derived>
4974 bool ExpectParameterPack) {
4978 if (NumExpansions && isa<PackExpansionType>(OldDI->
getType())) {
4988 QualType Result = getDerived().TransformType(TLB,
4993 Result = RebuildPackExpansionType(Result,
5003 NewDI = TLB.getTypeSourceInfo(SemaRef.Context, Result);
5005 NewDI = getDerived().TransformType(OldDI);
5009 if (NewDI == OldDI && indexAdjustment == 0)
5026 template <
typename Derived>
5034 int indexAdjustment = 0;
5036 unsigned NumParams = Params.size();
5037 for (
unsigned i = 0; i != NumParams; ++i) {
5039 assert(OldParm->getFunctionScopeIndex() == i);
5043 if (OldParm->isParameterPack()) {
5048 TypeLoc TL = OldParm->getTypeSourceInfo()->getTypeLoc();
5051 SemaRef.collectUnexpandedParameterPacks(Pattern, Unexpanded);
5052 assert(Unexpanded.size() > 0 &&
"Could not find parameter packs!");
5055 bool ShouldExpand =
false;
5056 bool RetainExpansion =
false;
5059 NumExpansions = OrigNumExpansions;
5060 if (getDerived().TryExpandParameterPacks(ExpansionTL.
getEllipsisLoc(),
5061 Pattern.getSourceRange(),
5072 getDerived().ExpandingFunctionParameterPack(OldParm);
5073 for (
unsigned I = 0; I != *NumExpansions; ++I) {
5076 = getDerived().TransformFunctionTypeParam(OldParm,
5084 PInfos.
set(OutParamTypes.size(), ParamInfos[i]);
5085 OutParamTypes.push_back(NewParm->
getType());
5087 PVars->push_back(NewParm);
5092 if (RetainExpansion) {
5093 ForgetPartiallySubstitutedPackRAII Forget(getDerived());
5095 = getDerived().TransformFunctionTypeParam(OldParm,
5103 PInfos.
set(OutParamTypes.size(), ParamInfos[i]);
5104 OutParamTypes.push_back(NewParm->
getType());
5106 PVars->push_back(NewParm);
5122 NewParm = getDerived().TransformFunctionTypeParam(OldParm,
5127 NewParm = getDerived().TransformFunctionTypeParam(
5128 OldParm, indexAdjustment, None,
false);
5135 PInfos.
set(OutParamTypes.size(), ParamInfos[i]);
5136 OutParamTypes.push_back(NewParm->
getType());
5138 PVars->push_back(NewParm);
5145 bool IsPackExpansion =
false;
5149 = dyn_cast<PackExpansionType>(OldType)) {
5151 QualType Pattern = Expansion->getPattern();
5153 getSema().collectUnexpandedParameterPacks(Pattern, Unexpanded);
5156 bool ShouldExpand =
false;
5157 bool RetainExpansion =
false;
5158 if (getDerived().TryExpandParameterPacks(Loc,
SourceRange(),
5169 for (
unsigned I = 0; I != *NumExpansions; ++I) {
5171 QualType NewType = getDerived().TransformType(Pattern);
5177 getSema().getASTContext().getPackExpansionType(NewType, None);
5184 PInfos.
set(OutParamTypes.size(), ParamInfos[i]);
5185 OutParamTypes.push_back(NewType);
5187 PVars->push_back(
nullptr);
5196 if (RetainExpansion) {
5197 ForgetPartiallySubstitutedPackRAII Forget(getDerived());
5198 QualType NewType = getDerived().TransformType(Pattern);
5203 PInfos.
set(OutParamTypes.size(), ParamInfos[i]);
5204 OutParamTypes.push_back(NewType);
5206 PVars->push_back(
nullptr);
5211 OldType = Expansion->getPattern();
5212 IsPackExpansion =
true;
5214 NewType = getDerived().TransformType(OldType);
5216 NewType = getDerived().TransformType(OldType);
5222 if (IsPackExpansion)
5223 NewType = getSema().Context.getPackExpansionType(NewType,
5227 PInfos.
set(OutParamTypes.size(), ParamInfos[i]);
5228 OutParamTypes.push_back(NewType);
5230 PVars->push_back(
nullptr);
5235 for (
unsigned i = 0, e = PVars->size(); i != e; ++i)
5237 assert(parm->getFunctionScopeIndex() == i);
5244 template<
typename Derived>
5254 ExceptionStorage, Changed);
5258 template<
typename Derived>
template<
typename Fn>
5261 Qualifiers ThisTypeQuals, Fn TransformExceptionSpec) {
5278 if (getDerived().TransformFunctionTypeParams(
5282 ParamTypes, &ParamDecls, ExtParamInfos))
5294 ResultType = getDerived().TransformType(TLB, TL.
getReturnLoc());
5300 ResultType = getDerived().TransformType(TLB, TL.
getReturnLoc());
5307 diag::err_attribute_address_function_type);
5311 if (getDerived().TransformFunctionTypeParams(
5315 ParamTypes, &ParamDecls, ExtParamInfos))
5321 bool EPIChanged =
false;
5326 if (
auto NewExtParamInfos =
5330 != llvm::makeArrayRef(NewExtParamInfos, ParamTypes.size())) {
5340 if (getDerived().AlwaysRebuild() || ResultType != T->
getReturnType() ||
5341 T->
getParamTypes() != llvm::makeArrayRef(ParamTypes) || EPIChanged) {
5342 Result = getDerived().RebuildFunctionProtoType(ResultType, ParamTypes, EPI);
5353 for (
unsigned i = 0, e = NewTL.
getNumParams(); i != e; ++i)
5359 template<
typename Derived>
5375 getSema().ActOnNoexceptSpec(Loc, NoexceptExpr.
get(), EST);
5396 SemaRef.collectUnexpandedParameterPacks(PackExpansion->getPattern(),
5398 assert(!Unexpanded.empty() &&
"Pack expansion without parameter packs?");
5403 bool Expand =
false;
5404 bool RetainExpansion =
false;
5408 if (getDerived().TryExpandParameterPacks(
5410 RetainExpansion, NumExpansions))
5418 QualType U = getDerived().TransformType(PackExpansion->getPattern());
5422 U = SemaRef.Context.getPackExpansionType(U, NumExpansions);
5423 Exceptions.push_back(U);
5429 for (
unsigned ArgIdx = 0; ArgIdx != *NumExpansions; ++ArgIdx) {
5432 QualType U = getDerived().TransformType(PackExpansion->getPattern());
5433 if (U.
isNull() || SemaRef.CheckSpecifiedExceptionType(U, Loc))
5436 Exceptions.push_back(U);
5439 QualType U = getDerived().TransformType(T);
5440 if (U.
isNull() || SemaRef.CheckSpecifiedExceptionType(U, Loc))
5445 Exceptions.push_back(U);
5455 template<
typename Derived>
5465 if (getDerived().AlwaysRebuild() || ResultType != T->
getReturnType())
5466 Result = getDerived().RebuildFunctionNoProtoType(ResultType);
5477 template<
typename Derived>
QualType 5486 if (getDerived().AlwaysRebuild() || D != T->
getDecl()) {
5487 Result = getDerived().RebuildUnresolvedUsingType(TL.
getNameLoc(), D);
5500 template<
typename Derived>
5505 = cast_or_null<TypedefNameDecl>(getDerived().TransformDecl(TL.
getNameLoc(),
5511 if (getDerived().AlwaysRebuild() ||
5513 Result = getDerived().RebuildTypedefType(Typedef);
5524 template<
typename Derived>
5536 E = SemaRef.HandleExprEvaluationContextForTypeof(E.
get());
5541 if (getDerived().AlwaysRebuild() ||
5543 Result = getDerived().RebuildTypeOfExprType(E.
get(), TL.
getTypeofLoc());
5557 template<
typename Derived>
5561 TypeSourceInfo* New_Under_TI = getDerived().TransformType(Old_Under_TI);
5566 if (getDerived().AlwaysRebuild() || New_Under_TI != Old_Under_TI) {
5567 Result = getDerived().RebuildTypeOfType(New_Under_TI->
getType());
5581 template<
typename Derived>
5595 E = getSema().ActOnDecltypeExpression(E.
get());
5600 if (getDerived().AlwaysRebuild() ||
5602 Result = getDerived().RebuildDecltypeType(E.
get(), TL.
getNameLoc());
5614 template<
typename Derived>
5623 Result = getDerived().RebuildUnaryTransformType(NewBase,
5637 template<
typename Derived>
5643 if (!OldDeduced.
isNull()) {
5644 NewDeduced = getDerived().TransformType(OldDeduced);
5650 if (getDerived().AlwaysRebuild() || NewDeduced != OldDeduced ||
5652 Result = getDerived().RebuildAutoType(NewDeduced, T->
getKeyword());
5663 template<
typename Derived>
5671 if (TemplateName.
isNull())
5676 if (!OldDeduced.
isNull()) {
5677 NewDeduced = getDerived().TransformType(OldDeduced);
5682 QualType Result = getDerived().RebuildDeducedTemplateSpecializationType(
5683 TemplateName, NewDeduced);
5694 template<
typename Derived>
5699 = cast_or_null<RecordDecl>(getDerived().TransformDecl(TL.
getNameLoc(),
5705 if (getDerived().AlwaysRebuild() ||
5707 Result = getDerived().RebuildRecordType(Record);
5718 template<
typename Derived>
5723 = cast_or_null<EnumDecl>(getDerived().TransformDecl(TL.
getNameLoc(),
5729 if (getDerived().AlwaysRebuild() ||
5731 Result = getDerived().RebuildEnumType(Enum);
5742 template<
typename Derived>
5750 QualType T = SemaRef.Context.getTypeDeclType(cast<TypeDecl>(D));
5755 template<
typename Derived>
5762 template<
typename Derived>
5773 if (Replacement.isNull())
5790 template<
typename Derived>
5797 template<
typename Derived>
5812 return getDerived().TransformTemplateSpecializationType(TLB, TL, Template);
5815 template<
typename Derived>
5823 if (getDerived().AlwaysRebuild() ||
5825 Result = getDerived().RebuildAtomicType(ValueType, TL.
getKWLoc());
5838 template <
typename Derived>
5849 Result = getDerived().RebuildPipeType(ValueType, TL.
getKWLoc(), isReadPipe);
5865 template<
typename ArgLocContainer>
5867 ArgLocContainer *Container;
5892 : Container(&Container), Index(Index) { }
5906 return Container->getArgLoc(Index);
5910 return pointer(Container->getArgLoc(Index));
5915 return X.Container == Y.Container && X.Index == Y.Index;
5925 template <
typename Derived>
5935 if (getDerived().TransformTemplateArguments(ArgIterator(TL, 0),
5943 getDerived().RebuildTemplateSpecializationType(Template,
5952 if (isa<DependentTemplateSpecializationType>(Result)) {
5961 for (
unsigned i = 0, e = NewTemplateArgs.
size(); i != e; ++i)
5972 for (
unsigned i = 0, e = NewTemplateArgs.
size(); i != e; ++i)
5979 template <
typename Derived>
5990 if (getDerived().TransformTemplateArguments(ArgIterator(TL, 0),
5999 = getSema().Context.getDependentTemplateSpecializationType(
6001 DTN->getQualifier(),
6002 DTN->getIdentifier(),
6013 for (
unsigned i = 0, e = NewTemplateArgs.
size(); i != e; ++i)
6019 = getDerived().RebuildTemplateSpecializationType(Template,
6031 for (
unsigned i = 0, e = NewTemplateArgs.
size(); i != e; ++i)
6038 template<
typename Derived>
6068 diag::err_tag_reference_non_tag)
6071 SemaRef.Diag(TAT->getLocation(), diag::note_declared_at);
6077 if (getDerived().AlwaysRebuild() ||
6082 QualifierLoc, NamedT);
6093 template<
typename Derived>
6099 if (modifiedType.
isNull())
6104 const Attr *newAttr = oldAttr ? getDerived().TransformAttr(oldAttr) :
nullptr;
6105 if (oldAttr && !newAttr)
6111 if (getDerived().AlwaysRebuild() ||
6117 if (equivalentType.
isNull())
6125 diag::err_nullability_nonpointer)
6131 result = SemaRef.Context.getAttributedType(TL.
getAttrKind(),
6141 template<
typename Derived>
6150 if (getDerived().AlwaysRebuild() ||
6152 Result = getDerived().RebuildParenType(Inner);
6163 template<
typename Derived>
6166 return TransformDependentNameType(TLB, TL,
false);
6169 template<
typename Derived>
6180 = getDerived().RebuildDependentNameType(T->
getKeyword(),
6190 QualType NamedT = ElabT->getNamedType();
6205 template<
typename Derived>
6218 .TransformDependentTemplateSpecializationType(TLB, TL, QualifierLoc);
6221 template<
typename Derived>
6234 if (getDerived().TransformTemplateArguments(ArgIterator(TL, 0),
6239 QualType Result = getDerived().RebuildDependentTemplateSpecializationType(
6246 if (
const ElaboratedType *ElabT = dyn_cast<ElaboratedType>(Result)) {
6247 QualType NamedT = ElabT->getNamedType();
6256 for (
unsigned I = 0, E = NewTemplateArgs.
size(); I != E; ++I)
6263 }
else if (isa<DependentTemplateSpecializationType>(Result)) {
6272 for (
unsigned I = 0, E = NewTemplateArgs.
size(); I != E; ++I)
6281 for (
unsigned I = 0, E = NewTemplateArgs.
size(); I != E; ++I)
6287 template<
typename Derived>
6296 if (getDerived().AlwaysRebuild() ||
6298 Result = getDerived().RebuildPackExpansionType(Pattern,
6311 template<
typename Derived>
6320 template<
typename Derived>
6331 if (getDerived().AlwaysRebuild() ||
6333 Result = getDerived().RebuildObjCTypeParamType(OTP,
6353 template<
typename Derived>
6374 const auto *PackExpansion = PackExpansionLoc.getType()
6377 SemaRef.collectUnexpandedParameterPacks(PackExpansion->getPattern(),
6379 assert(!Unexpanded.empty() &&
"Pack expansion without parameter packs?");
6383 TypeLoc PatternLoc = PackExpansionLoc.getPatternLoc();
6384 bool Expand =
false;
6385 bool RetainExpansion =
false;
6387 if (getDerived().TryExpandParameterPacks(
6388 PackExpansionLoc.getEllipsisLoc(), PatternLoc.getSourceRange(),
6389 Unexpanded, Expand, RetainExpansion, NumExpansions))
6399 TypeArgBuilder.
reserve(PatternLoc.getFullDataSize());
6400 QualType NewPatternType = getDerived().TransformType(TypeArgBuilder,
6402 if (NewPatternType.
isNull())
6405 QualType NewExpansionType = SemaRef.Context.getPackExpansionType(
6406 NewPatternType, NumExpansions);
6408 NewExpansionLoc.
setEllipsisLoc(PackExpansionLoc.getEllipsisLoc());
6409 NewTypeArgInfos.push_back(
6416 for (
unsigned ArgIdx = 0; ArgIdx != *NumExpansions; ++ArgIdx) {
6420 TypeArgBuilder.
reserve(PatternLoc.getFullDataSize());
6422 QualType NewTypeArg = getDerived().TransformType(TypeArgBuilder,
6427 NewTypeArgInfos.push_back(
6436 QualType NewTypeArg = getDerived().TransformType(TypeArgBuilder, TypeArgLoc);
6441 if (NewTypeArg == TypeArg) {
6442 NewTypeArgInfos.push_back(TypeArgInfo);
6446 NewTypeArgInfos.push_back(
6452 if (getDerived().AlwaysRebuild() || AnyChanged) {
6454 Result = getDerived().RebuildObjCObjectType(
6477 template<
typename Derived>
6482 if (PointeeType.
isNull())
6486 if (getDerived().AlwaysRebuild() ||
6488 Result = getDerived().RebuildObjCObjectPointerType(PointeeType,
6502 template<
typename Derived>
6508 template<
typename Derived>
6511 return getDerived().TransformCompoundStmt(S,
false);
6514 template<
typename Derived>
6520 bool SubStmtInvalid =
false;
6521 bool SubStmtChanged =
false;
6523 for (
auto *B : S->
body()) {
6525 getDerived().TransformStmt(B, !IsStmtExpr || B != S->
body_back());
6530 if (isa<DeclStmt>(B))
6534 SubStmtInvalid =
true;
6538 SubStmtChanged = SubStmtChanged || Result.
get() != B;
6539 Statements.push_back(Result.
getAs<
Stmt>());
6545 if (!getDerived().AlwaysRebuild() &&
6549 return getDerived().RebuildCompoundStmt(S->
getLBracLoc(),
6555 template<
typename Derived>
6564 LHS = getDerived().TransformExpr(S->
getLHS());
6565 LHS = SemaRef.ActOnCaseExpr(S->
getCaseLoc(), LHS);
6570 RHS = getDerived().TransformExpr(S->
getRHS());
6571 RHS = SemaRef.ActOnCaseExpr(S->
getCaseLoc(), RHS);
6593 return getDerived().RebuildCaseStmtBody(Case.
get(), SubStmt.
get());
6596 template<
typename Derived>
6609 template<
typename Derived>
6623 return getDerived().RebuildLabelStmt(S->
getIdentLoc(),
6628 template <
typename Derived>
6636 #define PRAGMA_SPELLING_ATTR(X) \ 6638 return getDerived().Transform##X##Attr(cast<X##Attr>(R)); 6639 #include "clang/Basic/AttrList.inc" 6645 template <
typename Derived>
6647 bool AttrsChanged =
false;
6651 for (
const auto *I : S->
getAttrs()) {
6652 const Attr *R = getDerived().TransformAttr(I);
6653 AttrsChanged |= (I != R);
6664 return getDerived().RebuildAttributedStmt(S->
getAttrLoc(), Attrs,
6668 template<
typename Derived>
6691 if (!ConstexprConditionValue || *ConstexprConditionValue) {
6692 Then = getDerived().TransformStmt(S->
getThen());
6701 if (!ConstexprConditionValue || !*ConstexprConditionValue) {
6702 Else = getDerived().TransformStmt(S->
getElse());
6707 if (!getDerived().AlwaysRebuild() &&
6719 template<
typename Derived>
6736 = getDerived().RebuildSwitchStmtStart(S->
getSwitchLoc(), Init.
get(), Cond);
6746 return getDerived().RebuildSwitchStmtBody(S->
getSwitchLoc(), Switch.
get(),
6750 template<
typename Derived>
6765 if (!getDerived().AlwaysRebuild() &&
6770 return getDerived().RebuildWhileStmt(S->
getWhileLoc(), Cond, Body.
get());
6773 template<
typename Derived>
6786 if (!getDerived().AlwaysRebuild() &&
6796 template<
typename Derived>
6799 if (getSema().getLangOpts().OpenMP)
6800 getSema().startOpenMPLoop();
6809 if (getSema().getLangOpts().OpenMP && Init.
isUsable())
6810 getSema().ActOnOpenMPLoopInitialization(S->
getForLoc(), Init.
get());
6833 if (!getDerived().AlwaysRebuild() &&
6841 Init.
get(), Cond, FullInc,
6845 template<
typename Derived>
6855 cast<LabelDecl>(LD));
6858 template<
typename Derived>
6864 Target = SemaRef.MaybeCreateExprWithCleanups(Target.
get());
6866 if (!getDerived().AlwaysRebuild() &&
6874 template<
typename Derived>
6880 template<
typename Derived>
6886 template<
typename Derived>
6896 return getDerived().RebuildReturnStmt(S->
getReturnLoc(), Result.
get());
6899 template<
typename Derived>
6902 bool DeclChanged =
false;
6904 for (
auto *D : S->
decls()) {
6905 Decl *Transformed = getDerived().TransformDefinition(D->getLocation(), D);
6909 if (Transformed != D)
6912 Decls.push_back(Transformed);
6915 if (!getDerived().AlwaysRebuild() && !DeclChanged)
6921 template<
typename Derived>
6932 bool ExprsChanged =
false;
6943 ExprResult Result = getDerived().TransformExpr(OutputExpr);
6947 ExprsChanged |= Result.
get() != OutputExpr;
6949 Exprs.push_back(Result.
get());
6953 for (
unsigned I = 0, E = S->
getNumInputs(); I != E; ++I) {
6961 ExprResult Result = getDerived().TransformExpr(InputExpr);
6965 ExprsChanged |= Result.
get() != InputExpr;
6967 Exprs.push_back(Result.
get());
6970 if (!getDerived().AlwaysRebuild() && !ExprsChanged)
6982 Constraints, Exprs, AsmString.
get(),
6986 template<
typename Derived>
6992 bool HadError =
false, HadChange =
false;
6996 TransformedExprs.reserve(SrcExprs.size());
6997 for (
unsigned i = 0, e = SrcExprs.size(); i != e; ++i) {
6998 ExprResult Result = getDerived().TransformExpr(SrcExprs[i]);
7002 HadChange |= (Result.
get() != SrcExprs[i]);
7003 TransformedExprs.push_back(Result.
get());
7008 if (!HadChange && !getDerived().AlwaysRebuild())
7020 template<
typename Derived>
7023 auto *ScopeInfo = SemaRef.getCurFunction();
7024 auto *FD = cast<FunctionDecl>(SemaRef.CurContext);
7025 assert(FD && ScopeInfo && !ScopeInfo->CoroutinePromise &&
7026 ScopeInfo->NeedsCoroutineSuspends &&
7027 ScopeInfo->CoroutineSuspends.first ==
nullptr &&
7028 ScopeInfo->CoroutineSuspends.second ==
nullptr &&
7029 "expected clean scope info");
7033 ScopeInfo->setNeedsCoroutineSuspends(
false);
7037 if (!SemaRef.buildCoroutineParameterMoves(FD->getLocation()))
7039 auto *Promise = SemaRef.buildCoroutinePromise(FD->getLocation());
7043 ScopeInfo->CoroutinePromise = Promise;
7054 ScopeInfo->setCoroutineSuspends(InitSuspend.
get(), FinalSuspend.
get());
7055 assert(isa<Expr>(InitSuspend.
get()) && isa<Expr>(FinalSuspend.
get()));
7062 if (Builder.isInvalid())
7066 assert(ReturnObject &&
"the return object is expected to be valid");
7067 ExprResult Res = getDerived().TransformInitializer(ReturnObject,
7071 Builder.ReturnValue = Res.
get();
7074 assert(!Promise->getType()->isDependentType() &&
7075 "the promise type must no longer be dependent");
7078 "these nodes should not have been built yet");
7079 if (!Builder.buildDependentStatements())
7083 StmtResult Res = getDerived().TransformStmt(OnFallthrough);
7086 Builder.OnFallthrough = Res.
get();
7090 StmtResult Res = getDerived().TransformStmt(OnException);
7093 Builder.OnException = Res.
get();
7097 StmtResult Res = getDerived().TransformStmt(OnAllocFailure);
7100 Builder.ReturnStmtOnAllocFailure = Res.
get();
7105 "allocation and deallocation calls must already be built");
7107 if (AllocRes.isInvalid())
7109 Builder.Allocate = AllocRes.get();
7114 Builder.Deallocate = DeallocRes.
get();
7116 assert(S->
getResultDecl() &&
"ResultDecl must already be built");
7118 if (ResultDecl.isInvalid())
7120 Builder.ResultDecl = ResultDecl.get();
7126 Builder.ReturnStmt = Res.
get();
7130 return getDerived().RebuildCoroutineBodyStmt(Builder);
7133 template<
typename Derived>
7147 template<
typename Derived>
7161 template <
typename Derived>
7177 return getDerived().RebuildDependentCoawaitExpr(
7179 cast<UnresolvedLookupExpr>(LookupResult.
get()));
7182 template<
typename Derived>
7197 template<
typename Derived>
7206 bool AnyCatchChanged =
false;
7213 AnyCatchChanged =
true;
7214 CatchStmts.push_back(Catch.
get());
7226 if (!getDerived().AlwaysRebuild() &&
7233 return getDerived().RebuildObjCAtTryStmt(S->
getAtTryLoc(), TryBody.
get(),
7234 CatchStmts, Finally.
get());
7237 template<
typename Derived>
7244 if (FromVar->getTypeSourceInfo()) {
7245 TSInfo = getDerived().TransformType(FromVar->getTypeSourceInfo());
7254 T = getDerived().TransformType(FromVar->getType());
7259 Var = getDerived().RebuildObjCExceptionDecl(FromVar, TSInfo, T);
7268 return getDerived().RebuildObjCAtCatchStmt(S->
getAtCatchLoc(),
7273 template<
typename Derived>
7282 if (!getDerived().AlwaysRebuild() &&
7291 template<
typename Derived>
7296 Operand = getDerived().TransformExpr(S->
getThrowExpr());
7301 if (!getDerived().AlwaysRebuild() &&
7305 return getDerived().RebuildObjCAtThrowStmt(S->
getThrowLoc(), Operand.
get());
7308 template<
typename Derived>
7328 if (!getDerived().AlwaysRebuild() &&
7335 Object.
get(), Body.
get());
7338 template<
typename Derived>
7348 if (!getDerived().AlwaysRebuild() &&
7353 return getDerived().RebuildObjCAutoreleasePoolStmt(
7357 template<
typename Derived>
7377 if (!getDerived().AlwaysRebuild() &&
7384 return getDerived().RebuildObjCForCollectionStmt(S->
getForLoc(),
7391 template <
typename Derived>
7397 getDerived().TransformType(ExceptionDecl->getTypeSourceInfo());
7401 Var = getDerived().RebuildExceptionDecl(
7402 ExceptionDecl, T, ExceptionDecl->getInnerLocStart(),
7403 ExceptionDecl->getLocation(), ExceptionDecl->getIdentifier());
7413 if (!getDerived().AlwaysRebuild() && !Var &&
7417 return getDerived().RebuildCXXCatchStmt(S->
getCatchLoc(), Var, Handler.
get());
7420 template <
typename Derived>
7428 bool HandlerChanged =
false;
7435 HandlerChanged = HandlerChanged || Handler.
get() != S->
getHandler(I);
7436 Handlers.push_back(Handler.
getAs<
Stmt>());
7439 if (!getDerived().AlwaysRebuild() && TryBlock.
get() == S->
getTryBlock() &&
7443 return getDerived().RebuildCXXTryStmt(S->
getTryLoc(), TryBlock.
get(),
7447 template<
typename Derived>
7470 Cond = SemaRef.CheckBooleanCondition(S->
getColonLoc(), Cond.
get());
7474 Cond = SemaRef.MaybeCreateExprWithCleanups(Cond.
get());
7480 Inc = SemaRef.MaybeCreateExprWithCleanups(Inc.
get());
7487 if (getDerived().AlwaysRebuild() ||
7495 NewStmt = getDerived().RebuildCXXForRangeStmt(S->
getForLoc(),
7500 Inc.
get(), LoopVar.
get(),
7513 NewStmt = getDerived().RebuildCXXForRangeStmt(S->
getForLoc(),
7518 Inc.
get(), LoopVar.
get(),
7524 if (NewStmt.
get() == S)
7527 return FinishCXXForRangeStmt(NewStmt.
get(), Body.
get());
7530 template<
typename Derived>
7546 NameInfo = getDerived().TransformDeclarationNameInfo(NameInfo);
7552 if (!getDerived().AlwaysRebuild() &&
7559 SS.
Adopt(QualifierLoc);
7560 bool Dependent =
false;
7561 switch (getSema().CheckMicrosoftIfExistsSymbol(
nullptr, SS, NameInfo)) {
7592 return getDerived().RebuildMSDependentExistsStmt(S->
getKeywordLoc(),
7599 template<
typename Derived>
7619 return new (SemaRef.getASTContext())
7621 SemaRef.getASTContext().PseudoObjectTy,
VK_LValue,
7625 template <
typename Derived>
7629 if (BaseRes.isInvalid())
7631 auto IdxRes = getDerived().TransformExpr(E->
getIdx());
7632 if (IdxRes.isInvalid())
7635 if (!getDerived().AlwaysRebuild() &&
7636 BaseRes.get() == E->
getBase() &&
7637 IdxRes.get() == E->
getIdx())
7640 return getDerived().RebuildArraySubscriptExpr(
7644 template <
typename Derived>
7654 if (!getDerived().AlwaysRebuild() && TryBlock.
get() == S->
getTryBlock() &&
7659 TryBlock.
get(), Handler.
get());
7662 template <
typename Derived>
7668 return getDerived().RebuildSEHFinallyStmt(S->
getFinallyLoc(), Block.
get());
7671 template <
typename Derived>
7681 return getDerived().RebuildSEHExceptStmt(S->
getExceptLoc(), FilterExpr.
get(),
7685 template <
typename Derived>
7687 if (isa<SEHFinallyStmt>(Handler))
7688 return getDerived().TransformSEHFinallyStmt(cast<SEHFinallyStmt>(Handler));
7690 return getDerived().TransformSEHExceptStmt(cast<SEHExceptStmt>(Handler));
7693 template<
typename Derived>
7702 template <
typename Derived>
7709 TClauses.reserve(Clauses.size());
7713 getDerived().getSema().StartOpenMPClause((*I)->getClauseKind());
7714 OMPClause *Clause = getDerived().TransformOMPClause(*I);
7715 getDerived().getSema().EndOpenMPClause();
7717 TClauses.push_back(Clause);
7719 TClauses.push_back(
nullptr);
7730 Body = getDerived().TransformStmt(CS);
7733 getDerived().getSema().ActOnOpenMPRegionEnd(Body, TClauses);
7738 if (TClauses.size() != Clauses.size()) {
7745 DirName = cast<OMPCriticalDirective>(D)->getDirectiveName();
7746 DirName = getDerived().TransformDeclarationNameInfo(DirName);
7750 CancelRegion = cast<OMPCancellationPointDirective>(D)->getCancelRegion();
7752 CancelRegion = cast<OMPCancelDirective>(D)->getCancelRegion();
7755 return getDerived().RebuildOMPExecutableDirective(
7760 template <
typename Derived>
7764 getDerived().getSema().StartOpenMPDSABlock(OMPD_parallel, DirName,
nullptr,
7766 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7767 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7771 template <
typename Derived>
7775 getDerived().getSema().StartOpenMPDSABlock(OMPD_simd, DirName,
nullptr,
7777 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7778 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7782 template <
typename Derived>
7786 getDerived().getSema().StartOpenMPDSABlock(OMPD_for, DirName,
nullptr,
7788 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7789 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7793 template <
typename Derived>
7797 getDerived().getSema().StartOpenMPDSABlock(OMPD_for_simd, DirName,
nullptr,
7799 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7800 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7804 template <
typename Derived>
7808 getDerived().getSema().StartOpenMPDSABlock(OMPD_sections, DirName,
nullptr,
7810 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7811 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7815 template <
typename Derived>
7819 getDerived().getSema().StartOpenMPDSABlock(OMPD_section, DirName,
nullptr,
7821 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7822 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7826 template <
typename Derived>
7830 getDerived().getSema().StartOpenMPDSABlock(OMPD_single, DirName,
nullptr,
7832 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7833 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7837 template <
typename Derived>
7841 getDerived().getSema().StartOpenMPDSABlock(OMPD_master, DirName,
nullptr,
7843 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7844 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7848 template <
typename Derived>
7853 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7854 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7858 template <
typename Derived>
7862 getDerived().getSema().StartOpenMPDSABlock(OMPD_parallel_for, DirName,
7864 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7865 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7869 template <
typename Derived>
7873 getDerived().getSema().StartOpenMPDSABlock(OMPD_parallel_for_simd, DirName,
7875 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7876 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7880 template <
typename Derived>
7884 getDerived().getSema().StartOpenMPDSABlock(OMPD_parallel_sections, DirName,
7886 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7887 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7891 template <
typename Derived>
7895 getDerived().getSema().StartOpenMPDSABlock(OMPD_task, DirName,
nullptr,
7897 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7898 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7902 template <
typename Derived>
7906 getDerived().getSema().StartOpenMPDSABlock(OMPD_taskyield, DirName,
nullptr,
7908 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7909 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7913 template <
typename Derived>
7917 getDerived().getSema().StartOpenMPDSABlock(OMPD_barrier, DirName,
nullptr,
7919 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7920 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7924 template <
typename Derived>
7928 getDerived().getSema().StartOpenMPDSABlock(OMPD_taskwait, DirName,
nullptr,
7930 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7931 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7935 template <
typename Derived>
7939 getDerived().getSema().StartOpenMPDSABlock(OMPD_taskgroup, DirName,
nullptr,
7941 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7942 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7946 template <
typename Derived>
7950 getDerived().getSema().StartOpenMPDSABlock(OMPD_flush, DirName,
nullptr,
7952 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7953 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7957 template <
typename Derived>
7961 getDerived().getSema().StartOpenMPDSABlock(OMPD_ordered, DirName,
nullptr,
7963 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7964 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7968 template <
typename Derived>
7972 getDerived().getSema().StartOpenMPDSABlock(OMPD_atomic, DirName,
nullptr,
7974 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7975 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7979 template <
typename Derived>
7983 getDerived().getSema().StartOpenMPDSABlock(OMPD_target, DirName,
nullptr,
7985 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7986 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
7990 template <
typename Derived>
7994 getDerived().getSema().StartOpenMPDSABlock(OMPD_target_data, DirName,
nullptr,
7996 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
7997 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8001 template <
typename Derived>
8005 getDerived().getSema().StartOpenMPDSABlock(OMPD_target_enter_data, DirName,
8007 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8008 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8012 template <
typename Derived>
8016 getDerived().getSema().StartOpenMPDSABlock(OMPD_target_exit_data, DirName,
8018 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8019 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8023 template <
typename Derived>
8027 getDerived().getSema().StartOpenMPDSABlock(OMPD_target_parallel, DirName,
8029 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8030 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8034 template <
typename Derived>
8038 getDerived().getSema().StartOpenMPDSABlock(OMPD_target_parallel_for, DirName,
8040 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8041 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8045 template <
typename Derived>
8049 getDerived().getSema().StartOpenMPDSABlock(OMPD_target_update, DirName,
8051 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8052 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8056 template <
typename Derived>
8060 getDerived().getSema().StartOpenMPDSABlock(OMPD_teams, DirName,
nullptr,
8062 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8063 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8067 template <
typename Derived>
8071 getDerived().getSema().StartOpenMPDSABlock(OMPD_cancellation_point, DirName,
8073 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8074 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8078 template <
typename Derived>
8082 getDerived().getSema().StartOpenMPDSABlock(OMPD_cancel, DirName,
nullptr,
8084 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8085 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8089 template <
typename Derived>
8093 getDerived().getSema().StartOpenMPDSABlock(OMPD_taskloop, DirName,
nullptr,
8095 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8096 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8100 template <
typename Derived>
8104 getDerived().getSema().StartOpenMPDSABlock(OMPD_taskloop_simd, DirName,
8106 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8107 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8111 template <
typename Derived>
8115 getDerived().getSema().StartOpenMPDSABlock(OMPD_distribute, DirName,
nullptr,
8117 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8118 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8122 template <
typename Derived>
8126 getDerived().getSema().StartOpenMPDSABlock(
8127 OMPD_distribute_parallel_for, DirName,
nullptr, D->
getBeginLoc());
8128 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8129 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8133 template <
typename Derived>
8138 getDerived().getSema().StartOpenMPDSABlock(
8139 OMPD_distribute_parallel_for_simd, DirName,
nullptr, D->
getBeginLoc());
8140 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8141 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8145 template <
typename Derived>
8149 getDerived().getSema().StartOpenMPDSABlock(OMPD_distribute_simd, DirName,
8151 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8152 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8156 template <
typename Derived>
8160 getDerived().getSema().StartOpenMPDSABlock(
8161 OMPD_target_parallel_for_simd, DirName,
nullptr, D->
getBeginLoc());
8162 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8163 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8167 template <
typename Derived>
8171 getDerived().getSema().StartOpenMPDSABlock(OMPD_target_simd, DirName,
nullptr,
8173 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8174 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8178 template <
typename Derived>
8182 getDerived().getSema().StartOpenMPDSABlock(OMPD_teams_distribute, DirName,
8184 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8185 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8189 template <
typename Derived>
8193 getDerived().getSema().StartOpenMPDSABlock(
8194 OMPD_teams_distribute_simd, DirName,
nullptr, D->
getBeginLoc());
8195 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8196 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8200 template <
typename Derived>
8204 getDerived().getSema().StartOpenMPDSABlock(
8205 OMPD_teams_distribute_parallel_for_simd, DirName,
nullptr,
8207 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8208 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8212 template <
typename Derived>
8216 getDerived().getSema().StartOpenMPDSABlock(
8217 OMPD_teams_distribute_parallel_for, DirName,
nullptr, D->
getBeginLoc());
8218 StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
8219 getDerived().getSema().EndOpenMPDSABlock(Res.
get());
8223 template <
typename Derived>
8227 getDerived().getSema().StartOpenMPDSABlock(OMPD_target_teams, DirName,
8229 auto Res = getDerived().TransformOMPExecutableDirective(D);
8230 getDerived().getSema().EndOpenMPDSABlock(Res.get());
8234 template <
typename Derived>
8238 getDerived().getSema().StartOpenMPDSABlock(
8239 OMPD_target_teams_distribute, DirName,
nullptr, D->
getBeginLoc());
8240 auto Res = getDerived().TransformOMPExecutableDirective(D);
8241 getDerived().getSema().EndOpenMPDSABlock(Res.get());
8245 template <
typename Derived>
8250 getDerived().getSema().StartOpenMPDSABlock(
8251 OMPD_target_teams_distribute_parallel_for, DirName,
nullptr,
8253 auto Res = getDerived().TransformOMPExecutableDirective(D);
8254 getDerived().getSema().EndOpenMPDSABlock(Res.get());
8258 template <
typename Derived>
8263 getDerived().getSema().StartOpenMPDSABlock(
8264 OMPD_target_teams_distribute_parallel_for_simd, DirName,
nullptr,
8266 auto Res = getDerived().TransformOMPExecutableDirective(D);
8267 getDerived().getSema().EndOpenMPDSABlock(Res.get());
8271 template <
typename Derived>
8276 getDerived().getSema().StartOpenMPDSABlock(
8277 OMPD_target_teams_distribute_simd, DirName,
nullptr, D->
getBeginLoc());
8278 auto Res = getDerived().TransformOMPExecutableDirective(D);
8279 getDerived().getSema().EndOpenMPDSABlock(Res.get());
8287 template <
typename Derived>
8292 return getDerived().RebuildOMPIfClause(
8297 template <
typename Derived>
8302 return getDerived().RebuildOMPFinalClause(Cond.
get(), C->
getBeginLoc(),
8306 template <
typename Derived>
8312 return getDerived().RebuildOMPNumThreadsClause(
8316 template <
typename Derived>
8322 return getDerived().RebuildOMPSafelenClause(
8326 template <
typename Derived>
8332 return getDerived().RebuildOMPSimdlenClause(
8336 template <
typename Derived>
8342 return getDerived().RebuildOMPCollapseClause(
8346 template <
typename Derived>
8354 template <
typename Derived>
8362 template <
typename Derived>
8368 return getDerived().RebuildOMPScheduleClause(
8375 template <
typename Derived>
8380 E = getDerived().TransformExpr(Num);
8388 template <
typename Derived>
8395 template <
typename Derived>
8402 template <
typename Derived>
8409 template <
typename Derived>
8415 template <
typename Derived>
8421 template <
typename Derived>
8428 template <
typename Derived>
8435 template <
typename Derived>
8442 template <
typename Derived>
8449 template <
typename Derived>
8455 template <
typename Derived>
8462 template <
typename Derived>
8465 llvm_unreachable(
"unified_address clause cannot appear in dependent context");
8468 template <
typename Derived>
8472 "unified_shared_memory clause cannot appear in dependent context");
8475 template <
typename Derived>
8478 llvm_unreachable(
"reverse_offload clause cannot appear in dependent context");
8481 template <
typename Derived>
8485 "dynamic_allocators clause cannot appear in dependent context");
8488 template <
typename Derived>
8492 "atomic_default_mem_order clause cannot appear in dependent context");
8495 template <
typename Derived>
8501 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8504 Vars.push_back(EVar.
get());
8506 return getDerived().RebuildOMPPrivateClause(
8510 template <
typename Derived>
8516 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8519 Vars.push_back(EVar.
get());
8521 return getDerived().RebuildOMPFirstprivateClause(
8525 template <
typename Derived>
8531 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8534 Vars.push_back(EVar.
get());
8536 return getDerived().RebuildOMPLastprivateClause(
8540 template <
typename Derived>
8546 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8549 Vars.push_back(EVar.
get());
8551 return getDerived().RebuildOMPSharedClause(Vars, C->
getBeginLoc(),
8555 template <
typename Derived>
8561 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8564 Vars.push_back(EVar.
get());
8571 NameInfo = getDerived().TransformDeclarationNameInfo(NameInfo);
8581 auto *ULE = cast<UnresolvedLookupExpr>(E);
8583 for (
auto *D : ULE->decls()) {
8585 cast<NamedDecl>(getDerived().TransformDecl(E->
getExprLoc(), D));
8586 Decls.addDecl(InstD, InstD->
getAccess());
8588 UnresolvedReductions.push_back(
8590 SemaRef.Context,
nullptr,
8592 NameInfo,
true, ULE->isOverloaded(),
8593 Decls.begin(), Decls.end()));
8595 UnresolvedReductions.push_back(
nullptr);
8597 return getDerived().RebuildOMPReductionClause(
8599 C->
getEndLoc(), ReductionIdScopeSpec, NameInfo, UnresolvedReductions);
8602 template <
typename Derived>
8608 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8611 Vars.push_back(EVar.
get());
8618 NameInfo = getDerived().TransformDeclarationNameInfo(NameInfo);
8628 auto *ULE = cast<UnresolvedLookupExpr>(E);
8630 for (
auto *D : ULE->decls()) {
8632 cast<NamedDecl>(getDerived().TransformDecl(E->
getExprLoc(), D));
8633 Decls.addDecl(InstD, InstD->
getAccess());
8636 SemaRef.Context,
nullptr,
8638 true, ULE->isOverloaded(), Decls.begin(), Decls.end()));
8640 UnresolvedReductions.push_back(
nullptr);
8642 return getDerived().RebuildOMPTaskReductionClause(
8644 C->
getEndLoc(), ReductionIdScopeSpec, NameInfo, UnresolvedReductions);
8647 template <
typename Derived>
8653 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8656 Vars.push_back(EVar.
get());
8663 NameInfo = getDerived().TransformDeclarationNameInfo(NameInfo);
8673 auto *ULE = cast<UnresolvedLookupExpr>(E);
8675 for (
auto *D : ULE->decls()) {
8677 cast<NamedDecl>(getDerived().TransformDecl(E->
getExprLoc(), D));
8678 Decls.addDecl(InstD, InstD->
getAccess());
8681 SemaRef.Context,
nullptr,
8683 true, ULE->isOverloaded(), Decls.begin(), Decls.end()));
8685 UnresolvedReductions.push_back(
nullptr);
8687 return getDerived().RebuildOMPInReductionClause(
8689 C->
getEndLoc(), ReductionIdScopeSpec, NameInfo, UnresolvedReductions);
8692 template <
typename Derived>
8698 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8701 Vars.push_back(EVar.
get());
8706 return getDerived().RebuildOMPLinearClause(
8708 C->getModifierLoc(), C->getColonLoc(), C->
getEndLoc());
8711 template <
typename Derived>
8715 Vars.reserve(C->varlist_size());
8716 for (
auto *VE : C->varlists()) {
8717 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8720 Vars.push_back(EVar.
get());
8725 return getDerived().RebuildOMPAlignedClause(
8726 Vars, Alignment.
get(), C->getBeginLoc(), C->getLParenLoc(),
8730 template <
typename Derived>
8734 Vars.reserve(C->varlist_size());
8735 for (
auto *VE : C->varlists()) {
8736 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8739 Vars.push_back(EVar.
get());
8741 return getDerived().RebuildOMPCopyinClause(Vars, C->getBeginLoc(),
8742 C->getLParenLoc(), C->getEndLoc());
8745 template <
typename Derived>
8749 Vars.reserve(C->varlist_size());
8750 for (
auto *VE : C->varlists()) {
8751 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8754 Vars.push_back(EVar.
get());
8756 return getDerived().RebuildOMPCopyprivateClause(
8757 Vars, C->getBeginLoc(), C->getLParenLoc(), C->getEndLoc());
8760 template <
typename Derived>
8763 Vars.reserve(C->varlist_size());
8764 for (
auto *VE : C->varlists()) {
8765 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8768 Vars.push_back(EVar.
get());
8770 return getDerived().RebuildOMPFlushClause(Vars, C->getBeginLoc(),
8771 C->getLParenLoc(), C->getEndLoc());
8774 template <
typename Derived>
8778 Vars.reserve(C->varlist_size());
8779 for (
auto *VE : C->varlists()) {
8780 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8783 Vars.push_back(EVar.
get());
8785 return getDerived().RebuildOMPDependClause(
8787 C->getBeginLoc(), C->getLParenLoc(), C->getEndLoc());
8790 template <
typename Derived>
8796 return getDerived().RebuildOMPDeviceClause(E.
get(), C->getBeginLoc(),
8800 template <
typename Derived>
8803 Vars.reserve(C->varlist_size());
8804 for (
auto *VE : C->varlists()) {
8805 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8808 Vars.push_back(EVar.
get());
8810 return getDerived().RebuildOMPMapClause(
8813 C->getBeginLoc(), C->getLParenLoc(), C->getEndLoc());
8816 template <
typename Derived>
8822 return getDerived().RebuildOMPNumTeamsClause(
8826 template <
typename Derived>
8832 return getDerived().RebuildOMPThreadLimitClause(
8836 template <
typename Derived>
8842 return getDerived().RebuildOMPPriorityClause(
8846 template <
typename Derived>
8852 return getDerived().RebuildOMPGrainsizeClause(
8856 template <
typename Derived>
8862 return getDerived().RebuildOMPNumTasksClause(
8866 template <
typename Derived>
8871 return getDerived().RebuildOMPHintClause(E.
get(), C->getBeginLoc(),
8875 template <
typename Derived>
8881 return getDerived().RebuildOMPDistScheduleClause(
8886 template <
typename Derived>
8892 template <
typename Derived>
8895 Vars.reserve(C->varlist_size());
8896 for (
auto *VE : C->varlists()) {
8897 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8900 Vars.push_back(EVar.
get());
8902 return getDerived().RebuildOMPToClause(Vars, C->getBeginLoc(),
8903 C->getLParenLoc(), C->getEndLoc());
8906 template <
typename Derived>
8909 Vars.reserve(C->varlist_size());
8910 for (
auto *VE : C->varlists()) {
8911 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8914 Vars.push_back(EVar.
get());
8916 return getDerived().RebuildOMPFromClause(Vars, C->getBeginLoc(),
8917 C->getLParenLoc(), C->getEndLoc());
8920 template <
typename Derived>
8924 Vars.reserve(C->varlist_size());
8925 for (
auto *VE : C->varlists()) {
8926 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8929 Vars.push_back(EVar.
get());
8931 return getDerived().RebuildOMPUseDevicePtrClause(
8932 Vars, C->getBeginLoc(), C->getLParenLoc(), C->getEndLoc());
8935 template <
typename Derived>
8939 Vars.reserve(C->varlist_size());
8940 for (
auto *VE : C->varlists()) {
8941 ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
8944 Vars.push_back(EVar.
get());
8946 return getDerived().RebuildOMPIsDevicePtrClause(
8947 Vars, C->getBeginLoc(), C->getLParenLoc(), C->getEndLoc());
8953 template<
typename Derived>
8959 template<
typename Derived>
8965 return getDerived().RebuildPredefinedExpr(E->
getLocation(),
8969 template<
typename Derived>
8981 = cast_or_null<ValueDecl>(getDerived().TransformDecl(E->
getLocation(),
8988 NameInfo = getDerived().TransformDeclarationNameInfo(NameInfo);
8993 if (!getDerived().AlwaysRebuild() &&
9001 SemaRef.MarkDeclRefReferenced(E);
9008 TemplateArgs = &TransArgs;
9017 return getDerived().RebuildDeclRefExpr(QualifierLoc, ND, NameInfo,
9021 template<
typename Derived>
9027 template <
typename Derived>
9033 template<
typename Derived>
9039 template<
typename Derived>
9045 template<
typename Derived>
9051 template<
typename Derived>
9057 template<
typename Derived>
9061 SemaRef.MarkFunctionReferenced(E->
getBeginLoc(), FD);
9062 return SemaRef.MaybeBindToTemporary(E);
9065 template<
typename Derived>
9081 AssocTypes.push_back(AssocType);
9083 AssocTypes.push_back(
nullptr);
9089 AssocExprs.push_back(AssocExpr.
get());
9092 return getDerived().RebuildGenericSelectionExpr(E->
getGenericLoc(),
9095 ControllingExpr.
get(),
9100 template<
typename Derived>
9107 if (!getDerived().AlwaysRebuild() && SubExpr.
get() == E->
getSubExpr())
9110 return getDerived().RebuildParenExpr(SubExpr.
get(), E->
getLParen(),
9117 template<
typename Derived>
9121 return getDerived().TransformDependentScopeDeclRefExpr(DRE,
true,
nullptr);
9123 return getDerived().TransformExpr(E);
9126 template<
typename Derived>
9131 SubExpr = TransformAddressOfOperand(E->
getSubExpr());
9137 if (!getDerived().AlwaysRebuild() && SubExpr.
get() == E->
getSubExpr())
9145 template<
typename Derived>
9159 bool ExprChanged =
false;
9165 Comp.isBrackets =
true;
9171 ExprResult Index = getDerived().TransformExpr(FromIndex);
9175 ExprChanged = ExprChanged || Index.
get() != FromIndex;
9176 Comp.isBrackets =
true;
9177 Comp.U.E = Index.
get();
9183 Comp.isBrackets =
false;
9185 if (!Comp.U.IdentInfo)
9195 Components.push_back(Comp);
9199 if (!getDerived().AlwaysRebuild() &&
9205 return getDerived().RebuildOffsetOfExpr(E->
getOperatorLoc(), Type,
9209 template<
typename Derived>
9213 "opaque value expression requires transformation");
9217 template<
typename Derived>
9223 template<
typename Derived>
9232 Expr *newSyntacticForm = SemaRef.recreateSyntacticForm(E);
9233 ExprResult result = getDerived().TransformExpr(newSyntacticForm);
9239 if (result.
get()->hasPlaceholderType(BuiltinType::PseudoObject))
9240 result = SemaRef.checkPseudoObjectRValue(result.
get());
9245 template<
typename Derived>
9256 if (!getDerived().AlwaysRebuild() && OldT == NewT)
9259 return getDerived().RebuildUnaryExprOrTypeTrait(NewT, E->
getOperatorLoc(),
9277 PE ? dyn_cast<DependentScopeDeclRefExpr>(PE->getSubExpr()) :
nullptr)
9278 SubExpr = getDerived().TransformParenDependentScopeDeclRefExpr(
9279 PE, DRE,
false, &RecoveryTSI);
9284 return getDerived().RebuildUnaryExprOrTypeTrait(
9292 return getDerived().RebuildUnaryExprOrTypeTrait(SubExpr.
get(),
9298 template<
typename Derived>
9310 if (!getDerived().AlwaysRebuild() &&
9315 return getDerived().RebuildArraySubscriptExpr(
9320 template <
typename Derived>
9329 LowerBound = getDerived().TransformExpr(E->
getLowerBound());
9336 Length = getDerived().TransformExpr(E->
getLength());
9341 if (!getDerived().AlwaysRebuild() && Base.
get() == E->
getBase() &&
9345 return getDerived().RebuildOMPArraySectionExpr(
9350 template<
typename Derived>
9359 bool ArgChanged =
false;
9365 if (!getDerived().AlwaysRebuild() &&
9368 return SemaRef.MaybeBindToTemporary(E);
9373 return getDerived().RebuildCallExpr(Callee.
get(), FakeLParenLoc,
9378 template<
typename Derived>
9396 = cast_or_null<ValueDecl>(getDerived().TransformDecl(E->
getMemberLoc(),
9405 FoundDecl = cast_or_null<NamedDecl>(
9406 getDerived().TransformDecl(E->
getMemberLoc(), FoundDecl));
9411 if (!getDerived().AlwaysRebuild() &&
9420 SemaRef.MarkMemberReferenced(E);
9443 NamedDecl *FirstQualifierInScope =
nullptr;
9445 if (MemberNameInfo.
getName()) {
9446 MemberNameInfo = getDerived().TransformDeclarationNameInfo(MemberNameInfo);
9447 if (!MemberNameInfo.
getName())
9451 return getDerived().RebuildMemberExpr(Base.
get(), FakeOperatorLoc,
9459 ? &TransArgs :
nullptr),
9460 FirstQualifierInScope);
9463 template<
typename Derived>
9474 if (!getDerived().AlwaysRebuild() &&
9486 template<
typename Derived>
9490 return getDerived().TransformBinaryOperator(E);
9493 template<
typename Derived>
9507 if (!getDerived().AlwaysRebuild() &&
9512 return getDerived().RebuildConditionalOperator(commonExpr.
get(),
9519 template<
typename Derived>
9534 if (!getDerived().AlwaysRebuild() &&
9540 return getDerived().RebuildConditionalOperator(Cond.
get(),
9547 template<
typename Derived>
9555 template<
typename Derived>
9567 if (!getDerived().AlwaysRebuild() &&
9572 return getDerived().RebuildCStyleCastExpr(E->
getLParenLoc(),
9578 template<
typename Derived>
9590 if (!getDerived().AlwaysRebuild() &&
9593 return SemaRef.MaybeBindToTemporary(E);
9599 return getDerived().RebuildCompoundLiteralExpr(
9604 template<
typename Derived>
9611 if (!getDerived().AlwaysRebuild() &&
9618 return getDerived().RebuildExtVectorElementExpr(Base.
get(), FakeOperatorLoc,
9623 template<
typename Derived>
9629 bool InitChanged =
false;
9636 Inits, &InitChanged))
9639 if (!getDerived().AlwaysRebuild() && !InitChanged) {
9650 template<
typename Derived>
9662 bool ExprChanged =
false;
9664 if (D.isFieldDesignator()) {
9669 FieldDecl *Field = cast_or_null<FieldDecl>(
9670 getDerived().TransformDecl(D.getFieldLoc(), D.getField()));
9671 if (Field != D.getField())
9684 if (D.isArrayDesignator()) {
9693 ArrayExprs.push_back(Index.
get());
9697 assert(D.isArrayRangeDesignator() &&
"New kind of designator?");
9700 if (Start.isInvalid())
9710 D.getEllipsisLoc()));
9715 ArrayExprs.push_back(Start.get());
9716 ArrayExprs.push_back(End.
get());
9719 if (!getDerived().AlwaysRebuild() &&
9724 return getDerived().RebuildDesignatedInitExpr(Desig, ArrayExprs,
9731 template<
typename Derived>
9735 llvm_unreachable(
"Unexpected DesignatedInitUpdateExpr in syntactic form of " 9740 template<
typename Derived>
9744 llvm_unreachable(
"Unexpected NoInitExpr in syntactic form of initializer");
9748 template<
typename Derived>
9751 llvm_unreachable(
"Unexpected ArrayInitLoopExpr outside of initializer");
9755 template<
typename Derived>
9758 llvm_unreachable(
"Unexpected ArrayInitIndexExpr outside of initializer");
9762 template<
typename Derived>
9774 if (!getDerived().AlwaysRebuild() &&
9778 return getDerived().RebuildImplicitValueInitExpr(T);
9781 template<
typename Derived>
9792 if (!getDerived().AlwaysRebuild() &&
9801 template<
typename Derived>
9804 bool ArgumentChanged =
false;
9810 return getDerived().RebuildParenListExpr(E->
getLParenLoc(),
9820 template<
typename Derived>
9829 cast<LabelDecl>(LD));
9832 template<
typename Derived>
9835 SemaRef.ActOnStartStmtExpr();
9837 = getDerived().TransformCompoundStmt(E->
getSubStmt(),
true);
9839 SemaRef.ActOnStmtExprError();
9843 if (!getDerived().AlwaysRebuild() &&
9846 SemaRef.ActOnStmtExprError();
9847 return SemaRef.MaybeBindToTemporary(E);
9855 template<
typename Derived>
9870 if (!getDerived().AlwaysRebuild() &&
9881 template<
typename Derived>
9887 template<
typename Derived>
9894 case OO_Array_Delete:
9895 llvm_unreachable(
"new and delete operators cannot use CXXOperatorCallExpr");
9899 assert(E->
getNumArgs() >= 1 &&
"Object call is missing arguments");
9903 if (Object.isInvalid())
9908 static_cast<Expr *>(Object.get())->getEndLoc());
9916 return getDerived().RebuildCallExpr(Object.get(), FakeLParenLoc, Args,
9920 #define OVERLOADED_OPERATOR(Name,Spelling,Token,Unary,Binary,MemberOnly) \ 9922 #define OVERLOADED_OPERATOR_MULTI(Name,Spelling,Unary,Binary,MemberOnly) 9923 #include "clang/Basic/OperatorKinds.def" 9928 case OO_Conditional:
9929 llvm_unreachable(
"conditional operator is not actually overloadable");
9933 llvm_unreachable(
"not an overloaded operator?");
9942 First = getDerived().TransformAddressOfOperand(E->
getArg(0));
9944 First = getDerived().TransformExpr(E->
getArg(0));
9950 Second = getDerived().TransformExpr(E->
getArg(1));
9955 if (!getDerived().AlwaysRebuild() &&
9959 return SemaRef.MaybeBindToTemporary(E);
9964 return getDerived().RebuildCXXOperatorCallExpr(E->
getOperator(),
9971 template<
typename Derived>
9974 return getDerived().TransformCallExpr(E);
9977 template<
typename Derived>
9991 bool ArgChanged =
false;
9997 if (!getDerived().AlwaysRebuild() &&
10000 return SemaRef.MaybeBindToTemporary(E);
10005 return getDerived().RebuildCallExpr(Callee.
get(), FakeLParenLoc,
10010 template<
typename Derived>
10022 if (!getDerived().AlwaysRebuild() &&
10026 return getDerived().RebuildCXXNamedCastExpr(
10033 template<
typename Derived>
10039 template<
typename Derived>
10045 template<
typename Derived>
10052 template<
typename Derived>
10058 template<
typename Derived>
10072 if (!getDerived().AlwaysRebuild() &&
10077 return getDerived().RebuildCXXFunctionalCastExpr(Type,
10084 template<
typename Derived>
10093 if (!getDerived().AlwaysRebuild() &&
10113 if (!getDerived().AlwaysRebuild() &&
10121 template<
typename Derived>
10130 if (!getDerived().AlwaysRebuild() &&
10145 if (!getDerived().AlwaysRebuild() &&
10153 template<
typename Derived>
10159 template<
typename Derived>
10166 template<
typename Derived>
10169 QualType T = getSema().getCurrentThisType();
10171 if (!getDerived().AlwaysRebuild() && T == E->
getType()) {
10180 template<
typename Derived>
10187 if (!getDerived().AlwaysRebuild() &&
10191 return getDerived().RebuildCXXThrowExpr(E->
getThrowLoc(), SubExpr.
get(),
10195 template<
typename Derived>
10203 if (!getDerived().AlwaysRebuild() &&
10207 return getDerived().RebuildCXXDefaultArgExpr(E->
getUsedLocation(), Param);
10210 template<
typename Derived>
10213 FieldDecl *Field = cast_or_null<FieldDecl>(
10218 if (!getDerived().AlwaysRebuild() && Field == E->
getField())
10221 return getDerived().RebuildCXXDefaultInitExpr(E->
getExprLoc(), Field);
10224 template<
typename Derived>
10232 if (!getDerived().AlwaysRebuild() &&
10236 return getDerived().RebuildCXXScalarValueInitExpr(T,
10241 template<
typename Derived>
10247 if (!AllocTypeInfo)
10256 bool ArgumentChanged =
false;
10260 PlacementArgs, &ArgumentChanged))
10267 NewInit = getDerived().TransformInitializer(OldInit,
true);
10274 OperatorNew = cast_or_null<FunctionDecl>(
10282 OperatorDelete = cast_or_null<FunctionDecl>(
10284 if (!OperatorDelete)
10288 if (!getDerived().AlwaysRebuild() &&
10291 NewInit.
get() == OldInit &&
10294 !ArgumentChanged) {
10298 SemaRef.MarkFunctionReferenced(E->
getBeginLoc(), OperatorNew);
10299 if (OperatorDelete)
10300 SemaRef.MarkFunctionReferenced(E->
getBeginLoc(), OperatorDelete);
10306 CXXRecordDecl *Record = cast<CXXRecordDecl>(RecordT->getDecl());
10308 SemaRef.MarkFunctionReferenced(E->
getBeginLoc(), Destructor);
10317 if (!ArraySize.
get()) {
10323 const ArrayType *ArrayT = SemaRef.Context.getAsArrayType(AllocType);
10327 = dyn_cast<ConstantArrayType>(ArrayT)) {
10329 SemaRef.Context.getSizeType(),
10331 AllocType = ConsArrayT->getElementType();
10333 = dyn_cast<DependentSizedArrayType>(ArrayT)) {
10334 if (DepArrayT->getSizeExpr()) {
10335 ArraySize = DepArrayT->getSizeExpr();
10336 AllocType = DepArrayT->getElementType();
10341 return getDerived().RebuildCXXNewExpr(
10348 template<
typename Derived>
10358 OperatorDelete = cast_or_null<FunctionDecl>(
10360 if (!OperatorDelete)
10364 if (!getDerived().AlwaysRebuild() &&
10369 if (OperatorDelete)
10370 SemaRef.MarkFunctionReferenced(E->
getBeginLoc(), OperatorDelete);
10373 QualType Destroyed = SemaRef.Context.getBaseElementType(
10376 CXXRecordDecl *Record = cast<CXXRecordDecl>(DestroyedRec->getDecl());
10378 SemaRef.LookupDestructor(Record));
10385 return getDerived().RebuildCXXDeleteExpr(
10389 template<
typename Derived>
10398 bool MayBePseudoDestructor =
false;
10399 Base = SemaRef.ActOnStartCXXMemberReference(
nullptr, Base.
get(),
10401 E->
isArrow()? tok::arrow : tok::period,
10403 MayBePseudoDestructor);
10407 QualType ObjectType = ObjectTypePtr.get();
10409 if (QualifierLoc) {
10411 = getDerived().TransformNestedNameSpecifierLoc(QualifierLoc, ObjectType);
10416 SS.
Adopt(QualifierLoc);
10422 ObjectType,
nullptr, SS);
10423 if (!DestroyedTypeInfo)
10425 Destroyed = DestroyedTypeInfo;
10443 = SemaRef.Context.getTrivialTypeSourceInfo(SemaRef.GetTypeFromParser(T),
10450 ScopeTypeInfo = getDerived().TransformTypeInObjectScope(
10452 if (!ScopeTypeInfo)
10456 return getDerived().RebuildCXXPseudoDestructorExpr(Base.
get(),
10466 template <
typename Derived>
10471 bool AllEmptyPacks =
true;
10472 for (
auto *OldD : Old->
decls()) {
10473 Decl *InstD = getDerived().TransformDecl(Old->
getNameLoc(), OldD);
10477 if (isa<UsingShadowDecl>(OldD))
10486 NamedDecl *SingleDecl = cast<NamedDecl>(InstD);
10488 if (
auto *UPD = dyn_cast<UsingPackDecl>(InstD))
10489 Decls = UPD->expansions();
10492 for (
auto *D : Decls) {
10493 if (
auto *UD = dyn_cast<UsingDecl>(D)) {
10494 for (
auto *SD : UD->shadows())
10501 AllEmptyPacks &= Decls.empty();
10510 if (AllEmptyPacks && !RequiresADL) {
10511 getSema().Diag(Old->
getNameLoc(), diag::err_using_pack_expansion_empty)
10512 << isa<UnresolvedMemberExpr>(Old) << Old->
getName();
10522 template<
typename Derived>
10530 if (TransformOverloadExprDecls(Old, Old->
requiresADL(), R))
10537 = getDerived().TransformNestedNameSpecifierLoc(Old->
getQualifierLoc());
10541 SS.
Adopt(QualifierLoc);
10546 = cast_or_null<CXXRecordDecl>(getDerived().TransformDecl(
10549 if (!NamingClass) {
10554 R.setNamingClass(NamingClass);
10567 return SemaRef.BuildPossibleImplicitMemberExpr(SS, TemplateKWLoc, R,
10572 return getDerived().RebuildDeclarationNameExpr(SS, R, Old->
requiresADL());
10586 return getDerived().RebuildTemplateIdExpr(SS, TemplateKWLoc, R,
10590 template<
typename Derived>
10593 bool ArgChanged =
false;
10595 for (
unsigned I = 0, N = E->
getNumArgs(); I != N; ++I) {
10601 QualType To = getDerived().TransformType(TLB, FromTL);
10606 Args.push_back(From);
10620 SemaRef.collectUnexpandedParameterPacks(PatternTL, Unexpanded);
10624 bool Expand =
true;
10625 bool RetainExpansion =
false;
10629 if (getDerived().TryExpandParameterPacks(ExpansionTL.
getEllipsisLoc(),
10630 PatternTL.getSourceRange(),
10632 Expand, RetainExpansion,
10645 QualType To = getDerived().TransformType(TLB, PatternTL);
10649 To = getDerived().RebuildPackExpansionType(To,
10650 PatternTL.getSourceRange(),
10665 for (
unsigned I = 0; I != *NumExpansions; ++I) {
10668 TLB.
reserve(PatternTL.getFullDataSize());
10669 QualType To = getDerived().TransformType(TLB, PatternTL);
10674 To = getDerived().RebuildPackExpansionType(To,
10675 PatternTL.getSourceRange(),
10689 if (!RetainExpansion)
10694 ForgetPartiallySubstitutedPackRAII Forget(getDerived());
10699 QualType To = getDerived().TransformType(TLB, PatternTL);
10703 To = getDerived().RebuildPackExpansionType(To,
10704 PatternTL.getSourceRange(),
10716 if (!getDerived().AlwaysRebuild() && !ArgChanged)
10723 template<
typename Derived>
10730 if (!getDerived().AlwaysRebuild() &&
10750 template<
typename Derived>
10769 template <
typename Derived>
10773 ExprResult NewDRE = getDerived().TransformDependentScopeDeclRefExpr(
10774 DRE, AddrTaken, RecoveryTSI);
10781 if (!getDerived().AlwaysRebuild() && NewDRE.
get() == DRE)
10783 return getDerived().RebuildParenExpr(NewDRE.
get(), PE->
getLParen(),
10787 template <
typename Derived>
10790 return TransformDependentScopeDeclRefExpr(E,
false,
10794 template<
typename Derived>
10798 bool IsAddressOfOperand,
10802 = getDerived().TransformNestedNameSpecifierLoc(E->
getQualifierLoc());
10812 = getDerived().TransformDeclarationNameInfo(E->
getNameInfo());
10817 if (!getDerived().AlwaysRebuild() &&
10824 return getDerived().RebuildDependentScopeDeclRefExpr(
10825 QualifierLoc, TemplateKWLoc, NameInfo,
nullptr,
10826 IsAddressOfOperand, RecoveryTSI);
10835 return getDerived().RebuildDependentScopeDeclRefExpr(
10836 QualifierLoc, TemplateKWLoc, NameInfo, &TransArgs, IsAddressOfOperand,
10840 template<
typename Derived>
10848 (!getDerived().DropCallArgument(E->
getArg(0))) &&
10863 bool ArgumentChanged =
false;
10874 if (!getDerived().AlwaysRebuild() &&
10877 !ArgumentChanged) {
10880 SemaRef.MarkFunctionReferenced(E->
getBeginLoc(), Constructor);
10884 return getDerived().RebuildCXXConstructExpr(
10891 template<
typename Derived>
10903 if (!getDerived().AlwaysRebuild() &&
10908 SemaRef.MarkFunctionReferenced(E->
getBeginLoc(), Constructor);
10912 return getDerived().RebuildCXXInheritedCtorInitExpr(
10921 template<
typename Derived>
10932 template<
typename Derived>
10938 template<
typename Derived>
10952 bool ArgumentChanged =
false;
10964 if (!getDerived().AlwaysRebuild() &&
10967 !ArgumentChanged) {
10969 SemaRef.MarkFunctionReferenced(E->
getBeginLoc(), Constructor);
10970 return SemaRef.MaybeBindToTemporary(E);
10976 return getDerived().RebuildCXXTemporaryObjectExpr(
10981 template<
typename Derived>
10986 typedef std::pair<ExprResult, QualType> InitCaptureInfoTy;
10997 ExprResult NewExprInitResult = getDerived().TransformInitializer(
10998 C->getCapturedVar()->getInit(),
11003 Expr *NewExprInit = NewExprInitResult.
get();
11005 VarDecl *OldVD = C->getCapturedVar();
11007 getSema().buildLambdaInitCaptureInitialization(
11010 C->getCapturedVar()->getInitStyle() !=
VarDecl::CInit, NewExprInit);
11011 NewExprInitResult = NewExprInit;
11013 std::make_pair(NewExprInitResult, NewInitCaptureType);
11018 auto TPL = getDerived().TransformTemplateParameterList(
11034 QualType NewCallOpType = TransformFunctionProtoType(
11035 NewCallOpTLBuilder, OldCallOpFPTL,
nullptr,
Qualifiers(),
11038 ExceptionStorage, Changed);
11040 if (NewCallOpType.
isNull())
11042 NewCallOpTSI = NewCallOpTLBuilder.getTypeSourceInfo(getSema().Context,
11059 CXXMethodDecl *NewCallOperator = getSema().startLambdaDefinition(
11067 for (
unsigned I = 0, NumParams = NewCallOperator->
getNumParams();
11068 I != NumParams; ++I) {
11070 if (
P->hasUninstantiatedDefaultArg()) {
11076 P->setDefaultArg(R.
get());
11081 getDerived().transformedLocalDecl(E->
getCallOperator(), NewCallOperator);
11088 getSema().buildLambdaScope(LSI, NewCallOperator,
11096 bool Invalid =
false;
11099 bool FinishedExplicitCaptures =
false;
11105 if (!FinishedExplicitCaptures && C->isImplicit()) {
11106 getSema().finishLambdaExplicitCaptures(LSI);
11107 FinishedExplicitCaptures =
true;
11111 if (C->capturesThis()) {
11112 getSema().CheckCXXThisCapture(C->getLocation(), C->isExplicit(),
11119 if (C->capturesVLAType())
11124 InitCaptureInfoTy InitExprTypePair =
11127 QualType InitQualType = InitExprTypePair.second;
11132 VarDecl *OldVD = C->getCapturedVar();
11133 VarDecl *NewVD = getSema().createLambdaInitCaptureVarDecl(
11139 getDerived().transformedLocalDecl(OldVD, NewVD);
11141 getSema().buildInitCaptureField(LSI, NewVD);
11145 assert(C->capturesVariable() &&
"unexpected kind of lambda capture");
11154 if (C->isPackExpansion()) {
11156 bool ShouldExpand =
false;
11157 bool RetainExpansion =
false;
11159 if (getDerived().TryExpandParameterPacks(C->getEllipsisLoc(),
11162 ShouldExpand, RetainExpansion,
11168 if (ShouldExpand) {
11172 VarDecl *Pack = C->getCapturedVar();
11173 for (
unsigned I = 0; I != *NumExpansions; ++I) {
11176 = cast_or_null<VarDecl>(getDerived().TransformDecl(C->getLocation(),
11178 if (!CapturedVar) {
11184 getSema().tryCaptureVariable(CapturedVar, C->getLocation(),
Kind);
11192 EllipsisLoc = C->getEllipsisLoc();
11197 = cast_or_null<VarDecl>(getDerived().TransformDecl(C->getLocation(),
11198 C->getCapturedVar()));
11205 getSema().tryCaptureVariable(CapturedVar, C->getLocation(),
Kind,
11208 if (!FinishedExplicitCaptures)
11209 getSema().finishLambdaExplicitCaptures(LSI);
11213 getSema().PushExpressionEvaluationContext(
11224 SavedContext.
pop();
11225 getSema().ActOnLambdaError(E->
getBeginLoc(),
nullptr,
11233 auto LSICopy = *LSI;
11234 getSema().ActOnFinishFunctionBody(NewCallOperator, Body.
get(),
11236 SavedContext.
pop();
11238 return getSema().BuildLambdaExpr(E->
getBeginLoc(), Body.
get()->getEndLoc(),
11242 template<
typename Derived>
11251 bool ArgumentChanged =
false;
11263 if (!getDerived().AlwaysRebuild() &&
11269 return getDerived().RebuildCXXUnresolvedConstructExpr(
11273 template<
typename Derived>
11284 Base = getDerived().TransformExpr(OldBase);
11290 bool MayBePseudoDestructor =
false;
11291 Base = SemaRef.ActOnStartCXXMemberReference(
nullptr, Base.
get(),
11293 E->
isArrow()? tok::arrow : tok::period,
11295 MayBePseudoDestructor);
11299 ObjectType = ObjectTy.get();
11300 BaseType = ((
Expr*) Base.
get())->getType();
11303 BaseType = getDerived().TransformType(E->
getBaseType());
11310 = getDerived().TransformFirstQualifierInScope(
11319 FirstQualifierInScope);
11338 if (!getDerived().AlwaysRebuild() &&
11339 Base.
get() == OldBase &&
11346 return getDerived().RebuildCXXDependentScopeMemberExpr(Base.
get(),
11352 FirstQualifierInScope,
11363 return getDerived().RebuildCXXDependentScopeMemberExpr(Base.
get(),
11369 FirstQualifierInScope,
11374 template<
typename Derived>
11381 Base = getDerived().TransformExpr(Old->
getBase());
11384 Base = getSema().PerformMemberExprBaseConversion(Base.
get(),
11388 BaseType = Base.
get()->getType();
11390 BaseType = getDerived().TransformType(Old->
getBaseType());
11396 = getDerived().TransformNestedNameSpecifierLoc(Old->
getQualifierLoc());
11407 if (TransformOverloadExprDecls(Old,
false, R))
11413 = cast_or_null<CXXRecordDecl>(getDerived().TransformDecl(
11419 R.setNamingClass(NamingClass);
11436 NamedDecl *FirstQualifierInScope =
nullptr;
11438 return getDerived().RebuildUnresolvedMemberExpr(Base.
get(),
11444 FirstQualifierInScope,
11447 ? &TransArgs :
nullptr));
11450 template<
typename Derived>
11459 if (!getDerived().AlwaysRebuild() && SubExpr.
get() == E->
getOperand())
11465 template<
typename Derived>
11472 if (!getDerived().AlwaysRebuild() && Pattern.
get() == E->
getPattern())
11479 template<
typename Derived>
11498 bool ShouldExpand =
false;
11499 bool RetainExpansion =
false;
11503 ShouldExpand, RetainExpansion,
11509 if (ShouldExpand) {
11511 if (
auto *TTPD = dyn_cast<TemplateTypeParmDecl>(Pack)) {
11512 ArgStorage = getSema().Context.getPackExpansionType(
11513 getSema().Context.getTypeDeclType(TTPD), None);
11514 }
else if (
auto *TTPD = dyn_cast<TemplateTemplateParmDecl>(Pack)) {
11517 auto *VD = cast<ValueDecl>(Pack);
11518 ExprResult DRE = getSema().BuildDeclRefExpr(
11519 VD, VD->getType().getNonLValueExprType(getSema().Context),
11522 if (DRE.isInvalid())
11525 getSema().Context.DependentTy, DRE.get(), E->
getPackLoc(), None);
11527 PackArgs = ArgStorage;
11532 if (!PackArgs.size()) {
11533 auto *Pack = cast_or_null<NamedDecl>(
11537 return getDerived().RebuildSizeOfPackExpr(E->
getOperatorLoc(), Pack,
11545 if (!Arg.isPackExpansion()) {
11546 Result = *Result + 1;
11551 InventTemplateArgumentLoc(Arg, ArgLoc);
11557 getSema().getTemplateArgumentPackExpansionPattern(ArgLoc, Ellipsis,
11558 OrigNumExpansions);
11563 if (getDerived().TransformTemplateArgument(Pattern, OutPattern,
11569 getSema().getFullyPackExpandedSize(OutPattern.
getArgument());
11570 if (!NumExpansions) {
11577 Result = *Result + *NumExpansions;
11593 if (TransformTemplateArguments(PackLocIterator(*
this, PackArgs.begin()),
11594 PackLocIterator(*
this, PackArgs.end()),
11595 TransformedPackArgs,
true))
11602 bool PartialSubstitution =
false;
11603 for (
auto &Loc : TransformedPackArgs.arguments()) {
11604 Args.push_back(Loc.getArgument());
11605 if (Loc.getArgument().isPackExpansion())
11606 PartialSubstitution =
true;
11609 if (PartialSubstitution)
11616 Args.size(), None);
11619 template<
typename Derived>
11627 template<
typename Derived>
11635 template<
typename Derived>
11642 template<
typename Derived>
11649 template<
typename Derived>
11655 getSema().collectUnexpandedParameterPacks(Pattern, Unexpanded);
11656 assert(!Unexpanded.empty() &&
"Pack expansion without parameter packs?");
11660 bool Expand =
true;
11661 bool RetainExpansion =
false;
11666 Expand, RetainExpansion,
11685 if (!getDerived().AlwaysRebuild() &&
11689 return getDerived().RebuildCXXFoldExpr(
11703 if (!LeftFold && RetainExpansion) {
11704 ForgetPartiallySubstitutedPackRAII Forget(getDerived());
11706 ExprResult Out = getDerived().TransformExpr(Pattern);
11710 Result = getDerived().RebuildCXXFoldExpr(
11717 for (
unsigned I = 0; I != *NumExpansions; ++I) {
11719 getSema(), LeftFold ? I : *NumExpansions - I - 1);
11720 ExprResult Out = getDerived().TransformExpr(Pattern);
11724 if (Out.
get()->containsUnexpandedParameterPack()) {
11726 Result = getDerived().RebuildCXXFoldExpr(
11732 Result = getDerived().RebuildBinaryOperator(
11734 LeftFold ? Result.
get() : Out.
get(),
11735 LeftFold ? Out.
get() : Result.
get());
11745 if (LeftFold && RetainExpansion) {
11746 ForgetPartiallySubstitutedPackRAII Forget(getDerived());
11748 ExprResult Out = getDerived().TransformExpr(Pattern);
11752 Result = getDerived().RebuildCXXFoldExpr(
11762 return getDerived().RebuildEmptyCXXFoldExpr(E->
getEllipsisLoc(),
11768 template<
typename Derived>
11775 template<
typename Derived>
11778 return SemaRef.MaybeBindToTemporary(E);
11781 template<
typename Derived>
11787 template<
typename Derived>
11794 if (!getDerived().AlwaysRebuild() &&
11801 template<
typename Derived>
11806 bool ArgChanged =
false;
11808 false, Elements, &ArgChanged))
11811 if (!getDerived().AlwaysRebuild() && !ArgChanged)
11812 return SemaRef.MaybeBindToTemporary(E);
11814 return getDerived().RebuildObjCArrayLiteral(E->
getSourceRange(),
11819 template<
typename Derived>
11825 bool ArgChanged =
false;
11832 getSema().collectUnexpandedParameterPacks(OrigElement.
Key, Unexpanded);
11833 getSema().collectUnexpandedParameterPacks(OrigElement.
Value, Unexpanded);
11834 assert(!Unexpanded.empty() &&
"Pack expansion without parameter packs?");
11838 bool Expand =
true;
11839 bool RetainExpansion =
false;
11844 if (getDerived().TryExpandParameterPacks(OrigElement.
EllipsisLoc,
11845 PatternRange, Unexpanded, Expand,
11846 RetainExpansion, NumExpansions))
11854 ExprResult Key = getDerived().TransformExpr(OrigElement.
Key);
11858 if (Key.
get() != OrigElement.
Key)
11865 if (Value.
get() != OrigElement.
Value)
11871 Elements.push_back(Expansion);
11881 for (
unsigned I = 0; I != *NumExpansions; ++I) {
11883 ExprResult Key = getDerived().TransformExpr(OrigElement.
Key);
11898 if (Key.
get()->containsUnexpandedParameterPack() ||
11899 Value.
get()->containsUnexpandedParameterPack())
11902 Elements.push_back(Element);
11912 ExprResult Key = getDerived().TransformExpr(OrigElement.
Key);
11916 if (Key.
get() != OrigElement.
Key)
11921 = getDerived().TransformExpr(OrigElement.
Value);
11925 if (Value.
get() != OrigElement.
Value)
11931 Elements.push_back(Element);
11934 if (!getDerived().AlwaysRebuild() && !ArgChanged)
11935 return SemaRef.MaybeBindToTemporary(E);
11937 return getDerived().RebuildObjCDictionaryLiteral(E->
getSourceRange(),
11941 template<
typename Derived>
11946 if (!EncodedTypeInfo)
11949 if (!getDerived().AlwaysRebuild() &&
11953 return getDerived().RebuildObjCEncodeExpr(E->
getAtLoc(),
11958 template<
typename Derived>
11968 template<
typename Derived>
11980 if (!getDerived().AlwaysRebuild() &&
11990 template <
typename Derived>
11996 template<
typename Derived>
12000 bool ArgChanged =
false;
12011 if (!ReceiverTypeInfo)
12015 if (!getDerived().AlwaysRebuild() &&
12017 return SemaRef.MaybeBindToTemporary(E);
12022 return getDerived().RebuildObjCMessageExpr(ReceiverTypeInfo,
12038 return getDerived().RebuildObjCMessageExpr(E->
getSuperLoc(),
12050 "Only class and instance messages may be instantiated");
12053 if (Receiver.isInvalid())
12057 if (!getDerived().AlwaysRebuild() &&
12059 return SemaRef.MaybeBindToTemporary(E);
12064 return getDerived().RebuildObjCMessageExpr(Receiver.get(),
12073 template<
typename Derived>
12079 template<
typename Derived>
12085 template<
typename Derived>
12096 if (!getDerived().AlwaysRebuild() &&
12100 return getDerived().RebuildObjCIvarRefExpr(Base.
get(), E->
getDecl(),
12105 template<
typename Derived>
12121 if (!getDerived().AlwaysRebuild() &&
12126 return getDerived().RebuildObjCPropertyRefExpr(Base.
get(),
12130 return getDerived().RebuildObjCPropertyRefExpr(Base.
get(),
12131 SemaRef.Context.PseudoObjectTy,
12137 template<
typename Derived>
12151 if (!getDerived().AlwaysRebuild() &&
12155 return getDerived().RebuildObjCSubscriptRefExpr(E->
getRBracket(),
12161 template<
typename Derived>
12170 if (!getDerived().AlwaysRebuild() &&
12179 template<
typename Derived>
12182 bool ArgumentChanged =
false;
12186 SubExprs, &ArgumentChanged))
12189 if (!getDerived().AlwaysRebuild() &&
12193 return getDerived().RebuildShuffleVectorExpr(E->
getBuiltinLoc(),
12198 template<
typename Derived>
12209 if (!getDerived().AlwaysRebuild() &&
12214 return getDerived().RebuildConvertVectorExpr(E->
getBuiltinLoc(),
12215 SrcExpr.
get(), Type,
12219 template<
typename Derived>
12238 if (getDerived().TransformFunctionTypeParams(
12247 getDerived().TransformType(exprFunctionType->
getReturnType());
12253 getDerived().RebuildFunctionProtoType(exprResultType, paramTypes, epi);
12257 if (!params.empty())
12275 if (!SemaRef.getDiagnostics().hasErrorOccurred()) {
12276 for (
const auto &I : oldBlock->
captures()) {
12277 VarDecl *oldCapture = I.getVariable();
12280 if (isa<ParmVarDecl>(oldCapture) &&
12281 cast<ParmVarDecl>(oldCapture)->isParameterPack())
12287 assert(blockScope->
CaptureMap.count(newCapture));
12297 template<
typename Derived>
12300 llvm_unreachable(
"Cannot transform asType expressions yet");
12303 template<
typename Derived>
12307 bool ArgumentChanged =
false;
12311 SubExprs, &ArgumentChanged))
12314 if (!getDerived().AlwaysRebuild() &&
12318 return getDerived().RebuildAtomicExpr(E->
getBuiltinLoc(), SubExprs,
12326 template<
typename Derived>
12329 return SemaRef.BuildPointerType(PointeeType, Star,
12330 getDerived().getBaseEntity());
12333 template<
typename Derived>
12336 return SemaRef.BuildBlockPointerType(PointeeType, Star,
12337 getDerived().getBaseEntity());
12340 template<
typename Derived>
12343 bool WrittenAsLValue,
12345 return SemaRef.BuildReferenceType(ReferentType, WrittenAsLValue,
12346 Sigil, getDerived().getBaseEntity());
12349 template<
typename Derived>
12354 return SemaRef.BuildMemberPointerType(PointeeType, ClassType, Sigil,
12355 getDerived().getBaseEntity());
12358 template<
typename Derived>
12365 return SemaRef.BuildObjCTypeParamType(Decl,
12366 ProtocolLAngleLoc, Protocols,
12367 ProtocolLocs, ProtocolRAngleLoc,
12371 template<
typename Derived>
12382 return SemaRef.BuildObjCObjectType(BaseType, Loc, TypeArgsLAngleLoc,
12383 TypeArgs, TypeArgsRAngleLoc,
12384 ProtocolLAngleLoc, Protocols, ProtocolLocs,
12389 template<
typename Derived>
12393 return SemaRef.Context.getObjCObjectPointerType(PointeeType);
12396 template<
typename Derived>
12400 const llvm::APInt *Size,
12402 unsigned IndexTypeQuals,
12404 if (SizeExpr || !Size)
12405 return SemaRef.BuildArrayType(ElementType, SizeMod, SizeExpr,
12406 IndexTypeQuals, BracketsRange,
12407 getDerived().getBaseEntity());
12410 SemaRef.Context.UnsignedCharTy, SemaRef.Context.UnsignedShortTy,
12411 SemaRef.Context.UnsignedIntTy, SemaRef.Context.UnsignedLongTy,
12412 SemaRef.Context.UnsignedLongLongTy, SemaRef.Context.UnsignedInt128Ty
12414 const unsigned NumTypes = llvm::array_lengthof(Types);
12416 for (
unsigned I = 0; I != NumTypes; ++I)
12417 if (Size->getBitWidth() == SemaRef.Context.getIntWidth(Types[I])) {
12418 SizeType = Types[I];
12427 return SemaRef.BuildArrayType(ElementType, SizeMod, ArraySize,
12428 IndexTypeQuals, BracketsRange,
12429 getDerived().getBaseEntity());
12432 template<
typename Derived>
12436 const llvm::APInt &Size,
12437 unsigned IndexTypeQuals,
12439 return getDerived().RebuildArrayType(ElementType, SizeMod, &Size,
nullptr,
12440 IndexTypeQuals, BracketsRange);
12443 template<
typename Derived>
12447 unsigned IndexTypeQuals,
12449 return getDerived().RebuildArrayType(ElementType, SizeMod,
nullptr,
nullptr,
12450 IndexTypeQuals, BracketsRange);
12453 template<
typename Derived>
12458 unsigned IndexTypeQuals,
12460 return getDerived().RebuildArrayType(ElementType, SizeMod,
nullptr,
12462 IndexTypeQuals, BracketsRange);
12465 template<
typename Derived>
12470 unsigned IndexTypeQuals,
12472 return getDerived().RebuildArrayType(ElementType, SizeMod,
nullptr,
12474 IndexTypeQuals, BracketsRange);
12477 template <
typename Derived>
12480 return SemaRef.BuildAddressSpaceAttr(PointeeType, AddrSpaceExpr,
12484 template <
typename Derived>
12487 unsigned NumElements,
12490 return SemaRef.Context.getVectorType(ElementType, NumElements, VecKind);
12493 template <
typename Derived>
12497 return SemaRef.BuildVectorType(ElementType, SizeExpr, AttributeLoc);
12500 template<
typename Derived>
12502 unsigned NumElements,
12504 llvm::APInt numElements(SemaRef.Context.getIntWidth(SemaRef.Context.IntTy),
12505 NumElements,
true);
12509 return SemaRef.BuildExtVectorType(ElementType, VectorSize, AttributeLoc);
12512 template<
typename Derived>
12517 return SemaRef.BuildExtVectorType(ElementType, SizeExpr, AttributeLoc);
12520 template<
typename Derived>
12525 return SemaRef.BuildFunctionType(T, ParamTypes,
12526 getDerived().getBaseLocation(),
12527 getDerived().getBaseEntity(),
12531 template<
typename Derived>
12533 return SemaRef.Context.getFunctionNoProtoType(T);
12536 template<
typename Derived>
12539 assert(D &&
"no decl found");
12544 if (
auto *UPD = dyn_cast<UsingPackDecl>(D)) {
12548 if (UPD->expansions().empty()) {
12549 getSema().Diag(Loc, diag::err_using_pack_expansion_empty)
12559 for (
auto *E : UPD->expansions()) {
12560 QualType ThisT = RebuildUnresolvedUsingType(Loc, E);
12568 assert(getSema().Context.hasSameType(ThisT, T) &&
12569 "mismatched resolved types in using pack expansion");
12571 return T.
isNull() ? FallbackT : T;
12572 }
else if (
auto *Using = dyn_cast<UsingDecl>(D)) {
12573 assert(Using->hasTypename() &&
12574 "UnresolvedUsingTypenameDecl transformed to non-typename using");
12577 assert(++Using->shadow_begin() == Using->shadow_end());
12578 Ty = cast<TypeDecl>((*Using->shadow_begin())->getTargetDecl());
12580 assert(isa<UnresolvedUsingTypenameDecl>(D) &&
12581 "UnresolvedUsingTypenameDecl transformed to non-using decl");
12582 Ty = cast<UnresolvedUsingTypenameDecl>(D);
12585 return SemaRef.Context.getTypeDeclType(Ty);
12588 template<
typename Derived>
12591 return SemaRef.BuildTypeofExprType(E, Loc);
12594 template<
typename Derived>
12596 return SemaRef.Context.getTypeOfType(Underlying);
12599 template<
typename Derived>
12602 return SemaRef.BuildDecltypeType(E, Loc);
12605 template<
typename Derived>
12609 return SemaRef.BuildUnaryTransformType(BaseType, UKind, Loc);
12612 template<
typename Derived>
12617 return SemaRef.CheckTemplateIdType(Template, TemplateNameLoc, TemplateArgs);
12620 template<
typename Derived>
12623 return SemaRef.BuildAtomicType(ValueType, KWLoc);
12626 template<
typename Derived>
12630 return isReadPipe ? SemaRef.BuildReadPipeType(ValueType, KWLoc)
12631 : SemaRef.BuildWritePipeType(ValueType, KWLoc);
12634 template<
typename Derived>
12639 return SemaRef.Context.getQualifiedTemplateName(SS.
getScopeRep(), TemplateKW,
12643 template<
typename Derived>
12651 bool AllowInjectedClassName) {
12655 getSema().ActOnDependentTemplateName(
nullptr,
12656 SS, TemplateKWLoc, TemplateName,
12659 Template, AllowInjectedClassName);
12660 return Template.
get();
12663 template<
typename Derived>
12670 bool AllowInjectedClassName) {
12673 SourceLocation SymbolLocations[3] = { NameLoc, NameLoc, NameLoc };
12676 getSema().ActOnDependentTemplateName(
nullptr,
12677 SS, TemplateKWLoc, Name,
12680 Template, AllowInjectedClassName);
12681 return Template.
get();
12684 template<
typename Derived>
12692 bool isPostIncDec = Second && (Op == OO_PlusPlus || Op == OO_MinusMinus);
12697 return SemaRef.checkPseudoObjectAssignment(
nullptr, OpLoc, Opc,
12699 ExprResult Result = SemaRef.CheckPlaceholderExpr(First);
12702 First = Result.
get();
12706 ExprResult Result = SemaRef.CheckPlaceholderExpr(Second);
12709 Second = Result.
get();
12713 if (Op == OO_Subscript) {
12716 return getSema().CreateBuiltinArraySubscriptExpr(
12718 }
else if (Op == OO_Arrow) {
12720 return SemaRef.BuildOverloadedArrowExpr(
nullptr, First, OpLoc);
12721 }
else if (Second ==
nullptr || isPostIncDec) {
12723 (Op == OO_Amp && getSema().isQualifiedMemberAccess(First))) {
12730 return getSema().CreateBuiltinUnaryOp(OpLoc, Opc, First);
12739 = SemaRef.CreateBuiltinBinOp(OpLoc, Opc, First, Second);
12753 Functions.
append(ULE->decls_begin(), ULE->decls_end());
12757 RequiresADL = ULE->requiresADL();
12762 NamedDecl *ND = cast<DeclRefExpr>(Callee)->getDecl();
12763 if (!isa<CXXMethodDecl>(ND))
12765 RequiresADL =
false;
12769 Expr *Args[2] = { First, Second };
12770 unsigned NumArgs = 1 + (Second !=
nullptr);
12773 if (NumArgs == 1 || isPostIncDec) {
12776 return SemaRef.CreateOverloadedUnaryOp(OpLoc, Opc, Functions, First,
12780 if (Op == OO_Subscript) {
12784 if (
DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(Callee)) {
12795 return SemaRef.CreateOverloadedArraySubscriptExpr(LBrace, RBrace,
12801 ExprResult Result = SemaRef.CreateOverloadedBinOp(
12802 OpLoc, Opc, Functions, Args[0], Args[1], RequiresADL);
12809 template<
typename Derived>
12824 ->template getAs<RecordType>())){
12826 return SemaRef.BuildPseudoDestructorExpr(
12827 Base, OperatorLoc, isArrow ? tok::arrow : tok::period, SS, ScopeType,
12828 CCLoc, TildeLoc, Destroyed);
12832 DeclarationName Name(SemaRef.Context.DeclarationNames.getCXXDestructorName(
12833 SemaRef.Context.getCanonicalType(DestroyedType->
getType())));
12842 diag::err_expected_class_or_namespace)
12843 << ScopeType->
getType() << getSema().getLangOpts().CPlusPlus;
12851 return getSema().BuildMemberReferenceExpr(Base, BaseType,
12852 OperatorLoc, isArrow,
12860 template<
typename Derived>
12868 for (
unsigned I = 0; I < NumParams; ++I) {
12869 if (I != ContextParamPos) {
12875 Params.push_back(std::make_pair(StringRef(),
QualType()));
12878 getSema().ActOnCapturedRegionStart(Loc,
nullptr,
12887 getSema().ActOnCapturedRegionError();
12891 return getSema().ActOnCapturedRegionEnd(Body.
get());
12896 #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
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...
static CXXDefaultInitExpr * Create(const ASTContext &Ctx, SourceLocation Loc, FieldDecl *Field)
Field is the non-static data member whose default initializer is used by this expression.
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
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.
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 AutoTemplateP...
SourceRange getSourceRange() const LLVM_READONLY
Retrieve the source range covering the entirety of this nested-name-specifier.
unsigned getNumSubExprs() const
getNumSubExprs - Return the size of the SubExprs array.
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
Ordinary name lookup, which finds ordinary names (functions, variables, typedefs, etc...
CompoundStmt * getSubStmt()
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.
SourceLocation getKWLoc() const
NestedNameSpecifierLoc getTemplateQualifierLoc() const
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...
bool isConstexpr() const
Whether this is a (C++11) constexpr function or constexpr constructor.
Represents a qualified type name for which the type name is dependent.
SourceLocation 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...
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.
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
Represents a C++17 deduced template specialization type.
SourceLocation getColonLoc() const
QualifiedTemplateName * getAsQualifiedTemplateName() const
Retrieve the underlying qualified template name structure, if any.
ObjCMethodDecl - Represents an instance or class method declaration.
SourceLocation getLeftLoc() const
ArrayRef< SourceLocation > getProtocolLocs() const
RAII object used to temporarily allow the C++ 'this' expression to be used, with the given qualifiers...
A namespace, stored as a NamespaceDecl*.
SourceLocation getColonLoc() const
Return the location of ':'.
DeclarationName getName() const
Gets the name looked up.
Implicit construction of a std::initializer_list<T> object from an array temporary within list-initia...
TypeLoc getNamedTypeLoc() const
bool isInvalidDecl() const
SourceLocation getIfLoc() const
void setAttrOperandParensRange(SourceRange range)
void setProtocolRAngleLoc(SourceLocation Loc)
Stores a list of template parameters for a TemplateDecl and its derived classes.
unsigned getContextParamPosition() const
unsigned getNumPlacementArgs() const
TypeSourceInfo * getArgumentTypeInfo() const
bool requiresADL() const
True if this declaration should be extended by argument-dependent lookup.
This represents implicit clause 'flush' for the '#pragma omp flush' directive.
Defines the Objective-C statement AST node classes.
SourceRange getSourceRange() const LLVM_READONLY
Retrieve the source range that covers this offsetof node.
const DeclarationNameInfo & getNameInfo() const
Gets the name info for specified reduction identifier.
SpecifierKind getKind() const
Determine what kind of nested name specifier is stored.
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will call.
A C++ throw-expression (C++ [except.throw]).
Expr * getExprOperand() const
Represents an expression – generally a full-expression – that introduces cleanups to be run at the ...
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)
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
An element in an Objective-C dictionary literal.
This represents '#pragma omp parallel' directive.
ShuffleVectorExpr - clang-specific builtin-in function __builtin_shufflevector.
SourceLocation getColonLoc() const
Gets location of ':' symbol in clause.
Represents a class type in Objective C.
SourceLocation getRParen() const
Get the location of the right parentheses ')'.
Expr * getAsExpr() const
Retrieve the template argument as an expression.
A C++ nested-name-specifier augmented with source location information.
Expr * getInit() const
Retrieve the initializer value.
Represents a dependent template name that cannot be resolved prior to template instantiation.
ArrayRef< QualType > getParamTypes() const
The results of name lookup within a DeclContext.
This represents 'simd' clause in the '#pragma omp ...' directive.
bool isObjCLifetimeType() const
Returns true if objects of this type have lifetime semantics under ARC.
TypeSourceInfo * getTypeSourceInfo() const
TypeLoc getInnerLoc() const
QualType BuildParenType(QualType T)
Build a paren type including T.
The template argument is an integral value stored in an llvm::APSInt that was provided for an integra...
void setBuiltinLoc(SourceLocation Loc)
void setArgLocInfo(unsigned i, TemplateArgumentLocInfo AI)
TemplateDecl * getAsTemplateDecl() const
Retrieve the underlying template declaration that this template name refers to, if known...
TemplateArgumentLoc value_type
TypeSourceInfo * getUnderlyingTInfo() const
bool isExplicitProperty() const
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.
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 '('.
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
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
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...
const Expr * getAssocExpr(unsigned i) const
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
IgnoreParenCasts - Ignore parentheses and casts.
ObjCStringLiteral, used for Objective-C string literals i.e.
std::input_iterator_tag iterator_category
SourceLocation getEqualOrColonLoc() const
Retrieve the location of the '=' that precedes the initializer value itself, if present.
SourceLocation getTemplateKeywordLoc() const
SourceLocation getRAngleLoc() const
Retrieve the location of the right angle bracket ending the explicit template argument list following...
Expr * getSizeExpr() const
const CallExpr * getConfig() const
Wrapper for source info for ObjC interfaces.
FPOptions getFPFeatures() const
SourceLocation getLocalEndLoc() const
Retrieve the location of the end of this component of the nested-name-specifier.
param_type_iterator param_type_begin() const
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
This represents '#pragma omp teams' directive.
OpenMPDependClauseKind getDependencyKind() const
Get dependency type.
void append(iterator I, iterator E)
Represents a C++ nested-name-specifier or a global scope specifier.
const Expr * getControllingExpr() const
This represents clause 'reduction' in the '#pragma omp ...' directives.
FieldDecl * getField()
Get the field whose initializer will be used.
Helper class for OffsetOfExpr.
Expr * getOperand() const
This represents '#pragma omp teams distribute simd' combined directive.
Represents binding an expression to a temporary.
StringLiteral * getClobberStringLiteral(unsigned i)
ArrayTypeTrait
Names for the array type traits.
Expr * Key
The key for the dictionary element.
SourceLocation getBuiltinLoc() const
void setProtocolLoc(unsigned i, SourceLocation Loc)
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 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.
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.
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.
ObjCTypeParamDecl * getDecl() const
Represents a call to the builtin function __builtin_va_arg.
void setArgLocInfo(unsigned i, TemplateArgumentLocInfo AI)
static CXXDefaultArgExpr * Create(const ASTContext &C, SourceLocation Loc, ParmVarDecl *Param)
pointer operator->() const
TypeSourceInfo * getTrivialTypeSourceInfo(QualType T, SourceLocation Loc=SourceLocation()) const
Allocate a TypeSourceInfo where all locations have been initialized to a given location, which defaults to the empty location.
OpenMPProcBindClauseKind getProcBindKind() const
Returns kind of the clause.
SourceLocation getLabelLoc() const
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
Pepresents a block literal declaration, which is like an unnamed FunctionDecl.
unsigned getFunctionScopeDepth() const
void setQualifierLoc(NestedNameSpecifierLoc QualifierLoc)
llvm::MutableArrayRef< Designator > designators()
NamespaceDecl * getAsNamespace() const
Retrieve the namespace stored in this nested name specifier.
This represents 'proc_bind' clause in the '#pragma omp ...' directive.
The current expression is potentially evaluated, but any declarations referenced inside that expressi...
This represents 'capture' clause in the '#pragma omp atomic' directive.
DeclAccessPair getFoundDecl() const
Retrieves the declaration found by lookup.
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
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
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
const TypeSourceInfo * getAssocTypeSourceInfo(unsigned i) const
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
T getAs() const
Convert to the specified TypeLoc type, returning a null TypeLoc if this TypeLoc is not of the desired...
Represents a C++ destructor within a class.
VarDecl * getExceptionDecl() const
IdentifierInfo * getDestroyedTypeIdentifier() const
In a dependent pseudo-destructor expression for which we do not have full type information on the des...
unsigned getNumInits() const
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.
bool isArrow() const
Determine whether this pseudo-destructor expression was written using an '->' (otherwise, it used a '.
unsigned getNumTemplateArgs() const
ObjCDictionaryLiteral - AST node to represent objective-c dictionary literals; as in:"name" : NSUserN...
const CompoundStmt * getSynchBody() const
DeclContext * getDeclContext()
SourceLocation getLParenLoc() const
const IdentifierInfo * getIdentifier() const
Retrieve the type named by the typename specifier as an identifier.
Represents Objective-C's @synchronized statement.
ObjCSelectorExpr used for @selector in Objective-C.
Expr ** getArgs()
Retrieve the arguments to this message, not including the receiver.
SourceLocation getEllipsisLoc() const
TypeSourceInfo * getNamedTypeInfo() const
getNamedTypeInfo - Returns the source type info associated to the name.
TypeSourceInfo * getTypeSourceInfo() const
NestedNameSpecifierLoc getPrefix() const
Return the prefix of this nested-name-specifier.
Represents an expression that computes the length of a parameter pack.
SourceLocation getRBracketLoc() const
CXXTryStmt - A C++ try block, including all handlers.
AsTypeExpr - Clang builtin function __builtin_astype [OpenCL 6.2.4.2] This AST node provides support ...
OpenMPDistScheduleClauseKind getDistScheduleKind() const
Get kind of the clause.
SourceLocation getAtTryLoc() const
Retrieve the location of the @ in the @try.
void setRParenLoc(SourceLocation Loc)
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.
bool isPackExpansion() const
Determine whether this template argument is a pack expansion.
SourceLocation getCommaLoc()
Get location of ','.
SourceLocation getLocation() const
SourceLocation getRParenLoc() const
QualType getTypeDeclType(const TypeDecl *Decl, const TypeDecl *PrevDecl=nullptr) const
Return the unique reference to the type for the specified type declaration.
SourceLocation getForLoc() const
QualType getDestroyedType() const
Retrieve the type being destroyed.
const Expr * getSubExpr() const
ObjCBridgeCastKind getBridgeKind() const
Determine which kind of bridge is being performed via this cast.
const Expr * getSubExpr() const
void setQualifierLoc(NestedNameSpecifierLoc QualifierLoc)
CStyleCastExpr - An explicit cast in C (C99 6.5.4) or a C-style cast in C++ (C++ [expr.cast]), which uses the syntax (Type)expr.
SourceLocation getPackLoc() const
Determine the location of the parameter pack.
CXXMethodDecl * getCallOperator() const
Retrieve the function call operator associated with this lambda expression.
OpenMPProcBindClauseKind
OpenMP attributes for 'proc_bind' clause.
bool isNull() const
Return true if this QualType doesn't point to a type yet.
A type, stored as a Type*.
InitializationStyle getInitStyle() const
The style of initialization for this declaration.
Expr * getLHS()
An array access can be written A[4] or 4[A] (both are equivalent).
TypeLoc getReturnLoc() const
ImaginaryLiteral - We support imaginary integer and floating point literals, like "1...
This represents '#pragma omp flush' directive.
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)
ExprResult BuildCXXNoexceptExpr(SourceLocation KeyLoc, Expr *Operand, SourceLocation RParen)
SourceLocation getLParenLoc() const
Retrieve the location of the left parentheses ('(') that precedes the argument list.
QualType getAutoType(QualType DeducedType, AutoTypeKeyword Keyword, bool IsDependent) const
C++11 deduced auto type.
bool hasTrailingReturn() const
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.
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. ...
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
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 that has been substituted but not yet expanded...
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.
unsigned getNumAssocs() const
Dataflow Directional Tag Classes.
SourceLocation getColonLoc() const
Get colon location.
This represents 'device' clause in the '#pragma omp ...' directive.
NestedNameSpecifier * getNestedNameSpecifier() const
Retrieve the nested-name-specifier to which this instance refers.
bool containsUnexpandedParameterPack() const
Whether this template argument contains an unexpanded parameter pack.
bool isValid() const
Return true if this is a valid SourceLocation object.
DeducedType * getContainedDeducedType() const
Get the DeducedType whose type will be deduced for a variable with an initializer of this type...
int ArgumentPackSubstitutionIndex
The current index into pack expansion arguments that will be used for substitution of parameter packs...
const TemplateArgumentLoc * getTemplateArgs() const
Retrieve the template arguments provided as part of this template-id.
Stmt * getReturnStmtOnAllocFailure() const
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.
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 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
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.
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.
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 '::'.
CompoundStmt * getTryBlock()
SourceLocation getCaseLoc() const
TypeLoc getTypeLoc() const
For a nested-name-specifier that refers to a type, retrieve the type with source-location information...
SourceLocation getEllipsisLoc() const
Represents Objective-C's @try ... @catch ... @finally statement.
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation tokens are not useful in isolation - they are low level value objects created/interpre...
bool isGlobalDelete() const
This represents '#pragma omp taskloop simd' directive.
SourceLocation getBuiltinLoc() const
getBuiltinLoc - Return the location of the __builtin_convertvector token.
unsigned getNumCatchStmts() const
Retrieve the number of @catch statements in this try-catch-finally block.
Expr * getBase() const
Retrieve the base object of this member expressions, e.g., the x in x.m.
StringLiteral - This represents a string literal expression, e.g.
bool hasExplicitParameters() const
Determine whether this lambda has an explicit parameter list vs.
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
SourceLocation getNameLoc() const
SourceRange getTypeIdParens() const
Expr * getPattern()
Retrieve the pattern of the pack expansion.
bool HasImplicitReturnType
void setRAngleLoc(SourceLocation Loc)
StringRef getName() const
Get the name of identifier for this declaration as a StringRef.
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.
Expr * getChunkSize()
Get chunk size.
const VarDecl * getCatchParamDecl() const
SourceLocation getTemplateNameLoc() const
Expr * getOperand() const
SourceLocation getAttrNameLoc() const
The location of the attribute name, i.e.
SourceLocation getTemplateKeywordLoc() const
Retrieve the location of the template keyword preceding the member name, if any.
bool isDefaultArgument() const
Determine whether this expression is a default function argument.
Expr * getNumThreads() const
Returns number of threads.
QualType getDependentTemplateSpecializationType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier *NNS, const IdentifierInfo *Name, const TemplateArgumentListInfo &Args) const
attr::Kind getAttrKind() const
SourceLocation getBridgeKeywordLoc() const
The location of the bridge keyword.
bool hadMultipleCandidates() const
Whether the referred constructor was resolved from an overloaded set having size greater than 1...
An instance of this class represents the declaration of a property member.
DeclStmt * getLoopVarStmt()
Wrapper for source info for builtin types.
An l-value expression is a reference to an object with independent storage.
void setRParenLoc(SourceLocation Loc)
unsigned getNumArgs() const
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 '('.
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.
unsigned getNumParams() const
Return the number of parameters this function must have based on its FunctionType.
Wrapper for source info for pointers.
SourceLocation getBegin() const
TypeSourceInfo * getTypeSourceInfo() const
getTypeSourceInfo - Return the destination type.
BinaryOperatorKind getOperator() const
SourceLocation ColonLoc
Location of ':'.
SourceLocation getRParenLoc() const
Return the location of the right parentheses.
SourceLocation getInnerLocStart() const
Return start of source range ignoring outer template declarations.
NamedDecl * getPack() const
Retrieve the parameter pack.
Wrapper for source info for block pointers.
Represents Objective-C's @autoreleasepool Statement.
llvm::Optional< NullabilityKind > getImmediateNullability() const
SourceLocation getKeywordLoc() const
Represents the canonical version of C arrays with a specified constant size.
CompoundStmt * getTryBlock() const
ExceptionSpecInfo ExceptionSpec
QualType getBaseType() const
TemplateArgumentLocContainerIterator()
InitListExpr * getSyntacticForm() const
Expr * getBaseExpr() const
The symbol does not exist.
Represents an implicitly-generated value initialization of an object of a given type.
CompoundStmt * getBlock() const
SourceLocation getReturnLoc() const
Stmt * getFinalSuspendStmt() const
void setElaboratedKeywordLoc(SourceLocation Loc)
CapturedRegionKind getCapturedRegionKind() const
Retrieve the captured region kind.
This represents '#pragma omp target parallel for' directive.
Attr - This represents one attribute.
SourceLocation getLocation() const
This represents clause 'use_device_ptr' in the '#pragma omp ...' directives.
SourceLocation getTypeArgsRAngleLoc() const
QualType getPointeeType() const
QualType getType() const
Return the type wrapped by this type source info.
TypeTrait getTrait() const
Determine which type trait this expression uses.
Expr * getLength()
Get length of array section.
void setUnderlyingTInfo(TypeSourceInfo *TI) const
const DeclarationNameInfo & getMemberNameInfo() const
Retrieve the name of the member that this expression refers to.
const IdentifierInfo * getIdentifier() const
Expr * getSizeExpr() const
bool isCXXInstanceMember() const
Determine whether the given declaration is an instance member of a C++ class.
ConstructionKind getConstructionKind() const
Determine whether this constructor is actually constructing a base class (rather than a complete obje...
TypeSourceInfo * getClassReceiverTypeInfo() const
Returns a type-source information of a class message send, or nullptr if the message is not a class m...
Expr * getBase()
An array section can be written only as Base[LowerBound:Length].
Qualifiers::ObjCLifetime getObjCLifetime() const
Returns lifetime attribute of this type.
This represents '#pragma omp taskloop' directive.