13#ifndef LLVM_CLANG_AST_EXPR_H
14#define LLVM_CLANG_AST_EXPR_H
31#include "llvm/ADT/APFloat.h"
32#include "llvm/ADT/APSInt.h"
33#include "llvm/ADT/SmallVector.h"
34#include "llvm/ADT/StringRef.h"
35#include "llvm/ADT/iterator.h"
36#include "llvm/ADT/iterator_range.h"
37#include "llvm/Support/AtomicOrdering.h"
38#include "llvm/Support/Compiler.h"
39#include "llvm/Support/TrailingObjects.h"
62class WarnUnusedResultAttr;
130 assert(
ExprBits.ObjectKind == OK &&
"truncated kind");
140 ExprBits.Dependent =
static_cast<unsigned>(Deps);
155 "Expressions can't have reference type");
180 return static_cast<bool>(
getDependence() & ExprDependence::Value);
197 return static_cast<bool>(
getDependence() & ExprDependence::Type);
226 return static_cast<bool>(
getDependence() & ExprDependence::Instantiation);
244 return static_cast<bool>(
getDependence() & ExprDependence::UnexpandedPack);
249 return static_cast<bool>(
getDependence() & ExprDependence::Error);
272 static
std::pair<const
NamedDecl *, const WarnUnusedResultAttr *>
341 class Classification {
378 unsigned short Modifiable;
381 : Kind(k), Modifiable(m)
389 assert(Modifiable !=
CM_Untested &&
"Did not test for modifiability.");
418 return ClassifyImpl(Ctx,
nullptr);
430 return ClassifyImpl(Ctx, &Loc);
443 : (RT->getPointeeType()->isFunctionType()
536 return BT->getKind() == K;
559 bool IgnoreTemplateOrMacroSubstitution =
false)
const;
570 std::optional<llvm::APSInt>
572 bool AllowRelaxedEval =
false)
const;
589 bool AllowRelaxedEval =
false)
const;
614 const Expr **Culprit =
nullptr)
const;
683 bool InConstantContext =
false)
const;
697 bool InConstantContext =
false)
const;
710 bool InConstantContext =
false)
const;
717 bool InConstantContext =
false)
const;
723 bool InConstantContext =
false)
const;
738 bool IncludePossibleEffects =
true)
const;
758 bool InConstantContext =
false)
const;
766 bool IsConstantInitializer)
const;
823 unsigned Type)
const;
832 const Expr *SizeExpression,
834 SemaProxy &SProxy, EvalResult &Status)
const;
838 SemaProxy &SProxy, EvalResult &Status)
const;
917 return const_cast<Expr *
>(
this)->IgnoreImpCasts();
928 return const_cast<Expr *
>(
this)->IgnoreCasts();
938 return const_cast<Expr *
>(
this)->IgnoreImplicit();
948 return const_cast<Expr *
>(
this)->IgnoreImplicitAsWritten();
960 return const_cast<Expr *
>(
this)->IgnoreParens();
974 return const_cast<Expr *
>(
this)->IgnoreParenImpCasts();
983 return const_cast<Expr *
>(
this)->IgnoreParenCasts();
990 return const_cast<Expr *
>(
this)->IgnoreConversionOperatorSingleStep();
1003 return const_cast<Expr *
>(
this)->IgnoreParenLValueCasts();
1024 return const_cast<Expr *
>(
this)->IgnoreParenBaseCasts();
1077 return T->getStmtClass() >= firstExprConstant &&
1078 T->getStmtClass() <= lastExprConstant;
1084 llvm::ConstantLog2<alignof(Expr)>(),
1085 "PointerLikeTypeTraits<Expr*> assumes too much alignment.");
1115 return T->getStmtClass() >= firstFullExprConstant &&
1116 T->getStmtClass() <= lastFullExprConstant;
1125class ConstantExpr final
1127 private llvm::TrailingObjects<ConstantExpr, APValue, uint64_t> {
1128 static_assert(std::is_same<uint64_t, llvm::APInt::WordType>::value,
1129 "ConstantExpr assumes that llvm::APInt::WordType is uint64_t "
1130 "for tail-allocated storage");
1131 friend TrailingObjects;
1135 size_t numTrailingObjects(OverloadToken<APValue>)
const {
1138 size_t numTrailingObjects(OverloadToken<uint64_t>)
const {
1142 uint64_t &Int64Result() {
1144 "invalid accessor");
1145 return *getTrailingObjects<uint64_t>();
1147 const uint64_t &Int64Result()
const {
1148 return const_cast<ConstantExpr *
>(
this)->Int64Result();
1152 "invalid accessor");
1153 return *getTrailingObjects<APValue>();
1155 APValue &APValueResult()
const {
1156 return const_cast<ConstantExpr *
>(
this)->APValueResult();
1160 bool IsImmediateInvocation);
1164 static ConstantExpr *
Create(
const ASTContext &Context,
Expr *E,
1166 static ConstantExpr *
1169 bool IsImmediateInvocation =
false);
1170 static ConstantExpr *
CreateEmpty(
const ASTContext &Context,
1175 const ASTContext &Context);
1178 return SubExpr->getBeginLoc();
1185 return T->getStmtClass() == ConstantExprClass;
1230 :
Expr(OpaqueValueExprClass,
T,
VK, OK), SourceExpr(SourceExpr) {
1248 return SourceExpr ? SourceExpr->getBeginLoc() :
getLocation();
1251 return SourceExpr ? SourceExpr->getEndLoc() :
getLocation();
1254 return SourceExpr ? SourceExpr->getExprLoc() :
getLocation();
1276 assert((!
V || SourceExpr) &&
1277 "unique OVEs are expected to have source expressions");
1284 return T->getStmtClass() == OpaqueValueExprClass;
1311class DeclRefExpr final
1313 private llvm::TrailingObjects<DeclRefExpr, NestedNameSpecifierLoc,
1314 NamedDecl *, ASTTemplateKWAndArgsInfo,
1315 TemplateArgumentLoc> {
1318 friend TrailingObjects;
1327 size_t numTrailingObjects(OverloadToken<NestedNameSpecifierLoc>)
const {
1331 size_t numTrailingObjects(OverloadToken<NamedDecl *>)
const {
1332 return hasFoundDecl();
1335 size_t numTrailingObjects(OverloadToken<ASTTemplateKWAndArgsInfo>)
const {
1343 DeclRefExpr(
const ASTContext &Ctx, NestedNameSpecifierLoc QualifierLoc,
1344 SourceLocation TemplateKWLoc, ValueDecl *D,
1345 bool RefersToEnclosingVariableOrCapture,
1346 const DeclarationNameInfo &NameInfo, NamedDecl *FoundD,
1347 const TemplateArgumentListInfo *TemplateArgs, QualType
T,
1354 DeclRefExpr(
const ASTContext &Ctx, ValueDecl *D,
1355 bool RefersToEnclosingVariableOrCapture, QualType
T,
1357 const DeclarationNameLoc &LocInfo = DeclarationNameLoc(),
1360 static DeclRefExpr *
1361 Create(
const ASTContext &Context, NestedNameSpecifierLoc QualifierLoc,
1362 SourceLocation TemplateKWLoc, ValueDecl *D,
1363 bool RefersToEnclosingVariableOrCapture, SourceLocation NameLoc,
1365 const TemplateArgumentListInfo *TemplateArgs =
nullptr,
1368 static DeclRefExpr *
1369 Create(
const ASTContext &Context, NestedNameSpecifierLoc QualifierLoc,
1370 SourceLocation TemplateKWLoc, ValueDecl *D,
1371 bool RefersToEnclosingVariableOrCapture,
1372 const DeclarationNameInfo &NameInfo, QualType
T,
ExprValueKind VK,
1373 NamedDecl *FoundD =
nullptr,
1374 const TemplateArgumentListInfo *TemplateArgs =
nullptr,
1378 static DeclRefExpr *
CreateEmpty(
const ASTContext &Context,
bool HasQualifier,
1380 bool HasTemplateKWAndArgsInfo,
1381 unsigned NumTemplateArgs);
1411 return *getTrailingObjects<NestedNameSpecifierLoc>();
1427 return hasFoundDecl() ? *getTrailingObjects<NamedDecl *>() : D;
1433 return hasFoundDecl() ? *getTrailingObjects<NamedDecl *>() : D;
1445 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->TemplateKWLoc;
1453 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->LAngleLoc;
1461 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->RAngleLoc;
1476 getTrailingObjects<ASTTemplateKWAndArgsInfo>()->copyInto(
1477 getTrailingObjects<TemplateArgumentLoc>(), List);
1485 return getTrailingObjects<TemplateArgumentLoc>();
1493 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->NumTemplateArgs;
1532 return DeclRefExprBits.CapturedByCopyInLambdaWithExplicitObjectParameter;
1542 return T->getStmtClass() == DeclRefExprClass;
1586 return T->getStmtClass() == IntegerLiteralClass;
1604 :
Expr(FixedPointLiteralClass,
Empty) {}
1612 const llvm::APInt &
V,
1634 return T->getStmtClass() == FixedPointLiteralClass;
1658 Value(value), Loc(l) {
1683 return T->getStmtClass() == CharacterLiteralClass;
1700 FloatingLiteral(
const ASTContext &
C,
const llvm::APFloat &
V,
bool isexact,
1715 assert(&
getSemantics() == &Val.getSemantics() &&
"Inconsistent semantics");
1722 return static_cast<llvm::APFloatBase::Semantics
>(
1734 return llvm::APFloatBase::EnumToSemantics(
1735 static_cast<llvm::APFloatBase::Semantics
>(
1759 return T->getStmtClass() == FloatingLiteralClass;
1786 :
Expr(ImaginaryLiteralClass,
Empty) { }
1793 return Val->getBeginLoc();
1798 return T->getStmtClass() == ImaginaryLiteralClass;
1841class StringLiteral final
1843 private llvm::TrailingObjects<StringLiteral, unsigned, SourceLocation,
1846 friend TrailingObjects;
1862 unsigned numTrailingObjects(OverloadToken<unsigned>)
const {
return 1; }
1863 unsigned numTrailingObjects(OverloadToken<SourceLocation>)
const {
1867 unsigned numTrailingObjects(OverloadToken<char>)
const {
1871 char *getStrDataAsChar() {
return getTrailingObjects<char>(); }
1872 const char *getStrDataAsChar()
const {
return getTrailingObjects<char>(); }
1874 const uint16_t *getStrDataAsUInt16()
const {
1875 return reinterpret_cast<const uint16_t *
>(getTrailingObjects<char>());
1878 const uint32_t *getStrDataAsUInt32()
const {
1879 return reinterpret_cast<const uint32_t *
>(getTrailingObjects<char>());
1884 bool Pascal, QualType Ty, ArrayRef<SourceLocation> Locs);
1887 StringLiteral(
EmptyShell Empty,
unsigned NumConcatenated,
unsigned Length,
1888 unsigned CharByteWidth);
1891 static unsigned mapCharByteWidth(TargetInfo
const &
Target,
1895 void setStrTokenLoc(
unsigned TokNum, SourceLocation L) {
1897 getTrailingObjects<SourceLocation>()[TokNum] = L;
1903 static StringLiteral *
Create(
const ASTContext &Ctx, StringRef Str,
1905 ArrayRef<SourceLocation> Locs);
1908 static StringLiteral *
CreateEmpty(
const ASTContext &Ctx,
1909 unsigned NumConcatenated,
unsigned Length,
1910 unsigned CharByteWidth);
1914 "This function is used in places that assume strings use char");
1932 assert(I <
getLength() &&
"out of bounds access");
1935 return static_cast<unsigned char>(getStrDataAsChar()[I]);
1937 return getStrDataAsUInt16()[I];
1939 return getStrDataAsUInt32()[I];
1941 llvm_unreachable(
"Unsupported character width!");
1951 llvm::APInt AInt(Width, (uint64_t)
V);
1952 V = AInt.getSExtValue();
1969 unsigned getLength()
const {
return *getTrailingObjects<unsigned>(); }
2017 return getTrailingObjects<SourceLocation>()[TokNum];
2029 unsigned *StartToken =
nullptr,
2030 unsigned *StartTokenByteOffset =
nullptr)
const;
2035 return getTrailingObjects<SourceLocation>();
2046 return T->getStmtClass() == StringLiteralClass;
2072class PredefinedExpr final
2074 private llvm::TrailingObjects<PredefinedExpr, Stmt *> {
2076 friend TrailingObjects;
2091 assert(hasFunctionName() &&
2092 "This PredefinedExpr has no storage for a function name!");
2093 *getTrailingObjects() = SL;
2103 bool IsTransparent, StringLiteral *SL);
2107 bool HasFunctionName);
2119 return hasFunctionName()
2125 return hasFunctionName()
2136 const Decl *CurrentDecl,
2137 bool ForceElaboratedPrinting =
false);
2143 return T->getStmtClass() == PredefinedExprClass;
2148 return child_range(getTrailingObjects(hasFunctionName()));
2159class OpenACCAsteriskSizeExpr final :
public Expr {
2165 AsteriskLoc(AsteriskLoc) {}
2167 void setAsteriskLocation(
SourceLocation Loc) { AsteriskLoc = Loc; }
2171 SourceLocation Loc);
2179 return T->getStmtClass() == OpenACCAsteriskSizeExprClass;
2195class SYCLUniqueStableNameExpr final :
public Expr {
2208 void setLParenLocation(SourceLocation L) { LParen = L; }
2209 void setRParenLocation(SourceLocation L) { RParen = L; }
2229 return T->getStmtClass() == SYCLUniqueStableNameExprClass;
2259 L(l), R(r), Val(val) {
2284 return T->getStmtClass() == ParenExprClass;
2297 ParenExprBits.ProducedByFoldExpansion = ProducedByFoldExpansion;
2313 private llvm::TrailingObjects<UnaryOperator, FPOptionsOverride> {
2318 return *getTrailingObjects();
2323 return *getTrailingObjects();
2384 return Op == UO_PostInc || Op == UO_PostDec;
2389 return Op == UO_PreInc || Op == UO_PreDec;
2396 return Op == UO_PreInc || Op == UO_PostInc;
2403 return Op == UO_PreDec || Op == UO_PostDec;
2415 return Op >= UO_Plus && Op <= UO_LNot;
2440 return T->getStmtClass() == UnaryOperatorClass;
2454 return getTrailingFPFeatures();
2506 enum { MaskBits = 2, Mask = 0x03 };
2526 : Range(LBracketLoc, RBracketLoc), Data((Index << 2) |
Array) {}
2530 : Range(DotLoc.isValid() ? DotLoc : NameLoc, NameLoc),
2536 : Range(DotLoc.isValid() ? DotLoc : NameLoc, NameLoc),
2594class OffsetOfExpr final
2596 private llvm::TrailingObjects<OffsetOfExpr, OffsetOfNode, Expr *> {
2605 size_t numTrailingObjects(OverloadToken<OffsetOfNode>)
const {
2614 explicit OffsetOfExpr(
unsigned numComps,
unsigned numExprs)
2616 TSInfo(
nullptr), NumComps(numComps), NumExprs(numExprs) {}
2626 unsigned NumComps,
unsigned NumExprs);
2644 return getTrailingObjects<OffsetOfNode>(NumComps)[Idx];
2648 getTrailingObjects<OffsetOfNode>(NumComps)[Idx] = ON;
2656 return getTrailingObjects<Expr *>(NumExprs)[Idx];
2660 return getTrailingObjects<Expr *>(NumExprs)[Idx];
2664 getTrailingObjects<Expr *>(NumComps)[Idx] = E;
2675 return T->getStmtClass() == OffsetOfExprClass;
2680 Stmt **begin =
reinterpret_cast<Stmt **
>(getTrailingObjects<Expr *>());
2684 Stmt *
const *begin =
2685 reinterpret_cast<Stmt *
const *
>(getTrailingObjects<Expr *>());
2707 OpLoc(op), RParenLoc(rp) {
2708 assert(ExprKind <= UETT_Last &&
"invalid enum value!");
2710 assert(
static_cast<unsigned>(ExprKind) ==
2712 "UnaryExprOrTypeTraitExprBits.Kind overflow!");
2714 Argument.Ty = TInfo;
2724 :
Expr(UnaryExprOrTypeTraitExprClass,
Empty) { }
2730 assert(K <= UETT_Last &&
"invalid enum value!");
2733 "UnaryExprOrTypeTraitExprBits.Kind overflow!");
2741 assert(
isArgumentType() &&
"calling getArgumentType() when arg is expr");
2745 assert(!
isArgumentType() &&
"calling getArgumentExpr() when arg is type");
2746 return static_cast<Expr*
>(Argument.Ex);
2757 Argument.Ty = TInfo;
2777 return T->getStmtClass() == UnaryExprOrTypeTraitExprClass;
2791 enum { LHS, RHS, END_EXPR };
2792 Stmt *SubExprs[END_EXPR];
2799 :
Expr(ArraySubscriptExprClass, t,
VK, OK) {
2800 SubExprs[LHS] = lhs;
2801 SubExprs[RHS] = rhs;
2808 :
Expr(ArraySubscriptExprClass, Shell) { }
2850 return T->getStmtClass() == ArraySubscriptExprClass;
2855 return child_range(&SubExprs[0], &SubExprs[0]+END_EXPR);
2865 enum { BASE, ROW_IDX, END_EXPR };
2866 Stmt *SubExprs[END_EXPR];
2877 :
Expr(MatrixSingleSubscriptExprClass,
T,
2880 SubExprs[BASE] =
Base;
2881 SubExprs[ROW_IDX] = RowIdx;
2888 :
Expr(MatrixSingleSubscriptExprClass, Shell) {}
2916 return T->getStmtClass() == MatrixSingleSubscriptExprClass;
2921 return child_range(&SubExprs[0], &SubExprs[0] + END_EXPR);
2935 enum { BASE, ROW_IDX, COLUMN_IDX, END_EXPR };
2936 Stmt *SubExprs[END_EXPR];
2943 SubExprs[BASE] =
Base;
2944 SubExprs[ROW_IDX] = RowIdx;
2945 SubExprs[COLUMN_IDX] = ColumnIdx;
2952 :
Expr(MatrixSubscriptExprClass, Shell) {}
2956 assert((SubExprs[COLUMN_IDX] || IsIncomplete) &&
2957 "expressions without column index must be marked as incomplete");
2958 return IsIncomplete;
2971 "cannot get the column index of an incomplete expression");
2994 return T->getStmtClass() == MatrixSubscriptExprClass;
2999 return child_range(&SubExprs[0], &SubExprs[0] + END_EXPR);
3013 enum { FN = 0, PREARGS_START = 1 };
3050 template <
typename T>
3051 static constexpr unsigned
3059 Stmt **getTrailingStmts() {
3060 return reinterpret_cast<Stmt **
>(
reinterpret_cast<char *
>(
this) +
3063 Stmt *
const *getTrailingStmts()
const {
3064 return const_cast<CallExpr *
>(
this)->getTrailingStmts();
3067 unsigned getSizeOfTrailingStmts()
const {
3071 size_t getOffsetOfTrailingFPFeatures()
const {
3096 bool HasFPFeatures) {
3097 return (1 + NumPreArgs + NumArgs) *
sizeof(
Stmt *) +
3102 assert(I <
getNumPreArgs() &&
"Prearg access out of range!");
3103 return getTrailingStmts()[PREARGS_START + I];
3106 assert(I <
getNumPreArgs() &&
"Prearg access out of range!");
3107 return getTrailingStmts()[PREARGS_START + I];
3110 assert(I <
getNumPreArgs() &&
"Prearg access out of range!");
3111 getTrailingStmts()[PREARGS_START + I] = PreArg;
3121 getSizeOfTrailingStmts());
3127 getSizeOfTrailingStmts());
3157 bool HasFPFeatures, EmptyShell
Empty);
3174 return CallExprBits.ExplicitObjectMemFunUsingMemberSyntax;
3182 updateTrailingSourceLoc();
3207 return reinterpret_cast<Expr **
>(getTrailingStmts() + PREARGS_START +
3211 return reinterpret_cast<const Expr *
const *
>(
3217 assert(Arg <
getNumArgs() &&
"Arg access out of range!");
3221 assert(Arg <
getNumArgs() &&
"Arg access out of range!");
3230 assert(Arg <
getNumArgs() &&
"Arg access out of range!");
3238 ArrayRef(
reinterpret_cast<Expr **
>(getTrailingStmts() + PREARGS_START),
3250 "shrinkNumArgs cannot increase the number of arguments!");
3251 NumArgs = NewNumArgs;
3270 return getTrailingStmts() + PREARGS_START +
getNumPreArgs();
3275 return getTrailingStmts() + PREARGS_START +
getNumPreArgs();
3333 std::pair<const NamedDecl *, const WarnUnusedResultAttr *>
3351 reinterpret_cast<const char *
>(
this + 1));
3369 bool hasTrailingSourceLoc()
const {
3373 void updateTrailingSourceLoc() {
3375 "Trailing source loc already set?");
3377 "Calling setTrailingSourceLocs on a subclass of CallExpr");
3382 reinterpret_cast<SourceLocation *
>(
reinterpret_cast<char *
>(
this + 1));
3404 std::optional<llvm::APInt>
3410 return T->getStmtClass() >= firstCallExprConstant &&
3411 T->getStmtClass() <= lastCallExprConstant;
3416 return child_range(getTrailingStmts(), getTrailingStmts() + PREARGS_START +
3422 getTrailingStmts() + PREARGS_START +
3429class MemberExpr final
3431 private llvm::TrailingObjects<MemberExpr, NestedNameSpecifierLoc,
3432 DeclAccessPair, ASTTemplateKWAndArgsInfo,
3433 TemplateArgumentLoc> {
3437 friend TrailingObjects;
3454 size_t numTrailingObjects(OverloadToken<NestedNameSpecifierLoc>)
const {
3458 size_t numTrailingObjects(OverloadToken<DeclAccessPair>)
const {
3459 return hasFoundDecl();
3462 size_t numTrailingObjects(OverloadToken<ASTTemplateKWAndArgsInfo>)
const {
3463 return hasTemplateKWAndArgsInfo();
3466 bool hasFoundDecl()
const {
return MemberExprBits.HasFoundDecl; }
3468 bool hasTemplateKWAndArgsInfo()
const {
3472 MemberExpr(
Expr *Base,
bool IsArrow, SourceLocation OperatorLoc,
3473 NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc,
3474 ValueDecl *MemberDecl, DeclAccessPair FoundDecl,
3475 const DeclarationNameInfo &NameInfo,
3476 const TemplateArgumentListInfo *TemplateArgs, QualType
T,
3479 :
Expr(MemberExprClass,
Empty), Base(), MemberDecl() {}
3482 static MemberExpr *
Create(
const ASTContext &
C,
Expr *Base,
bool IsArrow,
3483 SourceLocation OperatorLoc,
3484 NestedNameSpecifierLoc QualifierLoc,
3485 SourceLocation TemplateKWLoc, ValueDecl *MemberDecl,
3486 DeclAccessPair FoundDecl,
3487 DeclarationNameInfo MemberNameInfo,
3488 const TemplateArgumentListInfo *TemplateArgs,
3506 bool HasTemplateKWAndArgsInfo,
3507 unsigned NumTemplateArgs);
3521 if (!hasFoundDecl())
3524 return *getTrailingObjects<DeclAccessPair>();
3538 return *getTrailingObjects<NestedNameSpecifierLoc>();
3551 if (!hasTemplateKWAndArgsInfo())
3553 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->TemplateKWLoc;
3559 if (!hasTemplateKWAndArgsInfo())
3561 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->LAngleLoc;
3567 if (!hasTemplateKWAndArgsInfo())
3569 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->RAngleLoc;
3583 getTrailingObjects<ASTTemplateKWAndArgsInfo>()->copyInto(
3584 getTrailingObjects<TemplateArgumentLoc>(), List);
3593 return getTrailingObjects<TemplateArgumentLoc>();
3602 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->NumTemplateArgs;
3612 MemberLoc, MemberDNLoc);
3662 return T->getStmtClass() == MemberExprClass;
3683 llvm::PointerIntPair<TypeSourceInfo *, 1, bool> TInfoAndScope;
3687 mutable APValue *StaticValue =
nullptr;
3693 LParenLoc(lparenloc), TInfoAndScope(tinfo, fileScope), Init(init) {
3694 assert(Init &&
"Init is a nullptr");
3700 :
Expr(CompoundLiteralExprClass,
Empty) { }
3713 return TInfoAndScope.getPointer();
3716 TInfoAndScope.setPointer(tinfo);
3724 if (LParenLoc.isInvalid())
3725 return Init->getBeginLoc();
3731 return T->getStmtClass() == CompoundLiteralExprClass;
3748 bool CastConsistency()
const;
3751 return const_cast<CastExpr*
>(
this)->path_buffer();
3759 Expr *op,
unsigned BasePathSize,
bool HasFPFeatures)
3765 "BasePathSize overflow!");
3766 assert(CastConsistency());
3778 "BasePathSize overflow!");
3832 llvm::iterator_range<path_iterator>
path() {
3835 llvm::iterator_range<path_const_iterator>
path()
const {
3890 return T->getStmtClass() >= firstCastExprConstant &&
3891 T->getStmtClass() <= lastCastExprConstant;
3919class ImplicitCastExpr final
3921 private llvm::TrailingObjects<ImplicitCastExpr, CXXBaseSpecifier *,
3922 FPOptionsOverride> {
3927 :
CastExpr(ImplicitCastExprClass, ty,
VK,
kind, op, BasePathLength,
3935 explicit ImplicitCastExpr(
EmptyShell Shell,
unsigned PathSize,
3937 :
CastExpr(ImplicitCastExprClass, Shell, PathSize, HasFPFeatures) {}
3939 unsigned numTrailingObjects(OverloadToken<CXXBaseSpecifier *>)
const {
3948 FPO.requiresTrailingStorage()) {
3964 unsigned PathSize,
bool HasFPFeatures);
3974 return T->getStmtClass() == ImplicitCastExprClass;
4014 :
CastExpr(SC, Shell, PathSize, HasFPFeatures) {}
4027 return T->getStmtClass() >= firstExplicitCastExprConstant &&
4028 T->getStmtClass() <= lastExplicitCastExprConstant;
4035class CStyleCastExpr final
4037 private llvm::TrailingObjects<CStyleCastExpr, CXXBaseSpecifier *,
4038 FPOptionsOverride> {
4047 LPLoc(l), RPLoc(r) {
4053 explicit CStyleCastExpr(
EmptyShell Shell,
unsigned PathSize,
4057 unsigned numTrailingObjects(OverloadToken<CXXBaseSpecifier *>)
const {
4062 static CStyleCastExpr *
4068 unsigned PathSize,
bool HasFPFeatures);
4082 return T->getStmtClass() == CStyleCastExprClass;
4108 enum { LHS, RHS, END_EXPR };
4109 Stmt *SubExprs[END_EXPR];
4185 return Opc == BO_PtrMemD || Opc == BO_PtrMemI;
4190 return Opc >= BO_Mul && Opc <= BO_Rem;
4216 llvm_unreachable(
"Not a comparison operator.");
4217 case BO_LT:
return BO_GE;
4218 case BO_GT:
return BO_LE;
4219 case BO_LE:
return BO_GT;
4220 case BO_GE:
return BO_LT;
4221 case BO_EQ:
return BO_NE;
4222 case BO_NE:
return BO_EQ;
4229 llvm_unreachable(
"Not a comparison operator.");
4230 case BO_LT:
return BO_GT;
4231 case BO_GT:
return BO_LT;
4232 case BO_LE:
return BO_GE;
4233 case BO_GE:
return BO_LE;
4244 return Opc >= BO_Assign && Opc <= BO_OrAssign;
4249 return Opc > BO_Assign && Opc <= BO_OrAssign;
4256 if (Opc >= BO_AndAssign)
4257 return Opcode(
unsigned(Opc) - BO_AndAssign + BO_And);
4259 return Opcode(
unsigned(Opc) - BO_MulAssign + BO_Mul);
4263 return Opc == BO_ShlAssign || Opc == BO_ShrAssign;
4277 return S->
getStmtClass() >= firstBinaryOperatorConstant &&
4283 return child_range(&SubExprs[0], &SubExprs[0]+END_EXPR);
4385 ComputationLHSType(CompLHSType), ComputationResultType(CompResultType) {
4387 "Only should be used for compound assignments");
4392 bool hasFPFeatures);
4410 return S->
getStmtClass() == CompoundAssignOperatorClass;
4430 :
Expr(SC,
T,
VK, OK), QuestionLoc(qloc), ColonLoc(cloc) {}
4453 return T->getStmtClass() == ConditionalOperatorClass ||
4454 T->getStmtClass() == BinaryConditionalOperatorClass;
4461 enum { COND, LHS, RHS, END_EXPR };
4462 Stmt* SubExprs[END_EXPR];
4471 SubExprs[COND] = cond;
4472 SubExprs[LHS] = lhs;
4473 SubExprs[RHS] = rhs;
4505 return T->getStmtClass() == ConditionalOperatorClass;
4510 return child_range(&SubExprs[0], &SubExprs[0]+END_EXPR);
4523 enum { COMMON, COND, LHS, RHS, NUM_SUBEXPRS };
4530 Stmt *SubExprs[NUM_SUBEXPRS];
4541 OpaqueValue(opaqueValue) {
4542 SubExprs[COMMON] = common;
4543 SubExprs[COND] = cond;
4544 SubExprs[LHS] = lhs;
4545 SubExprs[RHS] = rhs;
4546 assert(OpaqueValue->getSourceExpr() == common &&
"Wrong opaque value");
4588 return T->getStmtClass() == BinaryConditionalOperatorClass;
4593 return child_range(SubExprs, SubExprs + NUM_SUBEXPRS);
4602 return co->getCond();
4608 return co->getTrueExpr();
4614 return co->getFalseExpr();
4626 LabelLoc(LLoc), Label(L) {
4646 return T->getStmtClass() == AddrLabelExprClass;
4671 LParenLoc(LParenLoc), RParenLoc(RParenLoc) {
4696 return T->getStmtClass() == StmtExprClass;
4739 return T->getStmtClass() == ShuffleVectorExprClass;
4753 "Arg access out of range!");
4758 "Arg access out of range!");
4766 "Shuffle idx out of range!");
4768 "Index expression must be a ConstantExpr");
4786class ConvertVectorExpr final
4788 private llvm::TrailingObjects<ConvertVectorExpr, FPOptionsOverride> {
4794 friend TrailingObjects;
4806 :
Expr(ConvertVectorExprClass, DstType,
VK, OK), SrcExpr(SrcExpr),
4807 TInfo(TI), BuiltinLoc(BuiltinLoc), RParenLoc(RParenLoc) {
4814 size_t numTrailingObjects(OverloadToken<FPOptionsOverride>)
const {
4818 FPOptionsOverride &getTrailingFPFeatures() {
4820 return *getTrailingObjects();
4823 const FPOptionsOverride &getTrailingFPFeatures()
const {
4825 return *getTrailingObjects();
4829 static ConvertVectorExpr *
CreateEmpty(
const ASTContext &
C,
4830 bool hasFPFeatures);
4832 static ConvertVectorExpr *
Create(
const ASTContext &
C,
Expr *SrcExpr,
4833 TypeSourceInfo *TI, QualType DstType,
4835 SourceLocation BuiltinLoc,
4836 SourceLocation RParenLoc,
4837 FPOptionsOverride FPFeatures);
4852 return getTrailingFPFeatures();
4898 return T->getStmtClass() == ConvertVectorExprClass;
4918 enum { COND, LHS, RHS, END_EXPR };
4919 Stmt* SubExprs[END_EXPR];
4926 :
Expr(ChooseExprClass, t,
VK, OK), BuiltinLoc(BLoc), RParenLoc(RP) {
4928 SubExprs[COND] = cond;
4929 SubExprs[LHS] = lhs;
4930 SubExprs[RHS] = rhs;
4942 "Dependent condition isn't true or false");
4974 return T->getStmtClass() == ChooseExprClass;
4979 return child_range(&SubExprs[0], &SubExprs[0]+END_EXPR);
5013 return T->getStmtClass() == GNUNullExprClass;
5032 llvm::PointerIntPair<TypeSourceInfo *, 2, VarArgKind> TInfo;
5038 TInfo(TInfo, VaKind), BuiltinLoc(BLoc), RParenLoc(RPLoc) {
5072 return T->getStmtClass() == VAArgExprClass;
5110 const Expr *DefaultExpr)
const;
5131 llvm_unreachable(
"unknown source location expression kind");
5152 return T->getStmtClass() == SourceLocExprClass;
5210 unsigned NumOfElements;
5214 unsigned Begin,
unsigned NumOfElements);
5234 template <
bool Const>
5235 class ChildElementIter
5236 :
public llvm::iterator_facade_base<
5237 ChildElementIter<Const>, std::random_access_iterator_tag,
5238 std::conditional_t<Const, const IntegerLiteral *,
5239 IntegerLiteral *>> {
5243 unsigned long long CurOffset = ULLONG_MAX;
5244 using BaseTy =
typename ChildElementIter::iterator_facade_base;
5254 assert(EExpr && CurOffset != ULLONG_MAX &&
5255 "trying to dereference an invalid iterator");
5259 EExpr->Data->BinaryData->getCodeUnit(CurOffset),
5263 return const_cast<typename BaseTy::reference
>(EExpr->FakeChildNode);
5266 using BaseTy::operator++;
5268 assert(EExpr &&
"trying to increment an invalid iterator");
5269 assert(CurOffset != ULLONG_MAX &&
5270 "Already at the end of what we can iterate over");
5272 EExpr->getDataElementCount() + EExpr->getStartingElementPos()) {
5273 CurOffset = ULLONG_MAX;
5279 return (EExpr ==
Other.EExpr && CurOffset ==
Other.CurOffset);
5307 return T->getStmtClass() == EmbedExprClass;
5316 template <
typename Call,
typename... Targs>
5318 Targs &&...Fargs)
const {
5320 if (!std::invoke(std::forward<Call>(
C),
const_cast<IntegerLiteral *
>(It),
5321 StartingIndexInArray, std::forward<Targs>(Fargs)...))
5323 StartingIndexInArray++;
5380 InitExprsTy InitExprs;
5388 llvm::PointerIntPair<InitListExpr *, 1, bool> AltForm;
5397 llvm::PointerUnion<Expr *, FieldDecl *> ArrayFillerOrUnionFieldInit;
5415 unsigned Sum = InitExprs.size();
5416 for (
auto *IE : InitExprs)
5418 Sum += EE->getDataElementCount() - 1;
5426 if (InitExprs.size() != 1)
5430 return !EE || EE->getDataElementCount() == 1;
5438 return reinterpret_cast<Expr *
const *
>(InitExprs.data());
5445 return cast_or_null<Expr>(InitExprs[
Init]);
5450 return cast_or_null<Expr>(InitExprs[
Init]);
5492 return dyn_cast_if_present<Expr *>(ArrayFillerOrUnionFieldInit);
5505 return llvm::any_of(
5516 return dyn_cast_if_present<FieldDecl *>(ArrayFillerOrUnionFieldInit);
5522 assert((FD ==
nullptr
5525 &&
"Only one field of a union may be initialized at a time!");
5526 ArrayFillerOrUnionFieldInit = FD;
5556 return !AltForm.getInt() || !AltForm.getPointer();
5563 AltForm.setPointer(
Init);
5564 AltForm.setInt(
true);
5565 Init->AltForm.setPointer(
this);
5566 Init->AltForm.setInt(
false);
5580 return T->getStmtClass() == InitListExprClass;
5592 if (InitExprs.empty())
5635class DesignatedInitExpr final
5637 private llvm::TrailingObjects<DesignatedInitExpr, Stmt *> {
5649 LLVM_PREFERRED_TYPE(
bool)
5650 unsigned GNUSyntax : 1;
5653 unsigned NumDesignators : 15;
5658 unsigned NumSubExprs : 16;
5669 explicit DesignatedInitExpr(
unsigned NumSubExprs)
5671 NumDesignators(0), NumSubExprs(NumSubExprs), Designators(
nullptr) { }
5682 struct FieldDesignatorInfo {
5699 : NameOrField(
reinterpret_cast<uintptr_t>(II) | 0x1), DotLoc(DotLoc),
5700 FieldLoc(FieldLoc) {}
5704 struct ArrayOrRangeDesignatorInfo {
5719 ArrayOrRangeDesignatorInfo(
unsigned Index,
SourceLocation LBracketLoc,
5721 : Index(Index), LBracketLoc(LBracketLoc), RBracketLoc(RBracketLoc) {}
5723 ArrayOrRangeDesignatorInfo(
unsigned Index,
5727 : Index(Index), LBracketLoc(LBracketLoc), EllipsisLoc(EllipsisLoc),
5728 RBracketLoc(RBracketLoc) {}
5732 enum DesignatorKind {
5735 ArrayRangeDesignator
5738 DesignatorKind Kind;
5748 Designator(DesignatorKind Kind) : Kind(Kind) {}
5764 Designator D(FieldDesignator);
5765 new (&D.
FieldInfo) FieldDesignatorInfo(FieldName, DotLoc, FieldLoc);
5800 Designator D(ArrayDesignator);
5811 Designator D(ArrayRangeDesignator);
5820 "Only valid on an array or array-range designator");
5826 "Only valid on an array or array-range designator");
5832 "Only valid on an array-range designator");
5838 "Only valid on an array or array-range designator");
5864 unsigned NumIndexExprs);
5867 unsigned size()
const {
return NumDesignators; }
5871 return {Designators, NumDesignators};
5875 return {Designators, NumDesignators};
5884 unsigned NumDesigs);
5920 return cast<Expr>(getTrailingObjects(NumSubExprs)[Idx]);
5924 getTrailingObjects(NumSubExprs)[Idx] = E;
5938 return T->getStmtClass() == DesignatedInitExprClass;
5943 Stmt **begin = getTrailingObjects();
5947 Stmt *
const *begin = getTrailingObjects();
5974 return T->getStmtClass() == NoInitExprClass;
6003 Stmt *BaseAndUpdaterExprs[2];
6010 :
Expr(DesignatedInitUpdateExprClass,
Empty) { }
6016 return T->getStmtClass() == DesignatedInitUpdateExprClass;
6030 return child_range(&BaseAndUpdaterExprs[0], &BaseAndUpdaterExprs[0] + 2);
6034 &BaseAndUpdaterExprs[0] + 2);
6054class ArrayInitLoopExpr :
public Expr {
6058 :
Expr(ArrayInitLoopExprClass,
Empty), SubExprs{} {}
6063 SubExprs{CommonInit, ElementInit} {
6107class ArrayInitIndexExpr :
public Expr {
6109 :
Expr(ArrayInitIndexExprClass,
Empty) {}
6152 :
Expr(ImplicitValueInitExprClass,
Empty) { }
6155 return T->getStmtClass() == ImplicitValueInitExprClass;
6170class ParenListExpr final
6172 private llvm::TrailingObjects<ParenListExpr, Stmt *> {
6174 friend TrailingObjects;
6204 return const_cast<ParenListExpr *
>(
this)->
getExpr(
Init);
6210 return reinterpret_cast<Expr *
const *
>(getTrailingObjects());
6221 return T->getStmtClass() == ParenListExprClass;
6265class GenericSelectionExpr final
6267 private llvm::TrailingObjects<GenericSelectionExpr, Stmt *,
6271 friend TrailingObjects;
6277 unsigned NumAssocs : 15;
6278 unsigned ResultIndex : 15;
6279 LLVM_PREFERRED_TYPE(
bool)
6280 unsigned IsExprPredicate : 1;
6282 ResultDependentIndex = 0x7FFF
6285 unsigned getIndexOfControllingExpression()
const {
6289 assert(
isExprPredicate() &&
"Asking for the controlling expression of a "
6290 "selection expr predicated by a type");
6294 unsigned getIndexOfControllingType()
const {
6298 "selection expr predicated by an expression");
6302 unsigned getIndexOfStartOfAssociatedExprs()
const {
6309 unsigned getIndexOfStartOfAssociatedTypes()
const {
6318 SourceLocation DefaultLoc, RParenLoc;
6331 unsigned numTrailingObjects(OverloadToken<Stmt *>)
const {
6337 unsigned numTrailingObjects(OverloadToken<TypeSourceInfo *>)
const {
6343 template <
bool Const>
class AssociationIteratorTy;
6347 template <
bool Const>
class AssociationTy {
6348 friend class GenericSelectionExpr;
6349 template <
bool OtherConst>
friend class AssociationIteratorTy;
6350 using ExprPtrTy = std::conditional_t<Const, const Expr *, Expr *>;
6352 std::conditional_t<Const, const TypeSourceInfo *, TypeSourceInfo *>;
6356 AssociationTy(ExprPtrTy E, TSIPtrTy TSI,
bool Selected)
6357 : E(E), TSI(TSI), Selected(Selected) {}
6360 ExprPtrTy getAssociationExpr()
const {
return E; }
6361 TSIPtrTy getTypeSourceInfo()
const {
return TSI; }
6362 QualType
getType()
const {
return TSI ? TSI->getType() : QualType(); }
6363 bool isSelected()
const {
return Selected; }
6364 AssociationTy *operator->() {
return this; }
6365 const AssociationTy *operator->()
const {
return this; }
6372 template <
bool Const>
6373 class AssociationIteratorTy
6374 :
public llvm::iterator_facade_base<
6375 AssociationIteratorTy<Const>, std::input_iterator_tag,
6376 AssociationTy<Const>, std::ptrdiff_t, AssociationTy<Const>,
6377 AssociationTy<Const>> {
6378 friend class GenericSelectionExpr;
6392 using BaseTy =
typename AssociationIteratorTy::iterator_facade_base;
6393 using StmtPtrPtrTy =
6394 std::conditional_t<Const, const Stmt *const *, Stmt **>;
6395 using TSIPtrPtrTy = std::conditional_t<
Const,
const TypeSourceInfo *
const *,
6397 StmtPtrPtrTy E =
nullptr;
6399 unsigned Offset = 0, SelectedOffset = 0;
6400 AssociationIteratorTy(StmtPtrPtrTy E, TSIPtrPtrTy TSI,
unsigned Offset,
6401 unsigned SelectedOffset)
6402 : E(E), TSI(TSI), Offset(Offset), SelectedOffset(SelectedOffset) {}
6406 typename BaseTy::reference
operator*()
const {
6407 return AssociationTy<Const>(
cast<Expr>(*E), *TSI,
6408 Offset == SelectedOffset);
6410 typename BaseTy::pointer operator->()
const {
return **
this; }
6411 using BaseTy::operator++;
6412 AssociationIteratorTy &operator++() {
6418 bool operator==(AssociationIteratorTy
Other)
const {
return E ==
Other.E; }
6423 GenericSelectionExpr(
const ASTContext &Context, SourceLocation GenericLoc,
6424 Expr *ControllingExpr,
6425 ArrayRef<TypeSourceInfo *> AssocTypes,
6426 ArrayRef<Expr *> AssocExprs, SourceLocation DefaultLoc,
6427 SourceLocation RParenLoc,
6428 bool ContainsUnexpandedParameterPack,
6429 unsigned ResultIndex);
6433 GenericSelectionExpr(
const ASTContext &Context, SourceLocation GenericLoc,
6434 Expr *ControllingExpr,
6435 ArrayRef<TypeSourceInfo *> AssocTypes,
6436 ArrayRef<Expr *> AssocExprs, SourceLocation DefaultLoc,
6437 SourceLocation RParenLoc,
6438 bool ContainsUnexpandedParameterPack);
6442 GenericSelectionExpr(
const ASTContext &Context, SourceLocation GenericLoc,
6443 TypeSourceInfo *ControllingType,
6444 ArrayRef<TypeSourceInfo *> AssocTypes,
6445 ArrayRef<Expr *> AssocExprs, SourceLocation DefaultLoc,
6446 SourceLocation RParenLoc,
6447 bool ContainsUnexpandedParameterPack,
6448 unsigned ResultIndex);
6452 GenericSelectionExpr(
const ASTContext &Context, SourceLocation GenericLoc,
6453 TypeSourceInfo *ControllingType,
6454 ArrayRef<TypeSourceInfo *> AssocTypes,
6455 ArrayRef<Expr *> AssocExprs, SourceLocation DefaultLoc,
6456 SourceLocation RParenLoc,
6457 bool ContainsUnexpandedParameterPack);
6465 static GenericSelectionExpr *
6466 Create(
const ASTContext &Context, SourceLocation GenericLoc,
6467 Expr *ControllingExpr, ArrayRef<TypeSourceInfo *> AssocTypes,
6468 ArrayRef<Expr *> AssocExprs, SourceLocation DefaultLoc,
6469 SourceLocation RParenLoc,
bool ContainsUnexpandedParameterPack,
6470 unsigned ResultIndex);
6474 static GenericSelectionExpr *
6475 Create(
const ASTContext &Context, SourceLocation GenericLoc,
6476 Expr *ControllingExpr, ArrayRef<TypeSourceInfo *> AssocTypes,
6477 ArrayRef<Expr *> AssocExprs, SourceLocation DefaultLoc,
6478 SourceLocation RParenLoc,
bool ContainsUnexpandedParameterPack);
6482 static GenericSelectionExpr *
6483 Create(
const ASTContext &Context, SourceLocation GenericLoc,
6484 TypeSourceInfo *ControllingType, ArrayRef<TypeSourceInfo *> AssocTypes,
6485 ArrayRef<Expr *> AssocExprs, SourceLocation DefaultLoc,
6486 SourceLocation RParenLoc,
bool ContainsUnexpandedParameterPack,
6487 unsigned ResultIndex);
6491 static GenericSelectionExpr *
6492 Create(
const ASTContext &Context, SourceLocation GenericLoc,
6493 TypeSourceInfo *ControllingType, ArrayRef<TypeSourceInfo *> AssocTypes,
6494 ArrayRef<Expr *> AssocExprs, SourceLocation DefaultLoc,
6495 SourceLocation RParenLoc,
bool ContainsUnexpandedParameterPack);
6498 static GenericSelectionExpr *
CreateEmpty(
const ASTContext &Context,
6499 unsigned NumAssocs);
6507 llvm::iterator_range<ConstAssociationIterator>;
6517 "Generic selection is result-dependent but getResultIndex called!");
6535 getTrailingObjects<Stmt *>()[getIndexOfControllingExpression()]);
6539 getTrailingObjects<Stmt *>()[getIndexOfControllingExpression()]);
6546 return getTrailingObjects<TypeSourceInfo *>()[getIndexOfControllingType()];
6549 return getTrailingObjects<TypeSourceInfo *>()[getIndexOfControllingType()];
6556 getTrailingObjects<Stmt *>()[getIndexOfStartOfAssociatedExprs() +
6561 getTrailingObjects<Stmt *>()[getIndexOfStartOfAssociatedExprs() +
6566 return {
reinterpret_cast<Expr *
const *
>(getTrailingObjects<Stmt *>() +
6567 getIndexOfStartOfAssociatedExprs()),
6571 return {getTrailingObjects<TypeSourceInfo *>() +
6572 getIndexOfStartOfAssociatedTypes(),
6580 "Out-of-range index in GenericSelectionExpr::getAssociation!");
6583 getTrailingObjects<Stmt *>()[getIndexOfStartOfAssociatedExprs() +
6591 "Out-of-range index in GenericSelectionExpr::getAssociation!");
6594 getTrailingObjects<Stmt *>()[getIndexOfStartOfAssociatedExprs() +
6603 getIndexOfStartOfAssociatedExprs(),
6604 getTrailingObjects<TypeSourceInfo *>() +
6605 getIndexOfStartOfAssociatedTypes(),
6608 NumAssocs, ResultIndex);
6609 return llvm::make_range(Begin, End);
6614 getIndexOfStartOfAssociatedExprs(),
6615 getTrailingObjects<TypeSourceInfo *>() +
6616 getIndexOfStartOfAssociatedTypes(),
6619 NumAssocs, ResultIndex);
6620 return llvm::make_range(Begin, End);
6632 return T->getStmtClass() == GenericSelectionExprClass;
6637 numTrailingObjects(OverloadToken<Stmt *>())));
6641 numTrailingObjects(OverloadToken<Stmt *>())));
6724 return T->getStmtClass() == ExtVectorElementExprClass;
6752 return T->getStmtClass() == MatrixElementExprClass;
6790 return T->getStmtClass() == BlockExprClass;
6832 :
Expr(AsTypeExprClass, DstType,
VK, OK), SrcExpr(SrcExpr),
6833 BuiltinLoc(BuiltinLoc), RParenLoc(RParenLoc) {
6850 return T->getStmtClass() == AsTypeExprClass;
6888class PseudoObjectExpr final
6890 private llvm::TrailingObjects<PseudoObjectExpr, Expr *> {
6904 unsigned resultIndex);
6906 PseudoObjectExpr(
EmptyShell shell,
unsigned numSemanticExprs);
6908 unsigned getNumSubExprs()
const {
6919 unsigned resultIndex);
6922 unsigned numSemanticExprs);
6944 return const_cast<PseudoObjectExpr*
>(
this)->
getResultExpr();
6953 return getTrailingObjects() + 1;
6956 return getTrailingObjects() + getNumSubExprs();
6959 return getTrailingObjects() + getNumSubExprs();
6963 return getTrailingObjects(getNumSubExprs()).drop_front();
6966 return getTrailingObjects(getNumSubExprs()).drop_front();
6970 return getTrailingObjects(getNumSubExprs())[
index + 1];
6989 const_cast<const PseudoObjectExpr *
>(
this)->
children();
6994 Stmt *
const *cs =
const_cast<Stmt *
const *
>(
6995 reinterpret_cast<const Stmt *
const *
>(getTrailingObjects()));
7000 return T->getStmtClass() == PseudoObjectExprClass;
7017#define ATOMIC_BUILTIN(ID, TYPE, ATTRS) AO ## ID,
7018#include "clang/Basic/Builtins.inc"
7027 enum {
PTR, ORDER, VAL1, ORDER_FAIL, VAL2, WEAK, END_EXPR };
7028 Stmt *SubExprs[END_EXPR + 1];
7029 unsigned NumSubExprs;
7030 SourceLocation BuiltinLoc, RParenLoc;
7053 return cast<Expr>(SubExprs[NumSubExprs - 1]);
7056 if (Op == AO__c11_atomic_init || Op == AO__opencl_atomic_init)
7058 assert(NumSubExprs > VAL1);
7062 assert(NumSubExprs > ORDER_FAIL);
7066 if (Op == AO__atomic_exchange || Op == AO__scoped_atomic_exchange)
7068 assert(NumSubExprs > VAL2);
7072 assert(NumSubExprs > WEAK);
7080#define ATOMIC_BUILTIN(ID, TYPE, ATTRS) \
7083#include "clang/Basic/Builtins.inc"
7085 llvm_unreachable(
"not an atomic operator?");
7091 return reinterpret_cast<Expr *
const *
>(SubExprs);
7099 return getOp() == AO__c11_atomic_compare_exchange_strong ||
7100 getOp() == AO__c11_atomic_compare_exchange_weak ||
7101 getOp() == AO__hip_atomic_compare_exchange_strong ||
7102 getOp() == AO__opencl_atomic_compare_exchange_strong ||
7103 getOp() == AO__opencl_atomic_compare_exchange_weak ||
7104 getOp() == AO__hip_atomic_compare_exchange_weak ||
7105 getOp() == AO__atomic_compare_exchange ||
7106 getOp() == AO__atomic_compare_exchange_n ||
7107 getOp() == AO__scoped_atomic_compare_exchange ||
7108 getOp() == AO__scoped_atomic_compare_exchange_n;
7113 case AO__atomic_load_n:
7114 case AO__scoped_atomic_load_n:
7115 case AO__c11_atomic_load:
7116 case AO__opencl_atomic_load:
7117 case AO__hip_atomic_load:
7118 case AO__atomic_test_and_set:
7119 case AO__atomic_clear:
7127 return getOp() >= AO__opencl_atomic_compare_exchange_strong &&
7128 getOp() <= AO__opencl_atomic_store;
7132 return Op >= AO__hip_atomic_compare_exchange_strong &&
7133 Op <= AO__hip_atomic_store;
7149 return T->getStmtClass() == AtomicExprClass;
7154 return child_range(SubExprs, SubExprs+NumSubExprs);
7165 if (Op >= AO__opencl_atomic_compare_exchange_strong &&
7166 Op <= AO__opencl_atomic_store && Op != AO__opencl_atomic_init)
7168 if (Op >= AO__hip_atomic_compare_exchange_strong &&
7169 Op <= AO__hip_atomic_store)
7171 if (Op >= AO__scoped_atomic_add_fetch && Op <= AO__scoped_atomic_xor_fetch)
7319 OPENACC_END_EXPR = STRIDE
7323 Stmt *SubExprs[END_EXPR] = {
nullptr};
7324 SourceLocation ColonLocFirst;
7325 SourceLocation ColonLocSecond;
7326 SourceLocation RBracketLoc;
7335 ColonLocFirst(ColonLocFirst), ColonLocSecond(ColonLocSecond),
7336 RBracketLoc(RBracketLoc) {
7338 setLowerBound(LowerBound);
7349 ColonLocFirst(ColonLoc), RBracketLoc(RBracketLoc) {
7351 setLowerBound(LowerBound);
7358 :
Expr(ArraySectionExprClass, Shell) {}
7376 return T->getStmtClass() == ArraySectionExprClass;
7389 return cast_or_null<Expr>(SubExprs[LOWER_BOUND]);
7399 "Stride not valid in OpenACC subarrays");
7400 return cast_or_null<Expr>(SubExprs[STRIDE]);
7405 "Stride not valid in OpenACC subarrays");
7406 return cast_or_null<Expr>(SubExprs[STRIDE]);
7417 "second colon for stride not valid in OpenACC subarrays");
7418 return ColonLocSecond;
7440 void setBase(
Expr *E) { SubExprs[BASE] = E; }
7443 void setLowerBound(
Expr *E) { SubExprs[LOWER_BOUND] = E; }
7446 void setLength(
Expr *E) { SubExprs[LENGTH] = E; }
7449 void setStride(
Expr *E) {
7451 "Stride not valid in OpenACC subarrays");
7452 SubExprs[STRIDE] = E;
7455 void setColonLocFirst(SourceLocation L) { ColonLocFirst = L; }
7457 void setColonLocSecond(SourceLocation L) {
7459 "second colon for stride not valid in OpenACC subarrays");
7462 void setRBracketLoc(SourceLocation L) { RBracketLoc = L; }
7483class HLSLOutArgExpr :
public Expr {
7493 Stmt *SubExprs[NumSubExprs];
7497 Expr *WB,
bool IsInOut)
7500 SubExprs[BaseLValue] = B;
7501 SubExprs[CastedTemporary] = OpV;
7502 SubExprs[WritebackCast] = WB;
7503 assert(!Ty->
isDependentType() &&
"HLSLOutArgExpr given a dependent type!");
7506 explicit HLSLOutArgExpr(EmptyShell Shell)
7507 :
Expr(HLSLOutArgExprClass, Shell) {}
7510 static HLSLOutArgExpr *
Create(
const ASTContext &
C, QualType Ty,
7511 OpaqueValueExpr *Base, OpaqueValueExpr *OpV,
7512 Expr *WB,
bool IsInOut);
7513 static HLSLOutArgExpr *
CreateEmpty(
const ASTContext &Ctx);
7545 return SubExprs[BaseLValue]->getBeginLoc();
7549 return SubExprs[BaseLValue]->getEndLoc();
7553 return T->getStmtClass() == HLSLOutArgExprClass;
7558 return child_range(&SubExprs[BaseLValue], &SubExprs[NumSubExprs]);
7588class RecoveryExpr final :
public Expr,
7589 private llvm::TrailingObjects<RecoveryExpr, Expr *> {
7603 Stmt **B =
reinterpret_cast<Stmt **
>(getTrailingObjects());
7611 return T->getStmtClass() == RecoveryExprClass;
7618 :
Expr(RecoveryExprClass,
Empty), NumExprs(NumSubExprs) {}
7620 size_t numTrailingObjects(OverloadToken<Stmt *>)
const {
return NumExprs; }
7622 SourceLocation BeginLoc, EndLoc;
7624 friend TrailingObjects;
7650 const Expr **OutArrayIndex =
nullptr,
7651 QualType *OutArrayElementTy =
nullptr);
Defines enumerations for traits support.
static bool CanThrow(Expr *E, ASTContext &Ctx)
clang::CharUnits operator*(clang::CharUnits::QuantityType Scale, clang::CharUnits CU)
Defines the clang::LangOptions interface.
static DiagnosticBuilder Diag(DiagnosticsEngine *Diags, const LangOptions &Features, FullSourceLoc TokLoc, const char *TokBegin, const char *TokRangeBegin, const char *TokRangeEnd, unsigned DiagID)
Produce a diagnostic highlighting some portion of a literal.
*collection of selector each with an associated kind and an ordered *collection of selectors A selector has a kind
Provides definitions for the atomic synchronization scopes.
C Language Family Type Representation.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
a trap message and trap category.
llvm::APFloat getValue(const llvm::fltSemantics &Semantics) const
void setValue(const ASTContext &C, const llvm::APFloat &Val)
unsigned getBitWidth() const
void setValue(const ASTContext &C, const llvm::APInt &Val)
llvm::APInt getValue() const
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat],...
@ None
There is no such object (it's outside its lifetime).
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
std::reverse_iterator< iterator > reverse_iterator
std::reverse_iterator< const_iterator > const_reverse_iterator
const Stmt ** const_iterator
AbstractConditionalOperator(StmtClass SC, EmptyShell Empty)
SourceLocation getColonLoc() const
Expr * getCond() const
getCond - Return the expression representing the condition for the ?
static bool classof(const Stmt *T)
AbstractConditionalOperator(StmtClass SC, QualType T, ExprValueKind VK, ExprObjectKind OK, SourceLocation qloc, SourceLocation cloc)
Expr * getTrueExpr() const
getTrueExpr - Return the subexpression representing the value of the expression if the condition eval...
SourceLocation getQuestionLoc() const
friend class ASTStmtReader
Expr * getFalseExpr() const
getFalseExpr - Return the subexpression representing the value of the expression if the condition eva...
SourceLocation getAmpAmpLoc() const
static bool classof(const Stmt *T)
void setLabel(LabelDecl *L)
void setLabelLoc(SourceLocation L)
AddrLabelExpr(SourceLocation AALoc, SourceLocation LLoc, LabelDecl *L, QualType t)
void setAmpAmpLoc(SourceLocation L)
SourceLocation getEndLoc() const LLVM_READONLY
AddrLabelExpr(EmptyShell Empty)
Build an empty address of a label expression.
SourceLocation getLabelLoc() const
const_child_range children() const
SourceLocation getBeginLoc() const LLVM_READONLY
LabelDecl * getLabel() const
const_child_range children() const
ArrayInitIndexExpr(QualType T)
SourceLocation getBeginLoc() const LLVM_READONLY
static bool classof(const Stmt *S)
SourceLocation getEndLoc() const LLVM_READONLY
friend class ASTStmtReader
ArrayInitLoopExpr(QualType T, Expr *CommonInit, Expr *ElementInit)
const_child_range children() const
llvm::APInt getArraySize() const
SourceLocation getEndLoc() const LLVM_READONLY
static bool classof(const Stmt *S)
SourceLocation getBeginLoc() const LLVM_READONLY
OpaqueValueExpr * getCommonExpr() const
Get the common subexpression shared by all initializations (the source array).
Expr * getSubExpr() const
Get the initializer to use for each array element.
friend class ASTStmtWriter
friend class ASTStmtReader
const Expr * getStride() const
QualType getElementType() const
Return the effective 'element' type of this array section.
SourceLocation getRBracketLoc() const
const_child_range children() const
Expr * getBase()
Get base of the array section.
static bool classof(const Stmt *T)
SourceLocation getEndLoc() const LLVM_READONLY
Expr * getLength()
Get length of array section.
static QualType getBaseOriginalType(const Expr *Base)
Return original type of the base expression for array section.
SourceLocation getExprLoc() const LLVM_READONLY
const Expr * getLowerBound() const
bool isOMPArraySection() const
Expr * getStride()
Get stride of array section.
const Expr * getBase() const
ArraySectionExpr(Expr *Base, Expr *LowerBound, Expr *Length, QualType Type, ExprValueKind VK, ExprObjectKind OK, SourceLocation ColonLoc, SourceLocation RBracketLoc)
const Expr * getLength() const
ArraySectionExpr(EmptyShell Shell)
Create an empty array section expression.
friend class ASTStmtWriter
ArraySectionExpr(Expr *Base, Expr *LowerBound, Expr *Length, Expr *Stride, QualType Type, ExprValueKind VK, ExprObjectKind OK, SourceLocation ColonLocFirst, SourceLocation ColonLocSecond, SourceLocation RBracketLoc)
SourceLocation getColonLocSecond() const
Expr * getLowerBound()
Get lower bound of array section.
QualType getBaseType() const
Returns the effective 'type' of the base of this array section.
friend class ASTStmtReader
SourceLocation getBeginLoc() const LLVM_READONLY
bool isOpenACCArraySection() const
SourceLocation getColonLocFirst() const
ArraySubscriptExpr(Expr *lhs, Expr *rhs, QualType t, ExprValueKind VK, ExprObjectKind OK, SourceLocation rbracketloc)
SourceLocation getExprLoc() const LLVM_READONLY
const Expr * getLHS() const
const_child_range children() const
const Expr * getBase() const
SourceLocation getRBracketLoc() const
const Expr * getRHS() const
Expr * getLHS()
An array access can be written A[4] or 4[A] (both are equivalent).
SourceLocation getBeginLoc() const LLVM_READONLY
const Expr * getIdx() const
SourceLocation getEndLoc() const
void setRBracketLoc(SourceLocation L)
static bool classof(const Stmt *T)
ArraySubscriptExpr(EmptyShell Shell)
Create an empty array subscript expression.
Expr * getSrcExpr() const
getSrcExpr - Return the Expr to be converted.
SourceLocation getEndLoc() const LLVM_READONLY
AsTypeExpr(Expr *SrcExpr, QualType DstType, ExprValueKind VK, ExprObjectKind OK, SourceLocation BuiltinLoc, SourceLocation RParenLoc)
SourceLocation getBuiltinLoc() const
getBuiltinLoc - Return the location of the __builtin_astype token.
const_child_range children() const
SourceLocation getBeginLoc() const LLVM_READONLY
SourceLocation getRParenLoc() const
getRParenLoc - Return the location of final right parenthesis.
static bool classof(const Stmt *T)
friend class ASTStmtReader
static std::unique_ptr< AtomicScopeModel > getScopeModel(AtomicOp Op)
Get atomic scope model for the atomic op code.
SourceLocation getRParenLoc() const
SourceLocation getEndLoc() const LLVM_READONLY
QualType getValueType() const
AtomicExpr(EmptyShell Empty)
Build an empty AtomicExpr.
StringRef getOpAsString() const
bool threadPrivateMemoryAtomicsAreUndefined() const
Return true if atomics operations targeting allocations in private memory are undefined.
const Expr *const * getSubExprs() const
std::unique_ptr< AtomicScopeModel > getScopeModel() const
Get atomic scope model.
const_child_range children() const
SourceLocation getBeginLoc() const LLVM_READONLY
AtomicExpr(SourceLocation BLoc, ArrayRef< Expr * > args, QualType t, AtomicOp op, SourceLocation RP)
friend class ASTStmtReader
SourceLocation getBuiltinLoc() const
Expr * getOrderFail() const
bool hasVal1Operand() const
unsigned getNumSubExprs() const
static bool classof(const Stmt *T)
static std::unique_ptr< AtomicScopeModel > create(AtomicScopeModelKind K)
Create an atomic scope model by AtomicScopeModelKind.
static bool classof(const Stmt *T)
BinaryConditionalOperator(Expr *common, OpaqueValueExpr *opaqueValue, Expr *cond, Expr *lhs, Expr *rhs, SourceLocation qloc, SourceLocation cloc, QualType t, ExprValueKind VK, ExprObjectKind OK)
const_child_range children() const
SourceLocation getBeginLoc() const LLVM_READONLY
Expr * getFalseExpr() const
getFalseExpr - Return the subexpression which will be evaluated if the condition evaluates to false; ...
BinaryConditionalOperator(EmptyShell Empty)
Build an empty conditional operator.
friend class ASTStmtReader
OpaqueValueExpr * getOpaqueValue() const
getOpaqueValue - Return the opaque value placeholder.
SourceLocation getEndLoc() const LLVM_READONLY
Expr * getCond() const
getCond - Return the condition expression; this is defined in terms of the opaque value.
Expr * getTrueExpr() const
getTrueExpr - Return the subexpression which will be evaluated if the condition evaluates to true; th...
Expr * getCommon() const
getCommon - Return the common expression, written to the left of the condition.
A builtin binary operation expression such as "x + y" or "x <= y".
static bool isLogicalOp(Opcode Opc)
BinaryOperator(EmptyShell Empty)
Construct an empty binary operator.
static bool isRelationalOp(Opcode Opc)
static OverloadedOperatorKind getOverloadedOperator(Opcode Opc)
Retrieve the overloaded operator kind that corresponds to the given binary opcode.
const FPOptionsOverride * getTrailingFPFeatures() const
const_child_range children() const
static bool isComparisonOp(Opcode Opc)
void setHasStoredFPFeatures(bool B)
Set and fetch the bit that shows whether FPFeatures needs to be allocated in Trailing Storage.
void setOperatorLoc(SourceLocation L)
static bool isShiftOp(Opcode Opc)
bool isComparisonOp() const
FPOptionsOverride getStoredFPFeaturesOrDefault() const
Get the store FPOptionsOverride or default if not stored.
StringRef getOpcodeStr() const
static bool isCommaOp(Opcode Opc)
static Opcode getOpForCompoundAssignment(Opcode Opc)
SourceLocation getBeginLoc() const LLVM_READONLY
FPOptionsOverride * getTrailingFPFeatures()
Return a pointer to the trailing FPOptions.
bool isRelationalOp() const
SourceLocation getOperatorLoc() const
bool isFEnvAccessOn(const LangOptions &LO) const
Get the FENV_ACCESS status of this operator.
bool hasStoredFPFeatures() const
bool isCompoundAssignmentOp() const
static Opcode negateComparisonOp(Opcode Opc)
bool isMultiplicativeOp() const
SourceLocation getExprLoc() const
static Opcode reverseComparisonOp(Opcode Opc)
static bool isShiftAssignOp(Opcode Opc)
bool isFPContractableWithinStatement(const LangOptions &LO) const
Get the FP contractibility status of this operator.
static unsigned sizeOfTrailingObjects(bool HasFPFeatures)
Return the size in bytes needed for the trailing objects.
bool isEqualityOp() const
BinaryOperator(StmtClass SC, EmptyShell Empty)
Construct an empty BinaryOperator, SC is CompoundAssignOperator.
void setExcludedOverflowPattern(bool B)
Set and get the bit that informs arithmetic overflow sanitizers whether or not they should exclude ce...
static BinaryOperator * CreateEmpty(const ASTContext &C, bool hasFPFeatures)
FPOptionsOverride getStoredFPFeatures() const
Get FPFeatures from trailing storage.
static bool classof(const Stmt *S)
bool isAdditiveOp() const
static bool isAdditiveOp(Opcode Opc)
static bool isPtrMemOp(Opcode Opc)
predicates to categorize the respective opcodes.
static bool isAssignmentOp(Opcode Opc)
static bool isCompoundAssignmentOp(Opcode Opc)
bool isShiftAssignOp() const
SourceLocation getEndLoc() const LLVM_READONLY
FPOptions getFPFeaturesInEffect(const LangOptions &LO) const
Get the FP features status of this operator.
static bool isNullPointerArithmeticExtension(ASTContext &Ctx, Opcode Opc, const Expr *LHS, const Expr *RHS)
Return true if a binary operator using the specified opcode and operands would match the 'p = (i8*)nu...
void setStoredFPFeatures(FPOptionsOverride F)
Set FPFeatures in trailing storage, used only by Serialization.
FPOptionsOverride getFPFeatures() const
bool isAssignmentOp() const
static Opcode getOverloadedOpcode(OverloadedOperatorKind OO)
Retrieve the binary opcode that corresponds to the given overloaded operator.
size_t offsetOfTrailingStorage() const
static bool isEqualityOp(Opcode Opc)
bool hasExcludedOverflowPattern() const
void setOpcode(Opcode Opc)
static bool isBitwiseOp(Opcode Opc)
static bool isMultiplicativeOp(Opcode Opc)
BinaryOperator(const ASTContext &Ctx, Expr *lhs, Expr *rhs, Opcode opc, QualType ResTy, ExprValueKind VK, ExprObjectKind OK, SourceLocation opLoc, FPOptionsOverride FPFeatures)
Build a binary operator, assuming that appropriate storage has been allocated for the trailing object...
BinaryOperatorKind Opcode
Represents a block literal declaration, which is like an unnamed FunctionDecl.
BlockExpr(EmptyShell Empty)
Build an empty block expression.
SourceLocation getCaretLocation() const
SourceLocation getBeginLoc() const LLVM_READONLY
BlockDecl * getBlockDecl()
const Stmt * getBody() const
BlockExpr(BlockDecl *BD, QualType ty, bool ContainsUnexpandedParameterPack)
const_child_range children() const
SourceLocation getEndLoc() const LLVM_READONLY
void setBlockDecl(BlockDecl *BD)
static bool classof(const Stmt *T)
const FunctionProtoType * getFunctionType() const
getFunctionType - Return the underlying function type for this block.
const BlockDecl * getBlockDecl() const
This class is used for builtin types like 'int'.
static bool isPlaceholderTypeKind(Kind K)
Determines whether the given kind corresponds to a placeholder type.
SourceLocation getRParenLoc() const
static CStyleCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize, bool HasFPFeatures)
SourceLocation getBeginLoc() const LLVM_READONLY
void setRParenLoc(SourceLocation L)
static bool classof(const Stmt *T)
SourceLocation getLParenLoc() const
SourceLocation getEndLoc() const LLVM_READONLY
void setLParenLoc(SourceLocation L)
Represents a base class of a C++ class.
Represents a call to a member function that may be written either with member call syntax (e....
A call to an overloaded operator written using operator syntax.
Represents a C++ struct/union/class.
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Expr * getArg(unsigned Arg)
getArg - Return the specified argument.
bool hasStoredFPFeatures() const
const FPOptionsOverride * getTrailingFPFeatures() const
bool usesMemberSyntax() const
std::optional< llvm::APInt > evaluateBytesReturnedByAllocSizeCall(const ASTContext &Ctx) const
Evaluates the total size in bytes allocated by calling a function decorated with alloc_size.
static unsigned sizeOfTrailingObjects(unsigned NumPreArgs, unsigned NumArgs, bool HasFPFeatures)
Return the size in bytes needed for the trailing objects.
static constexpr ADLCallKind NotADL
const Stmt * getPreArg(unsigned I) const
SourceLocation getBeginLoc() const
void setRParenLoc(SourceLocation L)
const_arg_iterator arg_begin() const
static bool classof(const Stmt *T)
llvm::iterator_range< const_arg_iterator > const_arg_range
void setCoroElideSafe(bool V=true)
const Expr *const * getArgs() const
void setArg(unsigned Arg, Expr *ArgExpr)
setArg - Set the specified argument.
ConstExprIterator const_arg_iterator
ExprIterator arg_iterator
std::pair< const NamedDecl *, const WarnUnusedResultAttr * > getUnusedResultAttr(const ASTContext &Ctx) const
Returns the WarnUnusedResultAttr that is declared on the callee or its return type declaration,...
void setADLCallKind(ADLCallKind V=UsesADL)
const AllocSizeAttr * getCalleeAllocSizeAttr() const
Try to get the alloc_size attribute of the callee. May return null.
llvm::iterator_range< arg_iterator > arg_range
const_arg_range arguments() const
unsigned getBuiltinCallee() const
getBuiltinCallee - If this is a call to a builtin, return the builtin ID of the callee.
FPOptionsOverride getStoredFPFeaturesOrDefault() const
Get the store FPOptionsOverride or default if not stored.
FPOptionsOverride getStoredFPFeatures() const
Get FPOptionsOverride from trailing storage.
FunctionDecl * getDirectCallee()
If the callee is a FunctionDecl, return it. Otherwise return null.
static CallExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, bool HasFPFeatures, EmptyShell Empty)
Create an empty call expression, for deserialization.
bool isCallToStdMove() const
void setUsesMemberSyntax(bool V=true)
void setPreArg(unsigned I, Stmt *PreArg)
ADLCallKind getADLCallKind() const
FPOptionsOverride getFPFeatures() const
static constexpr unsigned OffsetToTrailingObjects
void markDependentForPostponedNameLookup()
Used by Sema to implement MSVC-compatible delayed name lookup.
const Expr * getCallee() const
const Decl * getCalleeDecl() const
void computeDependence()
Compute and set dependence bits.
void setStoredFPFeatures(FPOptionsOverride F)
Set FPOptionsOverride in trailing storage. Used only by Serialization.
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this call.
FPOptions getFPFeaturesInEffect(const LangOptions &LO) const
Get the FP features status of this operator.
bool isCoroElideSafe() const
Expr ** getArgs()
Retrieve the call arguments.
const_child_range children() const
CallExpr(StmtClass SC, Expr *Fn, ArrayRef< Expr * > PreArgs, ArrayRef< Expr * > Args, QualType Ty, ExprValueKind VK, SourceLocation RParenLoc, FPOptionsOverride FPFeatures, unsigned MinNumArgs, ADLCallKind UsesADL)
Build a call expression, assuming that appropriate storage has been allocated for the trailing object...
static constexpr unsigned sizeToAllocateForCallExprSubclass(unsigned SizeOfTrailingObjects)
SourceLocation getEndLoc() const
SourceLocation getRParenLoc() const
static constexpr ADLCallKind UsesADL
bool isBuiltinAssumeFalse(const ASTContext &Ctx) const
Return true if this is a call to __assume() or __builtin_assume() with a non-value-dependent constant...
const_arg_iterator arg_end() const
const FunctionDecl * getDirectCallee() const
Stmt * getPreArg(unsigned I)
friend class ASTStmtReader
FPOptionsOverride * getTrailingFPFeatures()
Return a pointer to the trailing FPOptions.
QualType getCallReturnType(const ASTContext &Ctx) const
getCallReturnType - Get the return type of the call expr.
bool isUnevaluatedBuiltinCall(const ASTContext &Ctx) const
Returns true if this is a call to a builtin which does not evaluate side-effects within its arguments...
void setNumArgsUnsafe(unsigned NewNumArgs)
Bluntly set a new number of arguments without doing any checks whatsoever.
unsigned getNumPreArgs() const
ArrayRef< Stmt * > getRawSubExprs() const
This method provides fast access to all the subexpressions of a CallExpr without going through the sl...
bool hasUnusedResultAttr(const ASTContext &Ctx) const
Returns true if this call expression should warn on unused results.
void shrinkNumArgs(unsigned NewNumArgs)
Reduce the number of arguments in this call expression.
const Expr * getArg(unsigned Arg) const
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
FPOptionsOverride * getTrailingFPFeatures()
Return a pointer to the trailing FPOptions.
path_iterator path_begin()
unsigned path_size() const
NamedDecl * getConversionFunction() const
If this cast applies a user-defined conversion, retrieve the conversion function that it invokes.
const Expr * getSubExprAsWritten() const
Expr * getSubExprAsWritten()
Retrieve the cast subexpression as it was written in the source code, looking through any implicit ca...
CastKind getCastKind() const
void setCastKind(CastKind K)
llvm::iterator_range< path_iterator > path()
Path through the class hierarchy taken by casts between base and derived classes (see implementation ...
const FieldDecl * getTargetUnionField() const
CastExpr(StmtClass SC, EmptyShell Empty, unsigned BasePathSize, bool HasFPFeatures)
Construct an empty cast.
static bool classof(const Stmt *T)
llvm::iterator_range< path_const_iterator > path() const
bool hasStoredFPFeatures() const
bool changesVolatileQualification() const
Return.
static const FieldDecl * getTargetFieldForToUnionCast(QualType unionType, QualType opType)
FPOptionsOverride getStoredFPFeatures() const
Get FPOptionsOverride from trailing storage.
CastExpr(StmtClass SC, QualType ty, ExprValueKind VK, const CastKind kind, Expr *op, unsigned BasePathSize, bool HasFPFeatures)
const Expr * getSubExpr() const
const_child_range children() const
const FPOptionsOverride * getTrailingFPFeatures() const
CXXBaseSpecifier ** path_iterator
path_const_iterator path_end() const
const char * getCastKindName() const
friend class ASTStmtReader
path_const_iterator path_begin() const
const CXXBaseSpecifier *const * path_const_iterator
FPOptionsOverride getFPFeatures() const
FPOptionsOverride getStoredFPFeaturesOrDefault() const
Get the store FPOptionsOverride or default if not stored.
FPOptions getFPFeaturesInEffect(const LangOptions &LO) const
Get the FP features status of this operation.
void setValue(unsigned Val)
SourceLocation getLocation() const
SourceLocation getEndLoc() const LLVM_READONLY
void setLocation(SourceLocation Location)
static bool classof(const Stmt *T)
static void print(unsigned val, CharacterLiteralKind Kind, raw_ostream &OS)
unsigned getValue() const
void setKind(CharacterLiteralKind kind)
const_child_range children() const
CharacterLiteralKind getKind() const
CharacterLiteral(EmptyShell Empty)
Construct an empty character literal.
SourceLocation getBeginLoc() const LLVM_READONLY
CharacterLiteral(unsigned value, CharacterLiteralKind kind, QualType type, SourceLocation l)
void setRParenLoc(SourceLocation L)
void setIsConditionTrue(bool isTrue)
SourceLocation getBuiltinLoc() const
Expr * getChosenSubExpr() const
getChosenSubExpr - Return the subexpression chosen according to the condition.
bool isConditionDependent() const
void setBuiltinLoc(SourceLocation L)
bool isConditionTrue() const
isConditionTrue - Return whether the condition is true (i.e.
ChooseExpr(SourceLocation BLoc, Expr *cond, Expr *lhs, Expr *rhs, QualType t, ExprValueKind VK, ExprObjectKind OK, SourceLocation RP, bool condIsTrue)
SourceLocation getEndLoc() const LLVM_READONLY
SourceLocation getRParenLoc() const
ChooseExpr(EmptyShell Empty)
Build an empty __builtin_choose_expr.
const_child_range children() const
SourceLocation getBeginLoc() const LLVM_READONLY
static bool classof(const Stmt *T)
CompoundAssignOperator - For compound assignments (e.g.
void setComputationResultType(QualType T)
static CompoundAssignOperator * CreateEmpty(const ASTContext &C, bool hasFPFeatures)
CompoundAssignOperator(const ASTContext &C, Expr *lhs, Expr *rhs, Opcode opc, QualType ResType, ExprValueKind VK, ExprObjectKind OK, SourceLocation OpLoc, FPOptionsOverride FPFeatures, QualType CompLHSType, QualType CompResultType)
QualType getComputationLHSType() const
void setComputationLHSType(QualType T)
static bool classof(const Stmt *S)
QualType getComputationResultType() const
void setFileScope(bool FS)
const_child_range children() const
void setTypeSourceInfo(TypeSourceInfo *tinfo)
bool hasStaticStorage() const
SourceLocation getLParenLoc() const
SourceLocation getBeginLoc() const LLVM_READONLY
APValue & getStaticValue() const
CompoundLiteralExpr(EmptyShell Empty)
Construct an empty compound literal.
void setLParenLoc(SourceLocation L)
SourceLocation getEndLoc() const LLVM_READONLY
APValue & getOrCreateStaticValue(ASTContext &Ctx) const
static bool classof(const Stmt *T)
const Expr * getInitializer() const
TypeSourceInfo * getTypeSourceInfo() const
void setInitializer(Expr *E)
CompoundLiteralExpr(SourceLocation lparenloc, TypeSourceInfo *tinfo, QualType T, ExprValueKind VK, Expr *init, bool fileScope)
CompoundStmt - This represents a group of statements like { stmt stmt }.
ConditionalOperator - The ?
const_child_range children() const
Expr * getFalseExpr() const
getFalseExpr - Return the subexpression representing the value of the expression if the condition eva...
static bool classof(const Stmt *T)
ConditionalOperator(Expr *cond, SourceLocation QLoc, Expr *lhs, SourceLocation CLoc, Expr *rhs, QualType t, ExprValueKind VK, ExprObjectKind OK)
SourceLocation getBeginLoc() const LLVM_READONLY
Expr * getCond() const
getCond - Return the expression representing the condition for the ?
Expr * getTrueExpr() const
getTrueExpr - Return the subexpression representing the value of the expression if the condition eval...
SourceLocation getEndLoc() const LLVM_READONLY
friend class ASTStmtReader
ConditionalOperator(EmptyShell Empty)
Build an empty conditional operator.
APValue getAPValueResult() const
static ConstantResultStorageKind getStorageKind(const APValue &Value)
void MoveIntoResult(APValue &Value, const ASTContext &Context)
llvm::APSInt getResultAsAPSInt() const
SourceLocation getBeginLoc() const LLVM_READONLY
ConstantResultStorageKind getResultStorageKind() const
void SetResult(APValue Value, const ASTContext &Context)
APValue::ValueKind getResultAPValueKind() const
static bool classof(const Stmt *T)
bool hasAPValueResult() const
friend class ASTStmtWriter
const_child_range children() const
friend class ASTStmtReader
bool isImmediateInvocation() const
SourceLocation getEndLoc() const LLVM_READONLY
static ConstantExpr * CreateEmpty(const ASTContext &Context, ConstantResultStorageKind StorageKind)
ConvertVectorExpr - Clang builtin function __builtin_convertvector This AST node provides support for...
FPOptionsOverride getStoredFPFeaturesOrDefault() const
Get the store FPOptionsOverride or default if not stored.
SourceLocation getRParenLoc() const
getRParenLoc - Return the location of final right parenthesis.
const_child_range children() const
FPOptions getFPFeaturesInEffect(const LangOptions &LO) const
Get the FP features status of this operator.
bool isFPContractableWithinStatement(const LangOptions &LO) const
Get the FP contractibility status of this operator.
static ConvertVectorExpr * CreateEmpty(const ASTContext &C, bool hasFPFeatures)
static bool classof(const Stmt *T)
SourceLocation getEndLoc() const LLVM_READONLY
SourceLocation getBeginLoc() const LLVM_READONLY
SourceLocation getBuiltinLoc() const
getBuiltinLoc - Return the location of the __builtin_convertvector token.
FPOptionsOverride getStoredFPFeatures() const
Get FPFeatures from trailing storage.
TypeSourceInfo * getTypeSourceInfo() const
getTypeSourceInfo - Return the destination type.
void setStoredFPFeatures(FPOptionsOverride F)
Set FPFeatures in trailing storage, used by Serialization & ASTImporter.
bool hasStoredFPFeatures() const
Is FPFeatures in Trailing Storage?
friend class ASTStmtReader
void setTypeSourceInfo(TypeSourceInfo *ti)
Expr * getSrcExpr() const
getSrcExpr - Return the Expr to be converted.
FPOptionsOverride getFPOptionsOverride() const
A POD class for pairing a NamedDecl* with an access specifier.
static DeclAccessPair make(NamedDecl *D, AccessSpecifier AS)
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
NamedDecl * getFoundDecl()
Get the NamedDecl through which this reference occurred.
bool hasExplicitTemplateArgs() const
Determines whether this declaration reference was followed by an explicit template argument list.
NestedNameSpecifier getQualifier() const
If the name was qualified, retrieves the nested-name-specifier that precedes the name.
void setIsImmediateEscalating(bool Set)
const_child_range children() const
bool refersToEnclosingVariableOrCapture() const
Does this DeclRefExpr refer to an enclosing local or a captured variable?
void setDecl(ValueDecl *NewD)
bool hasTemplateKWAndArgsInfo() const
const NamedDecl * getFoundDecl() const
Get the NamedDecl through which this reference occurred.
static DeclRefExpr * CreateEmpty(const ASTContext &Context, bool HasQualifier, bool HasFoundDecl, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
Construct an empty declaration reference expression.
void setLocation(SourceLocation L)
void copyTemplateArgumentsInto(TemplateArgumentListInfo &List) const
Copies the template arguments (if present) into the given structure.
DeclarationNameInfo getNameInfo() const
void setHadMultipleCandidates(bool V=true)
Sets the flag telling whether this expression refers to a function that was resolved from an overload...
SourceLocation getTemplateKeywordLoc() const
Retrieve the location of the template keyword preceding this name, if any.
bool isCapturedByCopyInLambdaWithExplicitObjectParameter() const
SourceLocation getLAngleLoc() const
Retrieve the location of the left angle bracket starting the explicit template argument list followin...
bool hasQualifier() const
Determine whether this declaration reference was preceded by a C++ nested-name-specifier,...
NestedNameSpecifierLoc getQualifierLoc() const
If the name was qualified, retrieves the nested-name-specifier that precedes the name,...
const ValueDecl * getDecl() const
const TemplateArgumentLoc * getTemplateArgs() const
Retrieve the template arguments provided as part of this template-id.
friend class ASTStmtWriter
ArrayRef< TemplateArgumentLoc > template_arguments() const
static bool classof(const Stmt *T)
NonOdrUseReason isNonOdrUse() const
Is this expression a non-odr-use reference, and if so, why?
SourceLocation getEndLoc() const LLVM_READONLY
bool hadMultipleCandidates() const
Returns true if this expression refers to a function that was resolved from an overloaded set having ...
friend class ASTStmtReader
void setCapturedByCopyInLambdaWithExplicitObjectParameter(bool Set, const ASTContext &Context)
SourceLocation getBeginLoc() const
bool hasTemplateKeyword() const
Determines whether the name in this declaration reference was preceded by the template keyword.
SourceLocation getLocation() const
SourceLocation getRAngleLoc() const
Retrieve the location of the right angle bracket ending the explicit template argument list following...
bool isImmediateEscalating() const
Decl - This represents one declaration (or definition), e.g.
DeclarationNameLoc - Additional source/type location info for a declaration name.
Represents a single C99 designator.
unsigned getArrayIndex() const
SourceRange getSourceRange() const LLVM_READONLY
bool isFieldDesignator() const
SourceLocation getBeginLoc() const LLVM_READONLY
static Designator CreateArrayRangeDesignator(unsigned Index, SourceLocation LBracketLoc, SourceLocation EllipsisLoc, SourceLocation RBracketLoc)
Creates a GNU array-range designator.
struct FieldDesignatorInfo FieldInfo
A field designator, e.g., ".x".
static Designator CreateFieldDesignator(const IdentifierInfo *FieldName, SourceLocation DotLoc, SourceLocation FieldLoc)
Creates a field designator.
struct ArrayOrRangeDesignatorInfo ArrayOrRangeInfo
An array or GNU array-range designator, e.g., "[9]" or "[10..15]".
bool isArrayRangeDesignator() const
void setFieldDecl(FieldDecl *FD)
static Designator CreateArrayDesignator(unsigned Index, SourceLocation LBracketLoc, SourceLocation RBracketLoc)
Creates an array designator.
FieldDecl * getFieldDecl() const
bool isArrayDesignator() const
SourceLocation getFieldLoc() const
SourceLocation getRBracketLoc() const
SourceLocation getEndLoc() const LLVM_READONLY
const IdentifierInfo * getFieldName() const
SourceLocation getEllipsisLoc() const
SourceLocation getDotLoc() const
SourceLocation getLBracketLoc() const
Represents a C99 designated initializer expression.
bool isDirectInit() const
Whether this designated initializer should result in direct-initialization of the designated subobjec...
static DesignatedInitExpr * CreateEmpty(const ASTContext &C, unsigned NumIndexExprs)
Expr * getArrayRangeEnd(const Designator &D) const
const_child_range children() const
const Designator * getDesignator(unsigned Idx) const
Expr * getSubExpr(unsigned Idx) const
SourceRange getDesignatorsSourceRange() const
void setSubExpr(unsigned Idx, Expr *E)
bool usesGNUSyntax() const
Determines whether this designated initializer used the deprecated GNU syntax for designated initiali...
Expr * getArrayRangeStart(const Designator &D) const
void ExpandDesignator(const ASTContext &C, unsigned Idx, const Designator *First, const Designator *Last)
Replaces the designator at index Idx with the series of designators in [First, Last).
MutableArrayRef< Designator > designators()
void setGNUSyntax(bool GNU)
void setEqualOrColonLoc(SourceLocation L)
Expr * getArrayIndex(const Designator &D) const
Designator * getDesignator(unsigned Idx)
ArrayRef< Designator > designators() const
Expr * getInit() const
Retrieve the initializer value.
unsigned size() const
Returns the number of designators in this initializer.
SourceLocation getBeginLoc() const LLVM_READONLY
void setDesignators(const ASTContext &C, const Designator *Desigs, unsigned NumDesigs)
SourceLocation getEndLoc() const LLVM_READONLY
SourceLocation getEqualOrColonLoc() const
Retrieve the location of the '=' that precedes the initializer value itself, if present.
unsigned getNumSubExprs() const
Retrieve the total number of subexpressions in this designated initializer expression,...
static bool classof(const Stmt *T)
SourceLocation getBeginLoc() const LLVM_READONLY
DesignatedInitUpdateExpr(EmptyShell Empty)
DesignatedInitUpdateExpr(const ASTContext &C, SourceLocation lBraceLoc, Expr *baseExprs, SourceLocation rBraceLoc)
static bool classof(const Stmt *T)
SourceLocation getEndLoc() const LLVM_READONLY
const_child_range children() const
void setUpdater(Expr *Updater)
InitListExpr * getUpdater() const
Designator - A designator in a C99 designated initializer.
IdentifierInfo & getAccessor() const
void setAccessorLoc(SourceLocation L)
SourceLocation AccessorLoc
void setAccessor(IdentifierInfo *II)
const Expr * getBase() const
const_child_range children() const
SourceLocation getAccessorLoc() const
IdentifierInfo * Accessor
ElementAccessExprBase(StmtClass SC, EmptyShell Empty)
SourceLocation getEndLoc() const LLVM_READONLY
SourceLocation getBeginLoc() const LLVM_READONLY
ElementAccessExprBase(StmtClass SC, QualType Ty, ExprValueKind VK, Expr *Base, IdentifierInfo &Accessor, SourceLocation Loc, ExprObjectKind OK)
BaseTy::pointer operator->() const
ChildElementIter & operator++()
BaseTy::reference operator*() const
bool operator==(ChildElementIter Other) const
unsigned getStartingElementPos() const
ChildElementIter< false > begin()
bool doForEachDataElement(Call &&C, unsigned &StartingIndexInArray, Targs &&...Fargs) const
llvm::iterator_range< ChildElementIter< false > > fake_child_range
SourceLocation getEndLoc() const
ChildElementIter< true > begin() const
StringLiteral * getDataStringLiteral() const
const_fake_child_range underlying_data_elements() const
EmbedExpr(EmptyShell Empty)
EmbedDataStorage * getData() const
EmbedExpr(const ASTContext &Ctx, SourceLocation Loc, EmbedDataStorage *Data, unsigned Begin, unsigned NumOfElements)
StringRef getFileName() const
fake_child_range underlying_data_elements()
SourceLocation getBeginLoc() const
SourceLocation getLocation() const
static bool classof(const Stmt *T)
llvm::iterator_range< ChildElementIter< true > > const_fake_child_range
friend class ASTStmtReader
const_child_range children() const
size_t getDataElementCount() const
An instance of this object exists for each enum constant that is defined.
TypeSourceInfo * getTypeInfoAsWritten() const
getTypeInfoAsWritten - Returns the type source info for the type that this expression is casting to.
ExplicitCastExpr(StmtClass SC, QualType exprTy, ExprValueKind VK, CastKind kind, Expr *op, unsigned PathSize, bool HasFPFeatures, TypeSourceInfo *writtenTy)
void setTypeInfoAsWritten(TypeSourceInfo *writtenTy)
static bool classof(const Stmt *T)
ExplicitCastExpr(StmtClass SC, EmptyShell Shell, unsigned PathSize, bool HasFPFeatures)
Construct an empty explicit cast.
QualType getTypeAsWritten() const
getTypeAsWritten - Returns the type that this expression is casting to, as written in the source code...
The return type of classify().
ModifiableType
The results of modification testing.
ModifiableType getModifiable() const
Kinds
The various classification results. Most of these mean prvalue.
@ CL_DuplicateMatrixComponents
@ CL_SubObjCPropertySetting
@ CL_DuplicateVectorComponents
static Classification makeSimpleLValue()
Create a simple, modifiable lvalue.
bool isModifiable() const
This represents one expression.
@ LV_DuplicateMatrixComponents
@ LV_DuplicateVectorComponents
@ LV_InvalidMessageExpression
@ LV_SubObjCPropertySetting
Classification ClassifyModifiable(ASTContext &Ctx, SourceLocation &Loc) const
ClassifyModifiable - Classify this expression according to the C++11 expression taxonomy,...
Expr(StmtClass SC, QualType T, ExprValueKind VK, ExprObjectKind OK)
Expr(StmtClass SC, EmptyShell)
Construct an empty expression.
bool EvaluateAsInt(EvalResult &Result, const ASTContext &Ctx, SideEffectsKind AllowSideEffects=SE_NoSideEffects, bool InConstantContext=false) const
EvaluateAsInt - Return true if this is a constant which we can fold and convert to an integer,...
EnumConstantDecl * getEnumConstantDecl()
If this expression refers to an enum constant, retrieve its declaration.
static bool isPotentialConstantExpr(const FunctionDecl *FD, SmallVectorImpl< PartialDiagnosticAt > &Diags)
isPotentialConstantExpr - Return true if this function's definition might be usable in a constant exp...
bool isReadIfDiscardedInCPlusPlus11() const
Determine whether an lvalue-to-rvalue conversion should implicitly be applied to this expression if i...
bool isIntegerConstantExpr(const ASTContext &Ctx) const
static bool isPotentialConstantExprUnevaluated(Expr *E, const FunctionDecl *FD, SmallVectorImpl< PartialDiagnosticAt > &Diags)
isPotentialConstantExprUnevaluated - Return true if this expression might be usable in a constant exp...
Expr * IgnoreParenNoopCasts(const ASTContext &Ctx) LLVM_READONLY
Skip past any parentheses and casts which do not change the value (including ptr->int casts of the sa...
isModifiableLvalueResult isModifiableLvalue(ASTContext &Ctx, SourceLocation *Loc=nullptr) const
isModifiableLvalue - C99 6.3.2.1: an lvalue that does not have array type, does not have an incomplet...
@ SE_AllowSideEffects
Allow any unmodeled side effect.
@ SE_NoSideEffects
Strictly evaluate the expression.
@ SE_AllowUndefinedBehavior
Allow UB that we can give a value, but not arbitrary unmodeled side effects.
static bool classof(const Stmt *T)
static QualType findBoundMemberType(const Expr *expr)
Given an expression of bound-member type, find the type of the member.
Expr & operator=(const Expr &)=delete
static std::pair< const NamedDecl *, const WarnUnusedResultAttr * > getUnusedResultAttrImpl(const Decl *Callee, QualType ReturnType)
Returns the WarnUnusedResultAttr that is declared on the callee or its return type declaration,...
bool isImplicitCXXThis() const
Whether this expression is an implicit reference to 'this' in C++.
const Expr * IgnoreParenNoopCasts(const ASTContext &Ctx) const
llvm::APSInt EvaluateKnownConstIntCheckOverflow(const ASTContext &Ctx, SmallVectorImpl< PartialDiagnosticAt > *Diag=nullptr) const
Expr * IgnoreParenCasts() LLVM_READONLY
Skip past any parentheses and casts which might surround this expression until reaching a fixed point...
bool EvaluateAsMandatedConstantInitializer(EvalResult &Result, const ASTContext &Ctx, SemaProxy &SProxy, const VarDecl *VD) const
Evaluate an expression that is required by the language to be a constant expression.
bool isUnusedResultAWarning(const Expr *&WarnExpr, SourceLocation &Loc, SourceRange &R1, SourceRange &R2, ASTContext &Ctx) const
isUnusedResultAWarning - Return true if this immediate expression should be warned about if the resul...
LValueClassification ClassifyLValue(ASTContext &Ctx) const
Reasons why an expression might not be an l-value.
bool isValueDependent() const
Determines whether the value of this expression depends on.
ExprValueKind getValueKind() const
getValueKind - The value kind that this expression produces.
bool refersToVectorElement() const
Returns whether this expression refers to a vector element.
bool isTypeDependent() const
Determines whether the type of this expression depends on.
llvm::APSInt EvaluateKnownConstInt(const ASTContext &Ctx) const
EvaluateKnownConstInt - Call EvaluateAsRValue and return the folded integer.
bool EvaluateAsMandatedConstantExpr(EvalResult &Result, const ASTContext &Ctx, SemaProxy &SProxy, ConstantExprKind Kind=ConstantExprKind::Normal) const
Evaluate an expression that is required by the language to be a constant expression.
bool containsUnexpandedParameterPack() const
Whether this expression contains an unexpanded parameter pack (for C++11 variadic templates).
bool isCXX11ConstantExpr(const ASTContext &Ctx, APValue &Result, bool AllowRelaxedEval=false) const
isCXX11ConstantExpr - Return true if this expression is a constant expression in C++11.
Expr * IgnoreParenLValueCasts() LLVM_READONLY
Skip past any parentheses and lvalue casts which might surround this expression until reaching a fixe...
bool EvaluateAsMandatedConstantRValue(EvalResult &Result, const ASTContext &Ctx, SemaProxy &SProxy) const
Evaluate an expression that is required by the language to be a constant expression,...
FPOptions getFPFeaturesInEffect(const LangOptions &LO) const
Returns the set of floating point options that apply to this expression.
const CXXRecordDecl * getBestDynamicClassType() const
For an expression of class type or pointer to class type, return the most derived class decl the expr...
Expr * IgnoreParenImpCasts() LLVM_READONLY
Skip past any parentheses and implicit casts which might surround this expression until reaching a fi...
Expr * IgnoreImplicit() LLVM_READONLY
Skip past any implicit AST nodes which might surround this expression until reaching a fixed point.
Expr * IgnoreConversionOperatorSingleStep() LLVM_READONLY
Skip conversion operators.
bool containsErrors() const
Whether this expression contains subexpressions which had errors.
bool EvaluateAsFloat(llvm::APFloat &Result, const ASTContext &Ctx, SideEffectsKind AllowSideEffects=SE_NoSideEffects, bool InConstantContext=false) const
EvaluateAsFloat - Return true if this is a constant which we can fold and convert to a floating point...
bool isObjCSelfExpr() const
Check if this expression is the ObjC 'self' implicit parameter.
Expr * IgnoreParens() LLVM_READONLY
Skip past any parentheses which might surround this expression until reaching a fixed point.
bool isFlexibleArrayMemberLike(const ASTContext &Context, LangOptions::StrictFlexArraysLevelKind StrictFlexArraysLevel, bool IgnoreTemplateOrMacroSubstitution=false) const
Check whether this array fits the idiom of a flexible array member, depending on the value of -fstric...
bool hasPlaceholderType(BuiltinType::Kind K) const
Returns whether this expression has a specific placeholder type.
bool EvaluateAsLValue(EvalResult &Result, const ASTContext &Ctx, bool InConstantContext=false) const
EvaluateAsLValue - Evaluate an expression to see if we can fold it to an lvalue with link time known ...
bool EvaluateAsInitializer(const ASTContext &Ctx, const VarDecl *VD, EvalResult &Result, bool IsConstantInitializer) const
EvaluateAsInitializer - Evaluate an expression as if it were the initializer of the given declaration...
bool EvaluateAsFixedPoint(EvalResult &Result, const ASTContext &Ctx, SideEffectsKind AllowSideEffects=SE_NoSideEffects, bool InConstantContext=false) const
EvaluateAsFixedPoint - Return true if this is a constant which we can fold and convert to a fixed poi...
bool isEvaluatable(const ASTContext &Ctx, SideEffectsKind AllowSideEffects=SE_NoSideEffects) const
isEvaluatable - Call EvaluateAsRValue to see if this expression can be constant folded without side-e...
Expr * IgnoreParenBaseCasts() LLVM_READONLY
Skip past any parentheses and derived-to-base casts until reaching a fixed point.
bool isConstantInitializer(ASTContext &Ctx, bool ForRef=false, const Expr **Culprit=nullptr) const
Returns true if this expression can be emitted to IR as a constant, and thus can be used as a constan...
bool isLValue() const
isLValue - True if this expression is an "l-value" according to the rules of the current language.
static bool hasAnyTypeDependentArguments(ArrayRef< Expr * > Exprs)
hasAnyTypeDependentArguments - Determines if any of the expressions in Exprs is type-dependent.
FieldDecl * getSourceBitField()
If this expression refers to a bit-field, retrieve the declaration of that bit-field.
NullPointerConstantValueDependence
Enumeration used to describe how isNullPointerConstant() should cope with value-dependent expressions...
@ NPC_ValueDependentIsNull
Specifies that a value-dependent expression of integral or dependent type should be considered a null...
@ NPC_NeverValueDependent
Specifies that the expression should never be value-dependent.
@ NPC_ValueDependentIsNotNull
Specifies that a value-dependent expression should be considered to never be a null pointer constant.
Expr * IgnoreUnlessSpelledInSource()
Skip past any invisible AST nodes which might surround this statement, such as ExprWithCleanups or Im...
ExprObjectKind getObjectKind() const
getObjectKind - The object kind that this expression produces.
bool EvaluateAsRValue(EvalResult &Result, const ASTContext &Ctx, bool InConstantContext=false) const
EvaluateAsRValue - Return true if this is a constant which we can fold to an rvalue using any crazy t...
Expr * IgnoreCasts() LLVM_READONLY
Skip past any casts which might surround this expression until reaching a fixed point.
Decl * getReferencedDeclOfCallee()
Expr * IgnoreImplicitAsWritten() LLVM_READONLY
Skip past any implicit AST nodes which might surround this expression until reaching a fixed point.
std::optional< uint64_t > tryEvaluateStrLen(const ASTContext &Ctx) const
If the current Expr is a pointer, this will try to statically determine the strlen of the string poin...
bool HasSideEffects(const ASTContext &Ctx, bool IncludePossibleEffects=true) const
HasSideEffects - This routine returns true for all those expressions which have any effect other than...
bool EvaluateAsConstantExpr(EvalResult &Result, const ASTContext &Ctx, ConstantExprKind Kind=ConstantExprKind::Normal) const
Evaluate an expression that is required to be a constant expression.
bool isInstantiationDependent() const
Whether this expression is instantiation-dependent, meaning that it depends in some way on.
const Expr * getBestDynamicClassTypeExpr() const
Get the inner expression that determines the best dynamic class.
const Expr * IgnoreUnlessSpelledInSource() const
std::optional< llvm::APSInt > getIntegerConstantExpr(const ASTContext &Ctx, bool AllowRelaxedEval=false) const
isIntegerConstantExpr - Return the value if this expression is a valid integer constant expression.
std::optional< std::string > tryEvaluateString(ASTContext &Ctx) const
If the current Expr can be evaluated to a pointer to a null-terminated constant string,...
Expr * IgnoreImpCasts() LLVM_READONLY
Skip past any implicit casts which might surround this expression until reaching a fixed point.
NullPointerConstantKind
Enumeration used to describe the kind of Null pointer constant returned from isNullPointerConstant().
@ NPCK_ZeroExpression
Expression is a Null pointer constant built from a zero integer expression that is not a simple,...
@ NPCK_ZeroLiteral
Expression is a Null pointer constant built from a literal zero.
@ NPCK_CXX11_nullptr
Expression is a C++11 nullptr.
@ NPCK_GNUNull
Expression is a GNU-style __null constant.
@ NPCK_NotNull
Expression is not a Null pointer constant.
bool EvaluateAsBooleanCondition(bool &Result, const ASTContext &Ctx, bool InConstantContext=false) const
EvaluateAsBooleanCondition - Return true if this is a constant which we can fold and convert to a boo...
bool isTemporaryObject(ASTContext &Ctx, const CXXRecordDecl *TempTy) const
Determine whether the result of this expression is a temporary object of the given class type.
NullPointerConstantKind isNullPointerConstant(ASTContext &Ctx, NullPointerConstantValueDependence NPC) const
isNullPointerConstant - C99 6.3.2.3p3 - Test if this reduces down to a Null pointer constant.
QualType getEnumCoercedType(const ASTContext &Ctx) const
If this expression is an enumeration constant, return the enumeration type under which said constant ...
bool isBoundMemberFunction(ASTContext &Ctx) const
Returns true if this expression is a bound member function.
@ ClassTemplateArgument
A class template argument. Such a value is used for code generation.
@ Normal
An integer constant expression (an array bound, enumerator, case value, bit-field width,...
@ ImmediateInvocation
An immediate invocation.
@ Initializer
The initializer of an object with static storage duration.
@ NonClassTemplateArgument
A non-class template argument.
std::optional< uint64_t > tryEvaluateObjectSize(const ASTContext &Ctx, unsigned Type) const
If the current Expr is a pointer, this will try to statically determine the number of bytes available...
void setValueKind(ExprValueKind Cat)
setValueKind - Set the value kind produced by this expression.
SourceLocation getExprLoc() const LLVM_READONLY
getExprLoc - Return the preferred location for the arrow when diagnosing a problem with a generic exp...
const FieldDecl * getSourceBitField() const
static bool isSameComparisonOperand(const Expr *E1, const Expr *E2)
Checks that the two Expr's will refer to the same value as a comparison operand.
void setObjectKind(ExprObjectKind Cat)
setObjectKind - Set the object kind produced by this expression.
bool refersToMatrixElement() const
Returns whether this expression refers to a matrix element.
bool refersToBitField() const
Returns true if this expression is a gl-value that potentially refers to a bit-field.
bool EvaluateCharRangeAsString(std::string &Result, const Expr *SizeExpression, const Expr *PtrExpression, ASTContext &Ctx, SemaProxy &SProxy, EvalResult &Status) const
bool isDefaultArgument() const
Determine whether this expression is a default function argument.
@ MLV_DuplicateVectorComponents
@ MLV_InvalidMessageExpression
@ MLV_DuplicateMatrixComponents
@ MLV_ConstQualifiedField
@ MLV_SubObjCPropertySetting
Classification Classify(ASTContext &Ctx) const
Classify - Classify this expression according to the C++11 expression taxonomy.
const Decl * getReferencedDeclOfCallee() const
bool hasNonTrivialCall(const ASTContext &Ctx) const
Determine whether this expression involves a call to any function that is not trivial.
bool isOrdinaryOrBitFieldObject() const
bool hasPlaceholderType() const
Returns whether this expression has a placeholder type.
bool refersToGlobalRegisterVar() const
Returns whether this expression refers to a global register variable.
friend class ASTStmtReader
bool isCXX98IntegralConstantExpr(const ASTContext &Ctx) const
isCXX98IntegralConstantExpr - Return true if this expression is an integral constant expression in C+...
const ValueDecl * getAsBuiltinConstantDeclRef(const ASTContext &Context) const
If this expression is an unambiguous reference to a single declaration, in the style of __builtin_fun...
bool isOBJCGCCandidate(ASTContext &Ctx) const
isOBJCGCCandidate - Return true if this expression may be used in a read/ write barrier.
static ExprValueKind getValueKindForType(QualType T)
getValueKindForType - Given a formal return or parameter type, give its value kind.
bool EvaluateWithSubstitution(APValue &Value, ASTContext &Ctx, const FunctionDecl *Callee, ArrayRef< const Expr * > Args, const Expr *This=nullptr) const
EvaluateWithSubstitution - Evaluate an expression as if from the context of a call to the given funct...
const Expr * skipRValueSubobjectAdjustments() const
bool isKnownToHaveBooleanValue(bool Semantic=true) const
isKnownToHaveBooleanValue - Return true if this is an integer expression that is known to return 0 or...
void setDependence(ExprDependence Deps)
Each concrete expr subclass is expected to compute its dependence and call this in the constructor.
Expr(const Expr &)=delete
void EvaluateForOverflow(const ASTContext &Ctx) const
ExprDependence getDependence() const
Expr & operator=(Expr &&)=delete
const EnumConstantDecl * getEnumConstantDecl() const
const ObjCPropertyRefExpr * getObjCProperty() const
If this expression is an l-value for an Objective C property, find the underlying property reference ...
ExtVectorElementExpr(QualType Ty, ExprValueKind VK, Expr *Base, IdentifierInfo &Accessor, SourceLocation Loc)
ExtVectorElementExpr(EmptyShell Empty)
Build an empty vector element expression.
bool containsDuplicateElements() const
containsDuplicateElements - Return true if any element access is repeated.
bool isArrow() const
isArrow - Return true if the base expression is a pointer to vector, return false if the base express...
void getEncodedElementAccess(SmallVectorImpl< uint32_t > &Elts) const
getEncodedElementAccess - Encode the elements accessed into an llvm aggregate Constant of ConstantInt...
static bool classof(const Stmt *T)
unsigned getNumElements() const
getNumElements - Get the number of components being selected.
Represents difference between two FPOptions values.
FPOptions applyOverrides(FPOptions Base)
bool requiresTrailingStorage() const
static FPOptions defaultWithoutTrailingStorage(const LangOptions &LO)
Return the default value of FPOptions that's used when trailing storage isn't required.
bool allowFPContractWithinStatement() const
Represents a member of a struct/union/class.
SourceLocation getLocation() const
Retrieve the location of the literal.
std::string getValueAsString(unsigned Radix) const
unsigned getScale() const
SourceLocation getBeginLoc() const LLVM_READONLY
const_child_range children() const
void setLocation(SourceLocation Location)
llvm::APInt getValue() const
Returns an internal integer representation of the literal.
static bool classof(const Stmt *T)
void setScale(unsigned S)
static FixedPointLiteral * CreateFromRawInt(const ASTContext &C, const llvm::APInt &V, QualType type, SourceLocation l, unsigned Scale)
SourceLocation getEndLoc() const LLVM_READONLY
SourceLocation getLocation() const
llvm::APFloatBase::Semantics getRawSemantics() const
Get a raw enumeration value representing the floating-point semantics of this literal (32-bit IEEE,...
const llvm::fltSemantics & getSemantics() const
Return the APFloat semantics this literal uses.
void setValue(const ASTContext &C, const llvm::APFloat &Val)
const_child_range children() const
SourceLocation getBeginLoc() const LLVM_READONLY
void setRawSemantics(llvm::APFloatBase::Semantics Sem)
Set the raw enumeration value representing the floating-point semantics of this literal (32-bit IEEE,...
double getValueAsApproximateDouble() const
getValueAsApproximateDouble - This returns the value as an inaccurate double.
llvm::APFloat getValue() const
static bool classof(const Stmt *T)
void setLocation(SourceLocation L)
SourceLocation getEndLoc() const LLVM_READONLY
void setSemantics(const llvm::fltSemantics &Sem)
Set the APFloat semantics this literal uses.
FullExpr(StmtClass SC, EmptyShell Empty)
void setSubExpr(Expr *E)
As with any mutator of the AST, be very careful when modifying an existing AST to preserve its invari...
static bool classof(const Stmt *T)
FullExpr(StmtClass SC, Expr *subexpr)
const Expr * getSubExpr() const
Represents a function declaration or definition.
Represents a prototype with parameter type info, e.g.
SourceLocation getTokenLocation() const
getTokenLocation - The location of the __null token.
static bool classof(const Stmt *T)
SourceLocation getBeginLoc() const LLVM_READONLY
const_child_range children() const
GNUNullExpr(QualType Ty, SourceLocation Loc)
SourceLocation getEndLoc() const LLVM_READONLY
GNUNullExpr(EmptyShell Empty)
Build an empty GNU __null expression.
void setTokenLocation(SourceLocation L)
SourceLocation getBeginLoc() const
AssociationTy< false > Association
TypeSourceInfo * getControllingType()
Return the controlling type of this generic selection expression.
static bool classof(const Stmt *T)
const Expr * getControllingExpr() const
unsigned getNumAssocs() const
The number of association expressions.
const_association_range associations() const
AssociationIteratorTy< true > ConstAssociationIterator
SourceLocation getEndLoc() const
ArrayRef< Expr * > getAssocExprs() const
bool isExprPredicate() const
Whether this generic selection uses an expression as its controlling argument.
ConstAssociation getAssociation(unsigned I) const
association_range associations()
AssociationTy< true > ConstAssociation
SourceLocation getGenericLoc() const
SourceLocation getRParenLoc() const
unsigned getResultIndex() const
The zero-based index of the result expression's generic association in the generic selection's associ...
Expr * getResultExpr()
Return the result expression of this controlling expression.
AssociationIteratorTy< false > AssociationIterator
SourceLocation getDefaultLoc() const
llvm::iterator_range< AssociationIterator > association_range
const Expr * getResultExpr() const
bool isResultDependent() const
Whether this generic selection is result-dependent.
friend class ASTStmtWriter
const_child_range children() const
Association getAssociation(unsigned I)
Return the Ith association expression with its TypeSourceInfo, bundled together in GenericSelectionEx...
friend class ASTStmtReader
bool isTypePredicate() const
Whether this generic selection uses a type as its controlling argument.
const TypeSourceInfo * getControllingType() const
llvm::iterator_range< ConstAssociationIterator > const_association_range
static GenericSelectionExpr * CreateEmpty(const ASTContext &Context, unsigned NumAssocs)
Create an empty generic selection expression for deserialization.
Expr * getControllingExpr()
Return the controlling expression of this generic selection expression.
ArrayRef< TypeSourceInfo * > getAssocTypeSourceInfos() const
This class represents temporary values used to represent inout and out arguments in HLSL.
SourceLocation getEndLoc() const LLVM_READONLY
const OpaqueValueExpr * getCastedTemporary() const
const OpaqueValueExpr * getOpaqueArgLValue() const
Expr * getWritebackCast()
bool isInOut() const
returns true if the parameter is inout and false if the parameter is out.
static HLSLOutArgExpr * CreateEmpty(const ASTContext &Ctx)
static bool classof(const Stmt *T)
OpaqueValueExpr * getCastedTemporary()
const Expr * getWritebackCast() const
SourceLocation getBeginLoc() const LLVM_READONLY
const Expr * getArgLValue() const
Return the l-value expression that was written as the argument in source.
OpaqueValueExpr * getOpaqueArgLValue()
friend class ASTStmtReader
One of these records is kept for each identifier that is lexed.
SourceLocation getEndLoc() const LLVM_READONLY
ImaginaryLiteral(Expr *val, QualType Ty)
const Expr * getSubExpr() const
SourceLocation getBeginLoc() const LLVM_READONLY
ImaginaryLiteral(EmptyShell Empty)
Build an empty imaginary literal.
static bool classof(const Stmt *T)
const_child_range children() const
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
SourceLocation getEndLoc() const LLVM_READONLY
SourceLocation getBeginLoc() const LLVM_READONLY
static ImplicitCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize, bool HasFPFeatures)
ImplicitCastExpr(OnStack_t _, QualType ty, CastKind kind, Expr *op, ExprValueKind VK, FPOptionsOverride FPO)
bool isPartOfExplicitCast() const
static bool classof(const Stmt *T)
void setIsPartOfExplicitCast(bool PartOfExplicitCast)
SourceLocation getEndLoc() const LLVM_READONLY
static bool classof(const Stmt *T)
ImplicitValueInitExpr(EmptyShell Empty)
Construct an empty implicit value initialization.
const_child_range children() const
ImplicitValueInitExpr(QualType ty)
SourceLocation getBeginLoc() const LLVM_READONLY
Describes an C or C++ initializer list.
const_reverse_iterator rend() const
bool hasArrayFiller() const
Return true if this is an array initializer and its array "filler" has been set.
void setSyntacticForm(InitListExpr *Init)
InitExprsTy::reverse_iterator reverse_iterator
InitExprsTy::const_reverse_iterator const_reverse_iterator
void markError()
Mark the semantic form of the InitListExpr as error when the semantic analysis fails.
bool hasDesignatedInit() const
Determine whether this initializer list contains a designated initializer.
bool isTransparent() const
Is this a transparent initializer list (that is, an InitListExpr that is purely syntactic,...
bool hasOneInit() const
Whether getNumInitsWithEmbedExpanded() is 1, without walking the list.
void resizeInits(const ASTContext &Context, unsigned NumInits)
Specify the number of initializers.
bool isStringLiteralInit() const
Is this an initializer for an array of characters, initialized by a string literal or an @encode?
FieldDecl * getInitializedFieldInUnion()
If this initializes a union, specifies which field in the union to initialize.
unsigned getNumInits() const
SourceLocation getBeginLoc() const LLVM_READONLY
bool isSemanticForm() const
void setInit(unsigned Init, Expr *expr)
const_iterator begin() const
reverse_iterator rbegin()
bool hasZeroInits() const
const_reverse_iterator rbegin() const
InitExprsTy::const_iterator const_iterator
Expr *const * getInits() const
Retrieve the set of initializers.
SourceLocation getLBraceLoc() const
Expr * updateInit(const ASTContext &C, unsigned Init, Expr *expr)
Updates the initializer at index Init with the new expression expr, and returns the old expression at...
void setArrayFiller(Expr *filler)
InitListExpr * getSyntacticForm() const
static bool classof(const Stmt *T)
bool hadArrayRangeDesignator() const
Expr * getArrayFiller()
If this initializer list initializes an array with more elements than there are initializers in the l...
unsigned getNumInitsWithEmbedExpanded() const
getNumInits but if the list has an EmbedExpr inside includes full length of embedded data.
SourceLocation getRBraceLoc() const
InitListExpr * getSemanticForm() const
const FieldDecl * getInitializedFieldInUnion() const
InitListExpr(const ASTContext &C, SourceLocation lbraceloc, ArrayRef< Expr * > initExprs, SourceLocation rbraceloc, bool isExplicit)
friend class ASTStmtWriter
const Expr * getInit(unsigned Init) const
InitListExpr(EmptyShell Empty)
Build an empty initializer list.
void setLBraceLoc(SourceLocation Loc)
const Expr * getArrayFiller() const
const_child_range children() const
bool isIdiomaticZeroInitializer(const LangOptions &LangOpts) const
Is this the zero initializer {0} in a language which considers it idiomatic?
friend class ASTStmtReader
const_iterator end() const
SourceLocation getEndLoc() const LLVM_READONLY
void setInitializedFieldInUnion(FieldDecl *FD)
bool isSyntacticForm() const
void setRBraceLoc(SourceLocation Loc)
ArrayRef< Expr * > inits() const
InitExprsTy::iterator iterator
void sawArrayRangeDesignator(bool ARD=true)
Expr ** getInits()
Retrieve the set of initializers.
Expr * getInit(unsigned Init)
void reserveInits(const ASTContext &C, unsigned NumInits)
Reserve space for some number of initializers.
void setLocation(SourceLocation Location)
SourceLocation getEndLoc() const LLVM_READONLY
static bool classof(const Stmt *T)
SourceLocation getLocation() const
Retrieve the location of the literal.
const_child_range children() const
SourceLocation getBeginLoc() const LLVM_READONLY
Represents the declaration of a label.
StrictFlexArraysLevelKind
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Represents a prvalue temporary that is written into memory so that a reference can bind to it.
MatrixElementExpr(QualType Ty, ExprValueKind VK, Expr *Base, IdentifierInfo &Accessor, SourceLocation Loc)
bool containsDuplicateElements() const
containsDuplicateElements - Return true if any element access is repeated.
void getEncodedElementAccess(SmallVectorImpl< uint32_t > &Elts) const
getEncodedElementAccess - Encode the elements accessed into an llvm aggregate Constant of ConstantInt...
unsigned getNumElements() const
getNumElements - Get the number of components being selected.
static bool classof(const Stmt *T)
MatrixElementExpr(EmptyShell Empty)
Build an empty matrix element expression.
MatrixSingleSubscriptExpr(Expr *Base, Expr *RowIdx, QualType T, SourceLocation RBracketLoc)
matrix[row]
SourceLocation getRBracketLoc() const
const Expr * getRowIdx() const
const_child_range children() const
SourceLocation getBeginLoc() const LLVM_READONLY
void setRBracketLoc(SourceLocation L)
MatrixSingleSubscriptExpr(EmptyShell Shell)
Create an empty matrix single-subscript expression.
SourceLocation getExprLoc() const LLVM_READONLY
const Expr * getBase() const
static bool classof(const Stmt *T)
SourceLocation getEndLoc() const
void setColumnIdx(Expr *E)
SourceLocation getEndLoc() const
const Expr * getBase() const
const_child_range children() const
SourceLocation getRBracketLoc() const
SourceLocation getExprLoc() const LLVM_READONLY
MatrixSubscriptExpr(Expr *Base, Expr *RowIdx, Expr *ColumnIdx, QualType T, SourceLocation RBracketLoc)
const Expr * getRowIdx() const
bool isIncomplete() const
MatrixSubscriptExpr(EmptyShell Shell)
Create an empty matrix subscript expression.
static bool classof(const Stmt *T)
const Expr * getColumnIdx() const
void setRBracketLoc(SourceLocation L)
SourceLocation getBeginLoc() const LLVM_READONLY
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
static MemberExpr * CreateEmpty(const ASTContext &Context, bool HasQualifier, bool HasFoundDecl, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
ArrayRef< TemplateArgumentLoc > template_arguments() const
void setMemberDecl(ValueDecl *D)
SourceLocation getMemberLoc() const
getMemberLoc - Return the location of the "member", in X->F, it is the location of 'F'.
void setMemberLoc(SourceLocation L)
void setHadMultipleCandidates(bool V=true)
Sets the flag telling whether this expression refers to a method that was resolved from an overloaded...
SourceLocation getOperatorLoc() const
NestedNameSpecifier getQualifier() const
If the member name was qualified, retrieves the nested-name-specifier that precedes the member name.
static bool classof(const Stmt *T)
SourceLocation getTemplateKeywordLoc() const
Retrieve the location of the template keyword preceding the member name, if any.
NestedNameSpecifierLoc getQualifierLoc() const
If the member name was qualified, retrieves the nested-name-specifier that precedes the member name,...
ValueDecl * getMemberDecl() const
Retrieve the member declaration to which this expression refers.
const_child_range children() const
bool hasExplicitTemplateArgs() const
Determines whether the member name was followed by an explicit template argument list.
NonOdrUseReason isNonOdrUse() const
Is this expression a non-odr-use reference, and if so, why?
bool hasQualifier() const
Determines whether this member expression actually had a C++ nested-name-specifier prior to the name ...
void copyTemplateArgumentsInto(TemplateArgumentListInfo &List) const
Copies the template arguments (if present) into the given structure.
bool isImplicitAccess() const
Determine whether the base of this explicit is implicit.
const TemplateArgumentLoc * getTemplateArgs() const
Retrieve the template arguments provided as part of this template-id.
bool performsVirtualDispatch(const LangOptions &LO) const
Returns true if virtual dispatch is performed.
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
SourceLocation getRAngleLoc() const
Retrieve the location of the right angle bracket ending the explicit template argument list following...
SourceLocation getEndLoc() const LLVM_READONLY
friend class ASTStmtWriter
static MemberExpr * CreateImplicit(const ASTContext &C, Expr *Base, bool IsArrow, ValueDecl *MemberDecl, QualType T, ExprValueKind VK, ExprObjectKind OK)
Create an implicit MemberExpr, with no location, qualifier, template arguments, and so on.
bool hadMultipleCandidates() const
Returns true if this member expression refers to a method that was resolved from an overloaded set ha...
bool hasTemplateKeyword() const
Determines whether the member name was preceded by the template keyword.
friend class ASTStmtReader
SourceLocation getBeginLoc() const LLVM_READONLY
SourceLocation getLAngleLoc() const
Retrieve the location of the left angle bracket starting the explicit template argument list followin...
DeclarationNameInfo getMemberNameInfo() const
Retrieve the member declaration name info.
SourceLocation getExprLoc() const LLVM_READONLY
DeclAccessPair getFoundDecl() const
Retrieves the declaration found by lookup.
A pointer to member type per C++ 8.3.3 - Pointers to members.
This represents a decl that may have a name.
A C++ nested-name-specifier augmented with source location information.
NestedNameSpecifier getNestedNameSpecifier() const
Retrieve the nested-name-specifier to which this instance refers.
SourceLocation getBeginLoc() const
Retrieve the location of the beginning of this nested-name-specifier.
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
static bool classof(const Stmt *T)
SourceLocation getEndLoc() const LLVM_READONLY
SourceLocation getBeginLoc() const LLVM_READONLY
NoInitExpr(EmptyShell Empty)
const_child_range children() const
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
const Expr * getIndexExpr(unsigned Idx) const
SourceLocation getBeginLoc() const LLVM_READONLY
void setOperatorLoc(SourceLocation L)
static OffsetOfExpr * CreateEmpty(const ASTContext &C, unsigned NumComps, unsigned NumExprs)
Expr * getIndexExpr(unsigned Idx)
SourceLocation getEndLoc() const LLVM_READONLY
static bool classof(const Stmt *T)
SourceLocation getOperatorLoc() const
getOperatorLoc - Return the location of the operator.
const OffsetOfNode & getComponent(unsigned Idx) const
void setIndexExpr(unsigned Idx, Expr *E)
TypeSourceInfo * getTypeSourceInfo() const
void setTypeSourceInfo(TypeSourceInfo *tsi)
const_child_range children() const
void setComponent(unsigned Idx, OffsetOfNode ON)
unsigned getNumExpressions() const
SourceLocation getRParenLoc() const
Return the location of the right parentheses.
void setRParenLoc(SourceLocation R)
unsigned getNumComponents() const
Helper class for OffsetOfExpr.
const IdentifierInfo * getFieldName() const
For a field or identifier offsetof node, returns the name of the field.
unsigned getArrayExprIndex() const
For an array element node, returns the index into the array of expressions.
FieldDecl * getField() const
For a field offsetof node, returns the field.
OffsetOfNode(const CXXBaseSpecifier *Base)
Create an offsetof node that refers into a C++ base class.
OffsetOfNode(SourceLocation LBracketLoc, unsigned Index, SourceLocation RBracketLoc)
Create an offsetof node that refers to an array element.
SourceRange getSourceRange() const LLVM_READONLY
Retrieve the source range that covers this offsetof node.
Kind
The kind of offsetof node we have.
@ Array
An index into an array.
@ Identifier
A field in a dependent type, known only by its name.
@ Base
An implicit indirection through a C++ base class, when the field found is in a base class.
SourceLocation getBeginLoc() const LLVM_READONLY
Kind getKind() const
Determine what kind of offsetof node this is.
OffsetOfNode(SourceLocation DotLoc, FieldDecl *Field, SourceLocation NameLoc)
Create an offsetof node that refers to a field.
SourceLocation getEndLoc() const LLVM_READONLY
CXXBaseSpecifier * getBase() const
For a base class node, returns the base specifier.
OffsetOfNode(SourceLocation DotLoc, const IdentifierInfo *Name, SourceLocation NameLoc)
Create an offsetof node that refers to an identifier.
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class.
static const OpaqueValueExpr * findInCopyConstruct(const Expr *expr)
Given an expression which invokes a copy constructor — i.e.
OpaqueValueExpr(EmptyShell Empty)
OpaqueValueExpr(SourceLocation Loc, QualType T, ExprValueKind VK, ExprObjectKind OK=OK_Ordinary, Expr *SourceExpr=nullptr)
SourceLocation getBeginLoc() const LLVM_READONLY
SourceLocation getEndLoc() const LLVM_READONLY
static bool classof(const Stmt *T)
Expr * getSourceExpr() const
The source expression of an opaque value expression is the expression which originally generated the ...
SourceLocation getLocation() const
Retrieve the location of this expression.
friend class ASTStmtReader
const_child_range children() const
SourceLocation getExprLoc() const LLVM_READONLY
static OpenACCAsteriskSizeExpr * CreateEmpty(const ASTContext &C)
SourceLocation getEndLoc() const
SourceLocation getLocation() const
const_child_range children() const
SourceLocation getBeginLoc() const
friend class ASTStmtReader
static bool classof(const Stmt *T)
ParenExpr(SourceLocation l, SourceLocation r, Expr *val)
SourceLocation getLParen() const
Get the location of the left parentheses '('.
static bool classof(const Stmt *T)
ParenExpr(EmptyShell Empty)
Construct an empty parenthesized expression.
void setLParen(SourceLocation Loc)
void setIsProducedByFoldExpansion(bool ProducedByFoldExpansion=true)
const_child_range children() const
void setRParen(SourceLocation Loc)
SourceLocation getBeginLoc() const LLVM_READONLY
const Expr * getSubExpr() const
bool isProducedByFoldExpansion() const
SourceLocation getRParen() const
Get the location of the right parentheses ')'.
SourceLocation getEndLoc() const LLVM_READONLY
Expr *const * getExprs() const
static ParenListExpr * CreateEmpty(const ASTContext &Ctx, unsigned NumExprs)
Create an empty paren list.
SourceLocation getBeginLoc() const
Expr * getExpr(unsigned Init)
ArrayRef< Expr * > exprs() const
const Expr * getExpr(unsigned Init) const
const_child_range children() const
SourceLocation getEndLoc() const
unsigned getNumExprs() const
Return the number of expressions in this paren list.
SourceLocation getLParenLoc() const
friend class ASTStmtReader
SourceLocation getRParenLoc() const
static bool classof(const Stmt *T)
Represents a parameter to a function.
SourceLocation getBeginLoc() const
void setLocation(SourceLocation L)
static bool classof(const Stmt *T)
SourceLocation getEndLoc() const
const StringLiteral * getFunctionName() const
StringRef getIdentKindName() const
static PredefinedExpr * CreateEmpty(const ASTContext &Ctx, bool HasFunctionName)
Create an empty PredefinedExpr.
bool isTransparent() const
static std::string ComputeName(PredefinedIdentKind IK, const Decl *CurrentDecl, bool ForceElaboratedPrinting=false)
const_child_range children() const
PredefinedIdentKind getIdentKind() const
SourceLocation getLocation() const
friend class ASTStmtReader
StringLiteral * getFunctionName()
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
const Expr * getResultExpr() const
const_semantics_iterator semantics_begin() const
semantics_iterator semantics_end()
SourceLocation getExprLoc() const LLVM_READONLY
unsigned getResultExprIndex() const
Return the index of the result-bearing expression into the semantics expressions, or PseudoObjectExpr...
semantics_iterator semantics_begin()
const Expr *const * const_semantics_iterator
SourceLocation getBeginLoc() const LLVM_READONLY
Expr *const * semantics_iterator
const_semantics_iterator semantics_end() const
const Expr * getSyntacticForm() const
static bool classof(const Stmt *T)
const Expr * getSemanticExpr(unsigned index) const
Expr * getResultExpr()
Return the result-bearing expression, or null if there is none.
ArrayRef< Expr * > semantics()
ArrayRef< const Expr * > semantics() const
unsigned getNumSemanticExprs() const
friend class ASTStmtReader
Expr * getSemanticExpr(unsigned index)
Expr * getSyntacticForm()
Return the syntactic form of this expression, i.e.
SourceLocation getEndLoc() const LLVM_READONLY
const_child_range children() const
A (possibly-)qualified type.
bool isVolatileQualified() const
Determine whether this type is volatile-qualified.
bool isNull() const
Return true if this QualType doesn't point to a type yet.
Represents a struct/union/class.
Frontend produces RecoveryExprs on semantic errors that prevent creating other well-formed expression...
ArrayRef< const Expr * > subExpressions() const
ArrayRef< Expr * > subExpressions()
SourceLocation getEndLoc() const
static bool classof(const Stmt *T)
friend class ASTStmtWriter
friend class ASTStmtReader
SourceLocation getBeginLoc() const
static RecoveryExpr * CreateEmpty(ASTContext &Ctx, unsigned NumSubExprs)
Base for LValueReferenceType and RValueReferenceType.
static bool classof(const Stmt *T)
const_child_range children() const
SourceLocation getLocation() const
const TypeSourceInfo * getTypeSourceInfo() const
SourceLocation getLParenLocation() const
TypeSourceInfo * getTypeSourceInfo()
std::string ComputeName(ASTContext &Context) const
SourceLocation getBeginLoc() const
SourceLocation getRParenLocation() const
friend class ASTStmtReader
SourceLocation getEndLoc() const
static SYCLUniqueStableNameExpr * CreateEmpty(const ASTContext &Ctx)
Classes implementing SemaProxy present a restricted view of the (possibly mutating) actions and queri...
ShuffleVectorExpr(EmptyShell Empty)
Build an empty vector-shuffle expression.
llvm::APSInt getShuffleMaskIdx(unsigned N) const
void setExprs(const ASTContext &C, ArrayRef< Expr * > Exprs)
Expr ** getSubExprs()
Retrieve the array of expressions.
const_child_range children() const
ShuffleVectorExpr(const ASTContext &C, ArrayRef< Expr * > args, QualType Type, SourceLocation BLoc, SourceLocation RP)
SourceLocation getBuiltinLoc() const
SourceLocation getEndLoc() const LLVM_READONLY
void setRParenLoc(SourceLocation L)
const Expr * getExpr(unsigned Index) const
unsigned getNumSubExprs() const
getNumSubExprs - Return the size of the SubExprs array.
static bool classof(const Stmt *T)
SourceLocation getRParenLoc() const
SourceLocation getBeginLoc() const LLVM_READONLY
Expr * getExpr(unsigned Index)
getExpr - Return the Expr at the specified index.
void setBuiltinLoc(SourceLocation L)
SourceLocExpr(EmptyShell Empty)
Build an empty call expression.
SourceLocation getBeginLoc() const
APValue EvaluateInContext(const ASTContext &Ctx, const Expr *DefaultExpr) const
Return the result of evaluating this SourceLocExpr in the specified (and possibly null) default argum...
static bool classof(const Stmt *T)
SourceLocExpr(const ASTContext &Ctx, SourceLocIdentKind Type, QualType ResultTy, SourceLocation BLoc, SourceLocation RParenLoc, DeclContext *Context)
SourceLocation getLocation() const
const DeclContext * getParentContext() const
If the SourceLocExpr has been resolved return the subexpression representing the resolved value.
SourceLocation getEndLoc() const
DeclContext * getParentContext()
StringRef getBuiltinStr() const
Return a string representing the name of the specific builtin function.
const_child_range children() const
static bool MayBeDependent(SourceLocIdentKind Kind)
SourceLocIdentKind getIdentKind() const
friend class ASTStmtReader
Encodes a location in the source.
bool isValid() const
Return true if this is a valid SourceLocation object.
This class handles loading and caching of source files into memory.
A trivial tuple used to represent a source range.
const CompoundStmt * getSubStmt() const
void setRParenLoc(SourceLocation L)
const_child_range children() const
CompoundStmt * getSubStmt()
static bool classof(const Stmt *T)
StmtExpr(CompoundStmt *SubStmt, QualType T, SourceLocation LParenLoc, SourceLocation RParenLoc, unsigned TemplateDepth)
StmtExpr(EmptyShell Empty)
Build an empty statement expression.
void setLParenLoc(SourceLocation L)
SourceLocation getEndLoc() const LLVM_READONLY
unsigned getTemplateDepth() const
SourceLocation getBeginLoc() const LLVM_READONLY
SourceLocation getRParenLoc() const
void setSubStmt(CompoundStmt *S)
SourceLocation getLParenLoc() const
Stmt - This represents one statement.
SourceLocation getEndLoc() const LLVM_READONLY
UnaryExprOrTypeTraitExprBitfields UnaryExprOrTypeTraitExprBits
GenericSelectionExprBitfields GenericSelectionExprBits
InitListExprBitfields InitListExprBits
ParenListExprBitfields ParenListExprBits
ArrayOrMatrixSubscriptExprBitfields ArrayOrMatrixSubscriptExprBits
ParenExprBitfields ParenExprBits
StmtIterator child_iterator
Child Iterators: All subclasses must implement 'children' to permit easy iteration over the substatem...
CallExprBitfields CallExprBits
ShuffleVectorExprBitfields ShuffleVectorExprBits
FloatingLiteralBitfields FloatingLiteralBits
child_iterator child_begin()
StmtClass getStmtClass() const
CharacterLiteralBitfields CharacterLiteralBits
UnaryOperatorBitfields UnaryOperatorBits
ConstCastIterator< Expr > ConstExprIterator
SourceLocExprBitfields SourceLocExprBits
Stmt(StmtClass SC, EmptyShell)
Construct an empty statement.
ChooseExprBitfields ChooseExprBits
ConstantExprBitfields ConstantExprBits
llvm::iterator_range< child_iterator > child_range
StmtExprBitfields StmtExprBits
StringLiteralBitfields StringLiteralBits
OpaqueValueExprBitfields OpaqueValueExprBits
CastExprBitfields CastExprBits
MemberExprBitfields MemberExprBits
DeclRefExprBitfields DeclRefExprBits
ConstStmtIterator const_child_iterator
PredefinedExprBitfields PredefinedExprBits
ConvertVectorExprBitfields ConvertVectorExprBits
SourceLocation getBeginLoc() const LLVM_READONLY
BinaryOperatorBitfields BinaryOperatorBits
PseudoObjectExprBitfields PseudoObjectExprBits
llvm::iterator_range< const_child_iterator > const_child_range
CastIterator< Expr > ExprIterator
The streaming interface shared between DiagnosticBuilder and PartialDiagnostic.
void AddTaggedVal(uint64_t V, DiagnosticsEngine::ArgumentKind Kind) const
StringLiteral - This represents a string literal expression, e.g.
const_child_range children() const
UnsignedOrNone findZeroCodeUnit(unsigned StartIndex=0) const
Scan the string literal contents for a code unit with value 0.
SourceLocation getStrTokenLoc(unsigned TokNum) const
Get one of the string literal token.
SourceLocation getBeginLoc() const LLVM_READONLY
bool containsNonAscii() const
Scans the string contents for any non-ascii characters.
bool containsNonAsciiOrNull() const
Scans the string contents for any non-ascii or null characters.
unsigned getLength() const
static bool classof(const Stmt *T)
uint32_t getCodeUnit(size_t I) const
Return the code unit at the given position.
tokloc_iterator tokloc_begin() const
tokloc_iterator tokloc_end() const
StringLiteralKind getKind() const
SourceLocation getLocationOfByte(unsigned ByteNo, const SourceManager &SM, const LangOptions &Features, const TargetInfo &Target, unsigned *StartToken=nullptr, unsigned *StartTokenByteOffset=nullptr) const
Return a source location that points to the specified byte of this string literal.
StringRef getBytes() const
Allow access to clients that need the byte representation, such as ASTWriterStmt::VisitStringLiteral(...
bool isUnevaluated() const
void outputString(raw_ostream &OS) const
Prints the contents of the string to OS.
int64_t getCodeUnitS(size_t I, uint64_t BitWidth) const
unsigned getByteLength() const
StringRef getString() const
friend class ASTStmtReader
static StringLiteral * CreateEmpty(const ASTContext &Ctx, unsigned NumConcatenated, unsigned Length, unsigned CharByteWidth)
Construct an empty string literal.
SourceLocation getEndLoc() const LLVM_READONLY
const SourceLocation * tokloc_iterator
unsigned getNumConcatenated() const
Get the number of string literal tokens that were concatenated in translation phase #6 to form this s...
unsigned getCharByteWidth() const
Exposes information about the current target.
A convenient class for passing around template argument information.
Location wrapper for a TemplateArgument.
A container of type source information.
QualType getType() const
Return the type wrapped by this type source info.
The base class of the type hierarchy.
bool isPlaceholderType() const
Test for a type which does not represent an actual type-system type but is instead used as a placehol...
bool isIntegerType() const
isIntegerType() does not include complex integers (a GCC extension).
bool isReferenceType() const
QualType getPointeeType() const
If this is a pointer, ObjC object pointer, or block pointer, this returns the respective pointee.
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
SourceLocation getRParenLoc() const
SourceLocation getEndLoc() const LLVM_READONLY
void setKind(UnaryExprOrTypeTrait K)
QualType getArgumentType() const
void setOperatorLoc(SourceLocation L)
SourceLocation getOperatorLoc() const
const Expr * getArgumentExpr() const
SourceLocation getBeginLoc() const LLVM_READONLY
void setRParenLoc(SourceLocation L)
static bool classof(const Stmt *T)
QualType getTypeOfArgument() const
Gets the argument type, or the type of the argument expression, whichever is appropriate.
bool isArgumentType() const
void setArgument(Expr *E)
UnaryExprOrTypeTraitExpr(UnaryExprOrTypeTrait ExprKind, TypeSourceInfo *TInfo, QualType resultType, SourceLocation op, SourceLocation rp)
TypeSourceInfo * getArgumentTypeInfo() const
UnaryExprOrTypeTraitExpr(EmptyShell Empty)
Construct an empty sizeof/alignof expression.
UnaryExprOrTypeTrait getKind() const
void setArgument(TypeSourceInfo *TInfo)
UnaryOperator - This represents the unary-expression's (except sizeof and alignof),...
static bool classof(const Stmt *T)
static bool isPostfix(Opcode Op)
isPostfix - Return true if this is a postfix operation, like x++.
bool isDecrementOp() const
SourceLocation getExprLoc() const
bool isFEnvAccessOn(const LangOptions &LO) const
Get the FENV_ACCESS status of this operator.
void setOperatorLoc(SourceLocation L)
SourceLocation getOperatorLoc() const
getOperatorLoc - Return the location of the operator.
Expr * getSubExpr() const
SourceLocation getEndLoc() const LLVM_READONLY
bool isArithmeticOp() const
void setCanOverflow(bool C)
UnaryOperator(bool HasFPFeatures, EmptyShell Empty)
Build an empty unary operator.
friend class ASTNodeImporter
bool hasStoredFPFeatures() const
Is FPFeatures in Trailing Storage?
static OverloadedOperatorKind getOverloadedOperator(Opcode Opc)
Retrieve the overloaded operator kind that corresponds to the given unary opcode.
void setOpcode(Opcode Opc)
static bool isIncrementOp(Opcode Op)
static bool isIncrementDecrementOp(Opcode Op)
SourceLocation getBeginLoc() const LLVM_READONLY
static bool isDecrementOp(Opcode Op)
FPOptionsOverride getStoredFPFeaturesOrDefault() const
Get the store FPOptionsOverride or default if not stored.
FPOptionsOverride getStoredFPFeatures() const
Get FPFeatures from trailing storage.
bool isFPContractableWithinStatement(const LangOptions &LO) const
Get the FP contractibility status of this operator.
static Opcode getOverloadedOpcode(OverloadedOperatorKind OO, bool Postfix)
Retrieve the unary opcode that corresponds to the given overloaded operator.
FPOptions getFPFeaturesInEffect(const LangOptions &LO) const
Get the FP features status of this operator.
friend class ASTStmtWriter
void setStoredFPFeatures(FPOptionsOverride F)
Set FPFeatures in trailing storage, used by Serialization & ASTImporter.
UnaryOperator(const ASTContext &Ctx, Expr *input, Opcode opc, QualType type, ExprValueKind VK, ExprObjectKind OK, SourceLocation l, bool CanOverflow, FPOptionsOverride FPFeatures)
FPOptionsOverride getFPOptionsOverride() const
friend class ASTStmtReader
static UnaryOperator * CreateEmpty(const ASTContext &C, bool hasFPFeatures)
static bool isPrefix(Opcode Op)
isPrefix - Return true if this is a prefix operation, like –x.
static StringRef getOpcodeStr(Opcode Op)
getOpcodeStr - Turn an Opcode enum value into the punctuation char it corresponds to,...
static bool isArithmeticOp(Opcode Op)
bool isIncrementDecrementOp() const
bool isIncrementOp() const
const_child_range children() const
bool canOverflow() const
Returns true if the unary operator can cause an overflow.
void setVarargABI(VarArgKind Kind)
void setRParenLoc(SourceLocation L)
TypeSourceInfo * getWrittenTypeInfo() const
SourceLocation getBuiltinLoc() const
SourceLocation getRParenLoc() const
bool isZOSABI() const
Returns whether this is really a z/OS ABI va_arg expression.
VAArgExpr(EmptyShell Empty)
Create an empty __builtin_va_arg expression.
bool isMicrosoftABI() const
Returns whether this is really a Win64 ABI va_arg expression.
static bool classof(const Stmt *T)
SourceLocation getBeginLoc() const LLVM_READONLY
VAArgExpr(SourceLocation BLoc, Expr *e, TypeSourceInfo *TInfo, SourceLocation RPLoc, QualType t, VarArgKind VaKind)
SourceLocation getEndLoc() const LLVM_READONLY
void setBuiltinLoc(SourceLocation L)
VarArgKind getVarargABI() const
void setWrittenTypeInfo(TypeSourceInfo *TI)
const_child_range children() const
const Expr * getSubExpr() const
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Represents a statement that could possibly have a value and type.
Stmt(StmtClass SC, EmptyShell)
Construct an empty statement.
Represents a variable declaration or definition.
const internal::VariadicAllOfMatcher< Type > type
Matches Types in the clang AST.
const internal::VariadicDynCastAllOfMatcher< Stmt, Expr > expr
Matches expressions.
bool Const(InterpState &S, const T &Arg)
Top level wrappers for InstallAPI frontend operations.
LLVM_READNONE bool isASCII(char c)
Returns true if a byte is an ASCII character.
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
ConstantResultStorageKind
Describes the kind of result that can be tail-allocated.
bool isa(CodeGen::Address addr)
const Expr * findStructFieldAccess(const Expr *E, const Expr **OutArrayIndex=nullptr, QualType *OutArrayElementTy=nullptr)
Walk E through parens, implicit casts, unary &/*, array subscripts and comma operators to find the he...
ExprDependenceScope::ExprDependence ExprDependence
StmtIterator cast_away_const(const ConstStmtIterator &RHS)
ExprObjectKind
A further classification of the kind of object referenced by an l-value or x-value.
@ OK_VectorComponent
A vector component is an element or range of elements of a vector.
@ OK_Ordinary
An ordinary object is located at an address in memory.
@ OK_BitField
A bitfield object is a bitfield on a C or C++ record.
@ OK_MatrixComponent
A matrix component is a single element or range of elements of a matrix.
Expr::ConstantExprKind ConstantExprKind
ExprDependence computeDependence(FullExpr *E)
@ Create
'create' clause, allowed on Compute and Combined constructs, plus 'data', 'enter data',...
nullptr
This class represents a compute construct, representing a 'Kind' of ‘parallel’, 'serial',...
@ Result
The result type of a method or function.
OptionalUnsigned< unsigned > UnsignedOrNone
const FunctionProtoType * T
CastKind
CastKind - The kind of operation required for a conversion.
std::pair< SourceLocation, PartialDiagnostic > PartialDiagnosticAt
A partial diagnostic along with the source location where this diagnostic occurs.
ExprValueKind
The categorization of expression values, currently following the C++11 scheme.
@ VK_PRValue
A pr-value expression (in the C++11 taxonomy) produces a temporary value.
@ VK_XValue
An x-value expression is a reference to an object with independent storage but which can be "moved",...
@ VK_LValue
An l-value expression is a reference to an object with independent storage.
SmallVector< CXXBaseSpecifier *, 4 > CXXCastPath
A simple array of base specifiers.
const StreamingDiagnostic & operator<<(const StreamingDiagnostic &DB, const ConceptReference *C)
Insertion operator for diagnostics.
U cast(CodeGen::Address addr)
@ Other
Other implicit parameter.
@ PrettyFunctionNoVirtual
The same as PrettyFunction, except that the 'virtual' keyword is omitted for virtual member functions...
NonOdrUseReason
The reason why a DeclRefExpr does not constitute an odr-use.
@ NOUR_None
This is an odr-use.
__UINTPTR_TYPE__ uintptr_t
An unsigned integer type with the property that any valid pointer to void can be converted to this ty...
__builtin_bitreverse32 uint32_t __builtin_riscv_aaddu_u32 __builtin_riscv_asubu_u32 __builtin_elementwise_add_sat __builtin_elementwise_sub_sat int32_t uint32_t uint32_t __builtin_riscv_mhacc_i32 __builtin_riscv_mhaccu_u32 __builtin_riscv_mhaccsu_i32 __builtin_riscv_mulq_i32 __builtin_riscv_mqwacc_i64 __packed_splat4 uint16_t
__builtin_bitreverse32 uint32_t __builtin_riscv_aaddu_u32 __builtin_riscv_asubu_u32 __builtin_elementwise_add_sat __builtin_elementwise_sub_sat int32_t uint32_t uint32_t __builtin_riscv_mhacc_i32 __builtin_riscv_mhaccu_u32 __builtin_riscv_mhaccsu_i32 __builtin_riscv_mulq_i32 int64_t
BlockVarCopyInit(Expr *CopyExpr, bool CanThrow)
Expr * getCopyExpr() const
BlockVarCopyInit()=default
llvm::PointerIntPair< Expr *, 1, bool > ExprAndFlag
void setExprAndFlag(Expr *CopyExpr, bool CanThrow)
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspon...
Stores data related to a single embed directive.
StringLiteral * BinaryData
size_t getDataElementCount() const
EvalResult is a struct with detailed info about an evaluated expression.
APValue Val
Val - This is the value the expression can be folded to.
bool isGlobalLValue() const
Return true if the evaluated lvalue expression is global.
bool hasSideEffects() const
Return true if the evaluated expression has side effects.
SmallVectorImpl< PartialDiagnosticAt > * Diag
Diag - If this is non-null, it will be filled in with a stack of notes indicating why evaluation fail...
bool DiagEmitted
Whether any diagnostic has been emitted.
bool HasUndefinedBehavior
Whether the evaluation hit undefined behavior.
bool HasSideEffects
Whether the evaluated expression has side effects.
SmallVectorImpl< PartialDiagnosticAt > * ExtendedDiag
Location where we spot ptr to int cast or null subobject while evaluating constant expression in MS c...
A placeholder type used to construct an empty shell of a type, that will be filled in later (e....
const CastExpr * BasePath
const CXXRecordDecl * DerivedClass
const MemberPointerType * MPT
SubobjectAdjustment(const MemberPointerType *MPT, Expr *RHS)
SubobjectAdjustment(const FieldDecl *Field)
SubobjectAdjustment(const CastExpr *BasePath, const CXXRecordDecl *DerivedClass)
enum clang::SubobjectAdjustment::@253221166153022235222106274120241151060023135167 Kind
@ DerivedToBaseAdjustment
@ MemberPointerAdjustment