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" 40 class CXXBaseSpecifier;
41 class CXXMemberCallExpr;
42 class CXXOperatorCallExpr;
46 class MaterializeTemporaryExpr;
48 class ObjCPropertyRefExpr;
49 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;
596 SE_AllowUndefinedBehavior,
603 bool EvaluateAsInt(llvm::APSInt &Result,
const ASTContext &Ctx,
610 EvaluateAsFloat(llvm::APFloat &Result,
const ASTContext &Ctx,
626 bool IncludePossibleEffects =
true)
const;
630 bool hasNonTrivialCall(
const ASTContext &Ctx)
const;
635 llvm::APSInt EvaluateKnownConstInt(
const ASTContext &Ctx,
638 void EvaluateForOverflow(
const ASTContext &Ctx)
const;
659 const Expr *This =
nullptr)
const;
675 bool tryEvaluateObjectSize(uint64_t &Result,
ASTContext &Ctx,
676 unsigned Type)
const;
705 NPC_NeverValueDependent = 0,
713 NPC_ValueDependentIsNotNull
725 bool isOBJCGCCandidate(
ASTContext &Ctx)
const;
728 bool isBoundMemberFunction(
ASTContext &Ctx)
const;
737 Expr *IgnoreImpCasts() LLVM_READONLY;
741 Expr *IgnoreImplicit() LLVM_READONLY {
746 return const_cast<Expr*
>(
this)->IgnoreImplicit();
753 Expr *IgnoreParens() LLVM_READONLY;
757 Expr *IgnoreParenCasts() LLVM_READONLY;
760 Expr *IgnoreCasts() LLVM_READONLY;
764 Expr *IgnoreParenImpCasts() LLVM_READONLY;
768 Expr *IgnoreConversionOperator() LLVM_READONLY;
771 return const_cast<Expr*
>(
this)->IgnoreConversionOperator();
775 return const_cast<Expr*
>(
this)->IgnoreParenImpCasts();
780 Expr *IgnoreParenLValueCasts() LLVM_READONLY;
783 return const_cast<Expr*
>(
this)->IgnoreParenLValueCasts();
792 Expr *ignoreParenBaseCasts() LLVM_READONLY;
795 return const_cast<Expr*
>(
this)->ignoreParenBaseCasts();
805 bool isDefaultArgument()
const;
812 bool isImplicitCXXThis()
const;
815 return const_cast<Expr*
>(
this)->IgnoreImpCasts();
818 return const_cast<Expr*
>(
this)->IgnoreParens();
821 return const_cast<Expr*
>(
this)->IgnoreParenCasts();
825 return const_cast<Expr*
>(
this)->IgnoreCasts();
829 return const_cast<Expr*
>(
this)->IgnoreParenNoopCasts(Ctx);
846 const Expr *getBestDynamicClassTypeExpr()
const;
851 const Expr *skipRValueSubobjectAdjustments(
857 return skipRValueSubobjectAdjustments(CommaLHSs, Adjustments);
883 Expr *SourceExpr =
nullptr)
884 :
Expr(OpaqueValueExprClass, T, VK, OK,
885 T->isDependentType() ||
886 (SourceExpr && SourceExpr->isTypeDependent()),
887 T->isDependentType() ||
888 (SourceExpr && SourceExpr->isValueDependent()),
889 T->isInstantiationDependentType() ||
890 (SourceExpr && SourceExpr->isInstantiationDependent()),
892 SourceExpr(SourceExpr), Loc(Loc) {
902 :
Expr(OpaqueValueExprClass, Empty) { }
909 return SourceExpr ? SourceExpr->
getLocStart() : Loc;
913 return SourceExpr ? SourceExpr->
getLocEnd() : Loc;
916 if (SourceExpr)
return SourceExpr->
getExprLoc();
939 assert((!V || SourceExpr) &&
940 "unique OVEs are expected to have source expressions");
941 OpaqueValueExprBits.IsUnique = V;
944 bool isUnique()
const {
return OpaqueValueExprBits.IsUnique; }
977 NamedDecl *, ASTTemplateKWAndArgsInfo,
978 TemplateArgumentLoc> {
989 size_t numTrailingObjects(OverloadToken<NestedNameSpecifierLoc>)
const {
990 return hasQualifier() ? 1 : 0;
993 size_t numTrailingObjects(OverloadToken<NamedDecl *>)
const {
994 return hasFoundDecl() ? 1 : 0;
997 size_t numTrailingObjects(OverloadToken<ASTTemplateKWAndArgsInfo>)
const {
998 return hasTemplateKWAndArgsInfo() ? 1 : 0;
1003 bool hasFoundDecl()
const {
return DeclRefExprBits.HasFoundDecl; }
1008 ValueDecl *D,
bool RefersToEnlosingVariableOrCapture,
1016 :
Expr(DeclRefExprClass, Empty) { }
1027 D(D), Loc(L), DNLoc(LocInfo) {
1028 DeclRefExprBits.HasQualifier = 0;
1029 DeclRefExprBits.HasTemplateKWAndArgsInfo = 0;
1030 DeclRefExprBits.HasFoundDecl = 0;
1031 DeclRefExprBits.HadMultipleCandidates = 0;
1032 DeclRefExprBits.RefersToEnclosingVariableOrCapture =
1033 RefersToEnclosingVariableOrCapture;
1047 bool RefersToEnclosingVariableOrCapture,
1056 bool HasTemplateKWAndArgsInfo,
1057 unsigned NumTemplateArgs);
1081 if (!hasQualifier())
1083 return *getTrailingObjects<NestedNameSpecifierLoc>();
1089 return getQualifierLoc().getNestedNameSpecifier();
1099 return hasFoundDecl() ? *getTrailingObjects<NamedDecl *>() : D;
1105 return hasFoundDecl() ? *getTrailingObjects<NamedDecl *>() : D;
1109 return DeclRefExprBits.HasTemplateKWAndArgsInfo;
1116 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->TemplateKWLoc;
1123 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->LAngleLoc;
1130 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->RAngleLoc;
1144 if (hasExplicitTemplateArgs())
1145 getTrailingObjects<ASTTemplateKWAndArgsInfo>()->copyInto(
1146 getTrailingObjects<TemplateArgumentLoc>(), List);
1152 if (!hasExplicitTemplateArgs())
1155 return getTrailingObjects<TemplateArgumentLoc>();
1161 if (!hasExplicitTemplateArgs())
1164 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->NumTemplateArgs;
1168 return {getTemplateArgs(), getNumTemplateArgs()};
1174 return DeclRefExprBits.HadMultipleCandidates;
1180 DeclRefExprBits.HadMultipleCandidates = V;
1186 return DeclRefExprBits.RefersToEnclosingVariableOrCapture;
1220 PrettyFunctionNoVirtual
1234 :
Expr(PredefinedExprClass, Empty), Loc(), Type(Func), FnName(nullptr) {}
1246 static StringRef getIdentTypeName(
IdentType IT);
1247 static std::string ComputeName(
IdentType IT,
const Decl *CurrentDecl);
1282 bool hasAllocation()
const {
return llvm::APInt::getNumWords(BitWidth) > 1; }
1291 unsigned NumWords = llvm::APInt::getNumWords(BitWidth);
1293 return llvm::APInt(BitWidth, NumWords, pVal);
1295 return llvm::APInt(BitWidth, VAL);
1297 void setIntValue(
const ASTContext &C,
const llvm::APInt &Val);
1304 setIntValue(C, Val);
1310 llvm::APFloat
getValue(
const llvm::fltSemantics &Semantics)
const {
1311 return llvm::APFloat(Semantics, getIntValue());
1314 setIntValue(C, Val.bitcastToAPInt());
1323 :
Expr(IntegerLiteralClass, Empty) { }
1369 :
Expr(FixedPointLiteralClass, Empty) {}
1377 const llvm::APInt &V,
1395 std::string getValueAsString(
unsigned Radix)
const;
1425 Value(value), Loc(l) {
1426 CharacterLiteralBits.Kind =
kind;
1434 return static_cast<CharacterKind>(CharacterLiteralBits.Kind);
1479 assert(&getSemantics() == &Val.getSemantics() &&
"Inconsistent semantics");
1492 FloatingLiteralBits.Semantics = Sem;
1496 const llvm::fltSemantics &getSemantics()
const;
1499 void setSemantics(
const llvm::fltSemantics &Sem);
1501 bool isExact()
const {
return FloatingLiteralBits.IsExact; }
1502 void setExact(
bool E) { FloatingLiteralBits.IsExact = E; }
1507 double getValueAsApproximateDouble()
const;
1545 :
Expr(ImaginaryLiteralClass, Empty) { }
1604 unsigned CharByteWidth : 4;
1606 unsigned IsPascal : 1;
1607 unsigned NumConcatenated;
1627 return Create(C, Str, Kind, Pascal, Ty, &Loc, 1);
1634 assert(CharByteWidth==1
1635 &&
"This function is used in places that assume strings use char");
1636 return StringRef(StrData.asChar, getByteLength());
1643 if (CharByteWidth == 1)
1644 return StringRef(StrData.asChar, getByteLength());
1645 if (CharByteWidth == 4)
1646 return StringRef(reinterpret_cast<const char*>(StrData.asUInt32),
1648 assert(CharByteWidth == 2 &&
"unsupported CharByteWidth");
1649 return StringRef(reinterpret_cast<const char*>(StrData.asUInt16),
1653 void outputString(raw_ostream &OS)
const;
1656 assert(i < Length &&
"out of bounds access");
1657 if (CharByteWidth == 1)
1658 return static_cast<unsigned char>(StrData.asChar[i]);
1659 if (CharByteWidth == 4)
1660 return StrData.asUInt32[i];
1661 assert(CharByteWidth == 2 &&
"unsupported CharByteWidth");
1662 return StrData.asUInt16[i];
1670 void setString(
const ASTContext &C, StringRef Str,
1684 StringRef Str = getString();
1685 for (
unsigned i = 0, e = Str.size(); i != e; ++i)
1692 StringRef Str = getString();
1693 for (
unsigned i = 0, e = Str.size(); i != e; ++i)
1694 if (!
isASCII(Str[i]) || !Str[i])
1704 assert(TokNum < NumConcatenated &&
"Invalid tok number");
1705 return TokLocs[TokNum];
1708 assert(TokNum < NumConcatenated &&
"Invalid tok number");
1709 TokLocs[TokNum] = L;
1722 unsigned *StartToken =
nullptr,
1723 unsigned *StartTokenByteOffset =
nullptr)
const;
1727 tokloc_iterator
tokloc_end()
const {
return TokLocs + NumConcatenated; }
1733 return TokLocs[NumConcatenated - 1];
1756 :
Expr(ParenExprClass, val->getType(),
1757 val->getValueKind(), val->getObjectKind(),
1758 val->isTypeDependent(), val->isValueDependent(),
1759 val->isInstantiationDependent(),
1760 val->containsUnexpandedParameterPack()),
1761 L(l), R(r), Val(val) {}
1765 :
Expr(ParenExprClass, Empty) { }
1811 unsigned CanOverflow : 1;
1817 :
Expr(UnaryOperatorClass, type, VK, OK,
1818 input->isTypeDependent() || type->isDependentType(),
1819 input->isValueDependent(),
1820 (input->isInstantiationDependent() ||
1821 type->isInstantiationDependentType()),
1822 input->containsUnexpandedParameterPack()),
1823 Opc(opc), CanOverflow(CanOverflow), Loc(l), Val(input) {}
1827 :
Expr(UnaryOperatorClass, Empty), Opc(UO_AddrOf) { }
1829 Opcode
getOpcode()
const {
return static_cast<Opcode
>(Opc); }
1850 return Op == UO_PostInc || Op == UO_PostDec;
1855 return Op == UO_PreInc || Op == UO_PreDec;
1862 return Op == UO_PreInc || Op == UO_PostInc;
1869 return Op == UO_PreDec || Op == UO_PostDec;
1877 return isIncrementDecrementOp(
getOpcode());
1881 return Op >= UO_Plus && Op <= UO_LNot;
1887 static StringRef getOpcodeStr(Opcode Op);
1903 return isPostfix() ? Loc : Val->
getLocEnd();
1937 enum { MaskBits = 2, Mask = 0x03 };
1957 : Range(LBracketLoc, RBracketLoc), Data((Index << 2) | Array) {}
1961 : Range(DotLoc.isValid() ? DotLoc : NameLoc, NameLoc),
1967 : Range(DotLoc.isValid() ? DotLoc : NameLoc, NameLoc),
1968 Data(reinterpret_cast<
uintptr_t>(Name) | Identifier) {}
2038 size_t numTrailingObjects(OverloadToken<OffsetOfNode>)
const {
2047 explicit OffsetOfExpr(
unsigned numComps,
unsigned numExprs)
2049 TSInfo(
nullptr), NumComps(numComps), NumExprs(numExprs) {}
2059 unsigned NumComps,
unsigned NumExprs);
2077 assert(Idx < NumComps &&
"Subscript out of range");
2078 return getTrailingObjects<OffsetOfNode>()[Idx];
2082 assert(Idx < NumComps &&
"Subscript out of range");
2083 getTrailingObjects<OffsetOfNode>()[Idx] = ON;
2091 assert(Idx < NumExprs &&
"Subscript out of range");
2092 return getTrailingObjects<Expr *>()[Idx];
2096 assert(Idx < NumExprs &&
"Subscript out of range");
2097 return getTrailingObjects<Expr *>()[Idx];
2101 assert(Idx < NumComps &&
"Subscript out of range");
2102 getTrailingObjects<Expr *>()[Idx] = E;
2120 Stmt **begin =
reinterpret_cast<Stmt **
>(getTrailingObjects<Expr *>());
2124 Stmt *
const *begin =
2125 reinterpret_cast<Stmt *
const *
>(getTrailingObjects<Expr *>());
2148 TInfo->getType()->isDependentType(),
2149 TInfo->getType()->isInstantiationDependentType(),
2150 TInfo->getType()->containsUnexpandedParameterPack()),
2151 OpLoc(op), RParenLoc(rp) {
2152 UnaryExprOrTypeTraitExprBits.Kind = ExprKind;
2153 UnaryExprOrTypeTraitExprBits.IsType =
true;
2154 Argument.Ty = TInfo;
2163 :
Expr(UnaryExprOrTypeTraitExprClass, Empty) { }
2172 return getArgumentTypeInfo()->getType();
2175 assert(isArgumentType() &&
"calling getArgumentType() when arg is expr");
2179 assert(!isArgumentType() &&
"calling getArgumentExpr() when arg is type");
2180 return static_cast<Expr*
>(Argument.Ex);
2188 UnaryExprOrTypeTraitExprBits.IsType =
false;
2191 Argument.Ty = TInfo;
2192 UnaryExprOrTypeTraitExprBits.IsType =
true;
2198 return isArgumentType() ? getArgumentType() : getArgumentExpr()->getType();
2213 return T->
getStmtClass() == UnaryExprOrTypeTraitExprClass;
2227 enum { LHS, RHS, END_EXPR=2 };
2228 Stmt* SubExprs[END_EXPR];
2234 :
Expr(ArraySubscriptExprClass, t, VK, OK,
2235 lhs->isTypeDependent() || rhs->isTypeDependent(),
2236 lhs->isValueDependent() || rhs->isValueDependent(),
2237 (lhs->isInstantiationDependent() ||
2238 rhs->isInstantiationDependent()),
2239 (lhs->containsUnexpandedParameterPack() ||
2240 rhs->containsUnexpandedParameterPack())),
2241 RBracketLoc(rbracketloc) {
2242 SubExprs[LHS] = lhs;
2243 SubExprs[RHS] = rhs;
2248 :
Expr(ArraySubscriptExprClass, Shell) { }
2285 return getLHS()->getLocStart();
2294 return getBase()->getExprLoc();
2303 return child_range(&SubExprs[0], &SubExprs[0]+END_EXPR);
2317 enum { FN=0, PREARGS_START=1 };
2322 void updateDependenciesFromArg(
Expr *Arg);
2335 assert(i < getNumPreArgs() &&
"Prearg access out of range!");
2336 return SubExprs[PREARGS_START+i];
2339 assert(i < getNumPreArgs() &&
"Prearg access out of range!");
2340 return SubExprs[PREARGS_START+i];
2343 assert(i < getNumPreArgs() &&
"Prearg access out of range!");
2344 SubExprs[PREARGS_START+i] = PreArg;
2360 Decl *getCalleeDecl();
2362 return const_cast<CallExpr*
>(
this)->getCalleeDecl();
2368 return const_cast<CallExpr*
>(
this)->getDirectCallee();
2377 return reinterpret_cast<Expr **
>(SubExprs+getNumPreArgs()+PREARGS_START);
2380 return reinterpret_cast<Expr **
>(SubExprs + getNumPreArgs() +
2386 assert(Arg < NumArgs &&
"Arg access out of range!");
2387 return cast_or_null<Expr>(SubExprs[Arg + getNumPreArgs() + PREARGS_START]);
2390 assert(Arg < NumArgs &&
"Arg access out of range!");
2391 return cast_or_null<Expr>(SubExprs[Arg + getNumPreArgs() + PREARGS_START]);
2396 assert(Arg < NumArgs &&
"Arg access out of range!");
2397 SubExprs[Arg+getNumPreArgs()+PREARGS_START] = ArgExpr;
2403 void setNumArgs(
const ASTContext& C,
unsigned NumArgs);
2410 arg_range
arguments() {
return arg_range(arg_begin(), arg_end()); }
2412 return arg_const_range(arg_begin(), arg_end());
2415 arg_iterator
arg_begin() {
return SubExprs+PREARGS_START+getNumPreArgs(); }
2417 return SubExprs+PREARGS_START+getNumPreArgs()+getNumArgs();
2420 return SubExprs+PREARGS_START+getNumPreArgs();
2423 return SubExprs+PREARGS_START+getNumPreArgs()+getNumArgs();
2431 return llvm::makeArrayRef(SubExprs,
2432 getNumPreArgs() + PREARGS_START + getNumArgs());
2441 unsigned getBuiltinCallee()
const;
2445 bool isUnevaluatedBuiltinCall(
const ASTContext &Ctx)
const;
2478 &SubExprs[0]+NumArgs+getNumPreArgs()+PREARGS_START);
2483 getNumPreArgs() + PREARGS_START);
2503 ASTTemplateKWAndArgsInfo,
2504 TemplateArgumentLoc> {
2530 bool HasQualifierOrFoundDecl : 1;
2537 bool HasTemplateKWAndArgsInfo : 1;
2541 bool HadMultipleCandidates : 1;
2543 size_t numTrailingObjects(OverloadToken<MemberExprNameQualifier>)
const {
2544 return HasQualifierOrFoundDecl ? 1 : 0;
2547 size_t numTrailingObjects(OverloadToken<ASTTemplateKWAndArgsInfo>)
const {
2548 return HasTemplateKWAndArgsInfo ? 1 : 0;
2555 :
Expr(MemberExprClass, ty, VK, OK, base->isTypeDependent(),
2556 base->isValueDependent(), base->isInstantiationDependent(),
2557 base->containsUnexpandedParameterPack()),
2558 Base(base), MemberDecl(memberdecl), MemberDNLoc(NameInfo.
getInfo()),
2559 MemberLoc(NameInfo.getLoc()), OperatorLoc(operatorloc),
2560 IsArrow(isarrow), HasQualifierOrFoundDecl(
false),
2561 HasTemplateKWAndArgsInfo(
false), HadMultipleCandidates(
false) {
2572 :
Expr(MemberExprClass, ty, VK, OK, base->isTypeDependent(),
2573 base->isValueDependent(), base->isInstantiationDependent(),
2574 base->containsUnexpandedParameterPack()),
2575 Base(base), MemberDecl(memberdecl), MemberDNLoc(), MemberLoc(l),
2576 OperatorLoc(operatorloc), IsArrow(isarrow),
2577 HasQualifierOrFoundDecl(
false), HasTemplateKWAndArgsInfo(
false),
2578 HadMultipleCandidates(
false) {}
2601 if (!HasQualifierOrFoundDecl)
2603 getMemberDecl()->getAccess());
2604 return getTrailingObjects<MemberExprNameQualifier>()->FoundDecl;
2616 if (!HasQualifierOrFoundDecl)
2619 return getTrailingObjects<MemberExprNameQualifier>()->QualifierLoc;
2626 return getQualifierLoc().getNestedNameSpecifier();
2633 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->TemplateKWLoc;
2640 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->LAngleLoc;
2647 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->RAngleLoc;
2660 if (hasExplicitTemplateArgs())
2661 getTrailingObjects<ASTTemplateKWAndArgsInfo>()->copyInto(
2662 getTrailingObjects<TemplateArgumentLoc>(), List);
2668 if (!hasExplicitTemplateArgs())
2671 return getTrailingObjects<TemplateArgumentLoc>();
2677 if (!hasExplicitTemplateArgs())
2680 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->NumTemplateArgs;
2684 return {getTemplateArgs(), getNumTemplateArgs()};
2690 MemberLoc, MemberDNLoc);
2712 return getBase() && getBase()->isImplicitCXXThis();
2718 return HadMultipleCandidates;
2724 HadMultipleCandidates = V;
2732 return LO.AppleKext || !hasQualifier();
2761 llvm::PointerIntPair<TypeSourceInfo *, 1, bool> TInfoAndScope;
2767 tinfo->getType()->isDependentType(),
2768 init->isValueDependent(),
2769 (init->isInstantiationDependent() ||
2770 tinfo->getType()->isInstantiationDependentType()),
2771 init->containsUnexpandedParameterPack()),
2772 LParenLoc(lparenloc), TInfoAndScope(tinfo, fileScope), Init(init) {}
2776 :
Expr(CompoundLiteralExprClass, Empty) { }
2789 return TInfoAndScope.getPointer();
2792 TInfoAndScope.setPointer(tinfo);
2831 "[implimits] Direct and indirect base classes [16384].");
2836 bool CastConsistency()
const;
2841 return const_cast<CastExpr*
>(
this)->path_buffer();
2846 assert(!path_empty() && basePathSize != 0);
2847 *(BasePathSize()) = basePathSize;
2852 Expr *op,
unsigned BasePathSize)
2856 ty->isDependentType(),
2859 ty->isDependentType() || (op && op->isValueDependent()),
2860 (ty->isInstantiationDependentType() ||
2861 (op && op->isInstantiationDependent())),
2864 ((SC != ImplicitCastExprClass &&
2865 ty->containsUnexpandedParameterPack()) ||
2866 (op && op->containsUnexpandedParameterPack()))),
2868 CastExprBits.Kind =
kind;
2869 CastExprBits.PartOfExplicitCast =
false;
2870 CastExprBits.BasePathIsEmpty = BasePathSize == 0;
2872 setBasePathSize(BasePathSize);
2873 assert(CastConsistency());
2879 CastExprBits.PartOfExplicitCast =
false;
2880 CastExprBits.BasePathIsEmpty = BasePathSize == 0;
2882 setBasePathSize(BasePathSize);
2889 static const char *getCastKindName(
CastKind CK);
2899 Expr *getSubExprAsWritten();
2901 return const_cast<CastExpr *
>(
this)->getSubExprAsWritten();
2906 NamedDecl *getConversionFunction()
const;
2914 return *(
const_cast<CastExpr *
>(
this)->BasePathSize());
2917 path_iterator
path_end() {
return path_buffer() + path_size(); }
2919 path_const_iterator
path_end()
const {
return path_buffer() + path_size(); }
2922 assert(getCastKind() == CK_ToUnion);
2923 return getTargetFieldForToUnionCast(getType(), getSubExpr()->getType());
2964 CXXBaseSpecifier *> {
2965 size_t numTrailingObjects(OverloadToken<CastExpr::BasePathSizeTy>)
const {
2966 return path_empty() ? 0 : 1;
2972 :
CastExpr(ImplicitCastExprClass, ty, VK, kind, op, BasePathLength) {
2977 :
CastExpr(ImplicitCastExprClass, Shell, PathSize) { }
2983 :
CastExpr(ImplicitCastExprClass, ty, VK, kind, op, 0) {
2988 CastExprBits.PartOfExplicitCast = PartOfExplicitCast;
3001 return getSubExpr()->getLocStart();
3005 return getSubExpr()->getLocEnd();
3019 e = ice->getSubExpr();
3048 :
CastExpr(SC, exprTy, VK, kind, op, PathSize), TInfo(writtenTy) {}
3052 :
CastExpr(SC, Shell, PathSize) { }
3065 return T->
getStmtClass() >= firstExplicitCastExprConstant &&
3076 CXXBaseSpecifier *> {
3084 writtenTy), LPLoc(l), RPLoc(r) {}
3090 size_t numTrailingObjects(OverloadToken<CastExpr::BasePathSizeTy>)
const {
3091 return path_empty() ? 0 : 1;
3114 return getSubExpr()->getLocEnd();
3152 unsigned FPFeatures : 2;
3155 enum { LHS, RHS, END_EXPR };
3156 Stmt* SubExprs[END_EXPR];
3162 :
Expr(BinaryOperatorClass, ResTy, VK, OK,
3163 lhs->isTypeDependent() || rhs->isTypeDependent(),
3164 lhs->isValueDependent() || rhs->isValueDependent(),
3165 (lhs->isInstantiationDependent() ||
3166 rhs->isInstantiationDependent()),
3167 (lhs->containsUnexpandedParameterPack() ||
3168 rhs->containsUnexpandedParameterPack())),
3169 Opc(opc), FPFeatures(FPFeatures.getInt()), OpLoc(opLoc) {
3170 SubExprs[LHS] = lhs;
3171 SubExprs[RHS] = rhs;
3172 assert(!isCompoundAssignmentOp() &&
3173 "Use CompoundAssignOperator for compound assignments");
3178 :
Expr(BinaryOperatorClass, Empty), Opc(BO_Comma) { }
3184 Opcode
getOpcode()
const {
return static_cast<Opcode
>(Opc); }
3194 return getLHS()->getLocStart();
3198 return getRHS()->getLocEnd();
3203 static StringRef getOpcodeStr(Opcode Op);
3216 bool isPtrMemOp()
const {
return Opc == BO_PtrMemD || Opc == BO_PtrMemI; }
3218 return Opc >= BO_Mul && Opc <= BO_Rem;
3221 static bool isAdditiveOp(Opcode Opc) {
return Opc == BO_Add || Opc==BO_Sub; }
3223 static bool isShiftOp(Opcode Opc) {
return Opc == BO_Shl || Opc == BO_Shr; }
3226 static bool isBitwiseOp(Opcode Opc) {
return Opc >= BO_And && Opc <= BO_Or; }
3232 static bool isEqualityOp(Opcode Opc) {
return Opc == BO_EQ || Opc == BO_NE; }
3241 llvm_unreachable(
"Not a comparison operator.");
3242 case BO_LT:
return BO_GE;
3243 case BO_GT:
return BO_LE;
3244 case BO_LE:
return BO_GT;
3245 case BO_GE:
return BO_LT;
3246 case BO_EQ:
return BO_NE;
3247 case BO_NE:
return BO_EQ;
3254 llvm_unreachable(
"Not a comparison operator.");
3255 case BO_LT:
return BO_GT;
3256 case BO_GT:
return BO_LT;
3257 case BO_LE:
return BO_GE;
3258 case BO_GE:
return BO_LE;
3265 static bool isLogicalOp(Opcode Opc) {
return Opc == BO_LAnd || Opc==BO_LOr; }
3269 return Opc >= BO_Assign && Opc <= BO_OrAssign;
3274 return Opc > BO_Assign && Opc <= BO_OrAssign;
3277 return isCompoundAssignmentOp(
getOpcode());
3280 assert(isCompoundAssignmentOp(Opc));
3281 if (Opc >= BO_AndAssign)
3282 return Opcode(
unsigned(Opc) - BO_AndAssign + BO_And);
3284 return Opcode(
unsigned(Opc) - BO_MulAssign + BO_Mul);
3288 return Opc == BO_ShlAssign || Opc == BO_ShrAssign;
3297 static bool isNullPointerArithmeticExtension(
ASTContext &Ctx, Opcode Opc,
3301 return S->
getStmtClass() >= firstBinaryOperatorConstant &&
3307 return child_range(&SubExprs[0], &SubExprs[0]+END_EXPR);
3329 :
Expr(CompoundAssignOperatorClass, ResTy, VK, OK,
3330 lhs->isTypeDependent() || rhs->isTypeDependent(),
3331 lhs->isValueDependent() || rhs->isValueDependent(),
3332 (lhs->isInstantiationDependent() ||
3333 rhs->isInstantiationDependent()),
3334 (lhs->containsUnexpandedParameterPack() ||
3335 rhs->containsUnexpandedParameterPack())),
3336 Opc(opc), FPFeatures(FPFeatures.getInt()), OpLoc(opLoc) {
3337 SubExprs[LHS] = lhs;
3338 SubExprs[RHS] = rhs;
3342 :
Expr(SC, Empty), Opc(BO_MulAssign) { }
3359 :
BinaryOperator(lhs, rhs, opc, ResType, VK, OK, OpLoc, FPFeatures,
3361 ComputationLHSType(CompLHSType),
3362 ComputationResultType(CompResultType) {
3363 assert(isCompoundAssignmentOp() &&
3364 "Only should be used for compound assignments");
3381 return S->
getStmtClass() == CompoundAssignOperatorClass;
3394 bool TD,
bool VD,
bool ID,
3395 bool ContainsUnexpandedParameterPack,
3398 :
Expr(SC, T, VK, OK, TD, VD, ID, ContainsUnexpandedParameterPack),
3399 QuestionLoc(qloc), ColonLoc(cloc) {}
3402 :
Expr(SC, Empty) { }
3407 Expr *getCond()
const;
3411 Expr *getTrueExpr()
const;
3416 Expr *getFalseExpr()
const;
3422 return T->
getStmtClass() == ConditionalOperatorClass ||
3430 enum { COND, LHS, RHS, END_EXPR };
3431 Stmt* SubExprs[END_EXPR];
3442 (lhs->isTypeDependent() || rhs->isTypeDependent()),
3443 (cond->isValueDependent() || lhs->isValueDependent() ||
3444 rhs->isValueDependent()),
3445 (cond->isInstantiationDependent() ||
3446 lhs->isInstantiationDependent() ||
3447 rhs->isInstantiationDependent()),
3448 (cond->containsUnexpandedParameterPack() ||
3449 lhs->containsUnexpandedParameterPack() ||
3450 rhs->containsUnexpandedParameterPack()),
3452 SubExprs[COND] = cond;
3453 SubExprs[LHS] = lhs;
3454 SubExprs[RHS] = rhs;
3479 return getCond()->getLocStart();
3483 return getRHS()->getLocEnd();
3492 return child_range(&SubExprs[0], &SubExprs[0]+END_EXPR);
3505 enum { COMMON, COND, LHS, RHS, NUM_SUBEXPRS };
3512 Stmt *SubExprs[NUM_SUBEXPRS];
3522 (common->isTypeDependent() || rhs->isTypeDependent()),
3523 (common->isValueDependent() || rhs->isValueDependent()),
3524 (common->isInstantiationDependent() ||
3525 rhs->isInstantiationDependent()),
3526 (common->containsUnexpandedParameterPack() ||
3527 rhs->containsUnexpandedParameterPack()),
3529 OpaqueValue(opaqueValue) {
3530 SubExprs[COMMON] = common;
3531 SubExprs[COND] = cond;
3532 SubExprs[LHS] = lhs;
3533 SubExprs[RHS] = rhs;
3534 assert(OpaqueValue->
getSourceExpr() == common &&
"Wrong opaque value");
3557 return cast<Expr>(SubExprs[LHS]);
3564 return cast<Expr>(SubExprs[RHS]);
3569 return getCommon()->getLocStart();
3573 return getFalseExpr()->getLocEnd();
3577 return T->
getStmtClass() == BinaryConditionalOperatorClass;
3582 return child_range(SubExprs, SubExprs + NUM_SUBEXPRS);
3591 return co->getCond();
3592 return cast<BinaryConditionalOperator>(
this)->getCond();
3597 return co->getTrueExpr();
3598 return cast<BinaryConditionalOperator>(
this)->getTrueExpr();
3603 return co->getFalseExpr();
3604 return cast<BinaryConditionalOperator>(
this)->getFalseExpr();
3616 AmpAmpLoc(AALoc), LabelLoc(LLoc), Label(L) {}
3620 :
Expr(AddrLabelExprClass, Empty) { }
3665 SubStmt(substmt), LParenLoc(lp), RParenLoc(rp) { }
3717 :
Expr(ShuffleVectorExprClass, Empty), SubExprs(nullptr) { }
3744 assert((Index < NumExprs) &&
"Arg access out of range!");
3745 return cast<Expr>(SubExprs[Index]);
3748 assert((Index < NumExprs) &&
"Arg access out of range!");
3749 return cast<Expr>(SubExprs[Index]);
3755 assert((N < NumExprs - 2) &&
"Shuffle idx out of range!");
3756 return getExpr(N+2)->EvaluateKnownConstInt(Ctx);
3761 return child_range(&SubExprs[0], &SubExprs[0]+NumExprs);
3785 :
Expr(ConvertVectorExprClass, DstType, VK, OK,
3786 DstType->isDependentType(),
3787 DstType->isDependentType() || SrcExpr->isValueDependent(),
3788 (DstType->isInstantiationDependentType() ||
3789 SrcExpr->isInstantiationDependent()),
3790 (DstType->containsUnexpandedParameterPack() ||
3791 SrcExpr->containsUnexpandedParameterPack())),
3792 SrcExpr(SrcExpr), TInfo(TI), BuiltinLoc(BuiltinLoc), RParenLoc(RParenLoc) {}
3837 enum { COND, LHS, RHS, END_EXPR };
3838 Stmt* SubExprs[END_EXPR];
3845 bool TypeDependent,
bool ValueDependent)
3846 :
Expr(ChooseExprClass, t, VK, OK, TypeDependent, ValueDependent,
3847 (cond->isInstantiationDependent() ||
3848 lhs->isInstantiationDependent() ||
3849 rhs->isInstantiationDependent()),
3850 (cond->containsUnexpandedParameterPack() ||
3851 lhs->containsUnexpandedParameterPack() ||
3852 rhs->containsUnexpandedParameterPack())),
3853 BuiltinLoc(BLoc), RParenLoc(RP), CondIsTrue(condIsTrue) {
3854 SubExprs[COND] = cond;
3855 SubExprs[LHS] = lhs;
3856 SubExprs[RHS] = rhs;
3865 assert(!isConditionDependent() &&
3866 "Dependent condition isn't true or false");
3872 return getCond()->isTypeDependent() || getCond()->isValueDependent();
3878 return isConditionTrue() ? getLHS() : getRHS();
3905 return child_range(&SubExprs[0], &SubExprs[0]+END_EXPR);
3956 llvm::PointerIntPair<TypeSourceInfo *, 1, bool> TInfo;
3962 false, (TInfo->getType()->isInstantiationDependentType() ||
3963 e->isInstantiationDependent()),
3964 (TInfo->getType()->containsUnexpandedParameterPack() ||
3965 e->containsUnexpandedParameterPack())),
3966 Val(e), TInfo(TInfo, IsMS), BuiltinLoc(BLoc), RParenLoc(RPLoc) {}
3970 :
Expr(VAArgExprClass, Empty), Val(nullptr), TInfo(nullptr,
false) {}
4053 InitExprsTy InitExprs;
4061 llvm::PointerIntPair<InitListExpr *, 1, bool> AltForm;
4070 llvm::PointerUnion<Expr *, FieldDecl *> ArrayFillerOrUnionFieldInit;
4078 :
Expr(InitListExprClass, Empty), AltForm(nullptr,
true) { }
4087 return reinterpret_cast<Expr *
const *
>(InitExprs.
data());
4091 return llvm::makeArrayRef(
getInits(), getNumInits());
4095 return llvm::makeArrayRef(
getInits(), getNumInits());
4099 assert(Init < getNumInits() &&
"Initializer access out of range!");
4100 return cast_or_null<Expr>(InitExprs[Init]);
4104 assert(Init < getNumInits() &&
"Initializer access out of range!");
4105 return cast_or_null<Expr>(InitExprs[Init]);
4109 assert(Init < getNumInits() &&
"Initializer access out of range!");
4110 InitExprs[Init] =
expr;
4116 ExprBits.ContainsUnexpandedParameterPack |=
4122 void reserveInits(
const ASTContext &C,
unsigned NumInits);
4130 void resizeInits(
const ASTContext &Context,
unsigned NumInits);
4145 return ArrayFillerOrUnionFieldInit.dyn_cast<
Expr *>();
4148 return const_cast<InitListExpr *
>(
this)->getArrayFiller();
4150 void setArrayFiller(
Expr *filler);
4163 return ArrayFillerOrUnionFieldInit.dyn_cast<
FieldDecl *>();
4166 return const_cast<InitListExpr *
>(
this)->getInitializedFieldInUnion();
4169 assert((FD ==
nullptr 4170 || getInitializedFieldInUnion() ==
nullptr 4171 || getInitializedFieldInUnion() == FD)
4172 &&
"Only one field of a union may be initialized at a time!");
4173 ArrayFillerOrUnionFieldInit = FD;
4184 bool isStringLiteralInit()
const;
4189 bool isTransparent()
const;
4193 bool isIdiomaticZeroInitializer(
const LangOptions &LangOpts)
const;
4202 return isSemanticForm() ? nullptr : AltForm.getPointer();
4205 return !AltForm.getInt() || !AltForm.getPointer();
4208 return isSemanticForm() ? AltForm.getPointer() :
nullptr;
4212 AltForm.setPointer(Init);
4213 AltForm.setInt(
true);
4214 Init->AltForm.setPointer(
this);
4215 Init->AltForm.setInt(
false);
4219 return InitListExprBits.HadArrayRangeDesignator != 0;
4222 InitListExprBits.HadArrayRangeDesignator = ARD;
4243 if (InitExprs.
empty())
4256 const_iterator
end()
const {
return InitExprs.
end(); }
4260 const_reverse_iterator
rend()
const {
return InitExprs.
rend(); }
4300 unsigned GNUSyntax : 1;
4303 unsigned NumDesignators : 15;
4308 unsigned NumSubExprs : 16;
4321 NumDesignators(0), NumSubExprs(NumSubExprs), Designators(
nullptr) { }
4366 ArrayRangeDesignator
4384 Field.NameOrField =
reinterpret_cast<uintptr_t>(FieldName) | 0x01;
4392 : Kind(ArrayDesignator) {
4393 ArrayOrRange.
Index = Index;
4402 : Kind(ArrayRangeDesignator) {
4403 ArrayOrRange.
Index = Index;
4416 assert(Kind ==
FieldDesignator &&
"Only valid on a field designator");
4417 if (
Field.NameOrField & 0x01)
4424 assert(Kind ==
FieldDesignator &&
"Only valid on a field designator");
4429 assert(Kind ==
FieldDesignator &&
"Only valid on a field designator");
4434 assert(Kind ==
FieldDesignator &&
"Only valid on a field designator");
4439 assert((Kind == ArrayDesignator || Kind == ArrayRangeDesignator) &&
4440 "Only valid on an array or array-range designator");
4445 assert((Kind == ArrayDesignator || Kind == ArrayRangeDesignator) &&
4446 "Only valid on an array or array-range designator");
4451 assert(Kind == ArrayRangeDesignator &&
4452 "Only valid on an array-range designator");
4457 assert((Kind == ArrayDesignator || Kind == ArrayRangeDesignator) &&
4458 "Only valid on an array or array-range designator");
4459 return ArrayOrRange.
Index;
4465 return getDotLoc().
isInvalid()? getFieldLoc() : getDotLoc();
4467 return getLBracketLoc();
4482 bool GNUSyntax,
Expr *Init);
4485 unsigned NumIndexExprs);
4488 unsigned size()
const {
return NumDesignators; }
4492 return {Designators, NumDesignators};
4496 return {Designators, NumDesignators};
4501 return &designators()[Idx];
4505 unsigned NumDesigs);
4527 *child_begin() = init;
4537 assert(Idx < NumSubExprs &&
"Subscript out of range");
4538 return cast<Expr>(getTrailingObjects<Stmt *>()[Idx]);
4542 assert(Idx < NumSubExprs &&
"Subscript out of range");
4543 getTrailingObjects<Stmt *>()[Idx] = E;
4548 void ExpandDesignator(
const ASTContext &C,
unsigned Idx,
4564 Stmt **begin = getTrailingObjects<Stmt *>();
4568 Stmt *
const *begin = getTrailingObjects<Stmt *>();
4591 :
Expr(NoInitExprClass, Empty) { }
4625 Stmt *BaseAndUpdaterExprs[2];
4632 :
Expr(DesignatedInitUpdateExprClass, Empty) { }
4640 return T->
getStmtClass() == DesignatedInitUpdateExprClass;
4647 return cast<InitListExpr>(BaseAndUpdaterExprs[1]);
4654 return child_range(&BaseAndUpdaterExprs[0], &BaseAndUpdaterExprs[0] + 2);
4658 &BaseAndUpdaterExprs[0] + 2);
4682 :
Expr(ArrayInitLoopExprClass, Empty), SubExprs{} {}
4687 CommonInit->isValueDependent() || ElementInit->isValueDependent(),
4688 T->isInstantiationDependentType(),
4689 CommonInit->containsUnexpandedParameterPack() ||
4690 ElementInit->containsUnexpandedParameterPack()),
4691 SubExprs{CommonInit, ElementInit} {}
4696 return cast<OpaqueValueExpr>(SubExprs[0]);
4703 return cast<ConstantArrayType>(getType()->castAsArrayTypeUnsafe())
4713 return getCommonExpr()->getLocStart();
4717 return getCommonExpr()->getLocEnd();
4737 :
Expr(ArrayInitIndexExprClass, Empty) {}
4780 :
Expr(ImplicitValueInitExprClass, Empty) { }
4783 return T->
getStmtClass() == ImplicitValueInitExprClass;
4815 assert(Init < getNumExprs() &&
"Initializer access out of range!");
4816 return cast_or_null<Expr>(Exprs[Init]);
4820 assert(Init < getNumExprs() &&
"Initializer access out of range!");
4821 return cast_or_null<Expr>(Exprs[Init]);
4827 return llvm::makeArrayRef(getExprs(), getNumExprs());
4844 return child_range(&Exprs[0], &Exprs[0]+NumExprs);
4881 enum { CONTROLLING, END_EXPR };
4884 unsigned NumAssocs, ResultIndex;
4893 bool ContainsUnexpandedParameterPack,
4894 unsigned ResultIndex);
4902 bool ContainsUnexpandedParameterPack);
4905 :
Expr(GenericSelectionExprClass, Empty) { }
4914 return cast<Expr>(SubExprs[END_EXPR+i]);
4919 ? llvm::makeArrayRef(
4920 &reinterpret_cast<Expr **>(SubExprs)[END_EXPR], NumAssocs)
4924 return AssocTypes[i];
4928 return NumAssocs ? llvm::makeArrayRef(&AssocTypes[0], NumAssocs) :
None;
4933 return TS->getType();
4939 return cast<Expr>(SubExprs[CONTROLLING]);
4950 assert(!isResultDependent() &&
"Generic selection is result-dependent");
4969 return child_range(SubExprs, SubExprs+END_EXPR+NumAssocs);
4995 :
Expr(ExtVectorElementExprClass, ty, VK,
4997 base->isTypeDependent(), base->isValueDependent(),
4998 base->isInstantiationDependent(),
4999 base->containsUnexpandedParameterPack()),
5000 Base(base), Accessor(&accessor), AccessorLoc(loc) {}
5004 :
Expr(ExtVectorElementExprClass, Empty) { }
5017 unsigned getNumElements()
const;
5021 bool containsDuplicateElements()
const;
5029 return getBase()->getLocStart();
5036 bool isArrow()
const;
5057 ty->isDependentType(), ty->isDependentType(),
5058 ty->isInstantiationDependentType() || BD->isDependentContext(),
5071 const Stmt *getBody()
const;
5076 return getCaretLocation();
5115 :
Expr(AsTypeExprClass, DstType, VK, OK,
5116 DstType->isDependentType(),
5117 DstType->isDependentType() || SrcExpr->isValueDependent(),
5118 (DstType->isInstantiationDependentType() ||
5119 SrcExpr->isInstantiationDependent()),
5120 (DstType->containsUnexpandedParameterPack() ||
5121 SrcExpr->containsUnexpandedParameterPack())),
5122 SrcExpr(SrcExpr), BuiltinLoc(BuiltinLoc), RParenLoc(RParenLoc) {}
5191 Expr **getSubExprsBuffer() {
return getTrailingObjects<Expr *>(); }
5192 const Expr *
const *getSubExprsBuffer()
const {
5193 return getTrailingObjects<Expr *>();
5198 unsigned resultIndex);
5200 PseudoObjectExpr(
EmptyShell shell,
unsigned numSemanticExprs);
5202 unsigned getNumSubExprs()
const {
5203 return PseudoObjectExprBits.NumSubExprs;
5209 enum :
unsigned { NoResult = ~0U };
5213 unsigned resultIndex);
5216 unsigned numSemanticExprs);
5227 if (PseudoObjectExprBits.ResultIndex == 0)
return NoResult;
5228 return PseudoObjectExprBits.ResultIndex - 1;
5233 if (PseudoObjectExprBits.ResultIndex == 0)
5235 return getSubExprsBuffer()[PseudoObjectExprBits.ResultIndex];
5238 return const_cast<PseudoObjectExpr*
>(
this)->getResultExpr();
5246 return getSubExprsBuffer() + 1;
5249 return getSubExprsBuffer() + 1;
5252 return getSubExprsBuffer() + getNumSubExprs();
5255 return getSubExprsBuffer() + getNumSubExprs();
5259 return llvm::make_range(semantics_begin(), semantics_end());
5261 llvm::iterator_range<const_semantics_iterator>
semantics()
const {
5262 return llvm::make_range(semantics_begin(), semantics_end());
5266 assert(index + 1 < getNumSubExprs());
5267 return getSubExprsBuffer()[index + 1];
5270 return const_cast<PseudoObjectExpr*
>(
this)->getSemanticExpr(index);
5274 return getSyntacticForm()->getExprLoc();
5279 return getSyntacticForm()->getLocStart();
5283 return getSyntacticForm()->getLocEnd();
5288 const_cast<const PseudoObjectExpr *
>(
this)->
children();
5293 Stmt *
const *cs =
const_cast<Stmt *
const *
>(
5294 reinterpret_cast<const Stmt *
const *
>(getSubExprsBuffer()));
5316 #define BUILTIN(ID, TYPE, ATTRS) 5317 #define ATOMIC_BUILTIN(ID, TYPE, ATTRS) AO ## ID, 5318 #include "clang/Basic/Builtins.def" 5327 enum {
PTR, ORDER, VAL1, ORDER_FAIL, VAL2, WEAK, END_EXPR };
5328 Stmt *SubExprs[END_EXPR + 1];
5329 unsigned NumSubExprs;
5340 static unsigned getNumSubExprs(
AtomicOp Op);
5346 return cast<Expr>(SubExprs[
PTR]);
5349 return cast<Expr>(SubExprs[ORDER]);
5352 assert(getScopeModel() &&
"No scope");
5353 return cast<Expr>(SubExprs[NumSubExprs - 1]);
5356 if (Op == AO__c11_atomic_init || Op == AO__opencl_atomic_init)
5357 return cast<Expr>(SubExprs[ORDER]);
5358 assert(NumSubExprs > VAL1);
5359 return cast<Expr>(SubExprs[VAL1]);
5362 assert(NumSubExprs > ORDER_FAIL);
5363 return cast<Expr>(SubExprs[ORDER_FAIL]);
5366 if (Op == AO__atomic_exchange)
5367 return cast<Expr>(SubExprs[ORDER_FAIL]);
5368 assert(NumSubExprs > VAL2);
5369 return cast<Expr>(SubExprs[VAL2]);
5372 assert(NumSubExprs > WEAK);
5373 return cast<Expr>(SubExprs[WEAK]);
5382 return reinterpret_cast<Expr *
const *
>(SubExprs);
5386 return getPtr()->getType()->getPointeeType().isVolatileQualified();
5390 return getOp() == AO__c11_atomic_compare_exchange_strong ||
5391 getOp() == AO__c11_atomic_compare_exchange_weak ||
5392 getOp() == AO__opencl_atomic_compare_exchange_strong ||
5393 getOp() == AO__opencl_atomic_compare_exchange_weak ||
5394 getOp() == AO__atomic_compare_exchange ||
5395 getOp() == AO__atomic_compare_exchange_n;
5399 return getOp() >= AO__opencl_atomic_init &&
5400 getOp() <= AO__opencl_atomic_fetch_max;
5417 return child_range(SubExprs, SubExprs+NumSubExprs);
5428 (Op >= AO__opencl_atomic_load && Op <= AO__opencl_atomic_fetch_max)
5438 return getScopeModel(getOp());
5452 assert(T->
isDependentType() &&
"TypoExpr given a non-dependent type");
5474 #endif // LLVM_CLANG_AST_EXPR_H SourceLocation getEndLoc() const LLVM_READONLY
void setFPFeatures(FPOptions F)
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
unsigned getNumSemanticExprs() 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
SourceLocation getLocStart() const LLVM_READONLY
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)
void setPreArg(unsigned i, Stmt *PreArg)
SourceLocation getLocStart() const LLVM_READONLY
Expr ** getArgs()
Retrieve the call arguments.
static DiagnosticBuilder Diag(DiagnosticsEngine *Diags, const LangOptions &Features, FullSourceLoc TokLoc, const char *TokBegin, const char *TokRangeBegin, const char *TokRangeEnd, unsigned DiagID)
Produce a diagnostic highlighting some portion of a literal.
BlockExpr(EmptyShell Empty)
Build an empty block expression.
ImplicitCastExpr(OnStack_t _, QualType ty, CastKind kind, Expr *op, ExprValueKind VK)
Expr * getSyntacticForm()
Return the syntactic form of this expression, i.e.
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
A (possibly-)qualified type.
SourceLocation getEndLoc() const LLVM_READONLY
StringKind getKind() const
SourceLocation getLocStart() const LLVM_READONLY
SourceLocation getLocEnd() const LLVM_READONLY
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.
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.
SourceLocation getLocStart() const LLVM_READONLY
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...
SourceLocation getLocEnd() const LLVM_READONLY
CompoundStmt * getSubStmt()
InitExprsTy::const_iterator const_iterator
SourceLocation getLocEnd() const LLVM_READONLY
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.
SourceLocation getBeginLoc() const LLVM_READONLY
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 hasPlaceholderType() const
Returns whether this expression has a placeholder type.
C Language Family Type Representation.
static bool isMultiplicativeOp(Opcode Opc)
SourceLocation getLocEnd() const LLVM_READONLY
SourceLocation getRBracketLoc() const
const_child_range children() const
reverse_iterator rbegin()
const_child_range children() const
SourceLocation getLocEnd() const LLVM_READONLY
TypeSourceInfo * getTypeSourceInfo() const
SourceLocation getLocEnd() const LLVM_READONLY
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.
SourceLocation getLocEnd() const LLVM_READONLY
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 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.
SourceLocation getLocStart() const LLVM_READONLY
const_arg_iterator arg_begin() const
The base class of the type hierarchy.
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...
FPOptions getFPFeatures() const
InitExprsTy::iterator iterator
SourceLocation getLParenLoc() const
SourceLocation getLocStart() const LLVM_READONLY
The l-value was an access to a declared entity or something equivalently strong, like the address of ...
A container of type source information.
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 getLocStart() const LLVM_READONLY
SourceLocation getBeginLoc() const LLVM_READONLY
SourceLocation getEndLoc() const LLVM_READONLY
SourceLocation getLocStart() 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)
SourceLocation getLocStart() const LLVM_READONLY
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
SourceLocation getLocStart() const LLVM_READONLY
Expr * getIndexExpr(unsigned Idx)
const Expr * getIndexExpr(unsigned Idx) const
const CXXBaseSpecifier *const * path_const_iterator
SourceLocation getLocStart() const LLVM_READONLY
Represents a variable declaration or definition.
GenericSelectionExpr(EmptyShell Empty)
SourceLocation getLocEnd() const LLVM_READONLY
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
SourceLocation getLocEnd() const LLVM_READONLY
unsigned EllipsisLoc
The location of the ellipsis separating the start and end indices.
llvm::iterator_range< arg_iterator > arg_range
SourceLocation getColonLoc() const
BlockExpr(BlockDecl *BD, QualType ty)
void setInit(unsigned Init, Expr *expr)
SourceLocation getLocStart() const LLVM_READONLY
AddrLabelExpr(EmptyShell Empty)
Build an empty address of a label expression.
void setValue(unsigned Val)
const_iterator begin() const
void setLocation(SourceLocation Location)
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.
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
SourceLocation getLocStart() const LLVM_READONLY
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
void setStrTokenLoc(unsigned TokNum, SourceLocation L)
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)
One of these records is kept for each identifier that is lexed.
Expr * getFalseExpr() const
SourceLocation getBeginLoc() const LLVM_READONLY
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
SourceLocation getAmpAmpLoc() const
static SourceLocation getFromRawEncoding(unsigned Encoding)
Turn a raw encoding of a SourceLocation object into a real SourceLocation.
SourceLocation getLocStart() 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)
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
ArrayRef< Stmt * > getRawSubExprs()
This method provides fast access to all the subexpressions of a CallExpr without going through the sl...
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 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
SourceLocation getLocEnd() 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
static bool isRelationalOp(Opcode Opc)
SourceLocation getLocStart() const LLVM_READONLY
Expr *const * getInits() const
Retrieve the set of initializers.
void setLBraceLoc(SourceLocation Loc)
StringRef getOpcodeStr() const
SourceLocation getLocStart() const LLVM_READONLY
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 getLocEnd() const LLVM_READONLY
SourceLocation getLocStart() const LLVM_READONLY
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)
SourceLocation getLocEnd() const LLVM_READONLY
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
SourceLocation getLocEnd() const LLVM_READONLY
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)
const uint16_t * asUInt16
APValue Val
Val - This is the value the expression can be folded to.
A convenient class for passing around template argument information.
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"...
SourceLocation getLocStart() const LLVM_READONLY
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...
SourceLocation getLocEnd() const LLVM_READONLY
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.
SourceLocation getLocEnd() const LLVM_READONLY
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.
SourceLocation getLocStart() const LLVM_READONLY
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
SourceLocation getLocEnd() const LLVM_READONLY
An adjustment to be made to the temporary created when emitting a reference binding, which accesses a particular subobject of that temporary.
const Expr * getControllingExpr() const
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Helper class for OffsetOfExpr.
SourceLocation getLocEnd() const LLVM_READONLY
SourceLocation getLocStart() const LLVM_READONLY
SourceLocation getLocEnd() const LLVM_READONLY
SourceLocation getBuiltinLoc() const
SourceLocation getLocEnd() const LLVM_READONLY
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 getLocEnd() const LLVM_READONLY
SourceLocation getLocStart() const LLVM_READONLY
SourceLocation getOperatorLoc() const
getOperatorLoc - Return the location of the operator.
void setRParenLoc(SourceLocation R)
static Classification makeSimpleLValue()
Create a simple, modifiably lvalue.
SourceLocation getLocStart() const LLVM_READONLY
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.
ChooseExpr(SourceLocation BLoc, Expr *cond, Expr *lhs, Expr *rhs, QualType t, ExprValueKind VK, ExprObjectKind OK, SourceLocation RP, bool condIsTrue, bool TypeDependent, bool ValueDependent)
static bool classof(const Stmt *T)
SourceLocation getOperatorLoc() const LLVM_READONLY
void setEqualOrColonLoc(SourceLocation L)
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)
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.
const Stmt * getPreArg(unsigned i) const
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...
SourceLocation getLocEnd() const LLVM_READONLY
Stmt * getPreArg(unsigned i)
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)
bool HasUndefinedBehavior
Whether the evaluation hit undefined behavior.
Represents a call to the builtin function __builtin_va_arg.
SourceLocation getEndLoc() const LLVM_READONLY
static StringLiteral * Create(const ASTContext &C, StringRef Str, StringKind Kind, bool Pascal, QualType Ty, SourceLocation Loc)
Simple constructor for string literals made from one token.
Kinds
The various classification results. Most of these mean prvalue.
SourceLocation getEndLoc() const LLVM_READONLY
unsigned getValue() const
Exposes information about the current target.
Expr * getSrcExpr() const
getSrcExpr - Return the Expr to be converted.
SourceLocation getLocStart() const LLVM_READONLY
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
SourceLocation getBeginLoc() const LLVM_READONLY
const_child_range children() const
SourceLocation getEndLoc() const LLVM_READONLY
void setLocation(SourceLocation Location)
SourceLocation getLocStart() const LLVM_READONLY
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 ...
Expr - 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.
arg_const_range arguments() const
void setRParenLoc(SourceLocation L)
const Expr * getRHS() const
SourceLocation getLocEnd() const LLVM_READONLY
static bool classof(const Stmt *T)
void setSyntacticForm(InitListExpr *Init)
SourceLocation getEndLoc() const LLVM_READONLY
SourceLocation getEndLoc() const LLVM_READONLY
void setMemberLoc(SourceLocation L)
SourceLocation getLocEnd() const LLVM_READONLY
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 getLocEnd() const LLVM_READONLY
const Expr * getCallee() const
SourceLocation getEndLoc() const LLVM_READONLY
An array or GNU array-range designator, e.g., "[9]" or "[10..15]".
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
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
SourceLocation getLocStart() const LLVM_READONLY
ArrayRef< Expr * > inits()
ArraySubscriptExpr(EmptyShell Shell)
Create an empty array subscript expression.
Specifies that a value-dependent expression of integral or dependent type should be considered a null...
Extra data stored in some MemberExpr objects.
SourceLocation getLocStart() const LLVM_READONLY
SourceLocation 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...
SourceLocation getLocEnd() const LLVM_READONLY
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...
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.
SourceLocation getLocEnd() const LLVM_READONLY
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)
SourceLocation getLocStart() const LLVM_READONLY
ImaginaryLiteral - We support imaginary integer and floating point literals, like "1...
SourceLocation getEndLoc() const LLVM_READONLY
ArrayRef< TypeSourceInfo * > getAssocTypeSourceInfos() const
void setRParenLoc(SourceLocation L)
bool isDecrementOp() const
ExprObjectKind getObjectKind() const
getObjectKind - The object kind that this expression produces.
static bool classof(const Stmt *T)
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...
SourceLocation getLocStart() const LLVM_READONLY
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...
unsigned getNumExprs() const
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
SourceLocation getExprLoc() const LLVM_READONLY
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
SourceLocation getLocStart() const LLVM_READONLY
const Expr *const * getArgs() const
DeclarationName getName() const
getName - Returns the embedded declaration name.
pointer data()
data - Return a pointer to the vector's buffer, even if empty().
bool isModifiable() const
ASTContext & getASTContext() const LLVM_READONLY
static bool isPlaceholderTypeKind(Kind K)
Determines whether the given kind corresponds to a placeholder type.
SourceLocation getLocStart() const LLVM_READONLY
static bool classof(const Stmt *T)
Represents the declaration of a label.
unsigned int BasePathSizeTy
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
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)
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
SourceLocation getLocEnd() const LLVM_READONLY
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
SourceLocation getLocEnd() const LLVM_READONLY
AtomicExpr(EmptyShell Empty)
Build an empty AtomicExpr.
IdentType getIdentType() const
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
SourceLocation getEndLoc() const LLVM_READONLY
Expr * getArrayFiller()
If this initializer list initializes an array with more elements than there are initializers in the l...
void sawArrayRangeDesignator(bool ARD=true)
SourceLocation getLocStart() const LLVM_READONLY
bool isPartOfExplicitCast() const
SourceLocation getEndLoc() const LLVM_READONLY
SourceLocation getLocEnd() 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...
SourceLocation getLocEnd() const LLVM_READONLY
bool hasTemplateKeyword() const
Determines whether the name in this declaration reference was preceded by the template keyword...
const Expr * getInitializer() const
SourceLocation getLocEnd() const LLVM_READONLY
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
SourceLocation getLocEnd() const LLVM_READONLY
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.
SourceLocation getLocStart() const LLVM_READONLY
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
SourceLocation getLocStart() const LLVM_READONLY
EvalResult is a struct with detailed info about an evaluated expression.
std::reverse_iterator< iterator > reverse_iterator
SourceLocation getLocEnd() const LLVM_READONLY
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)
SourceLocation getLocStart() const LLVM_READONLY
BinaryConditionalOperator(EmptyShell Empty)
Build an empty conditional operator.
Reads an AST files chain containing the contents of a translation unit.
A field designator, e.g., ".x".
InitExprsTy::reverse_iterator reverse_iterator
SourceLocation getLocEnd() const LLVM_READONLY
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
SourceLocation getLocEnd() const LLVM_READONLY
StmtClass getStmtClass() const
SourceLocation getLocStart() const LLVM_READONLY
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...
SourceLocation getLocStart() const LLVM_READONLY
llvm::iterator_range< const_semantics_iterator > semantics() const
SourceLocation getLocStart() const LLVM_READONLY
enum clang::SubobjectAdjustment::@36 Kind
void setInstantiationDependent(bool ID)
Set whether this expression is instantiation-dependent or not.
llvm::iterator_range< const_arg_iterator > arg_const_range
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)
SourceLocation getLocStart() const LLVM_READONLY
static bool classof(const Stmt *T)
bool isPtrMemOp() const
predicates to categorize the respective opcodes.
ExplicitCastExpr(StmtClass SC, EmptyShell Shell, unsigned PathSize)
Construct an empty explicit cast.
SourceLocation getLocEnd() const LLVM_READONLY
llvm::APInt getValue() const
SourceLocation getLocStart() const LLVM_READONLY
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.
DeclRefExpr(ValueDecl *D, bool RefersToEnclosingVariableOrCapture, QualType T, ExprValueKind VK, SourceLocation L, const DeclarationNameLoc &LocInfo=DeclarationNameLoc())
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 getLocEnd() const LLVM_READONLY
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)
bool isIntegerType() const
isIntegerType() does not include complex integers (a GCC extension).
SourceLocation getLocEnd() const LLVM_READONLY
const_child_range children() const
void setIndexExpr(unsigned Idx, Expr *E)
SourceLocation getLocation() const
Retrieve the location of this expression.
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.
SourceLocation getLocStart() const LLVM_READONLY
void setOperatorLoc(SourceLocation L)
void setValue(const ASTContext &C, const llvm::APFloat &Val)
StringRef getBytes() const
Allow access to clients that need the byte representation, such as ASTWriterStmt::VisitStringLiteral(...
SourceLocation getLocStart() const LLVM_READONLY
SourceLocation getDefaultLoc() const
SourceLocation getLocStart() const LLVM_READONLY
const_child_range children() const
UnaryExprOrTypeTraitExpr(EmptyShell Empty)
Construct an empty sizeof/alignof expression.
const Expr * IgnoreImpCasts() const LLVM_READONLY
ParenListExpr(EmptyShell Empty)
Build an empty paren list.
SubobjectAdjustment(const MemberPointerType *MPT, Expr *RHS)
PredefinedExpr(EmptyShell Empty)
Construct an empty predefined expression.
ExprIterator arg_iterator
void setLParenLoc(SourceLocation L)
SourceLocation getExprLoc() const LLVM_READONLY
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.
SourceLocation getLocStart() const LLVM_READONLY
CharacterLiteral(unsigned value, CharacterKind kind, QualType type, SourceLocation l)
A bitfield object is a bitfield on a C or C++ record.
SourceLocation getLocStart() const LLVM_READONLY
const_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)
SourceLocation getLocEnd() const LLVM_READONLY
SourceLocation getLocEnd() const LLVM_READONLY
Expression is a Null pointer constant built from a literal zero.
SourceLocation getBeginLoc() const LLVM_READONLY
SourceLocation getLocEnd() const LLVM_READONLY
bool allowFPContractWithinStatement() const
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)
SourceLocation getLocStart() const LLVM_READONLY
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
SourceLocation getLocEnd() const LLVM_READONLY
unsigned getNumConcatenated() const
getNumConcatenated - Get the number of string literal tokens that were concatenated in translation ph...
bool containsNonAscii() const
SourceLocation getLocEnd() const LLVM_READONLY
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'.
SourceLocation getLocEnd() const LLVM_READONLY
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)
__DEVICE__ int max(int __a, int __b)
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.
const_child_range children() const
bool isIncrementDecrementOp() const
Expr * getSemanticExpr(unsigned index)
SourceLocation getEndLoc() const LLVM_READONLY
SourceLocation getLocation() const
const Expr *const * getSubExprs() const
SourceLocation getLocStart() const LLVM_READONLY
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.
SourceLocation getLocEnd() const LLVM_READONLY
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 getLocEnd() 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
const uint32_t * asUInt32
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
SourceLocation getLocStart() const LLVM_READONLY
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()...
SourceLocation getEndLoc() const LLVM_READONLY
QualType getType() const
Return the type wrapped by this type source info.
const FunctionDecl * getDirectCallee() 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
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...
SourceLocation getLocEnd() const LLVM_READONLY