14 #ifndef LLVM_CLANG_AST_EXPR_H 15 #define LLVM_CLANG_AST_EXPR_H 29 #include "llvm/ADT/APFloat.h" 30 #include "llvm/ADT/APSInt.h" 31 #include "llvm/ADT/SmallVector.h" 32 #include "llvm/ADT/StringRef.h" 33 #include "llvm/Support/AtomicOrdering.h" 34 #include "llvm/Support/Compiler.h" 35 #include "llvm/Support/TrailingObjects.h" 41 class CXXBaseSpecifier;
42 class CXXMemberCallExpr;
43 class CXXOperatorCallExpr;
47 class MaterializeTemporaryExpr;
49 class ObjCPropertyRefExpr;
50 class OpaqueValueExpr;
111 bool TD,
bool VD,
bool ID,
bool ContainsUnexpandedParameterPack)
114 ExprBits.TypeDependent = TD;
115 ExprBits.ValueDependent = VD;
116 ExprBits.InstantiationDependent =
ID;
117 ExprBits.ValueKind = VK;
118 ExprBits.ObjectKind = OK;
119 assert(ExprBits.ObjectKind == OK &&
"truncated kind");
120 ExprBits.ContainsUnexpandedParameterPack = ContainsUnexpandedParameterPack;
137 "Expressions can't have reference type");
153 ExprBits.ValueDependent = VD;
171 ExprBits.TypeDependent = TD;
192 return ExprBits.InstantiationDependent;
197 ExprBits.InstantiationDependent =
ID;
215 return ExprBits.ContainsUnexpandedParameterPack;
221 ExprBits.ContainsUnexpandedParameterPack = PP;
338 unsigned short Modifiable;
341 : Kind(k), Modifiable(m)
349 assert(Modifiable != CM_Untested &&
"Did not test for modifiability.");
352 bool isLValue()
const {
return Kind == CL_LValue; }
353 bool isXValue()
const {
return Kind == CL_XValue; }
356 bool isRValue()
const {
return Kind >= CL_XValue; }
378 return ClassifyImpl(Ctx,
nullptr);
390 return ClassifyImpl(Ctx, &Loc);
397 return (isa<LValueReferenceType>(RT)
399 : (RT->getPointeeType()->isFunctionType()
449 return const_cast<Expr*
>(
this)->getSourceBitField();
452 Decl *getReferencedDeclOfCallee();
454 return const_cast<Expr*
>(
this)->getReferencedDeclOfCallee();
462 bool isObjCSelfExpr()
const;
465 bool refersToVectorElement()
const;
469 bool refersToGlobalRegisterVar()
const;
473 return getType()->isPlaceholderType();
479 if (
const BuiltinType *BT = dyn_cast<BuiltinType>(getType()))
480 return BT->getKind() == K;
488 bool isKnownToHaveBooleanValue()
const;
499 bool isEvaluated =
true)
const;
500 bool isIntegerConstantExpr(
const ASTContext &Ctx,
505 bool isCXX98IntegralConstantExpr(
const ASTContext &Ctx)
const;
519 static bool isPotentialConstantExpr(
const FunctionDecl *FD,
528 static bool isPotentialConstantExprUnevaluated(
Expr *E,
537 bool isConstantInitializer(
ASTContext &Ctx,
bool ForRef,
538 const Expr **Culprit =
nullptr)
const;
561 : HasSideEffects(
false), HasUndefinedBehavior(
false), Diag(nullptr) {}
566 return HasSideEffects;
577 bool isGlobalLValue()
const;
587 bool InConstantContext =
false)
const;
597 SE_AllowUndefinedBehavior,
611 EvaluateAsFloat(llvm::APFloat &Result,
const ASTContext &Ctx,
627 bool IncludePossibleEffects =
true)
const;
631 bool hasNonTrivialCall(
const ASTContext &Ctx)
const;
636 llvm::APSInt EvaluateKnownConstInt(
640 llvm::APSInt EvaluateKnownConstIntCheckOverflow(
644 void EvaluateForOverflow(
const ASTContext &Ctx)
const;
665 const Expr *This =
nullptr)
const;
681 bool tryEvaluateObjectSize(uint64_t &Result,
ASTContext &Ctx,
682 unsigned Type)
const;
711 NPC_NeverValueDependent = 0,
719 NPC_ValueDependentIsNotNull
731 bool isOBJCGCCandidate(
ASTContext &Ctx)
const;
734 bool isBoundMemberFunction(
ASTContext &Ctx)
const;
743 Expr *IgnoreImpCasts() LLVM_READONLY;
747 Expr *IgnoreImplicit() LLVM_READONLY {
752 return const_cast<Expr*
>(
this)->IgnoreImplicit();
759 Expr *IgnoreParens() LLVM_READONLY;
763 Expr *IgnoreParenCasts() LLVM_READONLY;
766 Expr *IgnoreCasts() LLVM_READONLY;
770 Expr *IgnoreParenImpCasts() LLVM_READONLY;
774 Expr *IgnoreConversionOperator() LLVM_READONLY;
777 return const_cast<Expr*
>(
this)->IgnoreConversionOperator();
781 return const_cast<Expr*
>(
this)->IgnoreParenImpCasts();
786 Expr *IgnoreParenLValueCasts() LLVM_READONLY;
789 return const_cast<Expr*
>(
this)->IgnoreParenLValueCasts();
798 Expr *ignoreParenBaseCasts() LLVM_READONLY;
801 return const_cast<Expr*
>(
this)->ignoreParenBaseCasts();
811 bool isDefaultArgument()
const;
818 bool isImplicitCXXThis()
const;
821 return const_cast<Expr*
>(
this)->IgnoreImpCasts();
824 return const_cast<Expr*
>(
this)->IgnoreParens();
827 return const_cast<Expr*
>(
this)->IgnoreParenCasts();
831 return const_cast<Expr*
>(
this)->IgnoreCasts();
835 return const_cast<Expr*
>(
this)->IgnoreParenNoopCasts(Ctx);
852 const Expr *getBestDynamicClassTypeExpr()
const;
857 const Expr *skipRValueSubobjectAdjustments(
863 return skipRValueSubobjectAdjustments(CommaLHSs, Adjustments);
882 :
Expr(SC, subexpr->getType(),
883 subexpr->getValueKind(), subexpr->getObjectKind(),
884 subexpr->isTypeDependent(), subexpr->isValueDependent(),
885 subexpr->isInstantiationDependent(),
886 subexpr->containsUnexpandedParameterPack()), SubExpr(subexpr) {}
906 :
FullExpr(ConstantExprClass, subexpr) {}
910 assert(!isa<ConstantExpr>(E));
916 :
FullExpr(ConstantExprClass, Empty) {}
919 return SubExpr->getBeginLoc();
922 return SubExpr->getEndLoc();
952 Expr *SourceExpr =
nullptr)
953 :
Expr(OpaqueValueExprClass, T, VK, OK,
954 T->isDependentType() ||
955 (SourceExpr && SourceExpr->isTypeDependent()),
956 T->isDependentType() ||
957 (SourceExpr && SourceExpr->isValueDependent()),
958 T->isInstantiationDependentType() ||
959 (SourceExpr && SourceExpr->isInstantiationDependent()),
961 SourceExpr(SourceExpr) {
963 OpaqueValueExprBits.Loc = Loc;
972 :
Expr(OpaqueValueExprClass, Empty) {}
978 return SourceExpr ? SourceExpr->
getBeginLoc() : getLocation();
981 return SourceExpr ? SourceExpr->
getEndLoc() : getLocation();
984 return SourceExpr ? SourceExpr->
getExprLoc() : getLocation();
1006 assert((!V || SourceExpr) &&
1007 "unique OVEs are expected to have source expressions");
1008 OpaqueValueExprBits.IsUnique = V;
1011 bool isUnique()
const {
return OpaqueValueExprBits.IsUnique; }
1044 NamedDecl *, ASTTemplateKWAndArgsInfo,
1045 TemplateArgumentLoc> {
1057 size_t numTrailingObjects(OverloadToken<NestedNameSpecifierLoc>)
const {
1058 return hasQualifier();
1061 size_t numTrailingObjects(OverloadToken<NamedDecl *>)
const {
1062 return hasFoundDecl();
1065 size_t numTrailingObjects(OverloadToken<ASTTemplateKWAndArgsInfo>)
const {
1066 return hasTemplateKWAndArgsInfo();
1071 bool hasFoundDecl()
const {
return DeclRefExprBits.HasFoundDecl; }
1075 bool RefersToEnlosingVariableOrCapture,
1085 void computeDependence(
const ASTContext &Ctx);
1089 bool RefersToEnclosingVariableOrCapture,
QualType T,
1103 bool RefersToEnclosingVariableOrCapture,
1111 bool HasTemplateKWAndArgsInfo,
1112 unsigned NumTemplateArgs);
1134 if (!hasQualifier())
1136 return *getTrailingObjects<NestedNameSpecifierLoc>();
1142 return getQualifierLoc().getNestedNameSpecifier();
1152 return hasFoundDecl() ? *getTrailingObjects<NamedDecl *>() : D;
1158 return hasFoundDecl() ? *getTrailingObjects<NamedDecl *>() : D;
1162 return DeclRefExprBits.HasTemplateKWAndArgsInfo;
1168 if (!hasTemplateKWAndArgsInfo())
1170 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->TemplateKWLoc;
1176 if (!hasTemplateKWAndArgsInfo())
1178 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->LAngleLoc;
1184 if (!hasTemplateKWAndArgsInfo())
1186 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->RAngleLoc;
1200 if (hasExplicitTemplateArgs())
1201 getTrailingObjects<ASTTemplateKWAndArgsInfo>()->copyInto(
1202 getTrailingObjects<TemplateArgumentLoc>(), List);
1208 if (!hasExplicitTemplateArgs())
1210 return getTrailingObjects<TemplateArgumentLoc>();
1216 if (!hasExplicitTemplateArgs())
1218 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->NumTemplateArgs;
1222 return {getTemplateArgs(), getNumTemplateArgs()};
1228 return DeclRefExprBits.HadMultipleCandidates;
1234 DeclRefExprBits.HadMultipleCandidates = V;
1240 return DeclRefExprBits.RefersToEnclosingVariableOrCapture;
1272 bool hasAllocation()
const {
return llvm::APInt::getNumWords(BitWidth) > 1; }
1281 unsigned NumWords = llvm::APInt::getNumWords(BitWidth);
1283 return llvm::APInt(BitWidth, NumWords, pVal);
1285 return llvm::APInt(BitWidth, VAL);
1287 void setIntValue(
const ASTContext &
C,
const llvm::APInt &Val);
1294 setIntValue(C, Val);
1300 llvm::APFloat
getValue(
const llvm::fltSemantics &Semantics)
const {
1301 return llvm::APFloat(Semantics, getIntValue());
1304 setIntValue(C, Val.bitcastToAPInt());
1313 :
Expr(IntegerLiteralClass, Empty) { }
1357 :
Expr(FixedPointLiteralClass, Empty) {}
1365 const llvm::APInt &V,
1381 std::string getValueAsString(
unsigned Radix)
const;
1411 Value(value), Loc(l) {
1412 CharacterLiteralBits.Kind =
kind;
1420 return static_cast<CharacterKind>(CharacterLiteralBits.Kind);
1463 assert(&getSemantics() == &Val.getSemantics() &&
"Inconsistent semantics");
1476 FloatingLiteralBits.Semantics = Sem;
1480 const llvm::fltSemantics &getSemantics()
const;
1483 void setSemantics(
const llvm::fltSemantics &Sem);
1485 bool isExact()
const {
return FloatingLiteralBits.IsExact; }
1486 void setExact(
bool E) { FloatingLiteralBits.IsExact = E; }
1491 double getValueAsApproximateDouble()
const;
1527 :
Expr(ImaginaryLiteralClass, Empty) { }
1591 unsigned numTrailingObjects(OverloadToken<unsigned>)
const {
return 1; }
1592 unsigned numTrailingObjects(OverloadToken<SourceLocation>)
const {
1593 return getNumConcatenated();
1596 unsigned numTrailingObjects(OverloadToken<char>)
const {
1597 return getByteLength();
1600 char *getStrDataAsChar() {
return getTrailingObjects<char>(); }
1601 const char *getStrDataAsChar()
const {
return getTrailingObjects<char>(); }
1603 const uint16_t *getStrDataAsUInt16()
const {
1604 return reinterpret_cast<const uint16_t *
>(getTrailingObjects<char>());
1607 const uint32_t *getStrDataAsUInt32()
const {
1608 return reinterpret_cast<const uint32_t *
>(getTrailingObjects<char>());
1614 unsigned NumConcatenated);
1618 unsigned CharByteWidth);
1625 assert(TokNum < getNumConcatenated() &&
"Invalid tok number");
1626 getTrailingObjects<SourceLocation>()[TokNum] = L;
1635 unsigned NumConcatenated);
1641 return Create(Ctx, Str, Kind, Pascal, Ty, &Loc, 1);
1646 unsigned NumConcatenated,
unsigned Length,
1647 unsigned CharByteWidth);
1650 assert(getCharByteWidth() == 1 &&
1651 "This function is used in places that assume strings use char");
1652 return StringRef(getStrDataAsChar(), getByteLength());
1659 return StringRef(getStrDataAsChar(), getByteLength());
1662 void outputString(raw_ostream &OS)
const;
1665 assert(i < getLength() &&
"out of bounds access");
1666 switch (getCharByteWidth()) {
1668 return static_cast<unsigned char>(getStrDataAsChar()[i]);
1670 return getStrDataAsUInt16()[i];
1672 return getStrDataAsUInt32()[i];
1674 llvm_unreachable(
"Unsupported character width!");
1678 unsigned getLength()
const {
return *getTrailingObjects<unsigned>(); }
1682 return static_cast<StringKind>(StringLiteralBits.Kind);
1690 bool isPascal()
const {
return StringLiteralBits.IsPascal; }
1693 for (
auto c : getString())
1700 for (
auto c : getString())
1709 return StringLiteralBits.NumConcatenated;
1714 assert(TokNum < getNumConcatenated() &&
"Invalid tok number");
1715 return getTrailingObjects<SourceLocation>()[TokNum];
1728 unsigned *StartToken =
nullptr,
1729 unsigned *StartTokenByteOffset =
nullptr)
const;
1734 return getTrailingObjects<SourceLocation>();
1738 return getTrailingObjects<SourceLocation>() + getNumConcatenated();
1779 PrettyFunctionNoVirtual
1789 bool hasFunctionName()
const {
return PredefinedExprBits.HasFunctionName; }
1792 assert(hasFunctionName() &&
1793 "This PredefinedExpr has no storage for a function name!");
1794 *getTrailingObjects<Stmt *>() = SL;
1804 bool HasFunctionName);
1807 return static_cast<IdentKind>(PredefinedExprBits.Kind);
1814 return hasFunctionName()
1815 ?
static_cast<StringLiteral *
>(*getTrailingObjects<Stmt *>())
1820 return hasFunctionName()
1821 ?
static_cast<StringLiteral *
>(*getTrailingObjects<Stmt *>())
1825 static StringRef getIdentKindName(
IdentKind IK);
1826 static std::string ComputeName(
IdentKind IK,
const Decl *CurrentDecl);
1838 getTrailingObjects<Stmt *>() + hasFunctionName());
1849 :
Expr(ParenExprClass, val->getType(),
1850 val->getValueKind(), val->getObjectKind(),
1851 val->isTypeDependent(), val->isValueDependent(),
1852 val->isInstantiationDependent(),
1853 val->containsUnexpandedParameterPack()),
1854 L(l), R(r), Val(val) {}
1858 :
Expr(ParenExprClass, Empty) { }
1904 :
Expr(UnaryOperatorClass, type, VK, OK,
1905 input->isTypeDependent() || type->isDependentType(),
1906 input->isValueDependent(),
1907 (input->isInstantiationDependent() ||
1908 type->isInstantiationDependentType()),
1909 input->containsUnexpandedParameterPack()),
1911 UnaryOperatorBits.Opc = opc;
1912 UnaryOperatorBits.CanOverflow = CanOverflow;
1913 UnaryOperatorBits.Loc = l;
1918 UnaryOperatorBits.Opc = UO_AddrOf;
1922 return static_cast<Opcode
>(UnaryOperatorBits.Opc);
1944 return Op == UO_PostInc || Op == UO_PostDec;
1949 return Op == UO_PreInc || Op == UO_PreDec;
1956 return Op == UO_PreInc || Op == UO_PostInc;
1963 return Op == UO_PreDec || Op == UO_PostDec;
1971 return isIncrementDecrementOp(
getOpcode());
1975 return Op >= UO_Plus && Op <= UO_LNot;
1981 static StringRef getOpcodeStr(Opcode Op);
1992 return isPostfix() ? Val->
getBeginLoc() : getOperatorLoc();
1995 return isPostfix() ? getOperatorLoc() : Val->
getEndLoc();
2029 enum { MaskBits = 2, Mask = 0x03 };
2049 : Range(LBracketLoc, RBracketLoc), Data((Index << 2) | Array) {}
2053 : Range(DotLoc.isValid() ? DotLoc : NameLoc, NameLoc),
2059 : Range(DotLoc.isValid() ? DotLoc : NameLoc, NameLoc),
2128 size_t numTrailingObjects(OverloadToken<OffsetOfNode>)
const {
2137 explicit OffsetOfExpr(
unsigned numComps,
unsigned numExprs)
2139 TSInfo(
nullptr), NumComps(numComps), NumExprs(numExprs) {}
2149 unsigned NumComps,
unsigned NumExprs);
2167 assert(Idx < NumComps &&
"Subscript out of range");
2168 return getTrailingObjects<OffsetOfNode>()[Idx];
2172 assert(Idx < NumComps &&
"Subscript out of range");
2173 getTrailingObjects<OffsetOfNode>()[Idx] = ON;
2181 assert(Idx < NumExprs &&
"Subscript out of range");
2182 return getTrailingObjects<Expr *>()[Idx];
2186 assert(Idx < NumExprs &&
"Subscript out of range");
2187 return getTrailingObjects<Expr *>()[Idx];
2191 assert(Idx < NumComps &&
"Subscript out of range");
2192 getTrailingObjects<Expr *>()[Idx] = E;
2208 Stmt **begin =
reinterpret_cast<Stmt **
>(getTrailingObjects<Expr *>());
2212 Stmt *
const *begin =
2213 reinterpret_cast<Stmt *
const *
>(getTrailingObjects<Expr *>());
2236 TInfo->getType()->isDependentType(),
2237 TInfo->getType()->isInstantiationDependentType(),
2238 TInfo->getType()->containsUnexpandedParameterPack()),
2239 OpLoc(op), RParenLoc(rp) {
2240 UnaryExprOrTypeTraitExprBits.Kind = ExprKind;
2241 UnaryExprOrTypeTraitExprBits.IsType =
true;
2242 Argument.Ty = TInfo;
2251 :
Expr(UnaryExprOrTypeTraitExprClass, Empty) { }
2260 return getArgumentTypeInfo()->getType();
2263 assert(isArgumentType() &&
"calling getArgumentType() when arg is expr");
2267 assert(!isArgumentType() &&
"calling getArgumentExpr() when arg is type");
2268 return static_cast<Expr*
>(Argument.Ex);
2276 UnaryExprOrTypeTraitExprBits.IsType =
false;
2279 Argument.Ty = TInfo;
2280 UnaryExprOrTypeTraitExprBits.IsType =
true;
2286 return isArgumentType() ? getArgumentType() : getArgumentExpr()->getType();
2299 return T->
getStmtClass() == UnaryExprOrTypeTraitExprClass;
2313 enum { LHS, RHS, END_EXPR };
2314 Stmt *SubExprs[END_EXPR];
2316 bool lhsIsBase()
const {
return getRHS()->getType()->isIntegerType(); }
2322 :
Expr(ArraySubscriptExprClass, t, VK, OK,
2323 lhs->isTypeDependent() || rhs->isTypeDependent(),
2324 lhs->isValueDependent() || rhs->isValueDependent(),
2325 (lhs->isInstantiationDependent() ||
2326 rhs->isInstantiationDependent()),
2327 (lhs->containsUnexpandedParameterPack() ||
2328 rhs->containsUnexpandedParameterPack())) {
2329 SubExprs[LHS] = lhs;
2330 SubExprs[RHS] = rhs;
2331 ArraySubscriptExprBits.RBracketLoc = rbracketloc;
2336 :
Expr(ArraySubscriptExprClass, Shell) { }
2356 const Expr *
getBase()
const {
return lhsIsBase() ? getLHS() : getRHS(); }
2359 const Expr *
getIdx()
const {
return lhsIsBase() ? getRHS() : getLHS(); }
2362 return getLHS()->getBeginLoc();
2367 return ArraySubscriptExprBits.RBracketLoc;
2370 ArraySubscriptExprBits.RBracketLoc = L;
2374 return getBase()->getExprLoc();
2383 return child_range(&SubExprs[0], &SubExprs[0]+END_EXPR);
2397 enum { FN = 0, PREARGS_START = 1 };
2406 void updateDependenciesFromArg(
Expr *Arg);
2430 Stmt **getTrailingStmts() {
2431 return reinterpret_cast<Stmt **
>(
reinterpret_cast<char *
>(
this) +
2432 CallExprBits.OffsetToTrailingObjects);
2434 Stmt *
const *getTrailingStmts()
const {
2435 return const_cast<CallExpr *
>(
this)->getTrailingStmts();
2440 static unsigned offsetToTrailingObjects(
StmtClass SC);
2461 return (1 + NumPreArgs + NumArgs) *
sizeof(
Stmt *);
2465 assert(I < getNumPreArgs() &&
"Prearg access out of range!");
2466 return getTrailingStmts()[PREARGS_START + I];
2469 assert(I < getNumPreArgs() &&
"Prearg access out of range!");
2470 return getTrailingStmts()[PREARGS_START + I];
2473 assert(I < getNumPreArgs() &&
"Prearg access out of range!");
2474 getTrailingStmts()[PREARGS_START + I] = PreArg;
2519 return static_cast<ADLCallKind>(CallExprBits.UsesADL);
2522 CallExprBits.UsesADL =
static_cast<bool>(V);
2524 bool usesADL()
const {
return getADLCallKind() == UsesADL; }
2528 return getCallee()->getReferencedDeclOfCallee();
2533 return dyn_cast_or_null<FunctionDecl>(getCalleeDecl());
2536 return dyn_cast_or_null<FunctionDecl>(getCalleeDecl());
2544 return reinterpret_cast<Expr **
>(getTrailingStmts() + PREARGS_START +
2548 return reinterpret_cast<const Expr *
const *
>(
2549 getTrailingStmts() + PREARGS_START + getNumPreArgs());
2554 assert(Arg < getNumArgs() &&
"Arg access out of range!");
2555 return getArgs()[Arg];
2558 assert(Arg < getNumArgs() &&
"Arg access out of range!");
2559 return getArgs()[Arg];
2564 assert(Arg < getNumArgs() &&
"Arg access out of range!");
2565 getArgs()[Arg] = ArgExpr;
2575 assert((NewNumArgs <= getNumArgs()) &&
2576 "shrinkNumArgs cannot increase the number of arguments!");
2577 NumArgs = NewNumArgs;
2590 arg_range
arguments() {
return arg_range(arg_begin(), arg_end()); }
2592 return const_arg_range(arg_begin(), arg_end());
2596 return getTrailingStmts() + PREARGS_START + getNumPreArgs();
2598 arg_iterator
arg_end() {
return arg_begin() + getNumArgs(); }
2601 return getTrailingStmts() + PREARGS_START + getNumPreArgs();
2603 const_arg_iterator
arg_end()
const {
return arg_begin() + getNumArgs(); }
2610 return llvm::makeArrayRef(getTrailingStmts(),
2611 PREARGS_START + getNumPreArgs() + getNumArgs());
2616 unsigned getNumCommas()
const {
return getNumArgs() ? getNumArgs() - 1 : 0; }
2620 unsigned getBuiltinCallee()
const;
2624 bool isUnevaluatedBuiltinCall(
const ASTContext &Ctx)
const;
2637 return getUnusedResultAttr(Ctx) !=
nullptr;
2663 return child_range(getTrailingStmts(), getTrailingStmts() + PREARGS_START +
2664 getNumPreArgs() + getNumArgs());
2669 getTrailingStmts() + PREARGS_START +
2670 getNumPreArgs() + getNumArgs());
2690 ASTTemplateKWAndArgsInfo,
2691 TemplateArgumentLoc> {
2711 size_t numTrailingObjects(OverloadToken<MemberExprNameQualifier>)
const {
2712 return hasQualifierOrFoundDecl();
2715 size_t numTrailingObjects(OverloadToken<ASTTemplateKWAndArgsInfo>)
const {
2716 return hasTemplateKWAndArgsInfo();
2719 bool hasQualifierOrFoundDecl()
const {
2720 return MemberExprBits.HasQualifierOrFoundDecl;
2723 bool hasTemplateKWAndArgsInfo()
const {
2724 return MemberExprBits.HasTemplateKWAndArgsInfo;
2731 :
Expr(MemberExprClass, ty, VK, OK, base->isTypeDependent(),
2732 base->isValueDependent(), base->isInstantiationDependent(),
2733 base->containsUnexpandedParameterPack()),
2734 Base(base), MemberDecl(memberdecl), MemberDNLoc(NameInfo.
getInfo()),
2735 MemberLoc(NameInfo.getLoc()) {
2737 MemberExprBits.IsArrow = isarrow;
2738 MemberExprBits.HasQualifierOrFoundDecl =
false;
2739 MemberExprBits.HasTemplateKWAndArgsInfo =
false;
2740 MemberExprBits.HadMultipleCandidates =
false;
2741 MemberExprBits.OperatorLoc = operatorloc;
2751 :
Expr(MemberExprClass, ty, VK, OK, base->isTypeDependent(),
2752 base->isValueDependent(), base->isInstantiationDependent(),
2753 base->containsUnexpandedParameterPack()),
2754 Base(base), MemberDecl(memberdecl), MemberDNLoc(), MemberLoc(l) {
2755 MemberExprBits.IsArrow = isarrow;
2756 MemberExprBits.HasQualifierOrFoundDecl =
false;
2757 MemberExprBits.HasTemplateKWAndArgsInfo =
false;
2758 MemberExprBits.HadMultipleCandidates =
false;
2759 MemberExprBits.OperatorLoc = operatorloc;
2783 if (!hasQualifierOrFoundDecl())
2785 getMemberDecl()->getAccess());
2786 return getTrailingObjects<MemberExprNameQualifier>()->FoundDecl;
2798 if (!hasQualifierOrFoundDecl())
2800 return getTrailingObjects<MemberExprNameQualifier>()->QualifierLoc;
2807 return getQualifierLoc().getNestedNameSpecifier();
2813 if (!hasTemplateKWAndArgsInfo())
2815 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->TemplateKWLoc;
2821 if (!hasTemplateKWAndArgsInfo())
2823 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->LAngleLoc;
2829 if (!hasTemplateKWAndArgsInfo())
2831 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->RAngleLoc;
2844 if (hasExplicitTemplateArgs())
2845 getTrailingObjects<ASTTemplateKWAndArgsInfo>()->copyInto(
2846 getTrailingObjects<TemplateArgumentLoc>(), List);
2852 if (!hasExplicitTemplateArgs())
2855 return getTrailingObjects<TemplateArgumentLoc>();
2861 if (!hasExplicitTemplateArgs())
2864 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->NumTemplateArgs;
2868 return {getTemplateArgs(), getNumTemplateArgs()};
2874 MemberLoc, MemberDNLoc);
2879 bool isArrow()
const {
return MemberExprBits.IsArrow; }
2894 return getBase() && getBase()->isImplicitCXXThis();
2900 return MemberExprBits.HadMultipleCandidates;
2906 MemberExprBits.HadMultipleCandidates = V;
2914 return LO.AppleKext || !hasQualifier();
2939 llvm::PointerIntPair<TypeSourceInfo *, 1, bool> TInfoAndScope;
2945 tinfo->getType()->isDependentType(),
2946 init->isValueDependent(),
2947 (init->isInstantiationDependent() ||
2948 tinfo->getType()->isInstantiationDependentType()),
2949 init->containsUnexpandedParameterPack()),
2950 LParenLoc(lparenloc), TInfoAndScope(tinfo, fileScope), Init(init) {}
2954 :
Expr(CompoundLiteralExprClass, Empty) { }
2967 return TInfoAndScope.getPointer();
2970 TInfoAndScope.setPointer(tinfo);
3006 bool CastConsistency()
const;
3009 return const_cast<CastExpr*
>(
this)->path_buffer();
3015 Expr *op,
unsigned BasePathSize)
3019 ty->isDependentType(),
3022 ty->isDependentType() || (op && op->isValueDependent()),
3023 (ty->isInstantiationDependentType() ||
3024 (op && op->isInstantiationDependent())),
3027 ((SC != ImplicitCastExprClass &&
3028 ty->containsUnexpandedParameterPack()) ||
3029 (op && op->containsUnexpandedParameterPack()))),
3031 CastExprBits.Kind =
kind;
3032 CastExprBits.PartOfExplicitCast =
false;
3033 CastExprBits.BasePathSize = BasePathSize;
3034 assert((CastExprBits.BasePathSize == BasePathSize) &&
3035 "BasePathSize overflow!");
3036 assert(CastConsistency());
3042 CastExprBits.PartOfExplicitCast =
false;
3043 CastExprBits.BasePathSize = BasePathSize;
3044 assert((CastExprBits.BasePathSize == BasePathSize) &&
3045 "BasePathSize overflow!");
3052 static const char *getCastKindName(
CastKind CK);
3062 Expr *getSubExprAsWritten();
3064 return const_cast<CastExpr *
>(
this)->getSubExprAsWritten();
3069 NamedDecl *getConversionFunction()
const;
3074 unsigned path_size()
const {
return CastExprBits.BasePathSize; }
3076 path_iterator
path_end() {
return path_buffer() + path_size(); }
3078 path_const_iterator
path_end()
const {
return path_buffer() + path_size(); }
3081 assert(getCastKind() == CK_ToUnion);
3082 return getTargetFieldForToUnionCast(getType(), getSubExpr()->getType());
3126 :
CastExpr(ImplicitCastExprClass, ty, VK, kind, op, BasePathLength) { }
3129 explicit ImplicitCastExpr(
EmptyShell Shell,
unsigned PathSize)
3130 :
CastExpr(ImplicitCastExprClass, Shell, PathSize) { }
3136 :
CastExpr(ImplicitCastExprClass, ty, VK, kind, op, 0) {
3141 CastExprBits.PartOfExplicitCast = PartOfExplicitCast;
3153 return getSubExpr()->getBeginLoc();
3156 return getSubExpr()->getEndLoc();
3171 e = ice->getSubExpr();
3172 else if (
FullExpr *fe = dyn_cast<FullExpr>(e))
3173 e = fe->getSubExpr();
3204 :
CastExpr(SC, exprTy, VK, kind, op, PathSize), TInfo(writtenTy) {}
3208 :
CastExpr(SC, Shell, PathSize) { }
3221 return T->
getStmtClass() >= firstExplicitCastExprConstant &&
3239 writtenTy), LPLoc(l), RPLoc(r) {}
3263 return getSubExpr()->getEndLoc();
3293 enum { LHS, RHS, END_EXPR };
3294 Stmt *SubExprs[END_EXPR];
3302 :
Expr(BinaryOperatorClass, ResTy, VK, OK,
3303 lhs->isTypeDependent() || rhs->isTypeDependent(),
3304 lhs->isValueDependent() || rhs->isValueDependent(),
3305 (lhs->isInstantiationDependent() ||
3306 rhs->isInstantiationDependent()),
3307 (lhs->containsUnexpandedParameterPack() ||
3308 rhs->containsUnexpandedParameterPack())) {
3309 BinaryOperatorBits.Opc = opc;
3310 BinaryOperatorBits.FPFeatures = FPFeatures.
getInt();
3311 BinaryOperatorBits.OpLoc = opLoc;
3312 SubExprs[LHS] = lhs;
3313 SubExprs[RHS] = rhs;
3314 assert(!isCompoundAssignmentOp() &&
3315 "Use CompoundAssignOperator for compound assignments");
3320 BinaryOperatorBits.Opc = BO_Comma;
3328 return static_cast<Opcode
>(BinaryOperatorBits.Opc);
3330 void setOpcode(Opcode Opc) { BinaryOperatorBits.Opc = Opc; }
3338 return getLHS()->getBeginLoc();
3341 return getRHS()->getEndLoc();
3346 static StringRef getOpcodeStr(Opcode Op);
3360 return Opc == BO_PtrMemD || Opc == BO_PtrMemI;
3365 return Opc >= BO_Mul && Opc <= BO_Rem;
3368 static bool isAdditiveOp(Opcode Opc) {
return Opc == BO_Add || Opc==BO_Sub; }
3370 static bool isShiftOp(Opcode Opc) {
return Opc == BO_Shl || Opc == BO_Shr; }
3373 static bool isBitwiseOp(Opcode Opc) {
return Opc >= BO_And && Opc <= BO_Or; }
3379 static bool isEqualityOp(Opcode Opc) {
return Opc == BO_EQ || Opc == BO_NE; }
3388 llvm_unreachable(
"Not a comparison operator.");
3389 case BO_LT:
return BO_GE;
3390 case BO_GT:
return BO_LE;
3391 case BO_LE:
return BO_GT;
3392 case BO_GE:
return BO_LT;
3393 case BO_EQ:
return BO_NE;
3394 case BO_NE:
return BO_EQ;
3401 llvm_unreachable(
"Not a comparison operator.");
3402 case BO_LT:
return BO_GT;
3403 case BO_GT:
return BO_LT;
3404 case BO_LE:
return BO_GE;
3405 case BO_GE:
return BO_LE;
3412 static bool isLogicalOp(Opcode Opc) {
return Opc == BO_LAnd || Opc==BO_LOr; }
3416 return Opc >= BO_Assign && Opc <= BO_OrAssign;
3421 return Opc > BO_Assign && Opc <= BO_OrAssign;
3424 return isCompoundAssignmentOp(
getOpcode());
3427 assert(isCompoundAssignmentOp(Opc));
3428 if (Opc >= BO_AndAssign)
3429 return Opcode(
unsigned(Opc) - BO_AndAssign + BO_And);
3431 return Opcode(
unsigned(Opc) - BO_MulAssign + BO_Mul);
3435 return Opc == BO_ShlAssign || Opc == BO_ShrAssign;
3444 static bool isNullPointerArithmeticExtension(
ASTContext &Ctx, Opcode Opc,
3448 return S->
getStmtClass() >= firstBinaryOperatorConstant &&
3454 return child_range(&SubExprs[0], &SubExprs[0]+END_EXPR);
3463 BinaryOperatorBits.FPFeatures = F.
getInt();
3467 return FPOptions(BinaryOperatorBits.FPFeatures);
3473 return getFPFeatures().allowFPContractWithinStatement();
3484 :
Expr(CompoundAssignOperatorClass, ResTy, VK, OK,
3485 lhs->isTypeDependent() || rhs->isTypeDependent(),
3486 lhs->isValueDependent() || rhs->isValueDependent(),
3487 (lhs->isInstantiationDependent() ||
3488 rhs->isInstantiationDependent()),
3489 (lhs->containsUnexpandedParameterPack() ||
3490 rhs->containsUnexpandedParameterPack())) {
3491 BinaryOperatorBits.Opc = opc;
3492 BinaryOperatorBits.FPFeatures = FPFeatures.
getInt();
3493 BinaryOperatorBits.OpLoc = opLoc;
3494 SubExprs[LHS] = lhs;
3495 SubExprs[RHS] = rhs;
3499 BinaryOperatorBits.Opc = BO_MulAssign;
3517 :
BinaryOperator(lhs, rhs, opc, ResType, VK, OK, OpLoc, FPFeatures,
3519 ComputationLHSType(CompLHSType),
3520 ComputationResultType(CompResultType) {
3521 assert(isCompoundAssignmentOp() &&
3522 "Only should be used for compound assignments");
3539 return S->
getStmtClass() == CompoundAssignOperatorClass;
3552 bool TD,
bool VD,
bool ID,
3553 bool ContainsUnexpandedParameterPack,
3556 :
Expr(SC, T, VK, OK, TD, VD, ID, ContainsUnexpandedParameterPack),
3557 QuestionLoc(qloc), ColonLoc(cloc) {}
3560 :
Expr(SC, Empty) { }
3565 Expr *getCond()
const;
3569 Expr *getTrueExpr()
const;
3574 Expr *getFalseExpr()
const;
3580 return T->
getStmtClass() == ConditionalOperatorClass ||
3588 enum { COND, LHS, RHS, END_EXPR };
3589 Stmt* SubExprs[END_EXPR];
3600 (lhs->isTypeDependent() || rhs->isTypeDependent()),
3601 (cond->isValueDependent() || lhs->isValueDependent() ||
3602 rhs->isValueDependent()),
3603 (cond->isInstantiationDependent() ||
3604 lhs->isInstantiationDependent() ||
3605 rhs->isInstantiationDependent()),
3606 (cond->containsUnexpandedParameterPack() ||
3607 lhs->containsUnexpandedParameterPack() ||
3608 rhs->containsUnexpandedParameterPack()),
3610 SubExprs[COND] = cond;
3611 SubExprs[LHS] = lhs;
3612 SubExprs[RHS] = rhs;
3636 return getCond()->getBeginLoc();
3639 return getRHS()->getEndLoc();
3648 return child_range(&SubExprs[0], &SubExprs[0]+END_EXPR);
3661 enum { COMMON, COND, LHS, RHS, NUM_SUBEXPRS };
3668 Stmt *SubExprs[NUM_SUBEXPRS];
3678 (common->isTypeDependent() || rhs->isTypeDependent()),
3679 (common->isValueDependent() || rhs->isValueDependent()),
3680 (common->isInstantiationDependent() ||
3681 rhs->isInstantiationDependent()),
3682 (common->containsUnexpandedParameterPack() ||
3683 rhs->containsUnexpandedParameterPack()),
3685 OpaqueValue(opaqueValue) {
3686 SubExprs[COMMON] = common;
3687 SubExprs[COND] = cond;
3688 SubExprs[LHS] = lhs;
3689 SubExprs[RHS] = rhs;
3690 assert(OpaqueValue->
getSourceExpr() == common &&
"Wrong opaque value");
3713 return cast<Expr>(SubExprs[LHS]);
3720 return cast<Expr>(SubExprs[RHS]);
3724 return getCommon()->getBeginLoc();
3727 return getFalseExpr()->getEndLoc();
3731 return T->
getStmtClass() == BinaryConditionalOperatorClass;
3736 return child_range(SubExprs, SubExprs + NUM_SUBEXPRS);
3745 return co->getCond();
3746 return cast<BinaryConditionalOperator>(
this)->getCond();
3751 return co->getTrueExpr();
3752 return cast<BinaryConditionalOperator>(
this)->getTrueExpr();
3757 return co->getFalseExpr();
3758 return cast<BinaryConditionalOperator>(
this)->getFalseExpr();
3770 AmpAmpLoc(AALoc), LabelLoc(LLoc), Label(L) {}
3774 :
Expr(AddrLabelExprClass, Empty) { }
3817 SubStmt(substmt), LParenLoc(lp), RParenLoc(rp) { }
3867 :
Expr(ShuffleVectorExprClass, Empty), SubExprs(nullptr) { }
3892 assert((Index < NumExprs) &&
"Arg access out of range!");
3893 return cast<Expr>(SubExprs[Index]);
3896 assert((Index < NumExprs) &&
"Arg access out of range!");
3897 return cast<Expr>(SubExprs[Index]);
3903 assert((N < NumExprs - 2) &&
"Shuffle idx out of range!");
3904 return getExpr(N+2)->EvaluateKnownConstInt(Ctx);
3909 return child_range(&SubExprs[0], &SubExprs[0]+NumExprs);
3933 :
Expr(ConvertVectorExprClass, DstType, VK, OK,
3934 DstType->isDependentType(),
3935 DstType->isDependentType() || SrcExpr->isValueDependent(),
3936 (DstType->isInstantiationDependentType() ||
3937 SrcExpr->isInstantiationDependent()),
3938 (DstType->containsUnexpandedParameterPack() ||
3939 SrcExpr->containsUnexpandedParameterPack())),
3940 SrcExpr(SrcExpr), TInfo(TI), BuiltinLoc(BuiltinLoc), RParenLoc(RParenLoc) {}
3983 enum { COND, LHS, RHS, END_EXPR };
3984 Stmt* SubExprs[END_EXPR];
3991 bool TypeDependent,
bool ValueDependent)
3992 :
Expr(ChooseExprClass, t, VK, OK, TypeDependent, ValueDependent,
3993 (cond->isInstantiationDependent() ||
3994 lhs->isInstantiationDependent() ||
3995 rhs->isInstantiationDependent()),
3996 (cond->containsUnexpandedParameterPack() ||
3997 lhs->containsUnexpandedParameterPack() ||
3998 rhs->containsUnexpandedParameterPack())),
3999 BuiltinLoc(BLoc), RParenLoc(RP), CondIsTrue(condIsTrue) {
4000 SubExprs[COND] = cond;
4001 SubExprs[LHS] = lhs;
4002 SubExprs[RHS] = rhs;
4011 assert(!isConditionDependent() &&
4012 "Dependent condition isn't true or false");
4018 return getCond()->isTypeDependent() || getCond()->isValueDependent();
4024 return isConditionTrue() ? getLHS() : getRHS();
4049 return child_range(&SubExprs[0], &SubExprs[0]+END_EXPR);
4098 llvm::PointerIntPair<TypeSourceInfo *, 1, bool> TInfo;
4104 false, (TInfo->getType()->isInstantiationDependentType() ||
4105 e->isInstantiationDependent()),
4106 (TInfo->getType()->containsUnexpandedParameterPack() ||
4107 e->containsUnexpandedParameterPack())),
4108 Val(e), TInfo(TInfo, IsMS), BuiltinLoc(BLoc), RParenLoc(RPLoc) {}
4112 :
Expr(VAArgExprClass, Empty), Val(nullptr), TInfo(nullptr,
false) {}
4193 InitExprsTy InitExprs;
4201 llvm::PointerIntPair<InitListExpr *, 1, bool> AltForm;
4210 llvm::PointerUnion<Expr *, FieldDecl *> ArrayFillerOrUnionFieldInit;
4218 :
Expr(InitListExprClass, Empty), AltForm(nullptr,
true) { }
4227 return reinterpret_cast<Expr *
const *
>(InitExprs.
data());
4231 return llvm::makeArrayRef(
getInits(), getNumInits());
4235 return llvm::makeArrayRef(
getInits(), getNumInits());
4239 assert(Init < getNumInits() &&
"Initializer access out of range!");
4240 return cast_or_null<Expr>(InitExprs[Init]);
4244 assert(Init < getNumInits() &&
"Initializer access out of range!");
4245 return cast_or_null<Expr>(InitExprs[Init]);
4249 assert(Init < getNumInits() &&
"Initializer access out of range!");
4250 InitExprs[Init] =
expr;
4256 ExprBits.ContainsUnexpandedParameterPack |=
4262 void reserveInits(
const ASTContext &C,
unsigned NumInits);
4270 void resizeInits(
const ASTContext &Context,
unsigned NumInits);
4285 return ArrayFillerOrUnionFieldInit.dyn_cast<
Expr *>();
4288 return const_cast<InitListExpr *
>(
this)->getArrayFiller();
4290 void setArrayFiller(
Expr *filler);
4303 return ArrayFillerOrUnionFieldInit.dyn_cast<
FieldDecl *>();
4306 return const_cast<InitListExpr *
>(
this)->getInitializedFieldInUnion();
4309 assert((FD ==
nullptr 4310 || getInitializedFieldInUnion() ==
nullptr 4311 || getInitializedFieldInUnion() == FD)
4312 &&
"Only one field of a union may be initialized at a time!");
4313 ArrayFillerOrUnionFieldInit = FD;
4324 bool isStringLiteralInit()
const;
4329 bool isTransparent()
const;
4333 bool isIdiomaticZeroInitializer(
const LangOptions &LangOpts)
const;
4342 return isSemanticForm() ? nullptr : AltForm.getPointer();
4345 return !AltForm.getInt() || !AltForm.getPointer();
4348 return isSemanticForm() ? AltForm.getPointer() :
nullptr;
4352 AltForm.setPointer(Init);
4353 AltForm.setInt(
true);
4354 Init->AltForm.setPointer(
this);
4355 Init->AltForm.setInt(
false);
4359 return InitListExprBits.HadArrayRangeDesignator != 0;
4362 InitListExprBits.HadArrayRangeDesignator = ARD;
4381 if (InitExprs.
empty())
4394 const_iterator
end()
const {
return InitExprs.
end(); }
4398 const_reverse_iterator
rend()
const {
return InitExprs.
rend(); }
4438 unsigned GNUSyntax : 1;
4441 unsigned NumDesignators : 15;
4446 unsigned NumSubExprs : 16;
4459 NumDesignators(0), NumSubExprs(NumSubExprs), Designators(
nullptr) { }
4504 ArrayRangeDesignator
4522 Field.NameOrField =
reinterpret_cast<uintptr_t>(FieldName) | 0x01;
4530 : Kind(ArrayDesignator) {
4531 ArrayOrRange.
Index = Index;
4540 : Kind(ArrayRangeDesignator) {
4541 ArrayOrRange.
Index = Index;
4554 assert(Kind ==
FieldDesignator &&
"Only valid on a field designator");
4555 if (
Field.NameOrField & 0x01)
4562 assert(Kind ==
FieldDesignator &&
"Only valid on a field designator");
4567 assert(Kind ==
FieldDesignator &&
"Only valid on a field designator");
4572 assert(Kind ==
FieldDesignator &&
"Only valid on a field designator");
4577 assert((Kind == ArrayDesignator || Kind == ArrayRangeDesignator) &&
4578 "Only valid on an array or array-range designator");
4583 assert((Kind == ArrayDesignator || Kind == ArrayRangeDesignator) &&
4584 "Only valid on an array or array-range designator");
4589 assert(Kind == ArrayRangeDesignator &&
4590 "Only valid on an array-range designator");
4595 assert((Kind == ArrayDesignator || Kind == ArrayRangeDesignator) &&
4596 "Only valid on an array or array-range designator");
4597 return ArrayOrRange.
Index;
4602 return getDotLoc().
isInvalid()? getFieldLoc() : getDotLoc();
4604 return getLBracketLoc();
4618 bool GNUSyntax,
Expr *Init);
4621 unsigned NumIndexExprs);
4624 unsigned size()
const {
return NumDesignators; }
4628 return {Designators, NumDesignators};
4632 return {Designators, NumDesignators};
4637 return &designators()[Idx];
4641 unsigned NumDesigs);
4663 *child_begin() = init;
4673 assert(Idx < NumSubExprs &&
"Subscript out of range");
4674 return cast<Expr>(getTrailingObjects<Stmt *>()[Idx]);
4678 assert(Idx < NumSubExprs &&
"Subscript out of range");
4679 getTrailingObjects<Stmt *>()[Idx] = E;
4684 void ExpandDesignator(
const ASTContext &C,
unsigned Idx,
4698 Stmt **begin = getTrailingObjects<Stmt *>();
4702 Stmt *
const *begin = getTrailingObjects<Stmt *>();
4725 :
Expr(NoInitExprClass, Empty) { }
4757 Stmt *BaseAndUpdaterExprs[2];
4764 :
Expr(DesignatedInitUpdateExprClass, Empty) { }
4770 return T->
getStmtClass() == DesignatedInitUpdateExprClass;
4777 return cast<InitListExpr>(BaseAndUpdaterExprs[1]);
4784 return child_range(&BaseAndUpdaterExprs[0], &BaseAndUpdaterExprs[0] + 2);
4788 &BaseAndUpdaterExprs[0] + 2);
4812 :
Expr(ArrayInitLoopExprClass, Empty), SubExprs{} {}
4817 CommonInit->isValueDependent() || ElementInit->isValueDependent(),
4818 T->isInstantiationDependentType(),
4819 CommonInit->containsUnexpandedParameterPack() ||
4820 ElementInit->containsUnexpandedParameterPack()),
4821 SubExprs{CommonInit, ElementInit} {}
4826 return cast<OpaqueValueExpr>(SubExprs[0]);
4833 return cast<ConstantArrayType>(getType()->castAsArrayTypeUnsafe())
4842 return getCommonExpr()->getBeginLoc();
4845 return getCommonExpr()->getEndLoc();
4865 :
Expr(ArrayInitIndexExprClass, Empty) {}
4906 :
Expr(ImplicitValueInitExprClass, Empty) { }
4909 return T->
getStmtClass() == ImplicitValueInitExprClass;
4953 assert(Init < getNumExprs() &&
"Initializer access out of range!");
4954 return getExprs()[Init];
4962 return reinterpret_cast<Expr **
>(getTrailingObjects<Stmt *>());
4966 return llvm::makeArrayRef(getExprs(), getNumExprs());
4981 getTrailingObjects<Stmt *>() + getNumExprs());
4985 getTrailingObjects<Stmt *>() + getNumExprs());
5016 enum { CONTROLLING, END_EXPR };
5019 unsigned NumAssocs, ResultIndex;
5028 bool ContainsUnexpandedParameterPack,
5029 unsigned ResultIndex);
5037 bool ContainsUnexpandedParameterPack);
5040 :
Expr(GenericSelectionExprClass, Empty) { }
5049 return cast<Expr>(SubExprs[END_EXPR+i]);
5054 ? llvm::makeArrayRef(
5055 &reinterpret_cast<Expr **>(SubExprs)[END_EXPR], NumAssocs)
5059 return AssocTypes[i];
5063 return NumAssocs ? llvm::makeArrayRef(&AssocTypes[0], NumAssocs) :
None;
5068 return TS->getType();
5074 return cast<Expr>(SubExprs[CONTROLLING]);
5085 assert(!isResultDependent() &&
"Generic selection is result-dependent");
5102 return child_range(SubExprs, SubExprs+END_EXPR+NumAssocs);
5128 :
Expr(ExtVectorElementExprClass, ty, VK,
5130 base->isTypeDependent(), base->isValueDependent(),
5131 base->isInstantiationDependent(),
5132 base->containsUnexpandedParameterPack()),
5133 Base(base), Accessor(&accessor), AccessorLoc(loc) {}
5137 :
Expr(ExtVectorElementExprClass, Empty) { }
5150 unsigned getNumElements()
const;
5154 bool containsDuplicateElements()
const;
5161 return getBase()->getBeginLoc();
5167 bool isArrow()
const;
5188 ty->isDependentType(), ty->isDependentType(),
5189 ty->isInstantiationDependentType() || BD->isDependentContext(),
5202 const Stmt *getBody()
const;
5206 return getCaretLocation();
5244 :
Expr(AsTypeExprClass, DstType, VK, OK,
5245 DstType->isDependentType(),
5246 DstType->isDependentType() || SrcExpr->isValueDependent(),
5247 (DstType->isInstantiationDependentType() ||
5248 SrcExpr->isInstantiationDependent()),
5249 (DstType->containsUnexpandedParameterPack() ||
5250 SrcExpr->containsUnexpandedParameterPack())),
5251 SrcExpr(SrcExpr), BuiltinLoc(BuiltinLoc), RParenLoc(RParenLoc) {}
5318 Expr **getSubExprsBuffer() {
return getTrailingObjects<Expr *>(); }
5319 const Expr *
const *getSubExprsBuffer()
const {
5320 return getTrailingObjects<Expr *>();
5325 unsigned resultIndex);
5327 PseudoObjectExpr(
EmptyShell shell,
unsigned numSemanticExprs);
5329 unsigned getNumSubExprs()
const {
5330 return PseudoObjectExprBits.NumSubExprs;
5336 enum :
unsigned { NoResult = ~0U };
5340 unsigned resultIndex);
5343 unsigned numSemanticExprs);
5354 if (PseudoObjectExprBits.ResultIndex == 0)
return NoResult;
5355 return PseudoObjectExprBits.ResultIndex - 1;
5360 if (PseudoObjectExprBits.ResultIndex == 0)
5362 return getSubExprsBuffer()[PseudoObjectExprBits.ResultIndex];
5365 return const_cast<PseudoObjectExpr*
>(
this)->getResultExpr();
5373 return getSubExprsBuffer() + 1;
5376 return getSubExprsBuffer() + 1;
5379 return getSubExprsBuffer() + getNumSubExprs();
5382 return getSubExprsBuffer() + getNumSubExprs();
5386 return llvm::make_range(semantics_begin(), semantics_end());
5388 llvm::iterator_range<const_semantics_iterator>
semantics()
const {
5389 return llvm::make_range(semantics_begin(), semantics_end());
5393 assert(index + 1 < getNumSubExprs());
5394 return getSubExprsBuffer()[index + 1];
5397 return const_cast<PseudoObjectExpr*
>(
this)->getSemanticExpr(index);
5401 return getSyntacticForm()->getExprLoc();
5405 return getSyntacticForm()->getBeginLoc();
5408 return getSyntacticForm()->getEndLoc();
5413 const_cast<const PseudoObjectExpr *
>(
this)->
children();
5418 Stmt *
const *cs =
const_cast<Stmt *
const *
>(
5419 reinterpret_cast<const Stmt *
const *
>(getSubExprsBuffer()));
5441 #define BUILTIN(ID, TYPE, ATTRS) 5442 #define ATOMIC_BUILTIN(ID, TYPE, ATTRS) AO ## ID, 5443 #include "clang/Basic/Builtins.def" 5452 enum {
PTR, ORDER, VAL1, ORDER_FAIL, VAL2, WEAK, END_EXPR };
5453 Stmt *SubExprs[END_EXPR + 1];
5454 unsigned NumSubExprs;
5465 static unsigned getNumSubExprs(
AtomicOp Op);
5471 return cast<Expr>(SubExprs[
PTR]);
5474 return cast<Expr>(SubExprs[ORDER]);
5477 assert(getScopeModel() &&
"No scope");
5478 return cast<Expr>(SubExprs[NumSubExprs - 1]);
5481 if (Op == AO__c11_atomic_init || Op == AO__opencl_atomic_init)
5482 return cast<Expr>(SubExprs[ORDER]);
5483 assert(NumSubExprs > VAL1);
5484 return cast<Expr>(SubExprs[VAL1]);
5487 assert(NumSubExprs > ORDER_FAIL);
5488 return cast<Expr>(SubExprs[ORDER_FAIL]);
5491 if (Op == AO__atomic_exchange)
5492 return cast<Expr>(SubExprs[ORDER_FAIL]);
5493 assert(NumSubExprs > VAL2);
5494 return cast<Expr>(SubExprs[VAL2]);
5497 assert(NumSubExprs > WEAK);
5498 return cast<Expr>(SubExprs[WEAK]);
5507 return reinterpret_cast<Expr *
const *
>(SubExprs);
5511 return getPtr()->getType()->getPointeeType().isVolatileQualified();
5515 return getOp() == AO__c11_atomic_compare_exchange_strong ||
5516 getOp() == AO__c11_atomic_compare_exchange_weak ||
5517 getOp() == AO__opencl_atomic_compare_exchange_strong ||
5518 getOp() == AO__opencl_atomic_compare_exchange_weak ||
5519 getOp() == AO__atomic_compare_exchange ||
5520 getOp() == AO__atomic_compare_exchange_n;
5524 return getOp() >= AO__opencl_atomic_init &&
5525 getOp() <= AO__opencl_atomic_fetch_max;
5540 return child_range(SubExprs, SubExprs+NumSubExprs);
5551 (Op >= AO__opencl_atomic_load && Op <= AO__opencl_atomic_fetch_max)
5561 return getScopeModel(getOp());
5575 assert(T->
isDependentType() &&
"TypoExpr given a non-dependent type");
5595 #endif // LLVM_CLANG_AST_EXPR_H void setFPFeatures(FPOptions F)
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
unsigned getNumSemanticExprs() const
const Expr * getSubExpr() const
bool hasArrayFiller() const
Return true if this is an array initializer and its array "filler" has been set.
Represents a single C99 designator.
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
SourceLocation getBeginLoc() const LLVM_READONLY
void setValueDependent(bool VD)
Set whether this expression is value-dependent or not.
const BlockDecl * getBlockDecl() const
const_child_range children() const
bool isCallToStdMove() const
bool isIncrementOp() const
Expr * getChosenSubExpr() const
getChosenSubExpr - Return the subexpression chosen according to the condition.
const_child_range children() const
Represents a function declaration or definition.
NamedDecl * getFoundDecl()
Get the NamedDecl through which this reference occurred.
const StringLiteral * getFunctionName() const
void setSubStmt(CompoundStmt *S)
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.
SourceLocation getEndLoc() const LLVM_READONLY
bool hasTemplateKeyword() const
Determines whether the member name was preceded by the template keyword.
reverse_iterator rbegin()
SourceLocation getRParenLoc() const
const TemplateArgumentLoc * getTemplateArgs() const
Retrieve the template arguments provided as part of this template-id.
unsigned getRawEncoding() const
When a SourceLocation itself cannot be used, this returns an (opaque) 32-bit integer encoding for it...
const Expr * getIdx() const
enum clang::SubobjectAdjustment::@45 Kind
A (possibly-)qualified type.
SourceLocation getEndLoc() const LLVM_READONLY
StringKind getKind() const
ValueDecl * getMemberDecl() const
Retrieve the member declaration to which this expression refers.
void setOperatorLoc(SourceLocation L)
static Opcode getOpForCompoundAssignment(Opcode Opc)
Expr * getArg(unsigned Arg)
getArg - Return the specified argument.
SourceLocation getExprLoc() const
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.
SourceLocation getLParen() const
Get the location of the left parentheses '('.
SourceLocation getEndLoc() const LLVM_READONLY
Expr(StmtClass SC, QualType T, ExprValueKind VK, ExprObjectKind OK, bool TD, bool VD, bool ID, bool ContainsUnexpandedParameterPack)
Expr * getExpr(unsigned Index)
getExpr - Return the Expr at the specified index.
llvm::APFloat getValue(const llvm::fltSemantics &Semantics) const
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.
unsigned getNumSubExprs() const
getNumSubExprs - Return the size of the SubExprs array.
unsigned getResultIndex() const
The zero-based index of the result expression's generic association in the generic selection's associ...
CompoundStmt * getSubStmt()
InitExprsTy::const_iterator const_iterator
SourceLocation getEndLoc() const LLVM_READONLY
const Expr * getInit(unsigned Init) const
static bool classof(const Stmt *S)
Designator(const IdentifierInfo *FieldName, SourceLocation DotLoc, SourceLocation FieldLoc)
Initializes a field designator.
Expr * getControllingExpr()
bool containsNonAsciiOrNull() const
static bool isBuiltinAssumeFalse(const CFGBlock *B, const Stmt *S, ASTContext &C)
Expr *const * semantics_iterator
Stmt - This represents one statement.
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this call.
CompoundLiteralExpr(EmptyShell Empty)
Construct an empty compound literal.
SourceLocation getOperatorLoc() const
getOperatorLoc - Return the location of the operator.
SourceLocation getRParenLoc() const
SourceLocation getLocation() const
SourceLocation getBeginLoc() const LLVM_READONLY
StmtExpr(CompoundStmt *substmt, QualType T, SourceLocation lp, SourceLocation rp)
bool isFEnvAccessOn() const
bool hasPlaceholderType() const
Returns whether this expression has a placeholder type.
ArrayRef< Stmt * > getRawSubExprs()
This method provides fast access to all the subexpressions of a CallExpr without going through the sl...
C Language Family Type Representation.
static bool isMultiplicativeOp(Opcode Opc)
SourceLocation getRBracketLoc() const
void setOpcode(Opcode Opc)
const_child_range children() const
reverse_iterator rbegin()
const_child_range children() const
TypeSourceInfo * getTypeSourceInfo() const
static unsigned sizeOfTrailingObjects(unsigned NumPreArgs, unsigned NumArgs)
Return the size in bytes needed for the trailing objects.
Decl - This represents one declaration (or definition), e.g.
static bool classof(const Stmt *T)
llvm::APFloat getValue() const
Represents the index of the current element of an array being initialized by an ArrayInitLoopExpr.
LLVM_READNONE bool isASCII(char c)
Returns true if this is an ASCII character.
ConstExprUsage
Indicates how the constant expression will be used.
SourceLocation getBeginLoc() const LLVM_READONLY
const Expr * getSubExpr() const
const_child_range children() const
SourceLocation getEndLoc() const LLVM_READONLY
Classification Classify(ASTContext &Ctx) const
Classify - Classify this expression according to the C++11 expression taxonomy.
static bool classof(const Stmt *T)
const CastExpr * BasePath
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 setNumArgsUnsafe(unsigned NewNumArgs)
Bluntly set a new number of arguments without doing any checks whatsoever.
void setComputationResultType(QualType T)
ParenExpr - This represents a parethesized expression, e.g.
Expr * getFalseExpr() const
Is the identifier known as a GNU-style attribute?
bool hasQualifier() const
Determines whether this member expression actually had a C++ nested-name-specifier prior to the name ...
Strictly evaluate the expression.
const_arg_iterator arg_begin() const
The base class of the type hierarchy.
FullExpr(StmtClass SC, Expr *subexpr)
ImplicitValueInitExpr(QualType ty)
bool isSemanticForm() const
bool hasExplicitTemplateArgs() const
Determines whether this declaration reference was followed by an explicit template argument list...
llvm::iterator_range< child_iterator > child_range
SourceLocation getRParenLoc() const
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.
const Designator * getDesignator(unsigned Idx) const
TypeSourceInfo * getTypeInfoAsWritten() const
getTypeInfoAsWritten - Returns the type source info for the type that this expression is casting to...
void setADLCallKind(ADLCallKind V=UsesADL)
FPOptions getFPFeatures() const
InitExprsTy::iterator iterator
SourceLocation getLParenLoc() const
The l-value was an access to a declared entity or something equivalently strong, like the address of ...
A container of type source information.
SourceLocation getBeginLoc() const LLVM_READONLY
Stmt * IgnoreImplicit()
Skip past any implicit AST nodes which might surround this statement, such as ExprWithCleanups or Imp...
void setCanOverflow(bool C)
Floating point control options.
SourceLocation getBeginLoc() const LLVM_READONLY
IdentKind getIdentKind() const
SourceLocation getEndLoc() const LLVM_READONLY
static bool classof(const Stmt *T)
const_child_range children() const
SourceLocation getExprLoc() const LLVM_READONLY
SourceLocation getEndLoc() const LLVM_READONLY
const_child_range children() const
ShuffleVectorExpr(EmptyShell Empty)
Build an empty vector-shuffle expression.
SourceLocation getAccessorLoc() const
BinaryOperator(Expr *lhs, Expr *rhs, Opcode opc, QualType ResTy, ExprValueKind VK, ExprObjectKind OK, SourceLocation opLoc, FPOptions FPFeatures)
const Expr * getResultExpr() const
The generic selection's result expression.
bool isImplicitAccess() const
Determine whether the base of this explicit is implicit.
SourceLocation getRParenLoc() const
getRParenLoc - Return the location of final right parenthesis.
const Expr * getSubExpr() const
Expr * getIndexExpr(unsigned Idx)
const Expr * getIndexExpr(unsigned Idx) const
const CXXBaseSpecifier *const * path_const_iterator
Represents a variable declaration or definition.
GenericSelectionExpr(EmptyShell Empty)
bool hasTemplateKWAndArgsInfo() const
void setIsPartOfExplicitCast(bool PartOfExplicitCast)
CompoundLiteralExpr - [C99 6.5.2.5].
void setSubExpr(unsigned Idx, Expr *E)
static bool isArithmeticOp(Opcode Op)
const internal::VariadicDynCastAllOfMatcher< Stmt, Expr > expr
Matches expressions.
OpaqueValueExpr * getCommonExpr() const
Get the common subexpression shared by all initializations (the source array).
const T * getAs() const
Member-template getAs<specific type>'.
void setInitializer(Expr *E)
SourceLocation getBeginLoc() const LLVM_READONLY
const Expr * getSemanticExpr(unsigned index) const
unsigned EllipsisLoc
The location of the ellipsis separating the start and end indices.
llvm::iterator_range< arg_iterator > arg_range
SourceLocation getColonLoc() const
BlockExpr(BlockDecl *BD, QualType ty)
void setInit(unsigned Init, Expr *expr)
AddrLabelExpr(EmptyShell Empty)
Build an empty address of a label expression.
void setValue(unsigned Val)
const_iterator begin() const
void setLocation(SourceLocation Location)
static bool classof(const Stmt *T)
static std::unique_ptr< AtomicScopeModel > create(AtomicScopeModelKind K)
Create an atomic scope model by AtomicScopeModelKind.
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)
TypeSourceInfo * getArgumentTypeInfo() const
SourceLocation getBeginLoc() const LLVM_READONLY
SourceRange getSourceRange() const LLVM_READONLY
Retrieve the source range that covers this offsetof node.
bool isShiftAssignOp() const
unsigned getNumExpressions() const
SourceLocation getLocation() const
Retrieve the location of the literal.
ConstantExpr(EmptyShell Empty)
Build an empty constant expression wrapper.
const_child_range children() const
static bool isAssignmentOp(Opcode Opc)
SourceLocation getRParenLoc() const
SourceLocation getLocation() const
Retrieve the location of the literal.
const Expr * IgnoreParenNoopCasts(ASTContext &Ctx) const LLVM_READONLY
bool isAdditiveOp() const
bool isEqualityOp() const
SourceLocation getBuiltinLoc() const
SourceLocation getBeginLoc() const LLVM_READONLY
SourceLocation getEndLoc() const LLVM_READONLY
IdentifierInfo * getIdentifier() const
Get the identifier that names this declaration, if there is one.
const Expr * getBase() const
Expr * IgnoreImpCasts() LLVM_READONLY
IgnoreImpCasts - Skip past any implicit casts which might surround this expression.
static bool classof(const Stmt *T)
const_child_range children() const
SourceLocation getDotLoc() const
Represents a struct/union/class.
InitExprsTy::const_reverse_iterator const_reverse_iterator
Represents a C99 designated initializer expression.
AbstractConditionalOperator(StmtClass SC, EmptyShell Empty)
bool isOrdinaryOrBitFieldObject() const
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
static bool classof(const Stmt *T)
static StringLiteral * Create(const ASTContext &Ctx, StringRef Str, StringKind Kind, bool Pascal, QualType Ty, SourceLocation Loc)
Simple constructor for string literals made from one token.
One of these records is kept for each identifier that is lexed.
Expr * getFalseExpr() const
FieldDecl * getField() const
For a field offsetof node, returns the field.
SourceLocation getRParenLoc() const
AddrLabelExpr(SourceLocation AALoc, SourceLocation LLoc, LabelDecl *L, QualType t)
const_reverse_iterator rend() const
ShuffleVectorExpr - clang-specific builtin-in function __builtin_shufflevector.
static Opcode reverseComparisonOp(Opcode Opc)
QualType getComputationResultType() const
bool isArrayRangeDesignator() const
bool isStr(const char(&Str)[StrLen]) const
Return true if this is the identifier for the specified string.
SourceLocation getRParen() const
Get the location of the right parentheses ')'.
A vector component is an element or range of elements on a vector.
StmtIterator cast_away_const(const ConstStmtIterator &RHS)
const_child_range children() const
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.
Expr * getInit() const
Retrieve the initializer value.
SourceLocation getExprLoc() const LLVM_READONLY
SourceLocation getBeginLoc() const LLVM_READONLY
FullExpr - Represents a "full-expression" node.
SourceLocation getAmpAmpLoc() const
static SourceLocation getFromRawEncoding(unsigned Encoding)
Turn a raw encoding of a SourceLocation object into a real SourceLocation.
SourceLocation getBeginLoc() const LLVM_READONLY
Represents a member of a struct/union/class.
SourceLocation getBeginLoc() const LLVM_READONLY
void setIsMicrosoftABI(bool IsMS)
Represents a place-holder for an object not to be initialized by anything.
SourceLocation getBeginLoc() const LLVM_READONLY
UnaryOperator(Expr *input, Opcode opc, QualType type, ExprValueKind VK, ExprObjectKind OK, SourceLocation l, bool CanOverflow)
static bool isPtrMemOp(Opcode Opc)
predicates to categorize the respective opcodes.
bool isArrayDesignator() const
UnaryExprOrTypeTrait
Names for the "expression or type" traits.
static bool isIncrementDecrementOp(Opcode Op)
unsigned getArrayExprIndex() const
For an array element node, returns the index into the array of expressions.
SourceLocation getLabelLoc() const
ExtVectorElementExpr(EmptyShell Empty)
Build an empty vector element expression.
bool hasExplicitTemplateArgs() const
Determines whether the member name was followed by an explicit template argument list.
UnaryOperator(EmptyShell Empty)
Build an empty unary operator.
const Expr * getResultExpr() const
SourceLocation getRBraceLoc() const
SourceLocation getOperatorLoc() const
SourceLocation getExprLoc() const LLVM_READONLY
unsigned getNumCommas() const
getNumCommas - Return the number of commas that must have been present in this function call...
static bool classof(const Stmt *T)
GNUNullExpr - Implements the GNU __null extension, which is a name for a null pointer constant that h...
bool isReferenceType() const
SourceLocation getRParenLoc() const
void setArg(unsigned Arg, Expr *ArgExpr)
setArg - Set the specified argument.
SourceLocation getEndLoc() const LLVM_READONLY
void shrinkNumArgs(unsigned NewNumArgs)
Reduce the number of arguments in this call expression.
void setRParen(SourceLocation Loc)
GNUNullExpr(EmptyShell Empty)
Build an empty GNU __null expression.
SourceLocation getBeginLoc() const LLVM_READONLY
Expr * getSourceExpr() const
The source expression of an opaque value expression is the expression which originally generated the ...
const_child_range children() const
const_child_range children() const
ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...
SourceLocation getBeginLoc() const LLVM_READONLY
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.
std::unique_ptr< AtomicScopeModel > getScopeModel() const
Get atomic scope model.
SourceLocation getBeginLoc() const LLVM_READONLY
SourceLocation getQuestionLoc() const
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 getEndLoc() const LLVM_READONLY
const_child_range children() const
unsigned getCharByteWidth() const
SourceLocation getBeginLoc() const LLVM_READONLY
bool isAssignmentOp() const
SourceLocation getEndLoc() const LLVM_READONLY
NestedNameSpecifierLoc QualifierLoc
The nested-name-specifier that qualifies the name, including source-location information.
void setRParenLoc(SourceLocation L)
static bool classof(const Stmt *T)
bool hadArrayRangeDesignator() const
An r-value expression (a pr-value in the C++11 taxonomy) produces a temporary value.
const Expr *const * const_semantics_iterator
static bool classof(const Stmt *T)
SourceLocation getEndLoc() const LLVM_READONLY
void setSubExpr(Expr *E)
As with any mutator of the AST, be very careful when modifying an existing AST to preserve its invari...
static bool isRelationalOp(Opcode Opc)
Expr *const * getInits() const
Retrieve the set of initializers.
void setLBraceLoc(SourceLocation Loc)
StringRef getOpcodeStr() const
const_child_range children() const
void copyTemplateArgumentsInto(TemplateArgumentListInfo &List) const
Copies the template arguments (if present) into the given structure.
Describes an C or C++ initializer list.
SourceLocation getEndLoc() const LLVM_READONLY
AsTypeExpr(Expr *SrcExpr, QualType DstType, ExprValueKind VK, ExprObjectKind OK, SourceLocation BuiltinLoc, SourceLocation RParenLoc)
void setValue(const ASTContext &C, const llvm::APInt &Val)
void setBuiltinLoc(SourceLocation L)
SourceLocation getBeginLoc() const LLVM_READONLY
SmallVectorImpl< PartialDiagnosticAt > * Diag
Diag - If this is non-null, it will be filled in with a stack of notes indicating why evaluation fail...
unsigned getLength() const
static bool isEqualityOp(Opcode Opc)
unsigned getFirstExprIndex() const
bool refersToBitField() const
Returns true if this expression is a gl-value that potentially refers to a bit-field.
static DeclAccessPair make(NamedDecl *D, AccessSpecifier AS)
static bool classof(const Stmt *T)
APValue Val
Val - This is the value the expression can be folded to.
A convenient class for passing around template argument information.
APFloatSemantics getRawSemantics() const
Get a raw enumeration value representing the floating-point semantics of this literal (32-bit IEEE...
static bool classof(const Stmt *T)
OffsetOfNode(SourceLocation LBracketLoc, unsigned Index, SourceLocation RBracketLoc)
Create an offsetof node that refers to an array element.
ExprValueKind getValueKind() const
getValueKind - The value kind that this expression produces.
An x-value expression is a reference to an object with independent storage but which can be "moved"...
path_iterator path_begin()
const Expr * getArg(unsigned Arg) const
OffsetOfNode(const CXXBaseSpecifier *Base)
Create an offsetof node that refers into a C++ base class.
NullPointerConstantValueDependence
Enumeration used to describe how isNullPointerConstant() should cope with value-dependent expressions...
static bool classof(const Stmt *T)
unsigned getNumPreArgs() const
static bool classof(const Stmt *S)
semantics_iterator semantics_end()
A builtin binary operation expression such as "x + y" or "x <= y".
static bool classof(const Stmt *T)
const Expr * getAssocExpr(unsigned i) const
tokloc_iterator tokloc_end() const
unsigned RBracketLoc
The location of the ']' terminating the array range designator.
ArrayRef< TemplateArgumentLoc > template_arguments() const
void setAccessor(IdentifierInfo *II)
bool hadMultipleCandidates() const
Returns true if this member expression refers to a method that was resolved from an overloaded set ha...
unsigned getResultExprIndex() const
Return the index of the result-bearing expression into the semantics expressions, or PseudoObjectExpr...
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)
bool isFPContractableWithinStatement() const
SourceLocation getEqualOrColonLoc() const
Retrieve the location of the '=' that precedes the initializer value itself, if present.
BinaryOperator(EmptyShell Empty)
Construct an empty binary operator.
StringKind
StringLiteral is followed by several trailing objects.
TypoExpr - Internal placeholder for expressions where typo correction still needs to be performed and...
const_child_range children() const
void setOperatorLoc(SourceLocation L)
unsigned getInt() const
Used to serialize this.
bool isRelationalOp() const
An adjustment to be made to the temporary created when emitting a reference binding, which accesses a particular subobject of that temporary.
const Expr * getControllingExpr() const
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Helper class for OffsetOfExpr.
SourceLocation getBuiltinLoc() const
void setOpcode(Opcode Opc)
NestedNameSpecifierLoc getQualifierLoc() const
If the name was qualified, retrieves the nested-name-specifier that precedes the name, with source-location information.
bool isTypeDependent() const
isTypeDependent - Determines whether this expression is type-dependent (C++ [temp.dep.expr]), which means that its type could change from one template instantiation to the next.
An ordinary object is located at an address in memory.
SourceLocation getOperatorLoc() const
getOperatorLoc - Return the location of the operator.
void setRParenLoc(SourceLocation R)
SourceLocation getEndLoc() const
static Classification makeSimpleLValue()
Create a simple, modifiably lvalue.
GNUNullExpr(QualType Ty, SourceLocation Loc)
ConvertVectorExpr(Expr *SrcExpr, TypeSourceInfo *TI, QualType DstType, ExprValueKind VK, ExprObjectKind OK, SourceLocation BuiltinLoc, SourceLocation RParenLoc)
SourceLocation getTokenLocation() const
getTokenLocation - The location of the __null token.
Iterator for iterating over Stmt * arrays that contain only Expr *.
void setRParenLoc(SourceLocation L)
uint64_t * pVal
Used to store the >64 bits integer value.
const_child_range children() const
void setCastKind(CastKind K)
NestedNameSpecifierLoc getQualifierLoc() const
If the member name was qualified, retrieves the nested-name-specifier that precedes the member name...
SourceLocation getBeginLoc() const LLVM_READONLY
SourceLocation getEndLoc() const LLVM_READONLY
Expr ** getSubExprs()
Retrieve the array of expressions.
FullExpr(StmtClass SC, EmptyShell Empty)
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)
void setEqualOrColonLoc(SourceLocation L)
SourceLocation getEllipsisLoc() const
const Expr * getLHS() const
void setArgument(Expr *E)
QualType getTypeAsWritten() const
getTypeAsWritten - Returns the type that this expression is casting to, as written in the source code...
void setTypeSourceInfo(TypeSourceInfo *tsi)
static Opcode negateComparisonOp(Opcode Opc)
SourceLocation getEndLoc() const
static bool classof(const Stmt *T)
const Expr * getExpr(unsigned Index) const
ConditionalOperator - The ?: ternary operator.
Const iterator for iterating over Stmt * arrays that contain only Expr *.
void setField(FieldDecl *FD)
StringRef getString() const
ParenExpr(SourceLocation l, SourceLocation r, Expr *val)
void setAmpAmpLoc(SourceLocation L)
llvm::iterator_range< const_child_iterator > const_child_range
CompoundStmt - This represents a group of statements like { stmt stmt }.
Represents a prototype with parameter type info, e.g.
void setBlockDecl(BlockDecl *BD)
bool isMicrosoftABI() const
Returns whether this is really a Win64 ABI va_arg expression.
ArrayInitIndexExpr(QualType T)
SubobjectAdjustment(FieldDecl *Field)
void copyTemplateArgumentsInto(TemplateArgumentListInfo &List) const
Copies the template arguments (if present) into the given structure.
QualType getComputationLHSType() const
CastKind
CastKind - The kind of operation required for a conversion.
NestedNameSpecifier * getQualifier() const
If the member name was qualified, retrieves the nested-name-specifier that precedes the member name...
The return type of classify().
const Expr * IgnoreParenCasts() const LLVM_READONLY
const_semantics_iterator semantics_begin() const
Used by IntegerLiteral/FloatingLiteral to store the numeric without leaking memory.
static std::unique_ptr< AtomicScopeModel > getScopeModel(AtomicOp Op)
Get atomic scope model for the atomic op code.
SourceLocation getBeginLoc() const LLVM_READONLY
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand...
void setLParen(SourceLocation Loc)
const Expr * IgnoreImplicit() const LLVM_READONLY
llvm::APInt getIntValue() const
SourceLocation getLocation() const
InitListExpr * getUpdater() const
ConditionalOperator(Expr *cond, SourceLocation QLoc, Expr *lhs, SourceLocation CLoc, Expr *rhs, QualType t, ExprValueKind VK, ExprObjectKind OK)
ConstantExpr - An expression that occurs in a constant context.
bool HasUndefinedBehavior
Whether the evaluation hit undefined behavior.
Represents a call to the builtin function __builtin_va_arg.
Kinds
The various classification results. Most of these mean prvalue.
SourceLocation getEndLoc() const LLVM_READONLY
unsigned getValue() const
Exposes information about the current target.
Expr * getSrcExpr() const
getSrcExpr - Return the Expr to be converted.
CompoundAssignOperator(Expr *lhs, Expr *rhs, Opcode opc, QualType ResType, ExprValueKind VK, ExprObjectKind OK, QualType CompLHSType, QualType CompResultType, SourceLocation OpLoc, FPOptions FPFeatures)
llvm::APSInt getShuffleMaskIdx(const ASTContext &Ctx, unsigned N) const
ADLCallKind getADLCallKind() const
SourceLocation getBeginLoc() const LLVM_READONLY
const_child_range children() const
SourceLocation getEndLoc() const LLVM_READONLY
void setLocation(SourceLocation Location)
const_arg_range arguments() const
Pepresents a block literal declaration, which is like an unnamed FunctionDecl.
llvm::MutableArrayRef< Designator > designators()
static bool classof(const Stmt *T)
DeclAccessPair getFoundDecl() const
Retrieves the declaration found by lookup.
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
This represents one expression.
Defines the clang::LangOptions interface.
void setRBraceLoc(SourceLocation Loc)
const_child_range children() const
ExprValueKind
The categorization of expression values, currently following the C++11 scheme.
const Expr * getSyntacticForm() const
const_child_range children() const
CXXBaseSpecifier * getBase() const
For a base class node, returns the base specifier.
void setRParenLoc(SourceLocation L)
const Expr * getRHS() const
static bool classof(const Stmt *T)
void setSyntacticForm(InitListExpr *Init)
SourceLocation getEndLoc() const LLVM_READONLY
SourceLocation getEndLoc() const LLVM_READONLY
void setMemberLoc(SourceLocation L)
void setTypeDependent(bool TD)
Set whether this expression is type-dependent or not.
const TypeSourceInfo * getAssocTypeSourceInfo(unsigned i) const
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
bool isFieldDesignator() const
unsigned getNumInits() const
static bool classof(const Stmt *T)
Expr * getSubExpr() const
Get the initializer to use for each array element.
SourceLocation getBeginLoc() const
const Expr * getCallee() const
SourceLocation getEndLoc() const LLVM_READONLY
An array or GNU array-range designator, e.g., "[9]" or "[10..15]".
Stmt * getPreArg(unsigned I)
const Expr * skipRValueSubobjectAdjustments() const
void setTypeSourceInfo(TypeSourceInfo *ti)
const_iterator end() const
const_child_range children() const
QualType getArgumentType() const
bool performsVirtualDispatch(const LangOptions &LO) const
Returns true if virtual dispatch is performed.
void setWrittenTypeInfo(TypeSourceInfo *TI)
SourceLocation getLParenLoc() const
ParenExpr(EmptyShell Empty)
Construct an empty parenthesized expression.
uint32_t getCodeUnit(size_t i) const
void setObjectKind(ExprObjectKind Cat)
setObjectKind - Set the object kind produced by this expression.
bool hasQualifier() const
Determine whether this declaration reference was preceded by a C++ nested-name-specifier, e.g., N::foo.
TypeSourceInfo * getTypeSourceInfo() const
unsigned size() const
Returns the number of designators in this initializer.
AsTypeExpr - Clang builtin function __builtin_astype [OpenCL 6.2.4.2] This AST node provides support ...
const_child_range children() const
FunctionDecl * getDirectCallee()
If the callee is a FunctionDecl, return it. Otherwise return null.
bool refersToEnclosingVariableOrCapture() const
Does this DeclRefExpr refer to an enclosing local or a captured variable?
IdentifierInfo & getAccessor() const
static bool EvaluateAsBooleanCondition(const Expr *E, bool &Result, EvalInfo &Info)
BinaryOperator(Expr *lhs, Expr *rhs, Opcode opc, QualType ResTy, ExprValueKind VK, ExprObjectKind OK, SourceLocation opLoc, FPOptions FPFeatures, bool dead2)
const ValueDecl * getDecl() const
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 getBeginLoc() const LLVM_READONLY
Kind getKind() const
Determine what kind of offsetof node this is.
SourceLocation getLAngleLoc() const
Retrieve the location of the left angle bracket starting the explicit template argument list followin...
ArrayRef< Expr * > getAssocExprs() const
QualType getTypeOfArgument() const
Gets the argument type, or the type of the argument expression, whichever is appropriate.
const_semantics_iterator semantics_end() const
void setValueKind(ExprValueKind Cat)
setValueKind - Set the value kind produced by this expression.
SourceLocation getEndLoc() const LLVM_READONLY
static OMPLinearClause * CreateEmpty(const ASTContext &C, unsigned NumVars)
Creates an empty clause with the place for NumVars variables.
SourceLocation getRParenLoc() const
getRParenLoc - Return the location of final right parenthesis.
void setMemberDecl(ValueDecl *D)
const_child_range children() const
const_child_range children() const
ModifiableType
The results of modification testing.
void setRParenLoc(SourceLocation L)
SourceLocation getLBracketLoc() const
SourceLocation getRBracketLoc() const
SourceLocation getEnd() const
const_child_range children() const
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...
SourceLocation getMemberLoc() const
getMemberLoc - Return the location of the "member", in X->F, it is the location of 'F'...
const_child_range children() const
bool usesGNUSyntax() const
Determines whether this designated initializer used the deprecated GNU syntax for designated initiali...
static bool EvaluateAsInt(const Expr *E, Expr::EvalResult &ExprResult, const ASTContext &Ctx, Expr::SideEffectsKind AllowSideEffects, EvalInfo &Info)
ArrayRef< Expr * > inits() const
SourceLocation getBeginLoc() const LLVM_READONLY
SourceLocation getEndLoc() const LLVM_READONLY
const_arg_iterator arg_end() const
SourceLocation getEndLoc() const LLVM_READONLY
const OffsetOfNode & getComponent(unsigned Idx) const
Expr * getTrueExpr() const
getTrueExpr - Return the subexpression which will be evaluated if the condition evaluates to true; th...
SourceLocation getTemplateKeywordLoc() const
Retrieve the location of the template keyword preceding this name, if any.
static bool classof(const Stmt *T)
SourceLocation getLocation() const
Expr * getTrueExpr() const
SourceLocation getRParenLoc() const
The result type of a method or function.
Designator(unsigned Index, SourceLocation LBracketLoc, SourceLocation EllipsisLoc, SourceLocation RBracketLoc)
Initializes a GNU array-range designator.
const Expr * getSubExpr() const
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()
bool isNull() const
Return true if this QualType doesn't point to a type yet.
Expr * getLHS()
An array access can be written A[4] or 4[A] (both are equivalent).
static bool classof(const Stmt *T)
bool hadMultipleCandidates() const
Returns true if this expression refers to a function that was resolved from an overloaded set having ...
const_child_range children() const
__UINTPTR_TYPE__ uintptr_t
An unsigned integer type with the property that any valid pointer to void can be converted to this ty...
const_child_range children() const
SourceLocation getBeginLoc() const LLVM_READONLY
ExplicitCastExpr(StmtClass SC, QualType exprTy, ExprValueKind VK, CastKind kind, Expr *op, unsigned PathSize, TypeSourceInfo *writtenTy)
ImaginaryLiteral - We support imaginary integer and floating point literals, like "1...
SourceLocation getEndLoc() const LLVM_READONLY
ArrayRef< TypeSourceInfo * > getAssocTypeSourceInfos() const
SourceLocation getEndLoc() const LLVM_READONLY
void setRParenLoc(SourceLocation L)
bool isDecrementOp() const
ExprObjectKind getObjectKind() const
getObjectKind - The object kind that this expression produces.
static bool classof(const Stmt *T)
SourceLocation getBeginLoc() const LLVM_READONLY
bool isComparisonOp() const
static bool isBitwiseOp(Opcode Opc)
const Expr * IgnoreConversionOperator() const LLVM_READONLY
const_child_range children() const
static bool classof(const Stmt *T)
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)
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class...
void setComputationLHSType(QualType T)
ConvertVectorExpr - Clang builtin function __builtin_convertvector This AST node provides support for...
const Stmt * getPreArg(unsigned I) const
SourceLocation getLParenLoc() const
DesignatedInitUpdateExpr(EmptyShell Empty)
unsigned path_size() const
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
void setLParenLoc(SourceLocation L)
SmallVector< CXXBaseSpecifier *, 4 > CXXCastPath
A simple array of base specifiers.
bool isInstantiationDependent() const
Whether this expression is instantiation-dependent, meaning that it depends in some way on a template...
const CompoundStmt * getSubStmt() const
SourceLocation getBeginLoc() const LLVM_READONLY
SourceLocation getRAngleLoc() const
Retrieve the location of the right angle bracket ending the explicit template argument list following...
ConstExprIterator const_arg_iterator
SourceLocation getEndLoc() const LLVM_READONLY
void setAccessorLoc(SourceLocation L)
const_child_range children() const
SourceLocation getEndLoc() const LLVM_READONLY
SourceLocation getRAngleLoc() const
Retrieve the location of the right angle bracket ending the explicit template argument list following...
StringLiteral * getFunctionName()
const_child_range children() const
unsigned getNumExprs() const
Return the number of expressions in this paren list.
void setLocation(SourceLocation L)
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)
SourceLocation getEndLoc() const LLVM_READONLY
MutableArrayRef< Expr * > getInits()
const NamedDecl * getFoundDecl() const
Get the NamedDecl through which this reference occurred.
SourceLocation getOperatorLoc() const
SourceLocation getBeginLoc() const LLVM_READONLY
SourceLocation getBeginLoc() const LLVM_READONLY
const Expr * IgnoreParens() const LLVM_READONLY
Expr * getSubExpr() const
const Decl * getReferencedDeclOfCallee() const
SourceLocation getLAngleLoc() const
Retrieve the location of the left angle bracket starting the explicit template argument list followin...
void setUpdater(Expr *Updater)
SourceLocation getBuiltinLoc() const
getBuiltinLoc - Return the location of the __builtin_astype token.
NoInitExpr(EmptyShell Empty)
CastKind getCastKind() const
Expr * getSubExpr(unsigned Idx) const
const Expr *const * getArgs() const
DeclarationName getName() const
getName - Returns the embedded declaration name.
static ConstantExpr * Create(const ASTContext &Context, Expr *E)
pointer data()
data - Return a pointer to the vector's buffer, even if empty().
bool isModifiable() const
static bool isPlaceholderTypeKind(Kind K)
Determines whether the given kind corresponds to a placeholder type.
static bool classof(const Stmt *T)
Represents the declaration of a label.
static bool classof(const Stmt *T)
void setLabelLoc(SourceLocation L)
const Expr * getExpr(unsigned Init) const
ExprObjectKind
A further classification of the kind of object referenced by an l-value or x-value.
std::pair< SourceLocation, PartialDiagnostic > PartialDiagnosticAt
A partial diagnostic along with the source location where this diagnostic occurs. ...
const Expr * ignoreParenBaseCasts() const LLVM_READONLY
SourceLocation getBeginLoc() const LLVM_READONLY
SourceLocation getStrTokenLoc(unsigned TokNum) const
Get one of the string literal token.
StmtExpr(EmptyShell Empty)
Build an empty statement expression.
bool canOverflow() const
Returns true if the unary operator can cause an overflow.
CompoundAssignOperator(EmptyShell Empty)
Build an empty compound assignment operator expression.
SourceLocation getRParenLoc() const
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
Expr * getAssocExpr(unsigned i)
static bool classof(const Stmt *T)
SourceLocation getEndLoc() const LLVM_READONLY
uint64_t VAL
Used to store the <= 64 bits integer value.
MemberExpr(Expr *base, bool isarrow, SourceLocation operatorloc, ValueDecl *memberdecl, SourceLocation l, QualType ty, ExprValueKind VK, ExprObjectKind OK)
const Expr * getSubExprAsWritten() const
static bool classof(const Stmt *T)
const Expr * getArgumentExpr() const
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load, __atomic_store, and __atomic_compare_exchange_*, for the similarly-named C++11 instructions, and __c11 variants for <stdatomic.h>, and corresponding __opencl_atomic_* for OpenCL 2.0.
UnaryExprOrTypeTrait getKind() const
const_child_range children() const
Expr * getExpr(unsigned Init)
const Expr * IgnoreCasts() const LLVM_READONLY
Strip off casts, but keep parentheses.
const_reverse_iterator rbegin() const
bool isValueDependent() const
isValueDependent - Determines whether this expression is value-dependent (C++ [temp.dep.constexpr]).
static bool classof(const Stmt *T)
SourceLocation getBeginLoc() const LLVM_READONLY
SourceLocation getLParenLoc() const
const_child_range children() const
void setDecl(ValueDecl *NewD)
void setArgument(TypeSourceInfo *TInfo)
SourceLocation getEndLoc() const LLVM_READONLY
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Expr ** getInits()
Retrieve the set of initializers.
bool isLValue() const
isLValue - True if this expression is an "l-value" according to the rules of the current language...
CharacterKind getKind() const
static bool classof(const Stmt *T)
InitListExpr(EmptyShell Empty)
Build an empty initializer list.
SourceLocation getBeginLoc() const LLVM_READONLY
AtomicExpr(EmptyShell Empty)
Build an empty AtomicExpr.
static bool isLogicalOp(Opcode Opc)
const_child_range children() const
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;}).
OpaqueValueExpr(EmptyShell Empty)
unsigned LBracketLoc
The location of the '[' starting the array range designator.
const Expr * IgnoreParenLValueCasts() const LLVM_READONLY
path_const_iterator path_end() const
bool isArgumentType() const
const SourceLocation * tokloc_iterator
static bool classof(const Stmt *T)
Expr * getArrayFiller()
If this initializer list initializes an array with more elements than there are initializers in the l...
void sawArrayRangeDesignator(bool ARD=true)
bool isPartOfExplicitCast() const
SourceLocation getEndLoc() const LLVM_READONLY
A placeholder type used to construct an empty shell of a type, that will be filled in later (e...
SourceLocation getExprLoc() const LLVM_READONLY
getExprLoc - Return the preferred location for the arrow when diagnosing a problem with a generic exp...
bool hasTemplateKeyword() const
Determines whether the name in this declaration reference was preceded by the template keyword...
const Expr * getInitializer() const
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.
VAArgExpr(SourceLocation BLoc, Expr *e, TypeSourceInfo *TInfo, SourceLocation RPLoc, QualType t, bool IsMS)
const Expr * getBase() const
EvalStatus is a struct with detailed info about an evaluation in progress.
ArrayInitLoopExpr(QualType T, Expr *CommonInit, Expr *ElementInit)
AddrLabelExpr - The GNU address of label extension, representing &&label.
Expr * getResultExpr()
Return the result-bearing expression, or null if there is none.
Expr(StmtClass SC, EmptyShell)
Construct an empty expression.
OpaqueValueExpr * getOpaqueValue() const
getOpaqueValue - Return the opaque value placeholder.
const FieldDecl * getTargetUnionField() const
const FieldDecl * getInitializedFieldInUnion() const
static bool classof(const Stmt *T)
Expr * getFalseExpr() const
getFalseExpr - Return the subexpression which will be evaluated if the condnition evaluates to false;...
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.
unsigned getNumAssocs() const
Dataflow Directional Tag Classes.
bool isResultDependent() const
Whether this generic selection is result-dependent.
bool isValid() const
Return true if this is a valid SourceLocation object.
bool hasSideEffects() const
tokloc_iterator tokloc_begin() const
void setBuiltinLoc(SourceLocation L)
const TemplateArgumentLoc * getTemplateArgs() const
Retrieve the template arguments provided as part of this template-id.
[C99 6.4.2.2] - A predefined identifier such as func.
DeclarationNameInfo getMemberNameInfo() const
Retrieve the member declaration name info.
SourceLocation getBeginLoc() const LLVM_READONLY
EvalResult is a struct with detailed info about an evaluated expression.
std::reverse_iterator< iterator > reverse_iterator
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
void setRParenLoc(SourceLocation L)
ModifiableType getModifiable() const
void setLabel(LabelDecl *L)
static bool isShiftAssignOp(Opcode Opc)
void setTypeInfoAsWritten(TypeSourceInfo *writtenTy)
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
ExtVectorElementExpr(QualType ty, ExprValueKind VK, Expr *base, IdentifierInfo &accessor, SourceLocation loc)
QualType getAssocType(unsigned i) const
BinaryOperator::Opcode getOpcode(const SymExpr *SE)
void setFileScope(bool FS)
OpaqueValueExpr(SourceLocation Loc, QualType T, ExprValueKind VK, ExprObjectKind OK=OK_Ordinary, Expr *SourceExpr=nullptr)
const Decl * getCalleeDecl() const
const FieldDecl * getSourceBitField() const
SourceLocation getLBraceLoc() const
StmtClass getStmtClass() const
const char * getCastKindName() const
const_child_range children() const
const Expr * getArrayFiller() const
Expression is a Null pointer constant built from a zero integer expression that is not a simple...
llvm::iterator_range< const_semantics_iterator > semantics() const
void setInstantiationDependent(bool ID)
Set whether this expression is instantiation-dependent or not.
Kind
The kind of offsetof node we have.
Expression is a C++11 nullptr.
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.
SourceLocation getEndLoc() const LLVM_READONLY
const Expr * getSubExpr() const
VAArgExpr(EmptyShell Empty)
Create an empty __builtin_va_arg expression.
semantics_iterator semantics_begin()
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...
static bool isPrefix(Opcode Op)
isPrefix - Return true if this is a prefix operation, like –x.
void setInitializedFieldInUnion(FieldDecl *FD)
static bool classof(const Stmt *T)
ExplicitCastExpr(StmtClass SC, EmptyShell Shell, unsigned PathSize)
Construct an empty explicit cast.
llvm::APInt getValue() const
unsigned getNumSubExprs() const
LabelDecl * getLabel() const
void setRBracketLoc(SourceLocation L)
bool hasPlaceholderType(BuiltinType::Kind K) const
Returns whether this expression has a specific placeholder type.
unsigned getByteLength() const
static bool classof(const Stmt *T)
SourceLocation getFieldLoc() const
Expr * getOrderFail() const
DeclarationNameInfo getNameInfo() const
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 getBuiltinLoc() const
CompoundLiteralExpr(SourceLocation lparenloc, TypeSourceInfo *tinfo, QualType T, ExprValueKind VK, Expr *init, bool fileScope)
SourceLocation getEndLoc() const LLVM_READONLY
static bool classof(const Stmt *S)
const_child_range children() const
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
static bool classof(const Stmt *S)
AbstractConditionalOperator - An abstract base class for ConditionalOperator and BinaryConditionalOpe...
TypeSourceInfo * getAssocTypeSourceInfo(unsigned i)
const_child_range children() const
void setIndexExpr(unsigned Idx, Expr *E)
SourceLocation getLocation() const
Retrieve the location of this expression.
SourceLocation getEndLoc() const
Expr * getCond() const
getCond - Return the condition expression; this is defined in terms of the opaque value...
SourceLocation getRParenLoc() const
SourceLocation getBeginLoc() const LLVM_READONLY
static bool classof(const Stmt *T)
FieldDecl * getField() const
const_child_range children() const
SourceLocation getEndLoc() const LLVM_READONLY
ImaginaryLiteral(Expr *val, QualType Ty)
void setKind(UnaryExprOrTypeTrait K)
void setRParenLoc(SourceLocation L)
static bool isAdditiveOp(Opcode Opc)
Base for LValueReferenceType and RValueReferenceType.
void setOperatorLoc(SourceLocation L)
void setValue(const ASTContext &C, const llvm::APFloat &Val)
SourceLocation getBeginLoc() const
StringRef getBytes() const
Allow access to clients that need the byte representation, such as ASTWriterStmt::VisitStringLiteral(...
SourceLocation getDefaultLoc() const
const_child_range children() const
UnaryExprOrTypeTraitExpr(EmptyShell Empty)
Construct an empty sizeof/alignof expression.
const Expr * IgnoreImpCasts() const LLVM_READONLY
SubobjectAdjustment(const MemberPointerType *MPT, Expr *RHS)
ExprIterator arg_iterator
void setLParenLoc(SourceLocation L)
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat]...
ArraySubscriptExpr(Expr *lhs, Expr *rhs, QualType t, ExprValueKind VK, ExprObjectKind OK, SourceLocation rbracketloc)
const_child_range children() const
Represents a base class of a C++ class.
CharacterLiteral(unsigned value, CharacterKind kind, QualType type, SourceLocation l)
A bitfield object is a bitfield on a C or C++ record.
const_child_range children() const
void setOperatorLoc(SourceLocation L)
void setLocation(SourceLocation Location)
static bool isIncrementOp(Opcode Op)
void setHadMultipleCandidates(bool V=true)
Sets the flag telling whether this expression refers to a function that was resolved from an overload...
SourceLocation getBeginLoc() const LLVM_READONLY
Expr * getSrcExpr() const
getSrcExpr - Return the Expr to be converted.
bool isArithmeticOp() const
ImplicitValueInitExpr(EmptyShell Empty)
Construct an empty implicit value initialization.
BinaryOperatorKind Opcode
static bool classof(const Stmt *T)
ArrayRef< TemplateArgumentLoc > template_arguments() const
static bool classof(const Stmt *T)
void setBuiltinLoc(SourceLocation L)
static bool classof(const Stmt *T)
Expression is a Null pointer constant built from a literal zero.
SourceLocation getBeginLoc() const LLVM_READONLY
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
const_child_range children() const
BinaryConditionalOperator(Expr *common, OpaqueValueExpr *opaqueValue, Expr *cond, Expr *lhs, Expr *rhs, SourceLocation qloc, SourceLocation cloc, QualType t, ExprValueKind VK, ExprObjectKind OK)
CXXBaseSpecifier ** path_iterator
Provides definitions for the atomic synchronization scopes.
Represents a C++ struct/union/class.
static bool isCompoundAssignmentOp(Opcode Opc)
Expr * getTrueExpr() const
Represents a loop initializing the elements of an array.
bool isSyntacticForm() const
ChooseExpr - GNU builtin-in function __builtin_choose_expr.
SourceLocation getBeginLoc() const LLVM_READONLY
static bool classof(const Stmt *T)
BinaryConditionalOperator - The GNU extension to the conditional operator which allows the middle ope...
static bool classof(const Stmt *T)
SourceLocation getRParenLoc() const
bool isMultiplicativeOp() const
bool hasUnusedResultAttr(const ASTContext &Ctx) const
Returns true if this call expression should warn on unused results.
unsigned getNumConcatenated() const
getNumConcatenated - Get the number of string literal tokens that were concatenated in translation ph...
bool containsNonAscii() const
bool containsUnexpandedParameterPack() const
Whether this expression contains an unexpanded parameter pack (for C++11 variadic templates)...
SourceLocation getBeginLoc() 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'.
void setPreArg(unsigned I, Stmt *PreArg)
SourceLocation getEndLoc() const LLVM_READONLY
Expr * getInit(unsigned Init)
void setTokenLocation(SourceLocation L)
SourceLocation getBuiltinLoc() const
getBuiltinLoc - Return the location of the __builtin_convertvector token.
StringLiteral - This represents a string literal expression, e.g.
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
SourceLocation getBeginLoc() const LLVM_READONLY
const MemberPointerType * MPT
llvm::ArrayRef< Designator > designators() const
Designator * getDesignator(unsigned Idx)
SourceLocation getBeginLoc() const LLVM_READONLY
AbstractConditionalOperator(StmtClass SC, QualType T, ExprValueKind VK, ExprObjectKind OK, bool TD, bool VD, bool ID, bool ContainsUnexpandedParameterPack, SourceLocation qloc, SourceLocation cloc)
static Decl::Kind getKind(const Decl *D)
static bool classof(const Stmt *T)
SourceLocation getBeginLoc() const LLVM_READONLY
DeclAccessPair FoundDecl
The DeclAccessPair through which the MemberDecl was found due to name qualifiers. ...
unsigned getNumComponents() const
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
std::reverse_iterator< const_iterator > const_reverse_iterator
void setKind(CharacterKind kind)
A reference to a declared variable, function, enum, etc.
bool isIncrementDecrementOp() const
Expr * getSemanticExpr(unsigned index)
SourceLocation getEndLoc() const LLVM_READONLY
SourceLocation getLocation() const
const Expr *const * getSubExprs() const
FieldDecl * getInitializedFieldInUnion()
If this initializes a union, specifies which field in the union to initialize.
bool isConditionDependent() const
An l-value expression is a reference to an object with independent storage.
A trivial tuple used to represent a source range.
This represents a decl that may have a name.
SourceLocation getTemplateKeywordLoc() const
Retrieve the location of the template keyword preceding the member name, if any.
NestedNameSpecifier * getQualifier() const
If the name was qualified, retrieves the nested-name-specifier that precedes the name.
OffsetOfExpr - [C99 7.17] - This represents an expression of the form offsetof(record-type, member-designator).
SourceLocation getEndLoc() const LLVM_READONLY
SourceLocation getEndLoc() const LLVM_READONLY
static bool classof(const Stmt *T)
SourceLocation getBuiltinLoc() const
static bool isDecrementOp(Opcode Op)
Expr * getCommon() const
getCommon - Return the common expression, written to the left of the condition.
TypeSourceInfo * getWrittenTypeInfo() const
const CXXRecordDecl * DerivedClass
path_const_iterator path_begin() const
BlockDecl * getBlockDecl()
bool isInStdNamespace() const
static bool classof(const Stmt *T)
SourceLocation getGenericLoc() const
SubobjectAdjustment(const CastExpr *BasePath, const CXXRecordDecl *DerivedClass)
ImaginaryLiteral(EmptyShell Empty)
Build an empty imaginary literal.
static bool isComparisonOp(Opcode Opc)
SourceLocation getBegin() const
TypeSourceInfo * getTypeSourceInfo() const
getTypeSourceInfo - Return the destination type.
const_child_range children() const
SourceLocation ColonLoc
Location of ':'.
SourceLocation getRParenLoc() const
Return the location of the right parentheses.
llvm::APInt getArraySize() const
bool isConditionTrue() const
isConditionTrue - Return whether the condition is true (i.e.
CastExpr(StmtClass SC, QualType ty, ExprValueKind VK, const CastKind kind, Expr *op, unsigned BasePathSize)
This class handles loading and caching of source files into memory.
InitListExpr * getSyntacticForm() 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()...
Attr - This represents one attribute.
SourceLocation getEndLoc() const LLVM_READONLY
QualType getType() const
Return the type wrapped by this type source info.
const FunctionDecl * getDirectCallee() const
SourceLocation getOperatorLoc() const
InitListExpr * getSemanticForm() const
SourceLocation getEndLoc() const LLVM_READONLY
static OMPLinearClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, OpenMPLinearClauseKind Modifier, SourceLocation ModifierLoc, SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef< Expr *> VL, ArrayRef< Expr *> PL, ArrayRef< Expr *> IL, Expr *Step, Expr *CalcStep, Stmt *PreInit, Expr *PostUpdate)
Creates clause with a list of variables VL and a linear step Step.
static bool classof(const Stmt *T)
void setIsConditionTrue(bool isTrue)
SourceLocation getBeginLoc() const LLVM_READONLY
bool isCompoundAssignmentOp() const
SourceLocation getExprLoc() const
SourceRange getSourceRange() const LLVM_READONLY
static bool EvaluateAsRValue(EvalInfo &Info, const Expr *E, APValue &Result)
EvaluateAsRValue - Try to evaluate this expression, performing an implicit lvalue-to-rvalue cast if i...
llvm::iterator_range< const_arg_iterator > const_arg_range