14 #ifndef LLVM_CLANG_AST_EXPR_H
15 #define LLVM_CLANG_AST_EXPR_H
28 #include "llvm/ADT/APFloat.h"
29 #include "llvm/ADT/APSInt.h"
30 #include "llvm/ADT/SmallVector.h"
31 #include "llvm/ADT/StringRef.h"
32 #include "llvm/Support/AtomicOrdering.h"
33 #include "llvm/Support/Compiler.h"
39 class CXXBaseSpecifier;
40 class CXXMemberCallExpr;
41 class CXXOperatorCallExpr;
45 class MaterializeTemporaryExpr;
47 class ObjCPropertyRefExpr;
48 class OpaqueValueExpr;
110 bool TD,
bool VD,
bool ID,
bool ContainsUnexpandedParameterPack)
118 assert(
ExprBits.ObjectKind == OK &&
"truncated kind");
119 ExprBits.ContainsUnexpandedParameterPack = ContainsUnexpandedParameterPack;
136 "Expressions can't have reference type");
191 return ExprBits.InstantiationDependent;
214 return ExprBits.ContainsUnexpandedParameterPack;
220 ExprBits.ContainsUnexpandedParameterPack = PP;
335 unsigned short Modifiable;
338 :
Kind(k), Modifiable(m)
346 assert(Modifiable !=
CM_Untested &&
"Did not test for modifiability.");
375 return ClassifyImpl(Ctx,
nullptr);
387 return ClassifyImpl(Ctx, &Loc);
394 return (isa<LValueReferenceType>(RT)
396 : (RT->getPointeeType()->isFunctionType()
477 return BT->getKind() == K;
496 bool isEvaluated =
true)
const;
535 const Expr **Culprit =
nullptr)
const;
623 bool IncludePossibleEffects =
true)
const;
656 const Expr *This =
nullptr)
const;
666 unsigned Type)
const;
873 Expr *SourceExpr =
nullptr)
874 :
Expr(OpaqueValueExprClass, T, VK, OK,
875 T->isDependentType() ||
877 T->isDependentType() ||
879 T->isInstantiationDependentType() ||
882 SourceExpr(SourceExpr), Loc(Loc) {
891 :
Expr(OpaqueValueExprClass, Empty) { }
897 return SourceExpr ? SourceExpr->
getLocStart() : Loc;
900 return SourceExpr ? SourceExpr->
getLocEnd() : Loc;
903 if (SourceExpr)
return SourceExpr->
getExprLoc();
956 NamedDecl *, ASTTemplateKWAndArgsInfo,
957 TemplateArgumentLoc> {
968 size_t numTrailingObjects(OverloadToken<NestedNameSpecifierLoc>)
const {
972 size_t numTrailingObjects(OverloadToken<NamedDecl *>)
const {
973 return hasFoundDecl() ? 1 : 0;
976 size_t numTrailingObjects(OverloadToken<ASTTemplateKWAndArgsInfo>)
const {
987 ValueDecl *D,
bool RefersToEnlosingVariableOrCapture,
995 :
Expr(DeclRefExprClass, Empty) { }
1006 D(D), Loc(L), DNLoc(LocInfo) {
1012 RefersToEnclosingVariableOrCapture;
1026 bool RefersToEnclosingVariableOrCapture,
1035 bool HasTemplateKWAndArgsInfo,
1036 unsigned NumTemplateArgs);
1060 return *getTrailingObjects<NestedNameSpecifierLoc>();
1076 return hasFoundDecl() ? *getTrailingObjects<NamedDecl *>() : D;
1082 return hasFoundDecl() ? *getTrailingObjects<NamedDecl *>() : D;
1093 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->TemplateKWLoc;
1100 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->LAngleLoc;
1107 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->RAngleLoc;
1122 getTrailingObjects<ASTTemplateKWAndArgsInfo>()->copyInto(
1123 getTrailingObjects<TemplateArgumentLoc>(), List);
1132 return getTrailingObjects<TemplateArgumentLoc>();
1141 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->NumTemplateArgs;
1210 :
Expr(PredefinedExprClass, Empty), Loc(),
Type(
Func), FnName(nullptr) {}
1256 bool hasAllocation()
const {
return llvm::APInt::getNumWords(BitWidth) > 1; }
1265 unsigned NumWords = llvm::APInt::getNumWords(BitWidth);
1267 return llvm::APInt(BitWidth, NumWords,
pVal);
1269 return llvm::APInt(BitWidth,
VAL);
1284 llvm::APFloat
getValue(
const llvm::fltSemantics &Semantics)
const {
1297 :
Expr(IntegerLiteralClass, Empty) { }
1354 Value(value), Loc(l) {
1406 assert(&
getSemantics() == &Val.getSemantics() &&
"Inconsistent semantics");
1470 :
Expr(ImaginaryLiteralClass, Empty) { }
1525 unsigned CharByteWidth : 4;
1527 unsigned IsPascal : 1;
1528 unsigned NumConcatenated;
1535 static int mapCharByteWidth(TargetInfo
const &target,
StringKind k);
1540 static StringLiteral *
Create(
const ASTContext &C, StringRef Str,
1542 const SourceLocation *Loc,
unsigned NumStrs);
1548 return Create(C, Str, Kind, Pascal, Ty, &Loc, 1);
1555 assert(CharByteWidth==1
1556 &&
"This function is used in places that assume strings use char");
1564 if (CharByteWidth == 1)
1566 if (CharByteWidth == 4)
1567 return StringRef(reinterpret_cast<const char*>(StrData.asUInt32),
1569 assert(CharByteWidth == 2 &&
"unsupported CharByteWidth");
1570 return StringRef(reinterpret_cast<const char*>(StrData.asUInt16),
1577 assert(i < Length &&
"out of bounds access");
1578 if (CharByteWidth == 1)
1579 return static_cast<unsigned char>(StrData.asChar[i]);
1580 if (CharByteWidth == 4)
1581 return StrData.asUInt32[i];
1582 assert(CharByteWidth == 2 &&
"unsupported CharByteWidth");
1583 return StrData.asUInt16[i];
1606 for (
unsigned i = 0, e = Str.size(); i != e; ++i)
1607 if (!
isASCII(Str[i]) || !Str[i])
1617 assert(TokNum < NumConcatenated &&
"Invalid tok number");
1618 return TokLocs[TokNum];
1621 assert(TokNum < NumConcatenated &&
"Invalid tok number");
1622 TokLocs[TokNum] = L;
1635 unsigned *StartToken =
nullptr,
1636 unsigned *StartTokenByteOffset =
nullptr)
const;
1644 return TokLocs[NumConcatenated - 1];
1672 L(l), R(r), Val(val) {}
1676 :
Expr(ParenExprClass, Empty) { }
1726 :
Expr(UnaryOperatorClass, type, VK, OK,
1730 type->isInstantiationDependentType()),
1732 Opc(opc), Loc(l), Val(input) {}
1736 :
Expr(UnaryOperatorClass, Empty), Opc(UO_AddrOf) { }
1750 return Op == UO_PostInc || Op == UO_PostDec;
1755 return Op == UO_PreInc || Op == UO_PreDec;
1762 return Op == UO_PreInc || Op == UO_PostInc;
1769 return Op == UO_PreDec || Op == UO_PostDec;
1781 return Op >= UO_Plus && Op <= UO_LNot;
1835 enum { MaskBits = 2, Mask = 0x03 };
1855 : Range(LBracketLoc, RBracketLoc), Data((Index << 2) |
Array) {}
1859 : Range(DotLoc.isValid() ? DotLoc : NameLoc, NameLoc),
1865 : Range(DotLoc.isValid() ? DotLoc : NameLoc, NameLoc),
1934 size_t numTrailingObjects(OverloadToken<OffsetOfNode>)
const {
1943 explicit OffsetOfExpr(
unsigned numComps,
unsigned numExprs)
1945 TSInfo(
nullptr), NumComps(numComps), NumExprs(numExprs) {}
1955 unsigned NumComps,
unsigned NumExprs);
1973 assert(Idx < NumComps &&
"Subscript out of range");
1974 return getTrailingObjects<OffsetOfNode>()[Idx];
1978 assert(Idx < NumComps &&
"Subscript out of range");
1979 getTrailingObjects<OffsetOfNode>()[Idx] = ON;
1987 assert(Idx < NumExprs &&
"Subscript out of range");
1988 return getTrailingObjects<Expr *>()[Idx];
1992 assert(Idx < NumExprs &&
"Subscript out of range");
1993 return getTrailingObjects<Expr *>()[Idx];
1997 assert(Idx < NumComps &&
"Subscript out of range");
1998 getTrailingObjects<Expr *>()[Idx] = E;
2014 Stmt **begin =
reinterpret_cast<Stmt **
>(getTrailingObjects<Expr *>());
2018 Stmt *
const *begin =
2019 reinterpret_cast<Stmt *
const *
>(getTrailingObjects<Expr *>());
2042 TInfo->
getType()->isDependentType(),
2043 TInfo->
getType()->isInstantiationDependentType(),
2045 OpLoc(op), RParenLoc(rp) {
2048 Argument.Ty = TInfo;
2057 :
Expr(UnaryExprOrTypeTraitExprClass, Empty) { }
2069 assert(
isArgumentType() &&
"calling getArgumentType() when arg is expr");
2073 assert(!
isArgumentType() &&
"calling getArgumentExpr() when arg is type");
2074 return static_cast<Expr*
>(Argument.Ex);
2085 Argument.Ty = TInfo;
2105 return T->
getStmtClass() == UnaryExprOrTypeTraitExprClass;
2119 enum { LHS, RHS, END_EXPR=2 };
2120 Stmt* SubExprs[END_EXPR];
2126 :
Expr(ArraySubscriptExprClass, t, VK, OK,
2133 RBracketLoc(rbracketloc) {
2134 SubExprs[LHS] = lhs;
2135 SubExprs[RHS] = rhs;
2140 :
Expr(ArraySubscriptExprClass, Shell) { }
2193 return child_range(&SubExprs[0], &SubExprs[0]+END_EXPR);
2207 enum { FN=0, PREARGS_START=1 };
2212 void updateDependenciesFromArg(
Expr *Arg);
2225 assert(i <
getNumPreArgs() &&
"Prearg access out of range!");
2226 return SubExprs[PREARGS_START+i];
2229 assert(i <
getNumPreArgs() &&
"Prearg access out of range!");
2230 return SubExprs[PREARGS_START+i];
2233 assert(i <
getNumPreArgs() &&
"Prearg access out of range!");
2234 SubExprs[PREARGS_START+i] = PreArg;
2276 assert(Arg < NumArgs &&
"Arg access out of range!");
2277 return cast_or_null<Expr>(SubExprs[Arg +
getNumPreArgs() + PREARGS_START]);
2280 assert(Arg < NumArgs &&
"Arg access out of range!");
2281 return cast_or_null<Expr>(SubExprs[Arg +
getNumPreArgs() + PREARGS_START]);
2286 assert(Arg < NumArgs &&
"Arg access out of range!");
2321 return llvm::makeArrayRef(SubExprs,
2349 return T->getStmtClass() >= firstCallExprConstant &&
2350 T->getStmtClass() <= lastCallExprConstant;
2381 ASTTemplateKWAndArgsInfo,
2382 TemplateArgumentLoc> {
2408 bool HasQualifierOrFoundDecl : 1;
2415 bool HasTemplateKWAndArgsInfo : 1;
2419 bool HadMultipleCandidates : 1;
2421 size_t numTrailingObjects(OverloadToken<MemberExprNameQualifier>)
const {
2422 return HasQualifierOrFoundDecl ? 1 : 0;
2425 size_t numTrailingObjects(OverloadToken<ASTTemplateKWAndArgsInfo>)
const {
2426 return HasTemplateKWAndArgsInfo ? 1 : 0;
2436 Base(base), MemberDecl(memberdecl), MemberDNLoc(NameInfo.
getInfo()),
2437 MemberLoc(NameInfo.getLoc()), OperatorLoc(operatorloc),
2438 IsArrow(isarrow), HasQualifierOrFoundDecl(
false),
2439 HasTemplateKWAndArgsInfo(
false), HadMultipleCandidates(
false) {
2453 Base(base), MemberDecl(memberdecl), MemberDNLoc(), MemberLoc(l),
2454 OperatorLoc(operatorloc), IsArrow(isarrow),
2455 HasQualifierOrFoundDecl(
false), HasTemplateKWAndArgsInfo(
false),
2456 HadMultipleCandidates(
false) {}
2479 if (!HasQualifierOrFoundDecl)
2482 return getTrailingObjects<MemberExprNameQualifier>()->
FoundDecl;
2494 if (!HasQualifierOrFoundDecl)
2497 return getTrailingObjects<MemberExprNameQualifier>()->QualifierLoc;
2511 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->TemplateKWLoc;
2518 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->LAngleLoc;
2525 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->RAngleLoc;
2539 getTrailingObjects<ASTTemplateKWAndArgsInfo>()->copyInto(
2540 getTrailingObjects<TemplateArgumentLoc>(), List);
2549 return getTrailingObjects<TemplateArgumentLoc>();
2558 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->NumTemplateArgs;
2568 MemberLoc, MemberDNLoc);
2594 return HadMultipleCandidates;
2600 HadMultipleCandidates = V;
2637 llvm::PointerIntPair<TypeSourceInfo *, 1, bool> TInfoAndScope;
2643 tinfo->
getType()->isDependentType(),
2646 tinfo->
getType()->isInstantiationDependentType()),
2648 LParenLoc(lparenloc), TInfoAndScope(tinfo, fileScope), Init(init) {}
2652 :
Expr(CompoundLiteralExprClass, Empty) { }
2665 return TInfoAndScope.getPointer();
2668 TInfoAndScope.setPointer(tinfo);
2705 bool CastConsistency()
const;
2708 return const_cast<CastExpr*
>(
this)->path_buffer();
2712 void setBasePathSize(
unsigned basePathSize) {
2715 "basePathSize doesn't fit in bits of CastExprBits.BasePathSize!");
2720 Expr *op,
unsigned BasePathSize)
2724 ty->isDependentType(),
2728 (ty->isInstantiationDependentType() ||
2732 ((SC != ImplicitCastExprClass &&
2736 assert(kind !=
CK_Invalid &&
"creating cast with invalid cast kind");
2738 setBasePathSize(BasePathSize);
2739 assert(CastConsistency());
2745 setBasePathSize(BasePathSize);
2810 :
CastExpr(ImplicitCastExprClass, ty, VK, kind, op, BasePathLength) {
2815 :
CastExpr(ImplicitCastExprClass, Shell, PathSize) { }
2821 :
CastExpr(ImplicitCastExprClass, ty, VK, kind, op, 0) {
2850 e = ice->getSubExpr();
2879 :
CastExpr(SC, exprTy, VK, kind, op, PathSize), TInfo(writtenTy) {}
2883 :
CastExpr(SC, Shell, PathSize) { }
2896 return T->
getStmtClass() >= firstExplicitCastExprConstant &&
2914 writtenTy), LPLoc(l), RPLoc(r) {}
2976 unsigned FPFeatures : 2;
2979 enum { LHS, RHS, END_EXPR };
2980 Stmt* SubExprs[END_EXPR];
2986 :
Expr(BinaryOperatorClass, ResTy, VK, OK,
2993 Opc(opc), FPFeatures(FPFeatures.getInt()), OpLoc(opLoc) {
2994 SubExprs[LHS] = lhs;
2995 SubExprs[RHS] = rhs;
2997 "Use CompoundAssignOperator for compound assignments");
3002 :
Expr(BinaryOperatorClass, Empty), Opc(BO_Comma) { }
3038 bool isPtrMemOp()
const {
return Opc == BO_PtrMemD || Opc == BO_PtrMemI; }
3040 return Opc >= BO_Mul && Opc <= BO_Rem;
3063 llvm_unreachable(
"Not a comparsion operator.");
3064 case BO_LT:
return BO_GE;
3065 case BO_GT:
return BO_LE;
3066 case BO_LE:
return BO_GT;
3067 case BO_GE:
return BO_LT;
3068 case BO_EQ:
return BO_NE;
3069 case BO_NE:
return BO_EQ;
3076 llvm_unreachable(
"Not a comparsion operator.");
3077 case BO_LT:
return BO_GT;
3078 case BO_GT:
return BO_LT;
3079 case BO_LE:
return BO_GE;
3080 case BO_GE:
return BO_LE;
3091 return Opc >= BO_Assign && Opc <= BO_OrAssign;
3096 return Opc > BO_Assign && Opc <= BO_OrAssign;
3103 if (Opc >= BO_AndAssign)
3104 return Opcode(
unsigned(Opc) - BO_AndAssign + BO_And);
3106 return Opcode(
unsigned(Opc) - BO_MulAssign + BO_Mul);
3110 return Opc == BO_ShlAssign || Opc == BO_ShrAssign;
3117 return S->
getStmtClass() >= firstBinaryOperatorConstant &&
3123 return child_range(&SubExprs[0], &SubExprs[0]+END_EXPR);
3145 :
Expr(CompoundAssignOperatorClass, ResTy, VK, OK,
3152 Opc(opc), FPFeatures(FPFeatures.getInt()), OpLoc(opLoc) {
3153 SubExprs[LHS] = lhs;
3154 SubExprs[RHS] = rhs;
3158 :
Expr(SC, Empty), Opc(BO_MulAssign) { }
3175 :
BinaryOperator(lhs, rhs, opc, ResType, VK, OK, OpLoc, FPFeatures,
3177 ComputationLHSType(CompLHSType),
3178 ComputationResultType(CompResultType) {
3180 "Only should be used for compound assignments");
3197 return S->
getStmtClass() == CompoundAssignOperatorClass;
3210 bool TD,
bool VD,
bool ID,
3211 bool ContainsUnexpandedParameterPack,
3214 :
Expr(SC, T, VK, OK, TD, VD, ID, ContainsUnexpandedParameterPack),
3215 QuestionLoc(qloc),
ColonLoc(cloc) {}
3218 :
Expr(SC, Empty) { }
3238 return T->
getStmtClass() == ConditionalOperatorClass ||
3246 enum { COND, LHS, RHS, END_EXPR };
3247 Stmt* SubExprs[END_EXPR];
3268 SubExprs[COND] = cond;
3269 SubExprs[LHS] = lhs;
3270 SubExprs[RHS] = rhs;
3306 return child_range(&SubExprs[0], &SubExprs[0]+END_EXPR);
3319 enum { COMMON, COND, LHS, RHS, NUM_SUBEXPRS };
3326 Stmt *SubExprs[NUM_SUBEXPRS];
3343 OpaqueValue(opaqueValue) {
3344 SubExprs[COMMON] = common;
3345 SubExprs[COND] = cond;
3346 SubExprs[LHS] = lhs;
3347 SubExprs[RHS] = rhs;
3348 assert(OpaqueValue->
getSourceExpr() == common &&
"Wrong opaque value");
3371 return cast<Expr>(SubExprs[LHS]);
3378 return cast<Expr>(SubExprs[RHS]);
3389 return T->
getStmtClass() == BinaryConditionalOperatorClass;
3394 return child_range(SubExprs, SubExprs + NUM_SUBEXPRS);
3403 return co->getCond();
3404 return cast<BinaryConditionalOperator>(
this)->
getCond();
3409 return co->getTrueExpr();
3410 return cast<BinaryConditionalOperator>(
this)->
getTrueExpr();
3415 return co->getFalseExpr();
3416 return cast<BinaryConditionalOperator>(
this)->
getFalseExpr();
3428 AmpAmpLoc(AALoc), LabelLoc(LLoc), Label(L) {}
3432 :
Expr(AddrLabelExprClass, Empty) { }
3475 SubStmt(substmt), LParenLoc(lp), RParenLoc(rp) { }
3525 :
Expr(ShuffleVectorExprClass, Empty), SubExprs(nullptr) { }
3550 assert((Index < NumExprs) &&
"Arg access out of range!");
3551 return cast<Expr>(SubExprs[Index]);
3554 assert((Index < NumExprs) &&
"Arg access out of range!");
3555 return cast<Expr>(SubExprs[Index]);
3561 assert((N < NumExprs - 2) &&
"Shuffle idx out of range!");
3567 return child_range(&SubExprs[0], &SubExprs[0]+NumExprs);
3591 :
Expr(ConvertVectorExprClass, DstType, VK, OK,
3592 DstType->isDependentType(),
3594 (DstType->isInstantiationDependentType() ||
3598 SrcExpr(SrcExpr), TInfo(TI), BuiltinLoc(BuiltinLoc), RParenLoc(RParenLoc) {}
3641 enum { COND, LHS, RHS, END_EXPR };
3642 Stmt* SubExprs[END_EXPR];
3649 bool TypeDependent,
bool ValueDependent)
3650 :
Expr(ChooseExprClass, t, VK, OK, TypeDependent, ValueDependent,
3657 BuiltinLoc(BLoc), RParenLoc(RP), CondIsTrue(condIsTrue) {
3658 SubExprs[COND] = cond;
3659 SubExprs[LHS] = lhs;
3660 SubExprs[RHS] = rhs;
3670 "Dependent condition isn't true or false");
3707 return child_range(&SubExprs[0], &SubExprs[0]+END_EXPR);
3756 llvm::PointerIntPair<TypeSourceInfo *, 1, bool> TInfo;
3762 false, (TInfo->
getType()->isInstantiationDependentType() ||
3766 Val(e), TInfo(TInfo, IsMS), BuiltinLoc(BLoc), RParenLoc(RPLoc) {}
3770 :
Expr(VAArgExprClass, Empty), Val(nullptr), TInfo(nullptr,
false) {}
3859 llvm::PointerIntPair<InitListExpr *, 1, bool> AltForm;
3868 llvm::PointerUnion<Expr *, FieldDecl *> ArrayFillerOrUnionFieldInit;
3876 :
Expr(InitListExprClass, Empty), AltForm(nullptr,
true) { }
3885 return reinterpret_cast<Expr *
const *
>(InitExprs.
data());
3897 assert(Init <
getNumInits() &&
"Initializer access out of range!");
3898 return cast_or_null<Expr>(InitExprs[Init]);
3902 assert(Init <
getNumInits() &&
"Initializer access out of range!");
3903 return cast_or_null<Expr>(InitExprs[Init]);
3907 assert(Init <
getNumInits() &&
"Initializer access out of range!");
3908 InitExprs[Init] =
expr;
3914 ExprBits.ContainsUnexpandedParameterPack |=
3943 return ArrayFillerOrUnionFieldInit.dyn_cast<
Expr *>();
3961 return ArrayFillerOrUnionFieldInit.dyn_cast<
FieldDecl *>();
3967 assert((FD ==
nullptr
3970 &&
"Only one field of a union may be initialized at a time!");
3971 ArrayFillerOrUnionFieldInit = FD;
4003 AltForm.setPointer(Init);
4004 AltForm.setInt(
true);
4005 Init->AltForm.setPointer(
this);
4006 Init->AltForm.setInt(
false);
4020 return T->getStmtClass() == InitListExprClass;
4032 if (InitExprs.
empty())
4089 unsigned GNUSyntax : 1;
4092 unsigned NumDesignators : 15;
4097 unsigned NumSubExprs : 16;
4110 NumDesignators(0), NumSubExprs(NumSubExprs), Designators(
nullptr) { }
4155 ArrayRangeDesignator
4181 :
Kind(ArrayDesignator) {
4191 :
Kind(ArrayRangeDesignator) {
4228 assert((
Kind == ArrayDesignator ||
Kind == ArrayRangeDesignator) &&
4229 "Only valid on an array or array-range designator");
4234 assert((
Kind == ArrayDesignator ||
Kind == ArrayRangeDesignator) &&
4235 "Only valid on an array or array-range designator");
4240 assert(
Kind == ArrayRangeDesignator &&
4241 "Only valid on an array-range designator");
4246 assert((
Kind == ArrayDesignator ||
Kind == ArrayRangeDesignator) &&
4247 "Only valid on an array or array-range designator");
4269 bool GNUSyntax,
Expr *Init);
4272 unsigned NumIndexExprs);
4275 unsigned size()
const {
return NumDesignators; }
4279 return {Designators, NumDesignators};
4283 return {Designators, NumDesignators};
4292 unsigned NumDesigs);
4324 assert(Idx < NumSubExprs &&
"Subscript out of range");
4325 return cast<Expr>(getTrailingObjects<Stmt *>()[Idx]);
4329 assert(Idx < NumSubExprs &&
"Subscript out of range");
4330 getTrailingObjects<Stmt *>()[Idx] = E;
4344 return T->getStmtClass() == DesignatedInitExprClass;
4349 Stmt **begin = getTrailingObjects<Stmt *>();
4353 Stmt *
const *begin = getTrailingObjects<Stmt *>();
4376 :
Expr(NoInitExprClass, Empty) { }
4408 Stmt *BaseAndUpdaterExprs[2];
4415 :
Expr(DesignatedInitUpdateExprClass, Empty) { }
4421 return T->getStmtClass() == DesignatedInitUpdateExprClass;
4428 return cast<InitListExpr>(BaseAndUpdaterExprs[1]);
4435 return child_range(&BaseAndUpdaterExprs[0], &BaseAndUpdaterExprs[0] + 2);
4439 &BaseAndUpdaterExprs[0] + 2);
4463 :
Expr(ArrayInitLoopExprClass, Empty), SubExprs{} {}
4469 T->isInstantiationDependentType(),
4472 SubExprs{CommonInit, ElementInit} {}
4477 return cast<OpaqueValueExpr>(SubExprs[0]);
4516 :
Expr(ArrayInitIndexExprClass, Empty) {}
4557 :
Expr(ImplicitValueInitExprClass, Empty) { }
4560 return T->
getStmtClass() == ImplicitValueInitExprClass;
4590 assert(Init <
getNumExprs() &&
"Initializer access out of range!");
4591 return cast_or_null<Expr>(Exprs[Init]);
4595 assert(Init <
getNumExprs() &&
"Initializer access out of range!");
4596 return cast_or_null<Expr>(Exprs[Init]);
4617 return child_range(&Exprs[0], &Exprs[0]+NumExprs);
4654 enum { CONTROLLING, END_EXPR };
4657 unsigned NumAssocs, ResultIndex;
4666 bool ContainsUnexpandedParameterPack,
4667 unsigned ResultIndex);
4675 bool ContainsUnexpandedParameterPack);
4678 :
Expr(GenericSelectionExprClass, Empty) { }
4687 return cast<Expr>(SubExprs[END_EXPR+i]);
4692 ? llvm::makeArrayRef(
4693 &reinterpret_cast<Expr **>(SubExprs)[END_EXPR], NumAssocs)
4697 return AssocTypes[i];
4701 return NumAssocs ? llvm::makeArrayRef(&AssocTypes[0], NumAssocs) :
None;
4706 return TS->getType();
4712 return cast<Expr>(SubExprs[CONTROLLING]);
4740 return child_range(SubExprs, SubExprs+END_EXPR+NumAssocs);
4766 :
Expr(ExtVectorElementExprClass, ty, VK,
4771 Base(base), Accessor(&accessor), AccessorLoc(loc) {}
4775 :
Expr(ExtVectorElementExprClass, Empty) { }
4826 ty->isDependentType(), ty->isDependentType(),
4827 ty->isInstantiationDependentType() || BD->isDependentContext(),
4878 :
Expr(AsTypeExprClass, DstType, VK, OK,
4879 DstType->isDependentType(),
4881 (DstType->isInstantiationDependentType() ||
4885 SrcExpr(SrcExpr), BuiltinLoc(BuiltinLoc), RParenLoc(RParenLoc) {}
4952 Expr **getSubExprsBuffer() {
return getTrailingObjects<Expr *>(); }
4953 const Expr *
const *getSubExprsBuffer()
const {
4954 return getTrailingObjects<Expr *>();
4959 unsigned resultIndex);
4963 unsigned getNumSubExprs()
const {
4974 unsigned resultIndex);
4977 unsigned numSemanticExprs);
5007 return getSubExprsBuffer() + 1;
5010 return getSubExprsBuffer() + 1;
5013 return getSubExprsBuffer() + getNumSubExprs();
5016 return getSubExprsBuffer() + getNumSubExprs();
5022 llvm::iterator_range<const_semantics_iterator>
semantics()
const {
5027 assert(index + 1 < getNumSubExprs());
5028 return getSubExprsBuffer()[index + 1];
5052 Stmt *
const *cs =
const_cast<Stmt *
const *
>(
5053 reinterpret_cast<const Stmt *
const *
>(getSubExprsBuffer()));
5073 #define BUILTIN(ID, TYPE, ATTRS)
5074 #define ATOMIC_BUILTIN(ID, TYPE, ATTRS) AO ## ID,
5075 #include "clang/Basic/Builtins.def"
5081 enum { PTR, ORDER, VAL1, ORDER_FAIL, VAL2, WEAK, END_EXPR };
5082 Stmt* SubExprs[END_EXPR];
5083 unsigned NumSubExprs;
5084 SourceLocation BuiltinLoc, RParenLoc;
5101 return cast<Expr>(SubExprs[
PTR]);
5104 return cast<Expr>(SubExprs[ORDER]);
5107 if (Op == AO__c11_atomic_init)
5108 return cast<Expr>(SubExprs[ORDER]);
5109 assert(NumSubExprs > VAL1);
5110 return cast<Expr>(SubExprs[VAL1]);
5113 assert(NumSubExprs > ORDER_FAIL);
5114 return cast<Expr>(SubExprs[ORDER_FAIL]);
5117 if (Op == AO__atomic_exchange)
5118 return cast<Expr>(SubExprs[ORDER_FAIL]);
5119 assert(NumSubExprs > VAL2);
5120 return cast<Expr>(SubExprs[VAL2]);
5123 assert(NumSubExprs > WEAK);
5124 return cast<Expr>(SubExprs[WEAK]);
5132 return reinterpret_cast<Expr *
const *
>(SubExprs);
5140 return getOp() == AO__c11_atomic_compare_exchange_strong ||
5141 getOp() == AO__c11_atomic_compare_exchange_weak ||
5142 getOp() == AO__atomic_compare_exchange ||
5143 getOp() == AO__atomic_compare_exchange_n;
5158 return child_range(SubExprs, SubExprs+NumSubExprs);
5175 assert(T->
isDependentType() &&
"TypoExpr given a non-dependent type");
5195 #endif // LLVM_CLANG_AST_EXPR_H
SourceLocation getRParenLoc() const
child_iterator child_begin()
void setFPFeatures(FPOptions F)
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
GenericSelectionExpr(const ASTContext &Context, SourceLocation GenericLoc, Expr *ControllingExpr, ArrayRef< TypeSourceInfo * > AssocTypes, ArrayRef< Expr * > AssocExprs, SourceLocation DefaultLoc, SourceLocation RParenLoc, bool ContainsUnexpandedParameterPack, unsigned ResultIndex)
LValueClassification ClassifyLValue(ASTContext &Ctx) const
Reasons why an expression might not be an l-value.
Represents a single C99 designator.
SourceLocation getRParenLoc() const
ValueDecl * getMemberDecl() const
Retrieve the member declaration to which this expression refers.
void setValueDependent(bool VD)
Set whether this expression is value-dependent or not.
tokloc_iterator tokloc_begin() const
unsigned getNumInits() const
SourceLocation getEnd() const
bool containsDuplicateElements() const
containsDuplicateElements - Return true if any element access is repeated.
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
const_child_range children() const
SourceLocation getLocStart() const LLVM_READONLY
const_child_range children() const
StmtClass getStmtClass() const
static std::string ComputeName(IdentType IT, const Decl *CurrentDecl)
CastKind getCastKind() const
ExprObjectKind getObjectKind() const
getObjectKind - The object kind that this expression produces.
IdentifierInfo * getFieldName() const
For a field or identifier offsetof node, returns the name of the field.
FunctionDecl - An instance of this class is created to represent a function declaration or definition...
NamedDecl * getFoundDecl()
Get the NamedDecl through which this reference occurred.
void setSubStmt(CompoundStmt *S)
TypeSourceInfo * getTypeSourceInfo() const
void setPreArg(unsigned i, Stmt *PreArg)
const internal::VariadicDynCastAllOfMatcher< Stmt, Expr > expr
Matches expressions.
bool allowFPContractWithinStatement() const
SourceLocation getLocStart() const LLVM_READONLY
Expr ** getArgs()
Retrieve the call arguments.
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.
BlockExpr(EmptyShell Empty)
Build an empty block expression.
ImplicitCastExpr(OnStack_t _, QualType ty, CastKind kind, Expr *op, ExprValueKind VK)
Expr * getSyntacticForm()
Return the syntactic form of this expression, i.e.
reverse_iterator rbegin()
void setArrayFiller(Expr *filler)
bool hasTemplateKeyword() const
Determines whether the name in this declaration reference was preceded by the template keyword...
const_child_range children() const
A (possibly-)qualified type.
const_child_range children() const
bool containsUnexpandedParameterPack() const
Whether this expression contains an unexpanded parameter pack (for C++11 variadic templates)...
SourceLocation getLocStart() const LLVM_READONLY
SourceLocation getLocEnd() const LLVM_READONLY
void setOperatorLoc(SourceLocation L)
static Opcode getOpForCompoundAssignment(Opcode Opc)
bool isResultDependent() const
Whether this generic selection is result-dependent.
Expr * getArg(unsigned Arg)
getArg - Return the specified argument.
static StringLiteral * CreateEmpty(const ASTContext &C, unsigned NumStrs)
Construct an empty string literal.
void setRawSemantics(APFloatSemantics Sem)
Set the raw enumeration value representing the floating-point semantics of this literal (32-bit IEEE...
Defines enumerations for the type traits support.
Expr(StmtClass SC, QualType T, ExprValueKind VK, ExprObjectKind OK, bool TD, bool VD, bool ID, bool ContainsUnexpandedParameterPack)
static const CastKind CK_Invalid
Expr * getExpr(unsigned Index)
getExpr - Return the Expr at the specified index.
DeclarationNameInfo getMemberNameInfo() const
Retrieve the member declaration name info.
Designator(unsigned Index, SourceLocation LBracketLoc, SourceLocation RBracketLoc)
Initializes an array designator.
unsigned FieldLoc
The location of the field name in the designated initializer.
CharacterLiteral(EmptyShell Empty)
Construct an empty character literal.
SourceLocation getLocEnd() const LLVM_READONLY
const Expr * getIdx() const
CompoundStmt * getSubStmt()
SourceLocation getTemplateKeywordLoc() const
Retrieve the location of the template keyword preceding the member name, if any.
InitExprsTy::const_iterator const_iterator
SourceLocation getLocEnd() const LLVM_READONLY
static bool classof(const Stmt *S)
Designator(const IdentifierInfo *FieldName, SourceLocation DotLoc, SourceLocation FieldLoc)
Initializes a field designator.
Expr * getControllingExpr()
CharacterKind getKind() const
Expr *const * semantics_iterator
Stmt - This represents one statement.
DesignatedInitUpdateExpr(const ASTContext &C, SourceLocation lBraceLoc, Expr *baseExprs, SourceLocation rBraceLoc)
const_child_range children() const
bool isArgumentType() const
CompoundLiteralExpr(EmptyShell Empty)
Construct an empty compound literal.
Expr * getInit() const
Retrieve the initializer value.
StmtExpr(CompoundStmt *substmt, QualType T, SourceLocation lp, SourceLocation rp)
bool isArrow() const
isArrow - Return true if the base expression is a pointer to vector, return false if the base express...
const_child_range children() const
C Language Family Type Representation.
static bool isMultiplicativeOp(Opcode Opc)
tokloc_iterator tokloc_end() const
SourceLocation getLocEnd() const LLVM_READONLY
reverse_iterator rbegin()
TypeSourceInfo * getTypeSourceInfo() const
bool hasPlaceholderType() const
Returns whether this expression has a placeholder type.
NestedNameSpecifier * getQualifier() const
If the member name was qualified, retrieves the nested-name-specifier that precedes the member name...
void setSemantics(const llvm::fltSemantics &Sem)
Set the APFloat semantics this literal uses.
bool isMultiplicativeOp() const
SourceLocation getLocEnd() const LLVM_READONLY
Decl - This represents one declaration (or definition), e.g.
SourceLocation getLParenLoc() const
unsigned size() const
Returns the number of designators in this initializer.
FloatingLiteralBitfields FloatingLiteralBits
static bool classof(const Stmt *T)
Represents the index of the current element of an array being initialized by an ArrayInitLoopExpr.
SourceLocation getLocEnd() const LLVM_READONLY
static bool classof(const Stmt *T)
const CastExpr * BasePath
const_child_range children() const
void setComputationResultType(QualType T)
const Expr * getIndexExpr(unsigned Idx) const
ParenExpr - This represents a parethesized expression, e.g.
Is the identifier known as a GNU-style attribute?
bool isFPContractableWithinStatement() const
const char * getCastKindName() const
Strictly evaluate the expression.
unsigned getArrayExprIndex() const
For an array element node, returns the index into the array of expressions.
SourceLocation getLocStart() const LLVM_READONLY
The base class of the type hierarchy.
SourceLocation getBuiltinLoc() const
getBuiltinLoc - Return the location of the __builtin_astype token.
ImplicitValueInitExpr(QualType ty)
SourceLocation getRBracketLoc() const
unsigned getResultIndex() const
The zero-based index of the result expression's generic association in the generic selection's associ...
SourceLocation getLabelLoc() const
InitListExpr * getSyntacticForm() const
const Expr * getResultExpr() const
The generic selection's result expression.
void getEncodedElementAccess(SmallVectorImpl< uint32_t > &Elts) const
getEncodedElementAccess - Encode the elements accessed into an llvm aggregate Constant of ConstantInt...
CastExpr(StmtClass SC, EmptyShell Empty, unsigned BasePathSize)
Construct an empty cast.
static bool isShiftOp(Opcode Opc)
DeclRefExprBitfields DeclRefExprBits
static ExprValueKind getValueKindForType(QualType T)
getValueKindForType - Given a formal return or parameter type, give its value kind.
InitExprsTy::iterator iterator
SourceLocation getLocStart() const LLVM_READONLY
The l-value was an access to a declared entity or something equivalently strong, like the address of ...
A container of type source information.
ArrayRef< TemplateArgumentLoc > template_arguments() const
Stmt * IgnoreImplicit()
Skip past any implicit AST nodes which might surround this statement, such as ExprWithCleanups or Imp...
path_const_iterator path_end() const
const_child_range children() const
Floating point control options.
SourceLocation getOperatorLoc() const
SourceLocation getLocStart() const LLVM_READONLY
static StringLiteral * Create(const ASTContext &C, StringRef Str, StringKind Kind, bool Pascal, QualType Ty, const SourceLocation *Loc, unsigned NumStrs)
This is the "fully general" constructor that allows representation of strings formed from multiple co...
SourceLocation getLocStart() const LLVM_READONLY
unsigned getRawEncoding() const
When a SourceLocation itself cannot be used, this returns an (opaque) 32-bit integer encoding for it...
SourceLocation getEllipsisLoc() const
static bool classof(const Stmt *T)
SourceLocation getExprLoc() const LLVM_READONLY
arg_const_range arguments() const
const_iterator begin() const
bool HasSideEffects(const ASTContext &Ctx, bool IncludePossibleEffects=true) const
HasSideEffects - This routine returns true for all those expressions which have any effect other than...
ShuffleVectorExpr(EmptyShell Empty)
Build an empty vector-shuffle expression.
const_arg_iterator arg_end() const
BinaryOperator(Expr *lhs, Expr *rhs, Opcode opc, QualType ResTy, ExprValueKind VK, ExprObjectKind OK, SourceLocation opLoc, FPOptions FPFeatures)
SourceLocation getLocStart() const LLVM_READONLY
Expr * ignoreParenBaseCasts() LLVM_READONLY
Ignore parentheses and derived-to-base casts.
const_child_range children() const
bool hasExplicitTemplateArgs() const
Determines whether the member name was followed by an explicit template argument list.
unsigned getInt() const
Used to serialize this.
IdentType getIdentType() const
bool isConditionTrue() const
isConditionTrue - Return whether the condition is true (i.e.
Expr * getIndexExpr(unsigned Idx)
bool hadArrayRangeDesignator() const
bool isTransparent() const
Is this a transparent initializer list (that is, an InitListExpr that is purely syntactic, and whose semantics are that of the sole contained initializer)?
const CXXBaseSpecifier *const * path_const_iterator
SourceLocation getTemplateKeywordLoc() const
Retrieve the location of the template keyword preceding this name, if any.
SourceLocation getLocStart() const LLVM_READONLY
static OffsetOfExpr * CreateEmpty(const ASTContext &C, unsigned NumComps, unsigned NumExprs)
static const OpaqueValueExpr * findInCopyConstruct(const Expr *expr)
Given an expression which invokes a copy constructor — i.e.
VarDecl - An instance of this class is created to represent a variable declaration or definition...
const Expr * getResultExpr() const
const_child_range children() const
UnaryOperator(Expr *input, Opcode opc, QualType type, ExprValueKind VK, ExprObjectKind OK, SourceLocation l)
GenericSelectionExpr(EmptyShell Empty)
static LLVM_READNONE bool isASCII(char c)
Returns true if this is an ASCII character.
SourceLocation getLocEnd() const LLVM_READONLY
CompoundLiteralExpr - [C99 6.5.2.5].
void setSubExpr(unsigned Idx, Expr *E)
const Expr * getCallee() const
static bool isArithmeticOp(Opcode Op)
Classification ClassifyModifiable(ASTContext &Ctx, SourceLocation &Loc) const
ClassifyModifiable - Classify this expression according to the C++11 expression taxonomy, and see if it is valid on the left side of an assignment.
void setInitializer(Expr *E)
SourceLocation getLocEnd() const LLVM_READONLY
unsigned EllipsisLoc
The location of the ellipsis separating the start and end indices.
llvm::iterator_range< arg_iterator > arg_range
const FunctionProtoType * getFunctionType() const
getFunctionType - Return the underlying function type for this block.
void resizeInits(const ASTContext &Context, unsigned NumInits)
Specify the number of initializers.
BlockExpr(BlockDecl *BD, QualType ty)
void setInit(unsigned Init, Expr *expr)
SourceLocation getLocStart() const LLVM_READONLY
AddrLabelExpr(EmptyShell Empty)
Build an empty address of a label expression.
void setValue(unsigned Val)
SourceLocation getLocation() const
Retrieve the location of the literal.
PredefinedExpr(SourceLocation L, QualType FNTy, IdentType IT, StringLiteral *SL)
const TypeSourceInfo * getAssocTypeSourceInfo(unsigned i) const
Expr * IgnoreImplicit() LLVM_READONLY
IgnoreImplicit - Skip past any implicit AST nodes which might surround this expression.
UnaryExprOrTypeTrait getKind() const
static DeclRefExpr * CreateEmpty(const ASTContext &Context, bool HasQualifier, bool HasFoundDecl, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
Construct an empty declaration reference expression.
void setContainsUnexpandedParameterPack(bool PP=true)
Set the bit that describes whether this expression contains an unexpanded parameter pack...
ConditionalOperator(EmptyShell Empty)
Build an empty conditional operator.
void setGNUSyntax(bool GNU)
const_semantics_iterator semantics_begin() const
Expr * getCond() const
getCond - Return the condition expression; this is defined in terms of the opaque value...
SourceRange getSourceRange() const LLVM_READONLY
Retrieve the source range that covers this offsetof node.
const FunctionDecl * getDirectCallee() const
unsigned getValue() const
static bool isAssignmentOp(Opcode Opc)
NullPointerConstantKind isNullPointerConstant(ASTContext &Ctx, NullPointerConstantValueDependence NPC) const
isNullPointerConstant - C99 6.3.2.3p3 - Test if this reduces down to a Null pointer constant...
unsigned path_size() const
SourceLocation getLocation() const
const Expr * IgnoreParenNoopCasts(ASTContext &Ctx) const LLVM_READONLY
SourceLocation getLocStart() const LLVM_READONLY
Expr * getArrayIndex(const Designator &D) const
Stmt(StmtClass SC, EmptyShell)
Construct an empty statement.
FieldDecl * getSourceBitField()
If this expression refers to a bit-field, retrieve the declaration of that bit-field.
std::reverse_iterator< iterator > reverse_iterator
static bool classof(const Stmt *T)
Expr * IgnoreImpCasts() LLVM_READONLY
IgnoreImpCasts - Skip past any implicit casts which might surround this expression.
SourceLocation getRParenLoc() const
Return the location of the right parentheses.
InitExprsTy::const_reverse_iterator const_reverse_iterator
void setStrTokenLoc(unsigned TokNum, SourceLocation L)
Represents a C99 designated initializer expression.
bool isComparisonOp() const
AbstractConditionalOperator(StmtClass SC, EmptyShell Empty)
bool refersToGlobalRegisterVar() const
Returns whether this expression refers to a global register variable.
static bool classof(const Stmt *T)
DeclarationName getName() const
getName - Returns the embedded declaration name.
One of these records is kept for each identifier that is lexed.
const_child_range children() const
Expr * getSubExpr(unsigned Idx) const
AddrLabelExpr(SourceLocation AALoc, SourceLocation LLoc, LabelDecl *L, QualType t)
ShuffleVectorExpr - clang-specific builtin-in function __builtin_shufflevector.
static Opcode reverseComparisonOp(Opcode Opc)
const_child_range children() const
A vector component is an element or range of elements on a vector.
StmtIterator cast_away_const(const ConstStmtIterator &RHS)
ShuffleVectorExpr(const ASTContext &C, ArrayRef< Expr * > args, QualType Type, SourceLocation BLoc, SourceLocation RP)
static bool classof(const Stmt *T)
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
A C++ nested-name-specifier augmented with source location information.
llvm::iterator_range< const_semantics_iterator > semantics() const
unsigned getNumSemanticExprs() const
unsigned getNumAssocs() const
SourceLocation getExprLoc() const LLVM_READONLY
static SourceLocation getFromRawEncoding(unsigned Encoding)
Turn a raw encoding of a SourceLocation object into a real SourceLocation.
bool isReferenceType() const
bool isImplicitCXXThis() const
Whether this expression is an implicit reference to 'this' in C++.
SourceLocation getAmpAmpLoc() const
SourceLocation getLocStart() const LLVM_READONLY
const_child_range children() const
FieldDecl - An instance of this class is created by Sema::ActOnField to represent a member of a struc...
bool isSemanticForm() const
void setIsMicrosoftABI(bool IsMS)
Represents a place-holder for an object not to be initialized by anything.
CharacterLiteralBitfields CharacterLiteralBits
void setNumArgs(const ASTContext &C, unsigned NumArgs)
setNumArgs - This changes the number of arguments present in this call.
UnaryExprOrTypeTrait
Names for the "expression or type" traits.
const FieldDecl * getInitializedFieldInUnion() const
static bool isIncrementDecrementOp(Opcode Op)
SourceLocation getRParen() const
Get the location of the right parentheses ')'.
unsigned getNumCommas() const
getNumCommas - Return the number of commas that must have been present in this function call...
const TemplateArgumentLoc * getTemplateArgs() const
Retrieve the template arguments provided as part of this template-id.
const Stmt * getBody() const
const Expr * getSyntacticForm() const
ExtVectorElementExpr(EmptyShell Empty)
Build an empty vector element expression.
UnaryOperator(EmptyShell Empty)
Build an empty unary operator.
ArrayRef< Stmt * > getRawSubExprs()
This method provides fast access to all the subexpressions of a CallExpr without going through the sl...
SourceLocation getExprLoc() const LLVM_READONLY
static bool classof(const Stmt *T)
GNUNullExpr - Implements the GNU __null extension, which is a name for a null pointer constant that h...
const Expr * skipRValueSubobjectAdjustments() const
void setArg(unsigned Arg, Expr *ArgExpr)
setArg - Set the specified argument.
void setRParen(SourceLocation Loc)
static DeclRefExpr * Create(const ASTContext &Context, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, ValueDecl *D, bool RefersToEnclosingVariableOrCapture, SourceLocation NameLoc, QualType T, ExprValueKind VK, NamedDecl *FoundD=nullptr, const TemplateArgumentListInfo *TemplateArgs=nullptr)
GNUNullExpr(EmptyShell Empty)
Build an empty GNU __null expression.
llvm::APSInt getShuffleMaskIdx(const ASTContext &Ctx, unsigned N) const
ArrayRef< Expr * > inits() const
IdentifierInfo & getAccessor() const
ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...
const Decl * getCalleeDecl() const
bool refersToVectorElement() const
Returns whether this expression refers to a vector element.
SourceLocation getLocEnd() const LLVM_READONLY
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
void setComponent(unsigned Idx, OffsetOfNode ON)
SourceLocation getLAngleLoc() const
Retrieve the location of the left angle bracket starting the explicit template argument list followin...
SourceLocation getRAngleLoc() const
Retrieve the location of the right angle bracket ending the explicit template argument list following...
const ObjCPropertyRefExpr * getObjCProperty() const
If this expression is an l-value for an Objective C property, find the underlying property reference ...
SourceLocation getRParenLoc() const
NestedNameSpecifierLoc QualifierLoc
The nested-name-specifier that qualifies the name, including source-location information.
void setRParenLoc(SourceLocation L)
static bool classof(const Stmt *T)
static OffsetOfExpr * Create(const ASTContext &C, QualType type, SourceLocation OperatorLoc, TypeSourceInfo *tsi, ArrayRef< OffsetOfNode > comps, ArrayRef< Expr * > exprs, SourceLocation RParenLoc)
An r-value expression (a pr-value in the C++11 taxonomy) produces a temporary value.
const_child_range children() const
struct FieldDesignator Field
A field designator, e.g., ".x".
const Expr *const * const_semantics_iterator
static bool classof(const Stmt *T)
static bool isRelationalOp(Opcode Opc)
SourceLocation getLocStart() const LLVM_READONLY
void setLBraceLoc(SourceLocation Loc)
const Expr *const * getArgs() const
Describes an C or C++ initializer list.
SourceLocation getLocEnd() const LLVM_READONLY
SourceLocation getLocStart() const LLVM_READONLY
const_child_range children() const
uint32_t getCodeUnit(size_t i) const
Expr * getChosenSubExpr() const
getChosenSubExpr - Return the subexpression chosen according to the condition.
AsTypeExpr(Expr *SrcExpr, QualType DstType, ExprValueKind VK, ExprObjectKind OK, SourceLocation BuiltinLoc, SourceLocation RParenLoc)
void setValue(const ASTContext &C, const llvm::APInt &Val)
SourceLocation getLocEnd() const LLVM_READONLY
void setBuiltinLoc(SourceLocation L)
const_child_range children() const
const Expr *const * getSubExprs() const
SmallVectorImpl< PartialDiagnosticAt > * Diag
Diag - If this is non-null, it will be filled in with a stack of notes indicating why evaluation fail...
static bool isEqualityOp(Opcode Opc)
SourceLocation getLocEnd() const LLVM_READONLY
static DeclAccessPair make(NamedDecl *D, AccessSpecifier AS)
CallExpr(const ASTContext &C, StmtClass SC, Expr *fn, ArrayRef< Expr * > preargs, ArrayRef< Expr * > args, QualType t, ExprValueKind VK, SourceLocation rparenloc)
Expr * getTrueExpr() const
static bool classof(const Stmt *T)
unsigned getLength() const
const uint16_t * asUInt16
APValue Val
Val - This is the value the expression can be folded to.
A convenient class for passing around template argument information.
bool EvaluateAsFloat(llvm::APFloat &Result, const ASTContext &Ctx, SideEffectsKind AllowSideEffects=SE_NoSideEffects) const
EvaluateAsFloat - Return true if this is a constant which we can fold and convert to a floating point...
DeclarationNameInfo getNameInfo() const
static bool classof(const Stmt *T)
OffsetOfNode(SourceLocation LBracketLoc, unsigned Index, SourceLocation RBracketLoc)
Create an offsetof node that refers to an array element.
An x-value expression is a reference to an object with independent storage but which can be "moved"...
SourceLocation getLocStart() const LLVM_READONLY
path_iterator path_begin()
const_iterator end() const
OffsetOfNode(const CXXBaseSpecifier *Base)
Create an offsetof node that refers into a C++ base class.
SourceLocation getLParen() const
Get the location of the left parentheses '('.
NullPointerConstantValueDependence
Enumeration used to describe how isNullPointerConstant() should cope with value-dependent expressions...
SourceLocation getLocEnd() const LLVM_READONLY
static bool classof(const Stmt *T)
static bool classof(const Stmt *S)
const Expr * getSubExpr() const
semantics_iterator semantics_end()
SourceLocation getRParenLoc() const
A builtin binary operation expression such as "x + y" or "x <= y".
static bool classof(const Stmt *T)
SourceLocation getRBraceLoc() const
bool isValueDependent() const
isValueDependent - Determines whether this expression is value-dependent (C++ [temp.dep.constexpr]).
unsigned RBracketLoc
The location of the ']' terminating the array range designator.
SourceLocation getLocEnd() const LLVM_READONLY
void setAccessor(IdentifierInfo *II)
static bool isPostfix(Opcode Op)
isPostfix - Return true if this is a postfix operation, like x++.
static bool classof(const Stmt *T)
ChooseExpr(EmptyShell Empty)
Build an empty __builtin_choose_expr.
static bool classof(const Stmt *T)
const_child_range children() const
Expr * IgnoreParenCasts() LLVM_READONLY
IgnoreParenCasts - Ignore parentheses and casts.
QualType getTypeAsWritten() const
getTypeAsWritten - Returns the type that this expression is casting to, as written in the source code...
BinaryOperator(EmptyShell Empty)
Construct an empty binary operator.
SourceLocation getLocStart() const LLVM_READONLY
TypoExpr - Internal placeholder for expressions where typo correction still needs to be performed and...
void setOperatorLoc(SourceLocation L)
bool isConditionDependent() const
SourceLocation getLocEnd() const LLVM_READONLY
An adjustment to be made to the temporary created when emitting a reference binding, which accesses a particular subobject of that temporary.
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Helper class for OffsetOfExpr.
const Decl * getReferencedDeclOfCallee() const
std::reverse_iterator< const_iterator > const_reverse_iterator
SourceLocation getLocEnd() const LLVM_READONLY
SourceLocation getLocStart() const LLVM_READONLY
SourceLocation getLocEnd() const LLVM_READONLY
SourceLocation getLocEnd() const LLVM_READONLY
unsigned getBuiltinCallee() const
getBuiltinCallee - If this is a call to a builtin, return the builtin ID of the callee.
static IntegerLiteral * Create(const ASTContext &C, const llvm::APInt &V, QualType type, SourceLocation l)
Returns a new integer literal with value 'V' and type 'type'.
TypeSourceInfo * getTypeInfoAsWritten() const
getTypeInfoAsWritten - Returns the type source info for the type that this expression is casting to...
An ordinary object is located at an address in memory.
SourceLocation getLocEnd() const LLVM_READONLY
SourceLocation getLocStart() const LLVM_READONLY
bool hadMultipleCandidates() const
Returns true if this member expression refers to a method that was resolved from an overloaded set ha...
SourceLocation getLocation() const
Expression is a GNU-style __null constant.
bool isEqualityOp() const
void setRParenLoc(SourceLocation R)
SourceLocation getLParenLoc() const
SourceLocation getDefaultLoc() const
static Classification makeSimpleLValue()
Create a simple, modifiably lvalue.
static Opcode getOverloadedOpcode(OverloadedOperatorKind OO, bool Postfix)
Retrieve the unary opcode that corresponds to the given overloaded operator.
const Expr * getLHS() const
GNUNullExpr(QualType Ty, SourceLocation Loc)
ConvertVectorExpr(Expr *SrcExpr, TypeSourceInfo *TI, QualType DstType, ExprValueKind VK, ExprObjectKind OK, SourceLocation BuiltinLoc, SourceLocation RParenLoc)
void setIntValue(const ASTContext &C, const llvm::APInt &Val)
bool isCXX11ConstantExpr(const ASTContext &Ctx, APValue *Result=nullptr, SourceLocation *Loc=nullptr) const
isCXX11ConstantExpr - Return true if this expression is a constant expression in C++11.
Iterator for iterating over Stmt * arrays that contain only Expr *.
void setRParenLoc(SourceLocation L)
NestedNameSpecifier * getQualifier() const
If the name was qualified, retrieves the nested-name-specifier that precedes the name.
uint64_t * pVal
Used to store the >64 bits integer value.
const_child_range children() const
void setCastKind(CastKind K)
SourceLocation getRParenLoc() const
getRParenLoc - Return the location of final right parenthesis.
SourceLocation getBuiltinLoc() const
Expr ** getSubExprs()
Retrieve the array of expressions.
ChooseExpr(SourceLocation BLoc, Expr *cond, Expr *lhs, Expr *rhs, QualType t, ExprValueKind VK, ExprObjectKind OK, SourceLocation RP, bool condIsTrue, bool TypeDependent, bool ValueDependent)
const_child_range children() const
static bool classof(const Stmt *T)
SourceLocation getOperatorLoc() const LLVM_READONLY
void setEqualOrColonLoc(SourceLocation L)
const_child_range children() const
void setArgument(Expr *E)
void setTypeSourceInfo(TypeSourceInfo *tsi)
static Opcode negateComparisonOp(Opcode Opc)
InitListExpr * getSemanticForm() const
static bool classof(const Stmt *T)
ConditionalOperator - The ?: ternary operator.
Const iterator for iterating over Stmt * arrays that contain only Expr *.
const ArrayType * castAsArrayTypeUnsafe() const
A variant of castAs<> for array type which silently discards qualifiers from the outermost type...
void setField(FieldDecl *FD)
Expr * getFalseExpr() const
llvm::APInt getValue() const
ParenExpr(SourceLocation l, SourceLocation r, Expr *val)
bool isAssignmentOp() const
void setAmpAmpLoc(SourceLocation L)
SourceLocation getTokenLocation() const
getTokenLocation - The location of the __null token.
CompoundStmt - This represents a group of statements like { stmt stmt }.
Represents a prototype with parameter type info, e.g.
IdentifierInfo * getFieldName() const
void setBlockDecl(BlockDecl *BD)
ArrayInitIndexExpr(QualType T)
const TemplateArgumentLoc * getTemplateArgs() const
Retrieve the 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...
SubobjectAdjustment(FieldDecl *Field)
Expr * IgnoreParenNoopCasts(ASTContext &Ctx) LLVM_READONLY
IgnoreParenNoopCasts - Ignore parentheses and casts that do not change the value (including ptr->int ...
bool isOBJCGCCandidate(ASTContext &Ctx) const
isOBJCGCCandidate - Return true if this expression may be used in a read/ write barrier.
const Expr * getControllingExpr() const
CastKind
CastKind - The kind of operation required for a conversion.
bool EvaluateAsRValue(EvalResult &Result, const ASTContext &Ctx) const
EvaluateAsRValue - Return true if this is a constant which we can fold to an rvalue using any crazy t...
The return type of classify().
const Expr * IgnoreParenCasts() const LLVM_READONLY
SourceRange getDesignatorsSourceRange() const
Used by IntegerLiteral/FloatingLiteral to store the numeric without leaking memory.
static ImplicitCastExpr * Create(const ASTContext &Context, QualType T, CastKind Kind, Expr *Operand, const CXXCastPath *BasePath, ExprValueKind Cat)
SourceLocation getLocEnd() const LLVM_READONLY
Specifies that the expression should never be value-dependent.
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand...
SourceLocation getLocEnd() const LLVM_READONLY
const Expr * getRHS() const
Stmt * getPreArg(unsigned i)
void setLParen(SourceLocation Loc)
const Expr * IgnoreImplicit() const LLVM_READONLY
bool isInstantiationDependent() const
Whether this expression is instantiation-dependent, meaning that it depends in some way on a template...
ConditionalOperator(Expr *cond, SourceLocation QLoc, Expr *lhs, SourceLocation CLoc, Expr *rhs, QualType t, ExprValueKind VK, ExprObjectKind OK)
bool HasUndefinedBehavior
Whether the evaluation hit undefined behavior.
Represents a call to the builtin function __builtin_va_arg.
const_child_range children() const
QualType getPointeeType() const
If this is a pointer, ObjC object pointer, or block pointer, this returns the respective pointee...
static StringLiteral * Create(const ASTContext &C, StringRef Str, StringKind Kind, bool Pascal, QualType Ty, SourceLocation Loc)
Simple constructor for string literals made from one token.
Kinds
The various classification results. Most of these mean prvalue.
Exposes information about the current target.
InitListExpr(const ASTContext &C, SourceLocation lbraceloc, ArrayRef< Expr * > initExprs, SourceLocation rbraceloc)
bool isObjCSelfExpr() const
Check if this expression is the ObjC 'self' implicit parameter.
CompoundAssignOperator(Expr *lhs, Expr *rhs, Opcode opc, QualType ResType, ExprValueKind VK, ExprObjectKind OK, QualType CompLHSType, QualType CompResultType, SourceLocation OpLoc, FPOptions FPFeatures)
void setString(const ASTContext &C, StringRef Str, StringKind Kind, bool IsPascal)
Sets the string data to the given string data.
unsigned getNumExprs() const
void setLocation(SourceLocation Location)
SourceLocation getLocStart() const LLVM_READONLY
BlockDecl - This represents a block literal declaration, which is like an unnamed FunctionDecl...
llvm::MutableArrayRef< Designator > designators()
static bool classof(const Stmt *T)
bool isKnownToHaveBooleanValue() const
isKnownToHaveBooleanValue - Return true if this is an integer expression that is known to return 0 or...
ValueDecl - Represent the declaration of a variable (in which case it is an lvalue) a function (in wh...
Expr - This represents one expression.
bool isOrdinaryOrBitFieldObject() const
Defines the clang::LangOptions interface.
void setDesignators(const ASTContext &C, const Designator *Desigs, unsigned NumDesigs)
void setRBraceLoc(SourceLocation Loc)
SourceLocation getLocStart() const LLVM_READONLY
Allow any unmodeled side effect.
const Expr * getExpr(unsigned Init) const
SourceLocation getRParenLoc() const
ExprValueKind
The categorization of expression values, currently following the C++11 scheme.
bool performsVirtualDispatch(const LangOptions &LO) const
Returns true if virtual dispatch is performed.
void outputString(raw_ostream &OS) const
InitListExprBitfields InitListExprBits
void setRParenLoc(SourceLocation L)
SourceLocation getLocEnd() const LLVM_READONLY
SourceLocation getRParenLoc() const
static bool classof(const Stmt *T)
TypeSourceInfo * getTypeSourceInfo() const
getTypeSourceInfo - Return the destination type.
SourceLocation getLocation() const
Retrieve the location of this expression.
double getValueAsApproximateDouble() const
getValueAsApproximateDouble - This returns the value as an inaccurate double.
void setSyntacticForm(InitListExpr *Init)
ConstStmtIterator const_child_iterator
SourceLocation getLBraceLoc() const
SourceLocation getLocEnd() const LLVM_READONLY
void setMemberLoc(SourceLocation L)
SourceLocation getLocEnd() const LLVM_READONLY
unsigned getNumExpressions() const
void setTypeDependent(bool TD)
Set whether this expression is type-dependent or not.
const_child_range children() const
bool isArithmeticOp() const
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...
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
llvm::APInt getIntValue() const
static bool classof(const Stmt *T)
An array or GNU array-range designator, e.g., "[9]" or "[10..15]".
const_child_range children() const
SourceLocation getLocEnd() const LLVM_READONLY
SourceLocation getEqualOrColonLoc() const
Retrieve the location of the '=' that precedes the initializer value itself, if present.
void setTypeSourceInfo(TypeSourceInfo *ti)
const ValueDecl * getDecl() const
void setWrittenTypeInfo(TypeSourceInfo *TI)
const CompoundStmt * getSubStmt() const
Expr * getArrayRangeStart(const Designator &D) const
ParenExpr(EmptyShell Empty)
Construct an empty parenthesized expression.
void setObjectKind(ExprObjectKind Cat)
setObjectKind - Set the object kind produced by this expression.
static OverloadedOperatorKind getOverloadedOperator(Opcode Opc)
Retrieve the overloaded operator kind that corresponds to the given unary opcode. ...
AsTypeExpr - Clang builtin function __builtin_astype [OpenCL 6.2.4.2] This AST node provides support ...
Classification Classify(ASTContext &Ctx) const
Classify - Classify this expression according to the C++11 expression taxonomy.
static FloatingLiteral * Create(const ASTContext &C, const llvm::APFloat &V, bool isexact, QualType Type, SourceLocation L)
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...
BinaryOperator(Expr *lhs, Expr *rhs, Opcode opc, QualType ResTy, ExprValueKind VK, ExprObjectKind OK, SourceLocation opLoc, FPOptions FPFeatures, bool dead2)
void copyTemplateArgumentsInto(TemplateArgumentListInfo &List) const
Copies the template arguments (if present) into the given structure.
SourceLocation getLocStart() const LLVM_READONLY
ArrayRef< Expr * > inits()
ArraySubscriptExpr(EmptyShell Shell)
Create an empty array subscript expression.
Specifies that a value-dependent expression of integral or dependent type should be considered a null...
Extra data stored in some MemberExpr objects.
SourceLocation getLocStart() const LLVM_READONLY
SourceLocation getQuestionLoc() const
SourceLocation getLocEnd() const LLVM_READONLY
unsigned getNumSubExprs() const
static bool isPotentialConstantExpr(const FunctionDecl *FD, SmallVectorImpl< PartialDiagnosticAt > &Diags)
isPotentialConstantExpr - Return true if this function's definition might be usable in a constant exp...
Expr * getSubExpr() const
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
void setValueKind(ExprValueKind Cat)
setValueKind - Set the value kind produced by this expression.
void copyTemplateArgumentsInto(TemplateArgumentListInfo &List) const
Copies the template arguments (if present) into the given structure.
bool EvaluateAsInt(llvm::APSInt &Result, const ASTContext &Ctx, SideEffectsKind AllowSideEffects=SE_NoSideEffects) const
EvaluateAsInt - Return true if this is a constant which we can fold and convert to an integer...
Expr * getSrcExpr() const
getSrcExpr - Return the Expr to be converted.
void setMemberDecl(ValueDecl *D)
unsigned getNumComponents() const
ModifiableType
The results of modification testing.
void setRParenLoc(SourceLocation L)
Expr * getSubExprAsWritten()
Retrieve the cast subexpression as it was written in the source code, looking through any implicit ca...
CXXBaseSpecifier * getBase() const
For a base class node, returns the base specifier.
UnaryOperator - This represents the unary-expression's (except sizeof and alignof), the postinc/postdec operators from postfix-expression, and various extensions.
llvm::APInt getArraySize() const
unsigned Index
Location of the first index expression within the designated initializer expression's list of subexpr...
bool hasPlaceholderType(BuiltinType::Kind K) const
Returns whether this expression has a specific placeholder type.
DeclarationName getDeclName() const
getDeclName - Get the actual, stored name of the declaration, which may be a special name...
Allow UB that we can give a value, but not arbitrary unmodeled side effects.
static bool classof(const Stmt *T)
ArrayRef< Expr * > getAssocExprs() const
QualType getComputationLHSType() const
The result type of a method or function.
Designator(unsigned Index, SourceLocation LBracketLoc, SourceLocation EllipsisLoc, SourceLocation RBracketLoc)
Initializes a GNU array-range designator.
SourceLocation getLocEnd() const LLVM_READONLY
CStyleCastExpr - An explicit cast in C (C99 6.5.4) or a C-style cast in C++ (C++ [expr.cast]), which uses the syntax (Type)expr.
llvm::iterator_range< semantics_iterator > semantics()
NestedNameSpecifierLoc getQualifierLoc() const
If the name was qualified, retrieves the nested-name-specifier that precedes the name, with source-location information.
Expr * getLHS()
An array access can be written A[4] or 4[A] (both are equivalent).
const Expr * getArg(unsigned Arg) const
SourceLocation getLParenLoc() const
static bool classof(const Stmt *T)
const Stmt * getPreArg(unsigned i) const
SourceLocation getLocEnd() const LLVM_READONLY
void EvaluateForOverflow(const ASTContext &Ctx) const
__UINTPTR_TYPE__ uintptr_t
An unsigned integer type with the property that any valid pointer to void can be converted to this ty...
StmtIterator child_iterator
Child Iterators: All subclasses must implement 'children' to permit easy iteration over the substatem...
Expr * getTrueExpr() const
APFloatSemantics getRawSemantics() const
Get a raw enumeration value representing the floating-point semantics of this literal (32-bit IEEE...
ExplicitCastExpr(StmtClass SC, QualType exprTy, ExprValueKind VK, CastKind kind, Expr *op, unsigned PathSize, TypeSourceInfo *writtenTy)
SourceLocation getLocStart() const LLVM_READONLY
ImaginaryLiteral - We support imaginary integer and floating point literals, like "1...
unsigned getNumSubExprs() const
Retrieve the total number of subexpressions in this designated initializer expression, including the actual initialized value and any expressions that occur within array and array-range designators.
void setRParenLoc(SourceLocation L)
InitListExpr * getUpdater() const
bool EvaluateAsInitializer(APValue &Result, const ASTContext &Ctx, const VarDecl *VD, SmallVectorImpl< PartialDiagnosticAt > &Notes) const
EvaluateAsInitializer - Evaluate an expression as if it were the initializer of the given declaration...
static bool classof(const Stmt *T)
bool isArrayRangeDesignator() const
QualType getComputationResultType() const
SourceLocation getCaretLocation() const
unsigned getNumSubExprs() const
getNumSubExprs - Return the size of the SubExprs array.
Expr * IgnoreCasts() LLVM_READONLY
Ignore casts. Strip off any CastExprs, returning their operand.
const_child_range children() const
bool isBoundMemberFunction(ASTContext &Ctx) const
Returns true if this expression is a bound member function.
static bool isBitwiseOp(Opcode Opc)
SourceLocation getOperatorLoc() const
const llvm::fltSemantics & getSemantics() const
Return the APFloat semantics this literal uses.
static Opcode getOverloadedOpcode(OverloadedOperatorKind OO)
Retrieve the binary opcode that corresponds to the given overloaded operator.
SourceLocation getDotLoc() const
Expr * IgnoreConversionOperator() LLVM_READONLY
IgnoreConversionOperator - Ignore conversion operator.
void setTypeSourceInfo(TypeSourceInfo *tinfo)
static bool classof(const Stmt *T)
unsigned DotLoc
The location of the '.' in the designated initializer.
UnaryExprOrTypeTraitExpr(UnaryExprOrTypeTrait ExprKind, TypeSourceInfo *TInfo, QualType resultType, SourceLocation op, SourceLocation rp)
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).
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class...
void setComputationLHSType(QualType T)
bool EvaluateAsBooleanCondition(bool &Result, const ASTContext &Ctx) const
EvaluateAsBooleanCondition - Return true if this is a constant which we we can fold and convert to a ...
ConvertVectorExpr - Clang builtin function __builtin_convertvector This AST node provides support for...
SourceLocation getLocStart() const LLVM_READONLY
A field in a dependent type, known only by its name.
const Designator * getDesignator(unsigned Idx) const
Expr * getArrayRangeEnd(const Designator &D) const
DesignatedInitUpdateExpr(EmptyShell Empty)
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
void setLParenLoc(SourceLocation L)
SmallVector< CXXBaseSpecifier *, 4 > CXXCastPath
A simple array of base specifiers.
ConstExprIterator const_arg_iterator
void setAccessorLoc(SourceLocation L)
void setLocation(SourceLocation L)
unsigned getResultExprIndex() const
Return the index of the result-bearing expression into the semantics expressions, or PseudoObjectExpr...
const Expr * IgnoreParenImpCasts() const LLVM_READONLY
Encodes a location in the source.
void setLocation(SourceLocation L)
void setValue(const ASTContext &C, const llvm::APFloat &Val)
llvm::iterator_range< child_iterator > child_range
PseudoObjectExprBitfields PseudoObjectExprBits
const Expr * IgnoreParens() const LLVM_READONLY
Expression is not a Null pointer constant.
Expr * getSourceExpr() const
The source expression of an opaque value expression is the expression which originally generated the ...
SourceLocation getExprLoc() const LLVM_READONLY
SourceLocation getOperatorLoc() const
getOperatorLoc - Return the location of the operator.
void setUpdater(Expr *Updater)
bool hasSideEffects() const
NoInitExpr(EmptyShell Empty)
bool isImplicitAccess() const
Determine whether the base of this explicit is implicit.
bool isValid() const
Return true if this is a valid SourceLocation object.
FieldDecl * getField() const
SourceLocation getLocStart() const LLVM_READONLY
pointer data()
data - Return a pointer to the vector's buffer, even if empty().
const_child_range children() const
ASTContext & getASTContext() const LLVM_READONLY
static bool isPlaceholderTypeKind(Kind K)
Determines whether the given kind corresponds to a placeholder type.
bool refersToEnclosingVariableOrCapture() const
Does this DeclRefExpr refer to an enclosing local or a captured variable?
static bool classof(const Stmt *T)
LabelDecl - Represents the declaration of a label.
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
Expr *const * getInits() const
Retrieve the set of initializers.
llvm::APSInt EvaluateKnownConstInt(const ASTContext &Ctx, SmallVectorImpl< PartialDiagnosticAt > *Diag=nullptr) const
EvaluateKnownConstInt - Call EvaluateAsRValue and return the folded integer.
static bool classof(const Stmt *T)
void setLabelLoc(SourceLocation L)
ExprObjectKind
A further classification of the kind of object referenced by an l-value or x-value.
const_child_range children() const
Expr * getSrcExpr() const
getSrcExpr - Return the Expr to be converted.
StmtExpr(EmptyShell Empty)
Build an empty statement expression.
CompoundAssignOperator(EmptyShell Empty)
Build an empty compound assignment operator expression.
const CXXRecordDecl * getBestDynamicClassType() const
For an expression of class type or pointer to class type, return the most derived class decl the expr...
bool isCompoundAssignmentOp() const
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
Expr * getAssocExpr(unsigned i)
SourceLocation getGenericLoc() const
SourceLocation getLBracketLoc() const
static bool classof(const Stmt *T)
SourceLocation getStrTokenLoc(unsigned TokNum) const
uint64_t VAL
Used to store the <= 64 bits integer value.
bool isIntegerConstantExpr(llvm::APSInt &Result, const ASTContext &Ctx, SourceLocation *Loc=nullptr, bool isEvaluated=true) const
isIntegerConstantExpr - Return true if this expression is a valid integer constant expression...
MemberExpr(Expr *base, bool isarrow, SourceLocation operatorloc, ValueDecl *memberdecl, SourceLocation l, QualType ty, ExprValueKind VK, ExprObjectKind OK)
static bool classof(const Stmt *T)
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load, __atomic_store, and __atomic_compare_exchange_*, for the similarly-named C++11 instructions, and __c11 variants for <stdatomic.h>.
Specifies that a value-dependent expression should be considered to never be a null pointer constant...
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...
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...
unsigned getCharByteWidth() const
Expr * getExpr(unsigned Init)
const Expr * IgnoreCasts() const LLVM_READONLY
Strip off casts, but keep parentheses.
llvm::ArrayRef< Designator > designators() const
static bool classof(const Stmt *T)
void setDecl(ValueDecl *NewD)
const_child_range children() const
StringLiteral * getFunctionName()
void setArgument(TypeSourceInfo *TInfo)
ParenListExpr(const ASTContext &C, SourceLocation lparenloc, ArrayRef< Expr * > exprs, SourceLocation rparenloc)
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
std::pair< SourceLocation, PartialDiagnostic > PartialDiagnosticAt
A partial diagnostic along with the source location where this diagnostic occurs. ...
QualType getAssocType(unsigned i) const
static QualType findBoundMemberType(const Expr *expr)
Given an expression of bound-member type, find the type of the member.
path_const_iterator path_begin() const
Expr ** getInits()
Retrieve the set of initializers.
bool containsNonAsciiOrNull() const
static bool classof(const Stmt *T)
SourceLocation getBegin() const
InitListExpr(EmptyShell Empty)
Build an empty initializer list.
bool isTypeDependent() const
isTypeDependent - Determines whether this expression is type-dependent (C++ [temp.dep.expr]), which means that its type could change from one template instantiation to the next.
AtomicExpr(EmptyShell Empty)
Build an empty AtomicExpr.
static DesignatedInitExpr * CreateEmpty(const ASTContext &C, unsigned NumIndexExprs)
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...
static DesignatedInitExpr * Create(const ASTContext &C, llvm::ArrayRef< Designator > Designators, ArrayRef< Expr * > IndexExprs, SourceLocation EqualOrColonLoc, bool GNUSyntax, Expr *Init)
const Expr * getSemanticExpr(unsigned index) const
static bool isLogicalOp(Opcode Opc)
ArrayRef< Expr * > exprs()
uintptr_t NameOrField
Refers to the field that is being initialized.
StmtExpr - This is the GNU Statement Expression extension: ({int X=4; X;}).
const_child_range children() const
ArrayRef< TemplateArgumentLoc > template_arguments() const
SourceLocation getLocStart() const LLVM_READONLY
OpaqueValueExpr(EmptyShell Empty)
const Expr * getBase() const
unsigned LBracketLoc
The location of the '[' starting the array range designator.
bool isVolatileQualified() const
Determine whether this type is volatile-qualified.
const SourceLocation * tokloc_iterator
Expr * getArrayFiller()
If this initializer list initializes an array with more elements than there are initializers in the l...
SourceLocation getLocStart() const LLVM_READONLY
const BlockDecl * getBlockDecl() const
bool refersToBitField() const
Returns true if this expression is a gl-value that potentially refers to a bit-field.
void sawArrayRangeDesignator(bool ARD=true)
bool isCXX98IntegralConstantExpr(const ASTContext &Ctx) const
isCXX98IntegralConstantExpr - Return true if this expression is an integral constant expression in C+...
SourceLocation getLocStart() const LLVM_READONLY
QualType getType() const
Return the type wrapped by this type source info.
SourceLocation getRParenLoc() const
const Expr * getArrayFiller() const
bool isGlobalLValue() const
static MemberExpr * Create(const ASTContext &C, Expr *base, bool isarrow, SourceLocation OperatorLoc, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, ValueDecl *memberdecl, DeclAccessPair founddecl, DeclarationNameInfo MemberNameInfo, const TemplateArgumentListInfo *targs, QualType ty, ExprValueKind VK, ExprObjectKind OK)
const OffsetOfNode & getComponent(unsigned Idx) const
A placeholder type used to construct an empty shell of a type, that will be filled in later (e...
SourceLocation getExprLoc() const LLVM_READONLY
getExprLoc - Return the preferred location for the arrow when diagnosing a problem with a generic exp...
const Expr * getSubExprAsWritten() const
SourceLocation getLocEnd() const LLVM_READONLY
SourceLocation getOperatorLoc() const
getOperatorLoc - Return the location of the operator.
SourceLocation getLocEnd() const LLVM_READONLY
SourceLocation getRBracketLoc() const
bool isPtrMemOp() const
predicates to categorize the respective opcodes.
CompoundAssignOperator - For compound assignments (e.g.
A POD class for pairing a NamedDecl* with an access specifier.
DeclarationNameLoc - Additional source/type location info for a declaration name. ...
Represents a C11 generic selection.
bool isAdditiveOp() const
const_child_range children() const
VAArgExpr(SourceLocation BLoc, Expr *e, TypeSourceInfo *TInfo, SourceLocation RPLoc, QualType t, bool IsMS)
QualType getCallReturnType(const ASTContext &Ctx) const
getCallReturnType - Get the return type of the call expr.
EvalStatus is a struct with detailed info about an evaluation in progress.
ArrayInitLoopExpr(QualType T, Expr *CommonInit, Expr *ElementInit)
AddrLabelExpr - The GNU address of label extension, representing &&label.
Expr * getResultExpr()
Return the result-bearing expression, or null if there is none.
const Expr * getExpr(unsigned Index) const
Expr(StmtClass SC, EmptyShell)
Construct an empty expression.
SourceLocation getLocation() const
Expr * getCommon() const
getCommon - Return the common expression, written to the left of the condition.
static bool classof(const Stmt *T)
BinaryOperator(StmtClass SC, EmptyShell Empty)
void setLocation(SourceLocation L)
SourceLocation getExprLoc() const LLVM_READONLY
static bool classof(const Stmt *T)
OffsetOfNode(SourceLocation DotLoc, FieldDecl *Field, SourceLocation NameLoc)
Create an offsetof node that refers to a field.
const_reverse_iterator rend() const
SourceLocation getLocEnd() const LLVM_READONLY
SourceLocation getLParenLoc() const
const Expr * getAssocExpr(unsigned i) const
bool tryEvaluateObjectSize(uint64_t &Result, ASTContext &Ctx, unsigned Type) const
If the current Expr is a pointer, this will try to statically determine the number of bytes available...
StringRef getOpcodeStr() const
void setExprs(const ASTContext &C, ArrayRef< Expr * > Exprs)
SourceLocation getLocStart() const LLVM_READONLY
void setBuiltinLoc(SourceLocation L)
bool hadMultipleCandidates() const
Returns true if this expression refers to a function that was resolved from an overloaded set having ...
[C99 6.4.2.2] - A predefined identifier such as func.
SourceLocation getLAngleLoc() const
Retrieve the location of the left angle bracket starting the explicit template argument list followin...
SourceLocation getLocStart() const LLVM_READONLY
unsigned getByteLength() const
EvalResult is a struct with detailed info about an evaluated expression.
SourceLocation getLocEnd() const LLVM_READONLY
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
Decl * getReferencedDeclOfCallee()
FunctionDecl * getDirectCallee()
If the callee is a FunctionDecl, return it. Otherwise return 0.
void setRParenLoc(SourceLocation L)
const internal::VariadicAllOfMatcher< Type > type
Matches Types in the clang AST.
bool isTemporaryObject(ASTContext &Ctx, const CXXRecordDecl *TempTy) const
Determine whether the result of this expression is a temporary object of the given class type...
void setLabel(LabelDecl *L)
AtomicExpr(SourceLocation BLoc, ArrayRef< Expr * > args, QualType t, AtomicOp op, SourceLocation RP)
static bool isShiftAssignOp(Opcode Opc)
void setTypeInfoAsWritten(TypeSourceInfo *writtenTy)
SourceLocation getLocStart() const LLVM_READONLY
BinaryConditionalOperator(EmptyShell Empty)
Build an empty conditional operator.
Reads an AST files chain containing the contents of a translation unit.
A field designator, e.g., ".x".
InitExprsTy::reverse_iterator reverse_iterator
SourceLocation getLocEnd() const LLVM_READONLY
NestedNameSpecifierLoc getQualifierLoc() const
If the member name was qualified, retrieves the nested-name-specifier that precedes the member name...
The same as PrettyFunction, except that the 'virtual' keyword is omitted for virtual member functions...
ExtVectorElementExpr(QualType ty, ExprValueKind VK, Expr *base, IdentifierInfo &accessor, SourceLocation loc)
bool isDefaultArgument() const
Determine whether this expression is a default function argument.
void setFileScope(bool FS)
OpaqueValueExpr(SourceLocation Loc, QualType T, ExprValueKind VK, ExprObjectKind OK=OK_Ordinary, Expr *SourceExpr=nullptr)
SourceLocation getLocEnd() const LLVM_READONLY
ModifiableType getModifiable() const
SourceLocation getLocStart() const LLVM_READONLY
SourceLocation getLocStart() const LLVM_READONLY
bool isLValue() const
isLValue - True if this expression is an "l-value" according to the rules of the current language...
Expression is a Null pointer constant built from a zero integer expression that is not a simple...
SourceLocation getLocStart() const LLVM_READONLY
StringRef getString() const
enum clang::SubobjectAdjustment::@36 Kind
StringRef getBytes() const
Allow access to clients that need the byte representation, such as ASTWriterStmt::VisitStringLiteral(...
void setInstantiationDependent(bool ID)
Set whether this expression is instantiation-dependent or not.
llvm::iterator_range< const_arg_iterator > arg_const_range
StringKind getKind() const
const_arg_iterator arg_begin() const
Kind
The kind of offsetof node we have.
Expression is a C++11 nullptr.
detail::InMemoryDirectory::const_iterator E
OffsetOfNode(SourceLocation DotLoc, IdentifierInfo *Name, SourceLocation NameLoc)
Create an offsetof node that refers to an identifier.
A pointer to member type per C++ 8.3.3 - Pointers to members.
const_child_range children() const
bool usesGNUSyntax() const
Determines whether this designated initializer used the deprecated GNU syntax for designated initiali...
VAArgExpr(EmptyShell Empty)
Create an empty __builtin_va_arg expression.
semantics_iterator semantics_begin()
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this call.
const_child_range children() const
void setLParenLoc(SourceLocation L)
ExplicitCastExpr - An explicit cast written in the source code.
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspnd...
unsigned getNumConcatenated() const
getNumConcatenated - Get the number of string literal tokens that were concatenated in translation ph...
static bool isPrefix(Opcode Op)
isPrefix - Return true if this is a prefix operation, like –x.
void setInitializedFieldInUnion(FieldDecl *FD)
static PseudoObjectExpr * Create(const ASTContext &Context, Expr *syntactic, ArrayRef< Expr * > semantic, unsigned resultIndex)
SourceLocation getLocStart() const LLVM_READONLY
static bool classof(const Stmt *T)
ExplicitCastExpr(StmtClass SC, EmptyShell Shell, unsigned PathSize)
Construct an empty explicit cast.
SourceLocation getLocEnd() const LLVM_READONLY
llvm::APFloat getValue() const
Expr * IgnoreParenImpCasts() LLVM_READONLY
IgnoreParenImpCasts - Ignore parentheses and implicit casts.
const_child_range children() const
const Expr * getBase() const
SourceLocation getLocStart() const LLVM_READONLY
void setRBracketLoc(SourceLocation L)
bool isConstantInitializer(ASTContext &Ctx, bool ForRef, const Expr **Culprit=nullptr) const
isConstantInitializer - Returns true if this expression can be emitted to IR as a constant...
SourceLocation getMemberLoc() const
getMemberLoc - Return the location of the "member", in X->F, it is the location of 'F'...
bool hasQualifier() const
Determine whether this declaration reference was preceded by a C++ nested-name-specifier, e.g., N::foo.
DeclRefExpr(ValueDecl *D, bool RefersToEnclosingVariableOrCapture, QualType T, ExprValueKind VK, SourceLocation L, const DeclarationNameLoc &LocInfo=DeclarationNameLoc())
static bool classof(const Stmt *T)
struct ArrayOrRangeDesignator ArrayOrRange
An array or GNU array-range designator, e.g., "[9]" or "[10..15]".
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...
bool isDecrementOp() const
SourceLocation getRParenLoc() const
getRParenLoc - Return the location of final right parenthesis.
bool HasSideEffects
Whether the evaluated expression has side effects.
void setHadMultipleCandidates(bool V=true)
Sets the flag telling whether this expression refers to a method that was resolved from an overloaded...
MemberExpr(Expr *base, bool isarrow, SourceLocation operatorloc, ValueDecl *memberdecl, const DeclarationNameInfo &NameInfo, QualType ty, ExprValueKind VK, ExprObjectKind OK)
Location wrapper for a TemplateArgument.
static const TypeInfo & getInfo(unsigned id)
SourceLocation getLocEnd() const LLVM_READONLY
CompoundLiteralExpr(SourceLocation lparenloc, TypeSourceInfo *tinfo, QualType T, ExprValueKind VK, Expr *init, bool fileScope)
static bool classof(const Stmt *S)
const T * getAs() const
Member-template getAs<specific type>'.
llvm::iterator_range< const_child_iterator > const_child_range
Expr * getFalseExpr() const
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
QualType getTypeOfArgument() const
Gets the argument type, or the type of the argument expression, whichever is appropriate.
SourceLocation getLocEnd() const LLVM_READONLY
static bool classof(const Stmt *S)
AbstractConditionalOperator - An abstract base class for ConditionalOperator and BinaryConditionalOpe...
TypeSourceInfo * getAssocTypeSourceInfo(unsigned i)
OpaqueValueExpr * getOpaqueValue() const
getOpaqueValue - Return the opaque value placeholder.
static StringRef getIdentTypeName(IdentType IT)
SourceLocation getLocEnd() const LLVM_READONLY
void setIndexExpr(unsigned Idx, Expr *E)
SourceLocation getBuiltinLoc() const
static CStyleCastExpr * Create(const ASTContext &Context, QualType T, ExprValueKind VK, CastKind K, Expr *Op, const CXXCastPath *BasePath, TypeSourceInfo *WrittenTy, SourceLocation L, SourceLocation R)
const Expr * getArgumentExpr() const
const_child_range children() const
static ImplicitCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize)
SourceLocation getLocStart() const LLVM_READONLY
TypeSourceInfo * getWrittenTypeInfo() const
const_child_range children() const
static bool classof(const Stmt *T)
const_child_range children() const
ImaginaryLiteral(Expr *val, QualType Ty)
void setKind(UnaryExprOrTypeTrait K)
Expr * IgnoreParenLValueCasts() LLVM_READONLY
Ignore parentheses and lvalue casts.
void setRParenLoc(SourceLocation L)
static bool isAdditiveOp(Opcode Opc)
Base for LValueReferenceType and RValueReferenceType.
llvm::APFloat getValue(const llvm::fltSemantics &Semantics) const
SourceLocation getLocStart() const LLVM_READONLY
void setOperatorLoc(SourceLocation L)
void setValue(const ASTContext &C, const llvm::APFloat &Val)
const_semantics_iterator semantics_end() const
bool hasTemplateKeyword() const
Determines whether the member name was preceded by the template keyword.
const Expr * getSubExpr() const
SourceLocation getLocStart() const LLVM_READONLY
const_child_range children() const
UnaryExprOrTypeTraitExpr(EmptyShell Empty)
Construct an empty sizeof/alignof expression.
const Expr * IgnoreImpCasts() const LLVM_READONLY
ParenListExpr(EmptyShell Empty)
Build an empty paren list.
SubobjectAdjustment(const MemberPointerType *MPT, Expr *RHS)
SourceLocation getLocEnd() const LLVM_READONLY
PredefinedExpr(EmptyShell Empty)
Construct an empty predefined expression.
ExprIterator arg_iterator
SourceLocation getBuiltinLoc() const
getBuiltinLoc - Return the location of the __builtin_convertvector token.
UnaryExprOrTypeTraitExprBitfields UnaryExprOrTypeTraitExprBits
void setLParenLoc(SourceLocation L)
SourceLocation getExprLoc() const LLVM_READONLY
LabelDecl * getLabel() const
SourceLocation getAccessorLoc() const
bool isIncrementOp() const
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat]...
ArraySubscriptExpr(Expr *lhs, Expr *rhs, QualType t, ExprValueKind VK, ExprObjectKind OK, SourceLocation rbracketloc)
Represents a base class of a C++ class.
SourceLocation getLocStart() const LLVM_READONLY
const_child_range children() const
CharacterLiteral(unsigned value, CharacterKind kind, QualType type, SourceLocation l)
A bitfield object is a bitfield on a C or C++ record.
SourceLocation getLocStart() const LLVM_READONLY
const Expr * getInitializer() const
SourceLocation getRParenLoc() const
const Expr * getSubExpr() const
void setOperatorLoc(SourceLocation L)
void setLocation(SourceLocation Location)
static bool isIncrementOp(Opcode Op)
Expr * getFalseExpr() const
getFalseExpr - Return the subexpression which will be evaluated if the condnition evaluates to false;...
void setHadMultipleCandidates(bool V=true)
Sets the flag telling whether this expression refers to a function that was resolved from an overload...
static CStyleCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize)
ImplicitValueInitExpr(EmptyShell Empty)
Construct an empty implicit value initialization.
BinaryOperatorKind Opcode
static bool classof(const Stmt *T)
SourceLocation getLocEnd() const LLVM_READONLY
static bool classof(const Stmt *T)
const NamedDecl * getFoundDecl() const
Get the NamedDecl through which this reference occurred.
void setBuiltinLoc(SourceLocation L)
static bool classof(const Stmt *T)
Expression is a Null pointer constant built from a literal zero.
SourceLocation getLocEnd() const LLVM_READONLY
const_child_range children() const
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
BinaryConditionalOperator(Expr *common, OpaqueValueExpr *opaqueValue, Expr *cond, Expr *lhs, Expr *rhs, SourceLocation qloc, SourceLocation cloc, QualType t, ExprValueKind VK, ExprObjectKind OK)
CXXBaseSpecifier ** path_iterator
const Expr * getSubExpr() const
SourceLocation getBuiltinLoc() const
bool hasArrayFiller() const
Return true if this is an array initializer and its array "filler" has been set.
Represents a C++ struct/union/class.
static bool isCompoundAssignmentOp(Opcode Opc)
bool hasNonTrivialCall(const ASTContext &Ctx) const
Determine whether this expression involves a call to any function that is not trivial.
const_child_range children() const
Represents a loop initializing the elements of an array.
bool isPlaceholderType() const
Test for a type which does not represent an actual type-system type but is instead used as a placehol...
ChooseExpr - GNU builtin-in function __builtin_choose_expr.
static bool classof(const Stmt *T)
SourceLocation getLocStart() const LLVM_READONLY
const_child_range children() const
BinaryConditionalOperator - The GNU extension to the conditional operator which allows the middle ope...
SourceLocation getBuiltinLoc() const
static bool classof(const Stmt *T)
FPOptions getFPFeatures() const
bool hasQualifier() const
Determines whether this member expression actually had a C++ nested-name-specifier prior to the name ...
bool isShiftAssignOp() const
SourceLocation getLocEnd() const LLVM_READONLY
NestedNameSpecifier * getNestedNameSpecifier() const
Retrieve the nested-name-specifier to which this instance refers.
bool isRelationalOp() const
FieldDecl * getField() const
For a field offsetof node, returns the field.
SourceLocation getLocEnd() const LLVM_READONLY
unsigned kind
All of the diagnostics that can be emitted by the frontend.
This class is used for builtin types like 'int'.
Expr * getInit(unsigned Init)
bool hasTemplateKWAndArgsInfo() const
void setTokenLocation(SourceLocation L)
bool hasExplicitTemplateArgs() const
Determines whether this declaration reference was followed by an explicit template argument list...
StringLiteral - This represents a string literal expression, e.g.
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
const MemberPointerType * MPT
Designator * getDesignator(unsigned Idx)
static bool hasAnyTypeDependentArguments(ArrayRef< Expr * > Exprs)
hasAnyTypeDependentArguments - Determines if any of the expressions in Exprs is type-dependent.
const Expr * getBestDynamicClassTypeExpr() const
Get the inner expression that determines the best dynamic class.
void reserveInits(const ASTContext &C, unsigned NumInits)
Reserve space for some number of initializers.
AbstractConditionalOperator(StmtClass SC, QualType T, ExprValueKind VK, ExprObjectKind OK, bool TD, bool VD, bool ID, bool ContainsUnexpandedParameterPack, SourceLocation qloc, SourceLocation cloc)
const StringLiteral * getFunctionName() const
bool isMicrosoftABI() const
Returns whether this is really a Win64 ABI va_arg expression.
bool isStringLiteralInit() const
static bool classof(const Stmt *T)
DeclAccessPair FoundDecl
The DeclAccessPair through which the MemberDecl was found due to name qualifiers. ...
bool isModifiable() const
void setKind(CharacterKind kind)
A reference to a declared variable, function, enum, etc.
ExprValueKind getValueKind() const
getValueKind - The value kind that this expression produces.
Designator - A designator in a C99 designated initializer.
Expr * getSemanticExpr(unsigned index)
CallExprBitfields CallExprBits
static OverloadedOperatorKind getOverloadedOperator(Opcode Opc)
Retrieve the overloaded operator kind that corresponds to the given binary opcode.
SourceLocation getLocStart() const LLVM_READONLY
CastExprBitfields CastExprBits
const Expr * getInit(unsigned Init) const
FieldDecl * getInitializedFieldInUnion()
If this initializes a union, specifies which field in the union to initialize.
bool isFieldDesignator() const
static bool isPotentialConstantExprUnevaluated(Expr *E, const FunctionDecl *FD, SmallVectorImpl< PartialDiagnosticAt > &Diags)
isPotentialConstantExprUnevaluted - Return true if this expression might be usable in a constant expr...
const_child_range children() const
Expr * getTrueExpr() const
getTrueExpr - Return the subexpression which will be evaluated if the condition evaluates to true; th...
An l-value expression is a reference to an object with independent storage.
const_reverse_iterator rbegin() const
SourceLocation getLocEnd() const LLVM_READONLY
unsigned getFirstExprIndex() const
A trivial tuple used to represent a source range.
static StringRef getOpcodeStr(Opcode Op)
getOpcodeStr - Turn an Opcode enum value into the punctuation char it corresponds to...
unsigned getNumElements() const
getNumElements - Get the number of components being selected.
const FieldDecl * getSourceBitField() const
NamedDecl - This represents a decl with a name.
SourceLocation getRParenLoc() const
OffsetOfExpr - [C99 7.17] - This represents an expression of the form offsetof(record-type, member-designator).
SourceLocation getLocEnd() const LLVM_READONLY
static bool classof(const Stmt *T)
SourceLocation getLocationOfByte(unsigned ByteNo, const SourceManager &SM, const LangOptions &Features, const TargetInfo &Target, unsigned *StartToken=nullptr, unsigned *StartTokenByteOffset=nullptr) const
getLocationOfByte - Return a source location that points to the specified byte of this string literal...
bool isIncrementDecrementOp() const
static bool isDecrementOp(Opcode Op)
SourceLocation getLocation() const
bool EvaluateAsLValue(EvalResult &Result, const ASTContext &Ctx) const
EvaluateAsLValue - Evaluate an expression to see if we can fold it to an lvalue with link time known ...
bool isNull() const
Return true if this QualType doesn't point to a type yet.
const CXXRecordDecl * DerivedClass
BlockDecl * getBlockDecl()
static bool classof(const Stmt *T)
const uint32_t * asUInt32
unsigned getNumPreArgs() const
SubobjectAdjustment(const CastExpr *BasePath, const CXXRecordDecl *DerivedClass)
ImaginaryLiteral(EmptyShell Empty)
Build an empty imaginary literal.
SourceLocation getLocStart() const LLVM_READONLY
static bool isComparisonOp(Opcode Opc)
Expr * getSubExpr() const
Get the initializer to use for each array element.
SourceLocation ColonLoc
Location of ':'.
SourceLocation getLocStart() const LLVM_READONLY
ArrayRef< TypeSourceInfo * > getAssocTypeSourceInfos() const
CastExpr(StmtClass SC, QualType ty, ExprValueKind VK, const CastKind kind, Expr *op, unsigned BasePathSize)
Expr * getOrderFail() const
SourceLocation getFieldLoc() const
This class handles loading and caching of source files into memory.
OpaqueValueExpr * getCommonExpr() const
Get the common subexpression shared by all initializations (the source array).
bool isArrayDesignator() const
Represents an implicitly-generated value initialization of an object of a given type.
NullPointerConstantKind
Enumeration used to describe the kind of Null pointer constant returned from isNullPointerConstant()...
SourceLocation getRParenLoc() const
bool isIntegerType() const
isIntegerType() does not include complex integers (a GCC extension).
Kind getKind() const
Determine what kind of offsetof node this is.
SourceLocation getColonLoc() const
Expr * IgnoreParens() LLVM_READONLY
IgnoreParens - Ignore parentheses.
DeclAccessPair getFoundDecl() const
Retrieves the declaration found by lookup.
static bool classof(const Stmt *T)
void setIsConditionTrue(bool isTrue)
TypeSourceInfo * getArgumentTypeInfo() const
SourceRange getSourceRange() const LLVM_READONLY
QualType getArgumentType() const
SourceLocation getLocEnd() const LLVM_READONLY
SourceLocation getLocStart() const LLVM_READONLY