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/Compiler.h"
38 class CXXBaseSpecifier;
39 class CXXMemberCallExpr;
40 class CXXOperatorCallExpr;
44 class MaterializeTemporaryExpr;
46 class ObjCPropertyRefExpr;
47 class OpaqueValueExpr;
109 bool TD,
bool VD,
bool ID,
bool ContainsUnexpandedParameterPack)
112 ExprBits.TypeDependent = TD;
113 ExprBits.ValueDependent = VD;
114 ExprBits.InstantiationDependent =
ID;
115 ExprBits.ValueKind = VK;
116 ExprBits.ObjectKind = OK;
117 ExprBits.ContainsUnexpandedParameterPack = ContainsUnexpandedParameterPack;
122 explicit Expr(StmtClass SC, EmptyShell) :
Stmt(SC) { }
134 "Expressions can't have reference type");
150 ExprBits.ValueDependent = VD;
168 ExprBits.TypeDependent = TD;
189 return ExprBits.InstantiationDependent;
194 ExprBits.InstantiationDependent =
ID;
212 return ExprBits.ContainsUnexpandedParameterPack;
218 ExprBits.ContainsUnexpandedParameterPack = PP;
333 unsigned short Modifiable;
336 :
Kind(k), Modifiable(m)
344 assert(Modifiable !=
CM_Untested &&
"Did not test for modifiability.");
373 return ClassifyImpl(Ctx,
nullptr);
385 return ClassifyImpl(Ctx, &Loc);
392 return (isa<LValueReferenceType>(RT)
394 : (RT->getPointeeType()->isFunctionType()
470 return BT->getKind() == K;
489 bool isEvaluated =
true)
const;
528 const Expr **Culprit =
nullptr)
const;
609 bool IncludePossibleEffects =
true)
const;
651 unsigned Type)
const;
717 return cast<Expr>(Stmt::IgnoreImplicit());
826 return T->getStmtClass() >= firstExprConstant &&
827 T->getStmtClass() <= lastExprConstant;
848 Expr *SourceExpr =
nullptr)
849 :
Expr(OpaqueValueExprClass, T, VK, OK,
850 T->isDependentType(),
851 T->isDependentType() ||
853 T->isInstantiationDependentType(),
855 SourceExpr(SourceExpr), Loc(Loc) {
864 :
Expr(OpaqueValueExprClass, Empty) { }
870 return SourceExpr ? SourceExpr->getLocStart() : Loc;
873 return SourceExpr ? SourceExpr->getLocEnd() : Loc;
876 if (SourceExpr)
return SourceExpr->
getExprLoc();
881 return child_range(child_iterator(), child_iterator());
895 return T->getStmtClass() == OpaqueValueExprClass;
925 NamedDecl *, ASTTemplateKWAndArgsInfo,
926 TemplateArgumentLoc> {
937 size_t numTrailingObjects(OverloadToken<NestedNameSpecifierLoc>)
const {
941 size_t numTrailingObjects(OverloadToken<NamedDecl *>)
const {
942 return hasFoundDecl() ? 1 : 0;
945 size_t numTrailingObjects(OverloadToken<ASTTemplateKWAndArgsInfo>)
const {
951 bool hasFoundDecl()
const {
return DeclRefExprBits.HasFoundDecl; }
956 ValueDecl *D,
bool RefersToEnlosingVariableOrCapture,
964 :
Expr(DeclRefExprClass, Empty) { }
975 D(D), Loc(L), DNLoc(LocInfo) {
976 DeclRefExprBits.HasQualifier = 0;
977 DeclRefExprBits.HasTemplateKWAndArgsInfo = 0;
978 DeclRefExprBits.HasFoundDecl = 0;
979 DeclRefExprBits.HadMultipleCandidates = 0;
980 DeclRefExprBits.RefersToEnclosingVariableOrCapture =
981 RefersToEnclosingVariableOrCapture;
995 bool RefersToEnclosingVariableOrCapture,
1004 bool HasTemplateKWAndArgsInfo,
1005 unsigned NumTemplateArgs);
1029 return *getTrailingObjects<NestedNameSpecifierLoc>();
1045 return hasFoundDecl() ? *getTrailingObjects<NamedDecl *>() : D;
1051 return hasFoundDecl() ? *getTrailingObjects<NamedDecl *>() : D;
1055 return DeclRefExprBits.HasTemplateKWAndArgsInfo;
1062 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->TemplateKWLoc;
1069 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->LAngleLoc;
1076 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->RAngleLoc;
1091 getTrailingObjects<ASTTemplateKWAndArgsInfo>()->copyInto(
1092 getTrailingObjects<TemplateArgumentLoc>(), List);
1101 return getTrailingObjects<TemplateArgumentLoc>();
1110 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->NumTemplateArgs;
1116 return DeclRefExprBits.HadMultipleCandidates;
1122 DeclRefExprBits.HadMultipleCandidates = V;
1128 return DeclRefExprBits.RefersToEnclosingVariableOrCapture;
1132 return T->getStmtClass() == DeclRefExprClass;
1137 return child_range(child_iterator(), child_iterator());
1171 :
Expr(PredefinedExprClass, Empty), Loc(),
Type(
Func), FnName(nullptr) {}
1190 return T->getStmtClass() == PredefinedExprClass;
1194 child_range
children() {
return child_range(&FnName, &FnName + 1); }
1214 bool hasAllocation()
const {
return llvm::APInt::getNumWords(BitWidth) > 1; }
1223 unsigned NumWords = llvm::APInt::getNumWords(BitWidth);
1225 return llvm::APInt(BitWidth, NumWords,
pVal);
1227 return llvm::APInt(BitWidth,
VAL);
1242 llvm::APFloat
getValue(
const llvm::fltSemantics &Semantics)
const {
1255 :
Expr(IntegerLiteralClass, Empty) { }
1281 return T->getStmtClass() == IntegerLiteralClass;
1286 return child_range(child_iterator(), child_iterator());
1309 Value(value), Loc(l) {
1310 CharacterLiteralBits.Kind =
kind;
1318 return static_cast<CharacterKind>(CharacterLiteralBits.Kind);
1331 return T->getStmtClass() == CharacterLiteralClass;
1336 return child_range(child_iterator(), child_iterator());
1358 assert(&
getSemantics() == &Val.getSemantics() &&
"Inconsistent semantics");
1365 return static_cast<APFloatSemantics
>(FloatingLiteralBits.Semantics);
1371 FloatingLiteralBits.Semantics = Sem;
1380 bool isExact()
const {
return FloatingLiteralBits.IsExact; }
1395 return T->getStmtClass() == FloatingLiteralClass;
1400 return child_range(child_iterator(), child_iterator());
1419 :
Expr(ImaginaryLiteralClass, Empty) { }
1429 return T->getStmtClass() == ImaginaryLiteralClass;
1433 child_range
children() {
return child_range(&Val, &Val+1); }
1471 unsigned CharByteWidth : 4;
1473 unsigned IsPascal : 1;
1474 unsigned NumConcatenated;
1481 static int mapCharByteWidth(TargetInfo
const &target,
StringKind k);
1488 const SourceLocation *Loc,
unsigned NumStrs);
1494 return Create(C, Str, Kind, Pascal, Ty, &Loc, 1);
1501 assert(CharByteWidth==1
1502 &&
"This function is used in places that assume strings use char");
1510 if (CharByteWidth == 1)
1512 if (CharByteWidth == 4)
1513 return StringRef(reinterpret_cast<const char*>(StrData.asUInt32),
1515 assert(CharByteWidth == 2 &&
"unsupported CharByteWidth");
1516 return StringRef(reinterpret_cast<const char*>(StrData.asUInt16),
1523 assert(i < Length &&
"out of bounds access");
1524 if (CharByteWidth == 1)
1525 return static_cast<unsigned char>(StrData.asChar[i]);
1526 if (CharByteWidth == 4)
1527 return StrData.asUInt32[i];
1528 assert(CharByteWidth == 2 &&
"unsupported CharByteWidth");
1529 return StrData.asUInt16[i];
1552 for (
unsigned i = 0, e = Str.size(); i != e; ++i)
1553 if (!
isASCII(Str[i]) || !Str[i])
1563 assert(TokNum < NumConcatenated &&
"Invalid tok number");
1564 return TokLocs[TokNum];
1567 assert(TokNum < NumConcatenated &&
"Invalid tok number");
1568 TokLocs[TokNum] = L;
1581 unsigned *StartToken =
nullptr,
1582 unsigned *StartTokenByteOffset =
nullptr)
const;
1590 return TokLocs[NumConcatenated - 1];
1594 return T->getStmtClass() == StringLiteralClass;
1599 return child_range(child_iterator(), child_iterator());
1615 L(l), R(r), Val(val) {}
1619 :
Expr(ParenExprClass, Empty) { }
1637 return T->getStmtClass() == ParenExprClass;
1641 child_range
children() {
return child_range(&Val, &Val+1); }
1666 :
Expr(UnaryOperatorClass, type, VK, OK,
1670 type->isInstantiationDependentType()),
1672 Opc(opc), Loc(l), Val(input) {}
1738 return isPostfix() ? Val->getLocStart() : Loc;
1741 return isPostfix() ? Loc : Val->getLocEnd();
1746 return T->getStmtClass() == UnaryOperatorClass;
1750 child_range
children() {
return child_range(&Val, &Val+1); }
1772 enum { MaskBits = 2, Mask = 0x03 };
1792 : Range(LBracketLoc, RBracketLoc), Data((Index << 2) |
Array) {}
1796 : Range(DotLoc.isValid() ? DotLoc : NameLoc, NameLoc),
1797 Data(reinterpret_cast<uintptr_t>(Field) |
OffsetOfNode::Field) {}
1802 : Range(DotLoc.isValid() ? DotLoc : NameLoc, NameLoc),
1803 Data(reinterpret_cast<uintptr_t>(Name) |
Identifier) {}
1807 : Range(), Data(reinterpret_cast<uintptr_t>(Base) |
OffsetOfNode::Base) {}
1822 return reinterpret_cast<FieldDecl *
>(Data & ~(uintptr_t)Mask);
1871 size_t numTrailingObjects(OverloadToken<OffsetOfNode>)
const {
1880 explicit OffsetOfExpr(
unsigned numComps,
unsigned numExprs)
1881 :
Expr(OffsetOfExprClass, EmptyShell()),
1882 TSInfo(
nullptr), NumComps(numComps), NumExprs(numExprs) {}
1892 unsigned NumComps,
unsigned NumExprs);
1910 assert(Idx < NumComps &&
"Subscript out of range");
1911 return getTrailingObjects<OffsetOfNode>()[Idx];
1915 assert(Idx < NumComps &&
"Subscript out of range");
1916 getTrailingObjects<OffsetOfNode>()[Idx] = ON;
1924 assert(Idx < NumExprs &&
"Subscript out of range");
1925 return getTrailingObjects<Expr *>()[Idx];
1929 assert(Idx < NumExprs &&
"Subscript out of range");
1930 return getTrailingObjects<Expr *>()[Idx];
1934 assert(Idx < NumComps &&
"Subscript out of range");
1935 getTrailingObjects<Expr *>()[Idx] = E;
1946 return T->getStmtClass() == OffsetOfExprClass;
1951 Stmt **
begin =
reinterpret_cast<Stmt **
>(getTrailingObjects<Expr *>());
1952 return child_range(begin, begin + NumExprs);
1974 TInfo->
getType()->isDependentType(),
1975 TInfo->
getType()->isInstantiationDependentType(),
1977 OpLoc(op), RParenLoc(rp) {
1978 UnaryExprOrTypeTraitExprBits.Kind = ExprKind;
1979 UnaryExprOrTypeTraitExprBits.IsType =
true;
1980 Argument.Ty = TInfo;
1989 :
Expr(UnaryExprOrTypeTraitExprClass, Empty) { }
2001 assert(
isArgumentType() &&
"calling getArgumentType() when arg is expr");
2005 assert(!
isArgumentType() &&
"calling getArgumentExpr() when arg is type");
2006 return static_cast<Expr*
>(Argument.Ex);
2014 UnaryExprOrTypeTraitExprBits.IsType =
false;
2017 Argument.Ty = TInfo;
2018 UnaryExprOrTypeTraitExprBits.IsType =
true;
2037 return T->getStmtClass() == UnaryExprOrTypeTraitExprClass;
2050 enum { LHS, RHS, END_EXPR=2 };
2051 Stmt* SubExprs[END_EXPR];
2057 :
Expr(ArraySubscriptExprClass, t, VK, OK,
2064 RBracketLoc(rbracketloc) {
2065 SubExprs[LHS] = lhs;
2066 SubExprs[RHS] = rhs;
2071 :
Expr(ArraySubscriptExprClass, Shell) { }
2107 return getLHS()->getLocStart();
2119 return T->getStmtClass() == ArraySubscriptExprClass;
2124 return child_range(&SubExprs[0], &SubExprs[0]+END_EXPR);
2135 enum { FN=0, PREARGS_START=1 };
2149 assert(i <
getNumPreArgs() &&
"Prearg access out of range!");
2150 return SubExprs[PREARGS_START+i];
2153 assert(i <
getNumPreArgs() &&
"Prearg access out of range!");
2154 return SubExprs[PREARGS_START+i];
2157 assert(i <
getNumPreArgs() &&
"Prearg access out of range!");
2158 SubExprs[PREARGS_START+i] = PreArg;
2200 assert(Arg < NumArgs &&
"Arg access out of range!");
2201 return cast_or_null<Expr>(SubExprs[Arg +
getNumPreArgs() + PREARGS_START]);
2204 assert(Arg < NumArgs &&
"Arg access out of range!");
2205 return cast_or_null<Expr>(SubExprs[Arg +
getNumPreArgs() + PREARGS_START]);
2210 assert(Arg < NumArgs &&
"Arg access out of range!");
2245 return llvm::makeArrayRef(SubExprs,
2273 return T->getStmtClass() >= firstCallExprConstant &&
2274 T->getStmtClass() <= lastCallExprConstant;
2279 return child_range(&SubExprs[0],
2300 ASTTemplateKWAndArgsInfo,
2301 TemplateArgumentLoc> {
2327 bool HasQualifierOrFoundDecl : 1;
2334 bool HasTemplateKWAndArgsInfo : 1;
2338 bool HadMultipleCandidates : 1;
2340 size_t numTrailingObjects(OverloadToken<MemberExprNameQualifier>)
const {
2341 return HasQualifierOrFoundDecl ? 1 : 0;
2344 size_t numTrailingObjects(OverloadToken<ASTTemplateKWAndArgsInfo>)
const {
2345 return HasTemplateKWAndArgsInfo ? 1 : 0;
2355 Base(base), MemberDecl(memberdecl), MemberDNLoc(NameInfo.
getInfo()),
2356 MemberLoc(NameInfo.getLoc()), OperatorLoc(operatorloc),
2357 IsArrow(isarrow), HasQualifierOrFoundDecl(
false),
2358 HasTemplateKWAndArgsInfo(
false), HadMultipleCandidates(
false) {
2372 Base(base), MemberDecl(memberdecl), MemberDNLoc(), MemberLoc(l),
2373 OperatorLoc(operatorloc), IsArrow(isarrow),
2374 HasQualifierOrFoundDecl(
false), HasTemplateKWAndArgsInfo(
false),
2375 HadMultipleCandidates(
false) {}
2398 if (!HasQualifierOrFoundDecl)
2401 return getTrailingObjects<MemberExprNameQualifier>()->FoundDecl;
2413 if (!HasQualifierOrFoundDecl)
2416 return getTrailingObjects<MemberExprNameQualifier>()->QualifierLoc;
2430 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->TemplateKWLoc;
2437 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->LAngleLoc;
2444 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->RAngleLoc;
2458 getTrailingObjects<ASTTemplateKWAndArgsInfo>()->copyInto(
2459 getTrailingObjects<TemplateArgumentLoc>(), List);
2468 return getTrailingObjects<TemplateArgumentLoc>();
2477 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->NumTemplateArgs;
2483 MemberLoc, MemberDNLoc);
2509 return HadMultipleCandidates;
2515 HadMultipleCandidates = V;
2527 return T->getStmtClass() == MemberExprClass;
2549 llvm::PointerIntPair<TypeSourceInfo *, 1, bool> TInfoAndScope;
2555 tinfo->
getType()->isDependentType(),
2558 tinfo->
getType()->isInstantiationDependentType()),
2560 LParenLoc(lparenloc), TInfoAndScope(tinfo, fileScope), Init(init) {}
2564 :
Expr(CompoundLiteralExprClass, Empty) { }
2577 return TInfoAndScope.getPointer();
2580 TInfoAndScope.setPointer(tinfo);
2588 return Init->getLocStart();
2595 return Init->getLocEnd();
2599 return T->getStmtClass() == CompoundLiteralExprClass;
2603 child_range
children() {
return child_range(&Init, &Init+1); }
2614 bool CastConsistency()
const;
2617 return const_cast<CastExpr*
>(
this)->path_buffer();
2621 void setBasePathSize(
unsigned basePathSize) {
2622 CastExprBits.BasePathSize = basePathSize;
2623 assert(CastExprBits.BasePathSize == basePathSize &&
2624 "basePathSize doesn't fit in bits of CastExprBits.BasePathSize!");
2629 Expr *op,
unsigned BasePathSize)
2633 ty->isDependentType(),
2637 (ty->isInstantiationDependentType() ||
2641 ((SC != ImplicitCastExprClass &&
2645 assert(kind !=
CK_Invalid &&
"creating cast with invalid cast kind");
2646 CastExprBits.Kind =
kind;
2647 setBasePathSize(BasePathSize);
2648 assert(CastConsistency());
2652 CastExpr(StmtClass SC, EmptyShell Empty,
unsigned BasePathSize)
2654 setBasePathSize(BasePathSize);
2676 bool path_empty()
const {
return CastExprBits.BasePathSize == 0; }
2677 unsigned path_size()
const {
return CastExprBits.BasePathSize; }
2684 return T->getStmtClass() >= firstCastExprConstant &&
2685 T->getStmtClass() <= lastCastExprConstant;
2689 child_range
children() {
return child_range(&Op, &Op+1); }
2718 :
CastExpr(ImplicitCastExprClass, ty, VK, kind, op, BasePathLength) {
2723 :
CastExpr(ImplicitCastExprClass, Shell, PathSize) { }
2729 :
CastExpr(ImplicitCastExprClass, ty, VK, kind, op, 0) {
2748 return T->getStmtClass() == ImplicitCastExprClass;
2758 e = ice->getSubExpr();
2787 :
CastExpr(SC, exprTy, VK, kind, op, PathSize), TInfo(writtenTy) {}
2791 :
CastExpr(SC, Shell, PathSize) { }
2804 return T->getStmtClass() >= firstExplicitCastExprConstant &&
2805 T->getStmtClass() <= lastExplicitCastExprConstant;
2822 writtenTy), LPLoc(l), RPLoc(r) {}
2850 return T->getStmtClass() == CStyleCastExprClass;
2886 unsigned FPContractable : 1;
2889 enum { LHS, RHS, END_EXPR };
2890 Stmt* SubExprs[END_EXPR];
2896 :
Expr(BinaryOperatorClass, ResTy, VK, OK,
2903 Opc(opc), FPContractable(fpContractable), OpLoc(opLoc) {
2904 SubExprs[LHS] = lhs;
2905 SubExprs[RHS] = rhs;
2907 "Use CompoundAssignOperator for compound assignments");
2927 return getLHS()->getLocStart();
2930 return getRHS()->getLocEnd();
2973 llvm_unreachable(
"Not a comparsion operator.");
2986 llvm_unreachable(
"Not a comparsion operator.");
3027 return S->getStmtClass() >= firstBinaryOperatorConstant &&
3028 S->getStmtClass() <= lastBinaryOperatorConstant;
3033 return child_range(&SubExprs[0], &SubExprs[0]+END_EXPR);
3048 :
Expr(CompoundAssignOperatorClass, ResTy, VK, OK,
3055 Opc(opc), FPContractable(fpContractable), OpLoc(opLoc) {
3056 SubExprs[LHS] = lhs;
3057 SubExprs[RHS] = rhs;
3078 :
BinaryOperator(lhs, rhs, opc, ResType, VK, OK, OpLoc, fpContractable,
3080 ComputationLHSType(CompLHSType),
3081 ComputationResultType(CompResultType) {
3083 "Only should be used for compound assignments");
3100 return S->getStmtClass() == CompoundAssignOperatorClass;
3113 bool TD,
bool VD,
bool ID,
3114 bool ContainsUnexpandedParameterPack,
3117 :
Expr(SC, T, VK, OK, TD, VD, ID, ContainsUnexpandedParameterPack),
3118 QuestionLoc(qloc),
ColonLoc(cloc) {}
3121 :
Expr(SC, Empty) { }
3141 return T->getStmtClass() == ConditionalOperatorClass ||
3142 T->getStmtClass() == BinaryConditionalOperatorClass;
3149 enum { COND, LHS, RHS, END_EXPR };
3150 Stmt* SubExprs[END_EXPR];
3171 SubExprs[COND] = cond;
3172 SubExprs[LHS] = lhs;
3173 SubExprs[RHS] = rhs;
3197 return getCond()->getLocStart();
3200 return getRHS()->getLocEnd();
3204 return T->getStmtClass() == ConditionalOperatorClass;
3209 return child_range(&SubExprs[0], &SubExprs[0]+END_EXPR);
3219 enum { COMMON, COND, LHS, RHS, NUM_SUBEXPRS };
3226 Stmt *SubExprs[NUM_SUBEXPRS];
3243 OpaqueValue(opaqueValue) {
3244 SubExprs[COMMON] = common;
3245 SubExprs[COND] = cond;
3246 SubExprs[LHS] = lhs;
3247 SubExprs[RHS] = rhs;
3248 assert(OpaqueValue->
getSourceExpr() == common &&
"Wrong opaque value");
3271 return cast<Expr>(SubExprs[LHS]);
3278 return cast<Expr>(SubExprs[RHS]);
3289 return T->getStmtClass() == BinaryConditionalOperatorClass;
3294 return child_range(SubExprs, SubExprs + NUM_SUBEXPRS);
3300 return co->getCond();
3301 return cast<BinaryConditionalOperator>(
this)->
getCond();
3306 return co->getTrueExpr();
3307 return cast<BinaryConditionalOperator>(
this)->
getTrueExpr();
3312 return co->getFalseExpr();
3313 return cast<BinaryConditionalOperator>(
this)->
getFalseExpr();
3325 AmpAmpLoc(AALoc), LabelLoc(LLoc), Label(L) {}
3329 :
Expr(AddrLabelExprClass, Empty) { }
3343 return T->getStmtClass() == AddrLabelExprClass;
3348 return child_range(child_iterator(), child_iterator());
3369 SubStmt(substmt), LParenLoc(lp), RParenLoc(rp) { }
3387 return T->getStmtClass() == StmtExprClass;
3391 child_range
children() {
return child_range(&SubStmt, &SubStmt+1); }
3416 :
Expr(ShuffleVectorExprClass, Empty), SubExprs(nullptr) { }
3428 return T->getStmtClass() == ShuffleVectorExprClass;
3441 assert((Index < NumExprs) &&
"Arg access out of range!");
3442 return cast<Expr>(SubExprs[Index]);
3445 assert((Index < NumExprs) &&
"Arg access out of range!");
3446 return cast<Expr>(SubExprs[Index]);
3452 assert((N < NumExprs - 2) &&
"Shuffle idx out of range!");
3458 return child_range(&SubExprs[0], &SubExprs[0]+NumExprs);
3479 :
Expr(ConvertVectorExprClass, DstType, VK, OK,
3480 DstType->isDependentType(),
3482 (DstType->isInstantiationDependentType() ||
3486 SrcExpr(SrcExpr), TInfo(TI), BuiltinLoc(BuiltinLoc), RParenLoc(RParenLoc) {}
3509 return T->getStmtClass() == ConvertVectorExprClass;
3513 child_range
children() {
return child_range(&SrcExpr, &SrcExpr+1); }
3526 enum { COND, LHS, RHS, END_EXPR };
3527 Stmt* SubExprs[END_EXPR];
3534 bool TypeDependent,
bool ValueDependent)
3535 :
Expr(ChooseExprClass, t, VK, OK, TypeDependent, ValueDependent,
3542 BuiltinLoc(BLoc), RParenLoc(RP), CondIsTrue(condIsTrue) {
3543 SubExprs[COND] = cond;
3544 SubExprs[LHS] = lhs;
3545 SubExprs[RHS] = rhs;
3555 "Dependent condition isn't true or false");
3587 return T->getStmtClass() == ChooseExprClass;
3592 return child_range(&SubExprs[0], &SubExprs[0]+END_EXPR);
3623 return T->getStmtClass() == GNUNullExprClass;
3628 return child_range(child_iterator(), child_iterator());
3635 llvm::PointerIntPair<TypeSourceInfo *, 1, bool> TInfo;
3641 false, (TInfo->
getType()->isInstantiationDependentType() ||
3645 Val(e), TInfo(TInfo, IsMS), BuiltinLoc(BLoc), RParenLoc(RPLoc) {}
3649 :
Expr(VAArgExprClass, Empty), Val(nullptr), TInfo(nullptr,
false) {}
3672 return T->getStmtClass() == VAArgExprClass;
3676 child_range
children() {
return child_range(&Val, &Val+1); }
3735 llvm::PointerIntPair<InitListExpr *, 1, bool> AltForm;
3744 llvm::PointerUnion<Expr *, FieldDecl *> ArrayFillerOrUnionFieldInit;
3752 :
Expr(InitListExprClass, Empty) { }
3764 assert(Init <
getNumInits() &&
"Initializer access out of range!");
3765 return cast_or_null<Expr>(InitExprs[Init]);
3769 assert(Init <
getNumInits() &&
"Initializer access out of range!");
3770 return cast_or_null<Expr>(InitExprs[Init]);
3774 assert(Init <
getNumInits() &&
"Initializer access out of range!");
3775 InitExprs[Init] =
expr;
3781 ExprBits.ContainsUnexpandedParameterPack |=
3810 return ArrayFillerOrUnionFieldInit.dyn_cast<
Expr *>();
3828 return ArrayFillerOrUnionFieldInit.dyn_cast<
FieldDecl *>();
3834 assert((FD ==
nullptr
3837 &&
"Only one field of a union may be initialized at a time!");
3838 ArrayFillerOrUnionFieldInit = FD;
3865 AltForm.setPointer(Init);
3866 AltForm.setInt(
true);
3867 Init->AltForm.setPointer(
this);
3868 Init->AltForm.setInt(
false);
3872 return InitListExprBits.HadArrayRangeDesignator != 0;
3875 InitListExprBits.HadArrayRangeDesignator = ARD;
3882 return T->getStmtClass() == InitListExprClass;
3888 if (InitExprs.
empty())
3889 return child_range(child_iterator(), child_iterator());
3890 return child_range(&InitExprs[0], &InitExprs[0] + InitExprs.
size());
3948 unsigned NumDesignators : 15;
3953 unsigned NumSubExprs : 16;
3966 :
Expr(DesignatedInitExprClass, EmptyShell()),
3967 NumDesignators(0), NumSubExprs(NumSubExprs), Designators(
nullptr) { }
4012 ArrayRangeDesignator
4038 :
Kind(ArrayDesignator) {
4048 :
Kind(ArrayRangeDesignator) {
4085 assert((
Kind == ArrayDesignator ||
Kind == ArrayRangeDesignator) &&
4086 "Only valid on an array or array-range designator");
4091 assert((
Kind == ArrayDesignator ||
Kind == ArrayRangeDesignator) &&
4092 "Only valid on an array or array-range designator");
4097 assert(
Kind == ArrayRangeDesignator &&
4098 "Only valid on an array-range designator");
4103 assert((
Kind == ArrayDesignator ||
Kind == ArrayRangeDesignator) &&
4104 "Only valid on an array or array-range designator");
4124 unsigned NumDesignators,
4127 bool GNUSyntax,
Expr *Init);
4130 unsigned NumIndexExprs);
4133 unsigned size()
const {
return NumDesignators; }
4139 return Designators + NumDesignators;
4145 return Designators + NumDesignators;
4153 typedef llvm::iterator_range<const_designators_iterator>
4159 typedef std::reverse_iterator<designators_iterator>
4168 typedef std::reverse_iterator<const_designators_iterator>
4180 unsigned NumDesigs);
4202 *child_begin() = init;
4212 assert(Idx < NumSubExprs &&
"Subscript out of range");
4213 return cast<Expr>(getTrailingObjects<Stmt *>()[Idx]);
4217 assert(Idx < NumSubExprs &&
"Subscript out of range");
4218 getTrailingObjects<Stmt *>()[Idx] = E;
4232 return T->getStmtClass() == DesignatedInitExprClass;
4237 Stmt **
begin = getTrailingObjects<Stmt *>();
4238 return child_range(begin, begin + NumSubExprs);
4260 :
Expr(NoInitExprClass, Empty) { }
4263 return T->getStmtClass() == NoInitExprClass;
4271 return child_range(child_iterator(), child_iterator());
4289 Stmt *BaseAndUpdaterExprs[2];
4296 :
Expr(DesignatedInitUpdateExprClass, Empty) { }
4302 return T->getStmtClass() == DesignatedInitUpdateExprClass;
4309 return cast<InitListExpr>(BaseAndUpdaterExprs[1]);
4316 return child_range(&BaseAndUpdaterExprs[0], &BaseAndUpdaterExprs[0] + 2);
4336 :
Expr(ImplicitValueInitExprClass, Empty) { }
4339 return T->getStmtClass() == ImplicitValueInitExprClass;
4347 return child_range(child_iterator(), child_iterator());
4366 assert(Init <
getNumExprs() &&
"Initializer access out of range!");
4367 return cast_or_null<Expr>(Exprs[Init]);
4371 assert(Init <
getNumExprs() &&
"Initializer access out of range!");
4372 return cast_or_null<Expr>(Exprs[Init]);
4388 return T->getStmtClass() == ParenListExprClass;
4393 return child_range(&Exprs[0], &Exprs[0]+NumExprs);
4427 enum { CONTROLLING, END_EXPR };
4430 unsigned NumAssocs, ResultIndex;
4439 bool ContainsUnexpandedParameterPack,
4440 unsigned ResultIndex);
4448 bool ContainsUnexpandedParameterPack);
4451 :
Expr(GenericSelectionExprClass, Empty) { }
4460 return cast<Expr>(SubExprs[END_EXPR+i]);
4465 return AssocTypes[i];
4471 return TS->getType();
4477 return cast<Expr>(SubExprs[CONTROLLING]);
4501 return T->getStmtClass() == GenericSelectionExprClass;
4505 return child_range(SubExprs, SubExprs+END_EXPR+NumAssocs);
4529 :
Expr(ExtVectorElementExprClass, ty, VK,
4534 Base(base), Accessor(&accessor), AccessorLoc(loc) {}
4538 :
Expr(ExtVectorElementExprClass, Empty) { }
4562 return getBase()->getLocStart();
4571 return T->getStmtClass() == ExtVectorElementExprClass;
4586 ty->isDependentType(), ty->isDependentType(),
4587 ty->isInstantiationDependentType() || BD->isDependentContext(),
4610 return T->getStmtClass() == BlockExprClass;
4615 return child_range(child_iterator(), child_iterator());
4629 explicit AsTypeExpr(EmptyShell Empty) :
Expr(AsTypeExprClass, Empty) {}
4635 :
Expr(AsTypeExprClass, DstType, VK, OK,
4636 DstType->isDependentType(),
4638 (DstType->isInstantiationDependentType() ||
4642 SrcExpr(SrcExpr), BuiltinLoc(BuiltinLoc), RParenLoc(RParenLoc) {}
4657 return T->getStmtClass() == AsTypeExprClass;
4661 child_range
children() {
return child_range(&SrcExpr, &SrcExpr+1); }
4706 Expr **getSubExprsBuffer() {
return getTrailingObjects<Expr *>(); }
4707 const Expr *
const *getSubExprsBuffer()
const {
4708 return getTrailingObjects<Expr *>();
4713 unsigned resultIndex);
4717 unsigned getNumSubExprs()
const {
4718 return PseudoObjectExprBits.NumSubExprs;
4728 unsigned resultIndex);
4731 unsigned numSemanticExprs);
4742 if (PseudoObjectExprBits.ResultIndex == 0)
return NoResult;
4743 return PseudoObjectExprBits.ResultIndex - 1;
4748 if (PseudoObjectExprBits.ResultIndex == 0)
4750 return getSubExprsBuffer()[PseudoObjectExprBits.ResultIndex];
4761 return getSubExprsBuffer() + 1;
4764 return getSubExprsBuffer() + 1;
4767 return getSubExprsBuffer() + getNumSubExprs();
4770 return getSubExprsBuffer() + getNumSubExprs();
4776 llvm::iterator_range<const_semantics_iterator>
semantics()
const {
4781 assert(index + 1 < getNumSubExprs());
4782 return getSubExprsBuffer()[index + 1];
4800 Stmt **cs =
reinterpret_cast<Stmt**
>(getSubExprsBuffer());
4801 return child_range(cs, cs + getNumSubExprs());
4805 return T->getStmtClass() == PseudoObjectExprClass;
4820 #define BUILTIN(ID, TYPE, ATTRS)
4821 #define ATOMIC_BUILTIN(ID, TYPE, ATTRS) AO ## ID,
4822 #include "clang/Basic/Builtins.def"
4838 enum { PTR, ORDER, VAL1, ORDER_FAIL, VAL2, WEAK, END_EXPR };
4839 Stmt* SubExprs[END_EXPR];
4840 unsigned NumSubExprs;
4841 SourceLocation BuiltinLoc, RParenLoc;
4858 return cast<Expr>(SubExprs[
PTR]);
4861 return cast<Expr>(SubExprs[ORDER]);
4864 if (Op == AO__c11_atomic_init)
4865 return cast<Expr>(SubExprs[ORDER]);
4866 assert(NumSubExprs > VAL1);
4867 return cast<Expr>(SubExprs[VAL1]);
4870 assert(NumSubExprs > ORDER_FAIL);
4871 return cast<Expr>(SubExprs[ORDER_FAIL]);
4874 if (Op == AO__atomic_exchange)
4875 return cast<Expr>(SubExprs[ORDER_FAIL]);
4876 assert(NumSubExprs > VAL2);
4877 return cast<Expr>(SubExprs[VAL2]);
4880 assert(NumSubExprs > WEAK);
4881 return cast<Expr>(SubExprs[WEAK]);
4894 return getOp() == AO__c11_atomic_compare_exchange_strong ||
4895 getOp() == AO__c11_atomic_compare_exchange_weak ||
4896 getOp() == AO__atomic_compare_exchange ||
4897 getOp() == AO__atomic_compare_exchange_n;
4907 return T->getStmtClass() == AtomicExprClass;
4912 return child_range(SubExprs, SubExprs+NumSubExprs);
4926 assert(T->
isDependentType() &&
"TypoExpr given a non-dependent type");
4930 return child_range(child_iterator(), child_iterator());
4936 return T->getStmtClass() == TypoExprClass;
4942 #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.
reverse_designators_iterator designators_rbegin()
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
Decl - This represents one declaration (or definition), e.g.
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
The l-value was an access to a declared entity or something equivalently strong, like the address of ...
A container of type source information.
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.
enum clang::SubobjectAdjustment::@37 Kind
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)
reverse_designators_iterator designators_rend()
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.
static DesignatedInitExpr * Create(const ASTContext &C, Designator *Designators, unsigned NumDesignators, ArrayRef< Expr * > IndexExprs, SourceLocation EqualOrColonLoc, bool GNUSyntax, Expr *Init)
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)
designators_range designators()
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
CallExpr(const ASTContext &C, StmtClass SC, Expr *fn, unsigned NumPreArgs, ArrayRef< Expr * > args, QualType t, ExprValueKind VK, SourceLocation rparenloc)
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
llvm::iterator_range< const_designators_iterator > designators_const_range
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)
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)
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.
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
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.
llvm::iterator_range< designators_iterator > designators_range
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.
ID
Defines the set of possible language-specific address spaces.
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)
designators_iterator designators_begin()
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...
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.
const_reverse_designators_iterator designators_rbegin() const
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
const_designators_iterator designators_end() 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
std::reverse_iterator< designators_iterator > reverse_designators_iterator
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
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)
const Designator * const_designators_iterator
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
designators_const_range designators() const
SourceLocation getLocStart() const LLVM_READONLY
pointer data()
data - Return a pointer to the vector's buffer, even if empty().
ASTContext & getASTContext() const LLVM_READONLY
static bool isPlaceholderTypeKind(Kind K)
Determines whether the given kind corresponds to a placeholder type.
bool refersToEnclosingVariableOrCapture() const
Does this DeclRefExpr refer to an enclosing local or a captured variable?
static bool classof(const Stmt *T)
LabelDecl - Represents the declaration of a label.
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
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.
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)
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;}).
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
const_designators_iterator designators_begin() const
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)
const_reverse_designators_iterator designators_rend() const
designators_iterator designators_end()
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)
std::reverse_iterator< const_designators_iterator > const_reverse_designators_iterator
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...
Designator * designators_iterator
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'.
unsigned getNumSubExprs()
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