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)
113 ExprBits.TypeDependent = TD;
114 ExprBits.ValueDependent = VD;
115 ExprBits.InstantiationDependent =
ID;
116 ExprBits.ValueKind = VK;
117 ExprBits.ObjectKind = OK;
118 ExprBits.ContainsUnexpandedParameterPack = ContainsUnexpandedParameterPack;
123 explicit Expr(StmtClass SC, EmptyShell) :
Stmt(SC) { }
135 "Expressions can't have reference type");
151 ExprBits.ValueDependent = VD;
169 ExprBits.TypeDependent = TD;
190 return ExprBits.InstantiationDependent;
195 ExprBits.InstantiationDependent =
ID;
213 return ExprBits.ContainsUnexpandedParameterPack;
219 ExprBits.ContainsUnexpandedParameterPack = PP;
334 unsigned short Modifiable;
337 :
Kind(k), Modifiable(m)
345 assert(Modifiable !=
CM_Untested &&
"Did not test for modifiability.");
374 return ClassifyImpl(Ctx,
nullptr);
386 return ClassifyImpl(Ctx, &Loc);
393 return (isa<LValueReferenceType>(RT)
395 : (RT->getPointeeType()->isFunctionType()
471 return BT->getKind() == K;
490 bool isEvaluated =
true)
const;
529 const Expr **Culprit =
nullptr)
const;
617 bool IncludePossibleEffects =
true)
const;
659 unsigned Type)
const;
725 return cast<Expr>(Stmt::IgnoreImplicit());
834 return T->getStmtClass() >= firstExprConstant &&
835 T->getStmtClass() <= lastExprConstant;
856 Expr *SourceExpr =
nullptr)
857 :
Expr(OpaqueValueExprClass, T, VK, OK,
858 T->isDependentType() ||
860 T->isDependentType() ||
862 T->isInstantiationDependentType() ||
865 SourceExpr(SourceExpr), Loc(Loc) {
874 :
Expr(OpaqueValueExprClass, Empty) { }
880 return SourceExpr ? SourceExpr->getLocStart() : Loc;
883 return SourceExpr ? SourceExpr->getLocEnd() : Loc;
886 if (SourceExpr)
return SourceExpr->
getExprLoc();
891 return child_range(child_iterator(), child_iterator());
905 return T->getStmtClass() == OpaqueValueExprClass;
935 NamedDecl *, ASTTemplateKWAndArgsInfo,
936 TemplateArgumentLoc> {
947 size_t numTrailingObjects(OverloadToken<NestedNameSpecifierLoc>)
const {
951 size_t numTrailingObjects(OverloadToken<NamedDecl *>)
const {
952 return hasFoundDecl() ? 1 : 0;
955 size_t numTrailingObjects(OverloadToken<ASTTemplateKWAndArgsInfo>)
const {
961 bool hasFoundDecl()
const {
return DeclRefExprBits.HasFoundDecl; }
966 ValueDecl *D,
bool RefersToEnlosingVariableOrCapture,
974 :
Expr(DeclRefExprClass, Empty) { }
985 D(D), Loc(L), DNLoc(LocInfo) {
986 DeclRefExprBits.HasQualifier = 0;
987 DeclRefExprBits.HasTemplateKWAndArgsInfo = 0;
988 DeclRefExprBits.HasFoundDecl = 0;
989 DeclRefExprBits.HadMultipleCandidates = 0;
990 DeclRefExprBits.RefersToEnclosingVariableOrCapture =
991 RefersToEnclosingVariableOrCapture;
992 computeDependence(D->getASTContext());
1005 bool RefersToEnclosingVariableOrCapture,
1014 bool HasTemplateKWAndArgsInfo,
1015 unsigned NumTemplateArgs);
1039 return *getTrailingObjects<NestedNameSpecifierLoc>();
1055 return hasFoundDecl() ? *getTrailingObjects<NamedDecl *>() : D;
1061 return hasFoundDecl() ? *getTrailingObjects<NamedDecl *>() : D;
1065 return DeclRefExprBits.HasTemplateKWAndArgsInfo;
1072 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->TemplateKWLoc;
1079 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->LAngleLoc;
1086 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->RAngleLoc;
1101 getTrailingObjects<ASTTemplateKWAndArgsInfo>()->copyInto(
1102 getTrailingObjects<TemplateArgumentLoc>(), List);
1111 return getTrailingObjects<TemplateArgumentLoc>();
1120 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->NumTemplateArgs;
1130 return DeclRefExprBits.HadMultipleCandidates;
1136 DeclRefExprBits.HadMultipleCandidates = V;
1142 return DeclRefExprBits.RefersToEnclosingVariableOrCapture;
1146 return T->getStmtClass() == DeclRefExprClass;
1151 return child_range(child_iterator(), child_iterator());
1185 :
Expr(PredefinedExprClass, Empty), Loc(),
Type(
Func), FnName(nullptr) {}
1204 return T->getStmtClass() == PredefinedExprClass;
1208 child_range
children() {
return child_range(&FnName, &FnName + 1); }
1228 bool hasAllocation()
const {
return llvm::APInt::getNumWords(BitWidth) > 1; }
1237 unsigned NumWords = llvm::APInt::getNumWords(BitWidth);
1239 return llvm::APInt(BitWidth, NumWords,
pVal);
1241 return llvm::APInt(BitWidth,
VAL);
1256 llvm::APFloat
getValue(
const llvm::fltSemantics &Semantics)
const {
1269 :
Expr(IntegerLiteralClass, Empty) { }
1295 return T->getStmtClass() == IntegerLiteralClass;
1300 return child_range(child_iterator(), child_iterator());
1323 Value(value), Loc(l) {
1324 CharacterLiteralBits.Kind =
kind;
1332 return static_cast<CharacterKind>(CharacterLiteralBits.Kind);
1345 return T->getStmtClass() == CharacterLiteralClass;
1350 return child_range(child_iterator(), child_iterator());
1372 assert(&
getSemantics() == &Val.getSemantics() &&
"Inconsistent semantics");
1379 return static_cast<APFloatSemantics
>(FloatingLiteralBits.Semantics);
1385 FloatingLiteralBits.Semantics = Sem;
1394 bool isExact()
const {
return FloatingLiteralBits.IsExact; }
1409 return T->getStmtClass() == FloatingLiteralClass;
1414 return child_range(child_iterator(), child_iterator());
1433 :
Expr(ImaginaryLiteralClass, Empty) { }
1443 return T->getStmtClass() == ImaginaryLiteralClass;
1447 child_range
children() {
return child_range(&Val, &Val+1); }
1485 unsigned CharByteWidth : 4;
1487 unsigned IsPascal : 1;
1488 unsigned NumConcatenated;
1495 static int mapCharByteWidth(TargetInfo
const &target,
StringKind k);
1502 const SourceLocation *Loc,
unsigned NumStrs);
1508 return Create(C, Str, Kind, Pascal, Ty, &Loc, 1);
1515 assert(CharByteWidth==1
1516 &&
"This function is used in places that assume strings use char");
1524 if (CharByteWidth == 1)
1526 if (CharByteWidth == 4)
1527 return StringRef(reinterpret_cast<const char*>(StrData.asUInt32),
1529 assert(CharByteWidth == 2 &&
"unsupported CharByteWidth");
1530 return StringRef(reinterpret_cast<const char*>(StrData.asUInt16),
1537 assert(i < Length &&
"out of bounds access");
1538 if (CharByteWidth == 1)
1539 return static_cast<unsigned char>(StrData.asChar[i]);
1540 if (CharByteWidth == 4)
1541 return StrData.asUInt32[i];
1542 assert(CharByteWidth == 2 &&
"unsupported CharByteWidth");
1543 return StrData.asUInt16[i];
1566 for (
unsigned i = 0, e = Str.size(); i != e; ++i)
1567 if (!
isASCII(Str[i]) || !Str[i])
1577 assert(TokNum < NumConcatenated &&
"Invalid tok number");
1578 return TokLocs[TokNum];
1581 assert(TokNum < NumConcatenated &&
"Invalid tok number");
1582 TokLocs[TokNum] = L;
1595 unsigned *StartToken =
nullptr,
1596 unsigned *StartTokenByteOffset =
nullptr)
const;
1604 return TokLocs[NumConcatenated - 1];
1608 return T->getStmtClass() == StringLiteralClass;
1613 return child_range(child_iterator(), child_iterator());
1629 L(l), R(r), Val(val) {}
1633 :
Expr(ParenExprClass, Empty) { }
1651 return T->getStmtClass() == ParenExprClass;
1655 child_range
children() {
return child_range(&Val, &Val+1); }
1680 :
Expr(UnaryOperatorClass, type, VK, OK,
1684 type->isInstantiationDependentType()),
1686 Opc(opc), Loc(l), Val(input) {}
1690 :
Expr(UnaryOperatorClass, Empty), Opc(UO_AddrOf) { }
1704 return Op == UO_PostInc || Op == UO_PostDec;
1709 return Op == UO_PreInc || Op == UO_PreDec;
1716 return Op == UO_PreInc || Op == UO_PostInc;
1723 return Op == UO_PreDec || Op == UO_PostDec;
1735 return Op >= UO_Plus && Op <= UO_LNot;
1752 return isPostfix() ? Val->getLocStart() : Loc;
1755 return isPostfix() ? Loc : Val->getLocEnd();
1760 return T->getStmtClass() == UnaryOperatorClass;
1764 child_range
children() {
return child_range(&Val, &Val+1); }
1786 enum { MaskBits = 2, Mask = 0x03 };
1806 : Range(LBracketLoc, RBracketLoc), Data((Index << 2) |
Array) {}
1810 : Range(DotLoc.isValid() ? DotLoc : NameLoc, NameLoc),
1816 : Range(DotLoc.isValid() ? DotLoc : NameLoc, NameLoc),
1885 size_t numTrailingObjects(OverloadToken<OffsetOfNode>)
const {
1894 explicit OffsetOfExpr(
unsigned numComps,
unsigned numExprs)
1895 :
Expr(OffsetOfExprClass, EmptyShell()),
1896 TSInfo(
nullptr), NumComps(numComps), NumExprs(numExprs) {}
1906 unsigned NumComps,
unsigned NumExprs);
1924 assert(Idx < NumComps &&
"Subscript out of range");
1925 return getTrailingObjects<OffsetOfNode>()[Idx];
1929 assert(Idx < NumComps &&
"Subscript out of range");
1930 getTrailingObjects<OffsetOfNode>()[Idx] = ON;
1938 assert(Idx < NumExprs &&
"Subscript out of range");
1939 return getTrailingObjects<Expr *>()[Idx];
1943 assert(Idx < NumExprs &&
"Subscript out of range");
1944 return getTrailingObjects<Expr *>()[Idx];
1948 assert(Idx < NumComps &&
"Subscript out of range");
1949 getTrailingObjects<Expr *>()[Idx] = E;
1960 return T->getStmtClass() == OffsetOfExprClass;
1965 Stmt **
begin =
reinterpret_cast<Stmt **
>(getTrailingObjects<Expr *>());
1966 return child_range(begin, begin + NumExprs);
1988 TInfo->
getType()->isDependentType(),
1989 TInfo->
getType()->isInstantiationDependentType(),
1991 OpLoc(op), RParenLoc(rp) {
1992 UnaryExprOrTypeTraitExprBits.Kind = ExprKind;
1993 UnaryExprOrTypeTraitExprBits.IsType =
true;
1994 Argument.Ty = TInfo;
2003 :
Expr(UnaryExprOrTypeTraitExprClass, Empty) { }
2015 assert(
isArgumentType() &&
"calling getArgumentType() when arg is expr");
2019 assert(!
isArgumentType() &&
"calling getArgumentExpr() when arg is type");
2020 return static_cast<Expr*
>(Argument.Ex);
2028 UnaryExprOrTypeTraitExprBits.IsType =
false;
2031 Argument.Ty = TInfo;
2032 UnaryExprOrTypeTraitExprBits.IsType =
true;
2051 return T->getStmtClass() == UnaryExprOrTypeTraitExprClass;
2064 enum { LHS, RHS, END_EXPR=2 };
2065 Stmt* SubExprs[END_EXPR];
2071 :
Expr(ArraySubscriptExprClass, t, VK, OK,
2078 RBracketLoc(rbracketloc) {
2079 SubExprs[LHS] = lhs;
2080 SubExprs[RHS] = rhs;
2085 :
Expr(ArraySubscriptExprClass, Shell) { }
2121 return getLHS()->getLocStart();
2133 return T->getStmtClass() == ArraySubscriptExprClass;
2138 return child_range(&SubExprs[0], &SubExprs[0]+END_EXPR);
2149 enum { FN=0, PREARGS_START=1 };
2154 void updateDependenciesFromArg(
Expr *Arg);
2167 assert(i <
getNumPreArgs() &&
"Prearg access out of range!");
2168 return SubExprs[PREARGS_START+i];
2171 assert(i <
getNumPreArgs() &&
"Prearg access out of range!");
2172 return SubExprs[PREARGS_START+i];
2175 assert(i <
getNumPreArgs() &&
"Prearg access out of range!");
2176 SubExprs[PREARGS_START+i] = PreArg;
2218 assert(Arg < NumArgs &&
"Arg access out of range!");
2219 return cast_or_null<Expr>(SubExprs[Arg +
getNumPreArgs() + PREARGS_START]);
2222 assert(Arg < NumArgs &&
"Arg access out of range!");
2223 return cast_or_null<Expr>(SubExprs[Arg +
getNumPreArgs() + PREARGS_START]);
2228 assert(Arg < NumArgs &&
"Arg access out of range!");
2263 return llvm::makeArrayRef(SubExprs,
2291 return T->getStmtClass() >= firstCallExprConstant &&
2292 T->getStmtClass() <= lastCallExprConstant;
2297 return child_range(&SubExprs[0],
2318 ASTTemplateKWAndArgsInfo,
2319 TemplateArgumentLoc> {
2345 bool HasQualifierOrFoundDecl : 1;
2352 bool HasTemplateKWAndArgsInfo : 1;
2356 bool HadMultipleCandidates : 1;
2358 size_t numTrailingObjects(OverloadToken<MemberExprNameQualifier>)
const {
2359 return HasQualifierOrFoundDecl ? 1 : 0;
2362 size_t numTrailingObjects(OverloadToken<ASTTemplateKWAndArgsInfo>)
const {
2363 return HasTemplateKWAndArgsInfo ? 1 : 0;
2373 Base(base), MemberDecl(memberdecl), MemberDNLoc(NameInfo.
getInfo()),
2374 MemberLoc(NameInfo.getLoc()), OperatorLoc(operatorloc),
2375 IsArrow(isarrow), HasQualifierOrFoundDecl(
false),
2376 HasTemplateKWAndArgsInfo(
false), HadMultipleCandidates(
false) {
2390 Base(base), MemberDecl(memberdecl), MemberDNLoc(), MemberLoc(l),
2391 OperatorLoc(operatorloc), IsArrow(isarrow),
2392 HasQualifierOrFoundDecl(
false), HasTemplateKWAndArgsInfo(
false),
2393 HadMultipleCandidates(
false) {}
2416 if (!HasQualifierOrFoundDecl)
2419 return getTrailingObjects<MemberExprNameQualifier>()->FoundDecl;
2431 if (!HasQualifierOrFoundDecl)
2434 return getTrailingObjects<MemberExprNameQualifier>()->QualifierLoc;
2448 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->TemplateKWLoc;
2455 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->LAngleLoc;
2462 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->RAngleLoc;
2476 getTrailingObjects<ASTTemplateKWAndArgsInfo>()->copyInto(
2477 getTrailingObjects<TemplateArgumentLoc>(), List);
2486 return getTrailingObjects<TemplateArgumentLoc>();
2495 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->NumTemplateArgs;
2505 MemberLoc, MemberDNLoc);
2531 return HadMultipleCandidates;
2537 HadMultipleCandidates = V;
2549 return T->getStmtClass() == MemberExprClass;
2571 llvm::PointerIntPair<TypeSourceInfo *, 1, bool> TInfoAndScope;
2577 tinfo->
getType()->isDependentType(),
2580 tinfo->
getType()->isInstantiationDependentType()),
2582 LParenLoc(lparenloc), TInfoAndScope(tinfo, fileScope), Init(init) {}
2586 :
Expr(CompoundLiteralExprClass, Empty) { }
2599 return TInfoAndScope.getPointer();
2602 TInfoAndScope.setPointer(tinfo);
2610 return Init->getLocStart();
2617 return Init->getLocEnd();
2621 return T->getStmtClass() == CompoundLiteralExprClass;
2625 child_range
children() {
return child_range(&Init, &Init+1); }
2636 bool CastConsistency()
const;
2639 return const_cast<CastExpr*
>(
this)->path_buffer();
2643 void setBasePathSize(
unsigned basePathSize) {
2644 CastExprBits.BasePathSize = basePathSize;
2645 assert(CastExprBits.BasePathSize == basePathSize &&
2646 "basePathSize doesn't fit in bits of CastExprBits.BasePathSize!");
2651 Expr *op,
unsigned BasePathSize)
2655 ty->isDependentType(),
2659 (ty->isInstantiationDependentType() ||
2663 ((SC != ImplicitCastExprClass &&
2667 assert(kind !=
CK_Invalid &&
"creating cast with invalid cast kind");
2668 CastExprBits.Kind =
kind;
2669 setBasePathSize(BasePathSize);
2670 assert(CastConsistency());
2674 CastExpr(StmtClass SC, EmptyShell Empty,
unsigned BasePathSize)
2676 setBasePathSize(BasePathSize);
2698 bool path_empty()
const {
return CastExprBits.BasePathSize == 0; }
2699 unsigned path_size()
const {
return CastExprBits.BasePathSize; }
2706 return T->getStmtClass() >= firstCastExprConstant &&
2707 T->getStmtClass() <= lastCastExprConstant;
2711 child_range
children() {
return child_range(&Op, &Op+1); }
2740 :
CastExpr(ImplicitCastExprClass, ty, VK, kind, op, BasePathLength) {
2745 :
CastExpr(ImplicitCastExprClass, Shell, PathSize) { }
2751 :
CastExpr(ImplicitCastExprClass, ty, VK, kind, op, 0) {
2770 return T->getStmtClass() == ImplicitCastExprClass;
2780 e = ice->getSubExpr();
2809 :
CastExpr(SC, exprTy, VK, kind, op, PathSize), TInfo(writtenTy) {}
2813 :
CastExpr(SC, Shell, PathSize) { }
2826 return T->getStmtClass() >= firstExplicitCastExprConstant &&
2827 T->getStmtClass() <= lastExplicitCastExprConstant;
2844 writtenTy), LPLoc(l), RPLoc(r) {}
2872 return T->getStmtClass() == CStyleCastExprClass;
2908 unsigned FPContractable : 1;
2911 enum { LHS, RHS, END_EXPR };
2912 Stmt* SubExprs[END_EXPR];
2918 :
Expr(BinaryOperatorClass, ResTy, VK, OK,
2925 Opc(opc), FPContractable(fpContractable), OpLoc(opLoc) {
2926 SubExprs[LHS] = lhs;
2927 SubExprs[RHS] = rhs;
2929 "Use CompoundAssignOperator for compound assignments");
2934 :
Expr(BinaryOperatorClass, Empty), Opc(BO_Comma) { }
2949 return getLHS()->getLocStart();
2952 return getRHS()->getLocEnd();
2970 bool isPtrMemOp()
const {
return Opc == BO_PtrMemD || Opc == BO_PtrMemI; }
2972 return Opc >= BO_Mul && Opc <= BO_Rem;
2995 llvm_unreachable(
"Not a comparsion operator.");
2996 case BO_LT:
return BO_GE;
2997 case BO_GT:
return BO_LE;
2998 case BO_LE:
return BO_GT;
2999 case BO_GE:
return BO_LT;
3000 case BO_EQ:
return BO_NE;
3001 case BO_NE:
return BO_EQ;
3008 llvm_unreachable(
"Not a comparsion operator.");
3009 case BO_LT:
return BO_GT;
3010 case BO_GT:
return BO_LT;
3011 case BO_LE:
return BO_GE;
3012 case BO_GE:
return BO_LE;
3023 return Opc >= BO_Assign && Opc <= BO_OrAssign;
3028 return Opc > BO_Assign && Opc <= BO_OrAssign;
3035 if (Opc >= BO_AndAssign)
3036 return Opcode(
unsigned(Opc) - BO_AndAssign + BO_And);
3038 return Opcode(
unsigned(Opc) - BO_MulAssign + BO_Mul);
3042 return Opc == BO_ShlAssign || Opc == BO_ShrAssign;
3049 return S->getStmtClass() >= firstBinaryOperatorConstant &&
3050 S->getStmtClass() <= lastBinaryOperatorConstant;
3055 return child_range(&SubExprs[0], &SubExprs[0]+END_EXPR);
3070 :
Expr(CompoundAssignOperatorClass, ResTy, VK, OK,
3077 Opc(opc), FPContractable(fpContractable), OpLoc(opLoc) {
3078 SubExprs[LHS] = lhs;
3079 SubExprs[RHS] = rhs;
3083 :
Expr(SC, Empty), Opc(BO_MulAssign) { }
3100 :
BinaryOperator(lhs, rhs, opc, ResType, VK, OK, OpLoc, fpContractable,
3102 ComputationLHSType(CompLHSType),
3103 ComputationResultType(CompResultType) {
3105 "Only should be used for compound assignments");
3122 return S->getStmtClass() == CompoundAssignOperatorClass;
3135 bool TD,
bool VD,
bool ID,
3136 bool ContainsUnexpandedParameterPack,
3139 :
Expr(SC, T, VK, OK, TD, VD, ID, ContainsUnexpandedParameterPack),
3140 QuestionLoc(qloc),
ColonLoc(cloc) {}
3143 :
Expr(SC, Empty) { }
3163 return T->getStmtClass() == ConditionalOperatorClass ||
3164 T->getStmtClass() == BinaryConditionalOperatorClass;
3171 enum { COND, LHS, RHS, END_EXPR };
3172 Stmt* SubExprs[END_EXPR];
3193 SubExprs[COND] = cond;
3194 SubExprs[LHS] = lhs;
3195 SubExprs[RHS] = rhs;
3219 return getCond()->getLocStart();
3222 return getRHS()->getLocEnd();
3226 return T->getStmtClass() == ConditionalOperatorClass;
3231 return child_range(&SubExprs[0], &SubExprs[0]+END_EXPR);
3241 enum { COMMON, COND, LHS, RHS, NUM_SUBEXPRS };
3248 Stmt *SubExprs[NUM_SUBEXPRS];
3265 OpaqueValue(opaqueValue) {
3266 SubExprs[COMMON] = common;
3267 SubExprs[COND] = cond;
3268 SubExprs[LHS] = lhs;
3269 SubExprs[RHS] = rhs;
3270 assert(OpaqueValue->
getSourceExpr() == common &&
"Wrong opaque value");
3293 return cast<Expr>(SubExprs[LHS]);
3300 return cast<Expr>(SubExprs[RHS]);
3311 return T->getStmtClass() == BinaryConditionalOperatorClass;
3316 return child_range(SubExprs, SubExprs + NUM_SUBEXPRS);
3322 return co->getCond();
3323 return cast<BinaryConditionalOperator>(
this)->
getCond();
3328 return co->getTrueExpr();
3329 return cast<BinaryConditionalOperator>(
this)->
getTrueExpr();
3334 return co->getFalseExpr();
3335 return cast<BinaryConditionalOperator>(
this)->
getFalseExpr();
3347 AmpAmpLoc(AALoc), LabelLoc(LLoc), Label(L) {}
3351 :
Expr(AddrLabelExprClass, Empty) { }
3365 return T->getStmtClass() == AddrLabelExprClass;
3370 return child_range(child_iterator(), child_iterator());
3391 SubStmt(substmt), LParenLoc(lp), RParenLoc(rp) { }
3409 return T->getStmtClass() == StmtExprClass;
3413 child_range
children() {
return child_range(&SubStmt, &SubStmt+1); }
3438 :
Expr(ShuffleVectorExprClass, Empty), SubExprs(nullptr) { }
3450 return T->getStmtClass() == ShuffleVectorExprClass;
3463 assert((Index < NumExprs) &&
"Arg access out of range!");
3464 return cast<Expr>(SubExprs[Index]);
3467 assert((Index < NumExprs) &&
"Arg access out of range!");
3468 return cast<Expr>(SubExprs[Index]);
3474 assert((N < NumExprs - 2) &&
"Shuffle idx out of range!");
3480 return child_range(&SubExprs[0], &SubExprs[0]+NumExprs);
3501 :
Expr(ConvertVectorExprClass, DstType, VK, OK,
3502 DstType->isDependentType(),
3504 (DstType->isInstantiationDependentType() ||
3508 SrcExpr(SrcExpr), TInfo(TI), BuiltinLoc(BuiltinLoc), RParenLoc(RParenLoc) {}
3531 return T->getStmtClass() == ConvertVectorExprClass;
3535 child_range
children() {
return child_range(&SrcExpr, &SrcExpr+1); }
3548 enum { COND, LHS, RHS, END_EXPR };
3549 Stmt* SubExprs[END_EXPR];
3556 bool TypeDependent,
bool ValueDependent)
3557 :
Expr(ChooseExprClass, t, VK, OK, TypeDependent, ValueDependent,
3564 BuiltinLoc(BLoc), RParenLoc(RP), CondIsTrue(condIsTrue) {
3565 SubExprs[COND] = cond;
3566 SubExprs[LHS] = lhs;
3567 SubExprs[RHS] = rhs;
3577 "Dependent condition isn't true or false");
3609 return T->getStmtClass() == ChooseExprClass;
3614 return child_range(&SubExprs[0], &SubExprs[0]+END_EXPR);
3645 return T->getStmtClass() == GNUNullExprClass;
3650 return child_range(child_iterator(), child_iterator());
3657 llvm::PointerIntPair<TypeSourceInfo *, 1, bool> TInfo;
3663 false, (TInfo->
getType()->isInstantiationDependentType() ||
3667 Val(e), TInfo(TInfo, IsMS), BuiltinLoc(BLoc), RParenLoc(RPLoc) {}
3671 :
Expr(VAArgExprClass, Empty), Val(nullptr), TInfo(nullptr,
false) {}
3694 return T->getStmtClass() == VAArgExprClass;
3698 child_range
children() {
return child_range(&Val, &Val+1); }
3757 llvm::PointerIntPair<InitListExpr *, 1, bool> AltForm;
3766 llvm::PointerUnion<Expr *, FieldDecl *> ArrayFillerOrUnionFieldInit;
3774 :
Expr(InitListExprClass, Empty) { }
3786 assert(Init <
getNumInits() &&
"Initializer access out of range!");
3787 return cast_or_null<Expr>(InitExprs[Init]);
3791 assert(Init <
getNumInits() &&
"Initializer access out of range!");
3792 return cast_or_null<Expr>(InitExprs[Init]);
3796 assert(Init <
getNumInits() &&
"Initializer access out of range!");
3797 InitExprs[Init] =
expr;
3803 ExprBits.ContainsUnexpandedParameterPack |=
3832 return ArrayFillerOrUnionFieldInit.dyn_cast<
Expr *>();
3850 return ArrayFillerOrUnionFieldInit.dyn_cast<
FieldDecl *>();
3856 assert((FD ==
nullptr
3859 &&
"Only one field of a union may be initialized at a time!");
3860 ArrayFillerOrUnionFieldInit = FD;
3887 AltForm.setPointer(Init);
3888 AltForm.setInt(
true);
3889 Init->AltForm.setPointer(
this);
3890 Init->AltForm.setInt(
false);
3894 return InitListExprBits.HadArrayRangeDesignator != 0;
3897 InitListExprBits.HadArrayRangeDesignator = ARD;
3904 return T->getStmtClass() == InitListExprClass;
3910 if (InitExprs.
empty())
3911 return child_range(child_iterator(), child_iterator());
3912 return child_range(&InitExprs[0], &InitExprs[0] + InitExprs.
size());
3967 unsigned GNUSyntax : 1;
3970 unsigned NumDesignators : 15;
3975 unsigned NumSubExprs : 16;
3987 :
Expr(DesignatedInitExprClass, EmptyShell()),
3988 NumDesignators(0), NumSubExprs(NumSubExprs), Designators(
nullptr) { }
4033 ArrayRangeDesignator
4059 :
Kind(ArrayDesignator) {
4069 :
Kind(ArrayRangeDesignator) {
4106 assert((
Kind == ArrayDesignator ||
Kind == ArrayRangeDesignator) &&
4107 "Only valid on an array or array-range designator");
4112 assert((
Kind == ArrayDesignator ||
Kind == ArrayRangeDesignator) &&
4113 "Only valid on an array or array-range designator");
4118 assert(
Kind == ArrayRangeDesignator &&
4119 "Only valid on an array-range designator");
4124 assert((
Kind == ArrayDesignator ||
Kind == ArrayRangeDesignator) &&
4125 "Only valid on an array or array-range designator");
4147 bool GNUSyntax,
Expr *Init);
4150 unsigned NumIndexExprs);
4153 unsigned size()
const {
return NumDesignators; }
4157 return {Designators, NumDesignators};
4161 return {Designators, NumDesignators};
4167 unsigned NumDesigs);
4189 *child_begin() = init;
4199 assert(Idx < NumSubExprs &&
"Subscript out of range");
4200 return cast<Expr>(getTrailingObjects<Stmt *>()[Idx]);
4204 assert(Idx < NumSubExprs &&
"Subscript out of range");
4205 getTrailingObjects<Stmt *>()[Idx] = E;
4219 return T->getStmtClass() == DesignatedInitExprClass;
4224 Stmt **
begin = getTrailingObjects<Stmt *>();
4225 return child_range(begin, begin + NumSubExprs);
4247 :
Expr(NoInitExprClass, Empty) { }
4250 return T->getStmtClass() == NoInitExprClass;
4258 return child_range(child_iterator(), child_iterator());
4276 Stmt *BaseAndUpdaterExprs[2];
4283 :
Expr(DesignatedInitUpdateExprClass, Empty) { }
4289 return T->getStmtClass() == DesignatedInitUpdateExprClass;
4296 return cast<InitListExpr>(BaseAndUpdaterExprs[1]);
4303 return child_range(&BaseAndUpdaterExprs[0], &BaseAndUpdaterExprs[0] + 2);
4323 :
Expr(ImplicitValueInitExprClass, Empty) { }
4326 return T->getStmtClass() == ImplicitValueInitExprClass;
4334 return child_range(child_iterator(), child_iterator());
4353 assert(Init <
getNumExprs() &&
"Initializer access out of range!");
4354 return cast_or_null<Expr>(Exprs[Init]);
4358 assert(Init <
getNumExprs() &&
"Initializer access out of range!");
4359 return cast_or_null<Expr>(Exprs[Init]);
4375 return T->getStmtClass() == ParenListExprClass;
4380 return child_range(&Exprs[0], &Exprs[0]+NumExprs);
4414 enum { CONTROLLING, END_EXPR };
4417 unsigned NumAssocs, ResultIndex;
4426 bool ContainsUnexpandedParameterPack,
4427 unsigned ResultIndex);
4435 bool ContainsUnexpandedParameterPack);
4438 :
Expr(GenericSelectionExprClass, Empty) { }
4447 return cast<Expr>(SubExprs[END_EXPR+i]);
4452 return AssocTypes[i];
4458 return TS->getType();
4464 return cast<Expr>(SubExprs[CONTROLLING]);
4488 return T->getStmtClass() == GenericSelectionExprClass;
4492 return child_range(SubExprs, SubExprs+END_EXPR+NumAssocs);
4516 :
Expr(ExtVectorElementExprClass, ty, VK,
4521 Base(base), Accessor(&accessor), AccessorLoc(loc) {}
4525 :
Expr(ExtVectorElementExprClass, Empty) { }
4549 return getBase()->getLocStart();
4558 return T->getStmtClass() == ExtVectorElementExprClass;
4573 ty->isDependentType(), ty->isDependentType(),
4574 ty->isInstantiationDependentType() || BD->isDependentContext(),
4597 return T->getStmtClass() == BlockExprClass;
4602 return child_range(child_iterator(), child_iterator());
4616 explicit AsTypeExpr(EmptyShell Empty) :
Expr(AsTypeExprClass, Empty) {}
4622 :
Expr(AsTypeExprClass, DstType, VK, OK,
4623 DstType->isDependentType(),
4625 (DstType->isInstantiationDependentType() ||
4629 SrcExpr(SrcExpr), BuiltinLoc(BuiltinLoc), RParenLoc(RParenLoc) {}
4644 return T->getStmtClass() == AsTypeExprClass;
4648 child_range
children() {
return child_range(&SrcExpr, &SrcExpr+1); }
4693 Expr **getSubExprsBuffer() {
return getTrailingObjects<Expr *>(); }
4694 const Expr *
const *getSubExprsBuffer()
const {
4695 return getTrailingObjects<Expr *>();
4700 unsigned resultIndex);
4704 unsigned getNumSubExprs()
const {
4705 return PseudoObjectExprBits.NumSubExprs;
4715 unsigned resultIndex);
4718 unsigned numSemanticExprs);
4729 if (PseudoObjectExprBits.ResultIndex == 0)
return NoResult;
4730 return PseudoObjectExprBits.ResultIndex - 1;
4735 if (PseudoObjectExprBits.ResultIndex == 0)
4737 return getSubExprsBuffer()[PseudoObjectExprBits.ResultIndex];
4748 return getSubExprsBuffer() + 1;
4751 return getSubExprsBuffer() + 1;
4754 return getSubExprsBuffer() + getNumSubExprs();
4757 return getSubExprsBuffer() + getNumSubExprs();
4763 llvm::iterator_range<const_semantics_iterator>
semantics()
const {
4768 assert(index + 1 < getNumSubExprs());
4769 return getSubExprsBuffer()[index + 1];
4787 Stmt **cs =
reinterpret_cast<Stmt**
>(getSubExprsBuffer());
4788 return child_range(cs, cs + getNumSubExprs());
4792 return T->getStmtClass() == PseudoObjectExprClass;
4807 #define BUILTIN(ID, TYPE, ATTRS)
4808 #define ATOMIC_BUILTIN(ID, TYPE, ATTRS) AO ## ID,
4809 #include "clang/Basic/Builtins.def"
4815 enum { PTR, ORDER, VAL1, ORDER_FAIL, VAL2, WEAK, END_EXPR };
4816 Stmt* SubExprs[END_EXPR];
4817 unsigned NumSubExprs;
4818 SourceLocation BuiltinLoc, RParenLoc;
4835 return cast<Expr>(SubExprs[
PTR]);
4838 return cast<Expr>(SubExprs[ORDER]);
4841 if (Op == AO__c11_atomic_init)
4842 return cast<Expr>(SubExprs[ORDER]);
4843 assert(NumSubExprs > VAL1);
4844 return cast<Expr>(SubExprs[VAL1]);
4847 assert(NumSubExprs > ORDER_FAIL);
4848 return cast<Expr>(SubExprs[ORDER_FAIL]);
4851 if (Op == AO__atomic_exchange)
4852 return cast<Expr>(SubExprs[ORDER_FAIL]);
4853 assert(NumSubExprs > VAL2);
4854 return cast<Expr>(SubExprs[VAL2]);
4857 assert(NumSubExprs > WEAK);
4858 return cast<Expr>(SubExprs[WEAK]);
4866 return reinterpret_cast<Expr *
const *
>(SubExprs);
4874 return getOp() == AO__c11_atomic_compare_exchange_strong ||
4875 getOp() == AO__c11_atomic_compare_exchange_weak ||
4876 getOp() == AO__atomic_compare_exchange ||
4877 getOp() == AO__atomic_compare_exchange_n;
4887 return T->getStmtClass() == AtomicExprClass;
4892 return child_range(SubExprs, SubExprs+NumSubExprs);
4906 assert(T->
isDependentType() &&
"TypoExpr given a non-dependent type");
4910 return child_range(child_iterator(), child_iterator());
4916 return T->getStmtClass() == TypoExprClass;
4922 #endif // LLVM_CLANG_AST_EXPR_H
SourceLocation getRParenLoc() const
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.
SourceLocation getLocStart() const LLVM_READONLY
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.
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...
A (possibly-)qualified type.
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.
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
Designator(const IdentifierInfo *FieldName, SourceLocation DotLoc, SourceLocation FieldLoc)
Initializes a field designator.
Expr * getControllingExpr()
CharacterKind getKind() const
Expr *const * semantics_iterator
DesignatedInitUpdateExpr(const ASTContext &C, SourceLocation lBraceLoc, Expr *baseExprs, SourceLocation rBraceLoc)
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...
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
SourceLocation getLParenLoc() const
unsigned size() const
Returns the number of designators in this initializer.
static bool classof(const Stmt *T)
SourceLocation getLocEnd() const LLVM_READONLY
static bool classof(const Stmt *T)
const CastExpr * BasePath
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?
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)
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
A container of type source information.
ArrayRef< TemplateArgumentLoc > template_arguments() const
path_const_iterator path_end() const
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
SourceLocation getLocStart() const LLVM_READONLY
Expr * ignoreParenBaseCasts() LLVM_READONLY
Ignore parentheses and derived-to-base casts.
bool hasExplicitTemplateArgs() const
Determines whether the member name was followed by an explicit template argument list.
IdentType getIdentType() const
bool isConditionTrue() const
isConditionTrue - Return whether the condition is true (i.e.
Expr * getIndexExpr(unsigned Idx)
bool hadArrayRangeDesignator() const
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
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
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.
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)
class LLVM_ALIGNAS(8) DependentTemplateSpecializationType const IdentifierInfo * Name
Represents a template specialization type whose template cannot be resolved, e.g. ...
A vector component is an element or range of elements on a vector.
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
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.
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...
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
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)
bool isFPContractable() const
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.
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
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 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)
const Expr * getSubExpr() const
semantics_iterator semantics_end()
SourceLocation getRParenLoc() const
A builtin binary operation expression such as "x + y" or "x <= y".
const Expr * skipRValueSubobjectAdjustments(SmallVectorImpl< const Expr * > &CommaLHS, SmallVectorImpl< SubobjectAdjustment > &Adjustments) const
Walk outwards from an expression we want to bind a reference to and find the expression whose lifetim...
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.
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)
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
enum clang::SubobjectAdjustment::@35 Kind
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.
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.
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.
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)
static bool classof(const Stmt *T)
SourceLocation getOperatorLoc() const LLVM_READONLY
void setEqualOrColonLoc(SourceLocation L)
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.
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)
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)
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.
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.
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
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)
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.
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]".
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 ...
BinaryOperator(Expr *lhs, Expr *rhs, Opcode opc, QualType ResTy, ExprValueKind VK, ExprObjectKind OK, SourceLocation opLoc, bool fpContractable)
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...
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.
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)
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...
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.
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.
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)
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().
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.
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.
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)
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)
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;}).
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
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
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.
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)
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.
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
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.
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.
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 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>'.
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
static ImplicitCastExpr * CreateEmpty(const ASTContext &Context, unsigned PathSize)
SourceLocation getLocStart() const LLVM_READONLY
TypeSourceInfo * getWrittenTypeInfo() const
static bool classof(const Stmt *T)
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
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.
void setLParenLoc(SourceLocation L)
SourceLocation getExprLoc() const LLVM_READONLY
LabelDecl * getLabel() const
void setFPContractable(bool FPC)
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
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.
BinaryOperator(Expr *lhs, Expr *rhs, Opcode opc, QualType ResTy, ExprValueKind VK, ExprObjectKind OK, SourceLocation opLoc, bool fpContractable, bool dead2)
SourceLocation getLocEnd() const LLVM_READONLY
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.
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
BinaryConditionalOperator - The GNU extension to the conditional operator which allows the middle ope...
SourceLocation getBuiltinLoc() const
static bool classof(const Stmt *T)
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.
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)
static OverloadedOperatorKind getOverloadedOperator(Opcode Opc)
Retrieve the overloaded operator kind that corresponds to the given binary opcode.
CompoundAssignOperator(Expr *lhs, Expr *rhs, Opcode opc, QualType ResType, ExprValueKind VK, ExprObjectKind OK, QualType CompLHSType, QualType CompResultType, SourceLocation OpLoc, bool fpContractable)
SourceLocation getLocStart() const LLVM_READONLY
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...
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 EvaluateWithSubstitution(APValue &Value, ASTContext &Ctx, const FunctionDecl *Callee, ArrayRef< const Expr * > Args) const
EvaluateWithSubstitution - Evaluate an expression as if from the context of a call to the given funct...
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.
static bool isComparisonOp(Opcode Opc)
SourceLocation ColonLoc
Location of ':'.
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.
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