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;
668 bool tryEvaluateObjectSize(uint64_t &Result,
ASTContext &Ctx,
669 unsigned Type)
const;
698 NPC_NeverValueDependent = 0,
706 NPC_ValueDependentIsNotNull
718 bool isOBJCGCCandidate(
ASTContext &Ctx)
const;
721 bool isBoundMemberFunction(
ASTContext &Ctx)
const;
730 Expr *IgnoreImpCasts() LLVM_READONLY;
734 Expr *IgnoreImplicit() LLVM_READONLY {
739 return const_cast<Expr*
>(
this)->IgnoreImplicit();
746 Expr *IgnoreParens() LLVM_READONLY;
750 Expr *IgnoreParenCasts() LLVM_READONLY;
753 Expr *IgnoreCasts() LLVM_READONLY;
757 Expr *IgnoreParenImpCasts() LLVM_READONLY;
761 Expr *IgnoreConversionOperator() LLVM_READONLY;
764 return const_cast<Expr*
>(
this)->IgnoreConversionOperator();
768 return const_cast<Expr*
>(
this)->IgnoreParenImpCasts();
773 Expr *IgnoreParenLValueCasts() LLVM_READONLY;
776 return const_cast<Expr*
>(
this)->IgnoreParenLValueCasts();
785 Expr *ignoreParenBaseCasts() LLVM_READONLY;
788 return const_cast<Expr*
>(
this)->ignoreParenBaseCasts();
798 bool isDefaultArgument()
const;
805 bool isImplicitCXXThis()
const;
808 return const_cast<Expr*
>(
this)->IgnoreImpCasts();
811 return const_cast<Expr*
>(
this)->IgnoreParens();
814 return const_cast<Expr*
>(
this)->IgnoreParenCasts();
818 return const_cast<Expr*
>(
this)->IgnoreCasts();
822 return const_cast<Expr*
>(
this)->IgnoreParenNoopCasts(Ctx);
839 const Expr *getBestDynamicClassTypeExpr()
const;
844 const Expr *skipRValueSubobjectAdjustments(
850 return skipRValueSubobjectAdjustments(CommaLHSs, Adjustments);
876 Expr *SourceExpr =
nullptr)
877 :
Expr(OpaqueValueExprClass, T, VK, OK,
878 T->isDependentType() ||
879 (SourceExpr && SourceExpr->isTypeDependent()),
880 T->isDependentType() ||
881 (SourceExpr && SourceExpr->isValueDependent()),
882 T->isInstantiationDependentType() ||
883 (SourceExpr && SourceExpr->isInstantiationDependent()),
885 SourceExpr(SourceExpr), Loc(Loc) {
894 :
Expr(OpaqueValueExprClass, Empty) { }
900 return SourceExpr ? SourceExpr->
getLocStart() : Loc;
903 return SourceExpr ? SourceExpr->
getLocEnd() : Loc;
906 if (SourceExpr)
return SourceExpr->
getExprLoc();
959 NamedDecl *, ASTTemplateKWAndArgsInfo,
960 TemplateArgumentLoc> {
971 size_t numTrailingObjects(OverloadToken<NestedNameSpecifierLoc>)
const {
972 return hasQualifier() ? 1 : 0;
975 size_t numTrailingObjects(OverloadToken<NamedDecl *>)
const {
976 return hasFoundDecl() ? 1 : 0;
979 size_t numTrailingObjects(OverloadToken<ASTTemplateKWAndArgsInfo>)
const {
980 return hasTemplateKWAndArgsInfo() ? 1 : 0;
985 bool hasFoundDecl()
const {
return DeclRefExprBits.HasFoundDecl; }
990 ValueDecl *D,
bool RefersToEnlosingVariableOrCapture,
998 :
Expr(DeclRefExprClass, Empty) { }
1009 D(D), Loc(L), DNLoc(LocInfo) {
1010 DeclRefExprBits.HasQualifier = 0;
1011 DeclRefExprBits.HasTemplateKWAndArgsInfo = 0;
1012 DeclRefExprBits.HasFoundDecl = 0;
1013 DeclRefExprBits.HadMultipleCandidates = 0;
1014 DeclRefExprBits.RefersToEnclosingVariableOrCapture =
1015 RefersToEnclosingVariableOrCapture;
1029 bool RefersToEnclosingVariableOrCapture,
1038 bool HasTemplateKWAndArgsInfo,
1039 unsigned NumTemplateArgs);
1061 if (!hasQualifier())
1063 return *getTrailingObjects<NestedNameSpecifierLoc>();
1069 return getQualifierLoc().getNestedNameSpecifier();
1079 return hasFoundDecl() ? *getTrailingObjects<NamedDecl *>() : D;
1085 return hasFoundDecl() ? *getTrailingObjects<NamedDecl *>() : D;
1089 return DeclRefExprBits.HasTemplateKWAndArgsInfo;
1096 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->TemplateKWLoc;
1103 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->LAngleLoc;
1110 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->RAngleLoc;
1124 if (hasExplicitTemplateArgs())
1125 getTrailingObjects<ASTTemplateKWAndArgsInfo>()->copyInto(
1126 getTrailingObjects<TemplateArgumentLoc>(), List);
1132 if (!hasExplicitTemplateArgs())
1135 return getTrailingObjects<TemplateArgumentLoc>();
1141 if (!hasExplicitTemplateArgs())
1144 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->NumTemplateArgs;
1148 return {getTemplateArgs(), getNumTemplateArgs()};
1154 return DeclRefExprBits.HadMultipleCandidates;
1160 DeclRefExprBits.HadMultipleCandidates = V;
1166 return DeclRefExprBits.RefersToEnclosingVariableOrCapture;
1199 PrettyFunctionNoVirtual
1213 :
Expr(PredefinedExprClass, Empty), Loc(), Type(Func), FnName(nullptr) {}
1225 static StringRef getIdentTypeName(
IdentType IT);
1226 static std::string ComputeName(
IdentType IT,
const Decl *CurrentDecl);
1259 bool hasAllocation()
const {
return llvm::APInt::getNumWords(BitWidth) > 1; }
1268 unsigned NumWords = llvm::APInt::getNumWords(BitWidth);
1270 return llvm::APInt(BitWidth, NumWords, pVal);
1272 return llvm::APInt(BitWidth, VAL);
1274 void setIntValue(
const ASTContext &C,
const llvm::APInt &Val);
1281 setIntValue(C, Val);
1287 llvm::APFloat
getValue(
const llvm::fltSemantics &Semantics)
const {
1288 return llvm::APFloat(Semantics, getIntValue());
1291 setIntValue(C, Val.bitcastToAPInt());
1300 :
Expr(IntegerLiteralClass, Empty) { }
1357 Value(value), Loc(l) {
1358 CharacterLiteralBits.Kind =
kind;
1366 return static_cast<CharacterKind>(CharacterLiteralBits.Kind);
1409 assert(&getSemantics() == &Val.getSemantics() &&
"Inconsistent semantics");
1422 FloatingLiteralBits.Semantics = Sem;
1426 const llvm::fltSemantics &getSemantics()
const;
1429 void setSemantics(
const llvm::fltSemantics &Sem);
1431 bool isExact()
const {
return FloatingLiteralBits.IsExact; }
1432 void setExact(
bool E) { FloatingLiteralBits.IsExact = E; }
1437 double getValueAsApproximateDouble()
const;
1473 :
Expr(ImaginaryLiteralClass, Empty) { }
1528 unsigned CharByteWidth : 4;
1530 unsigned IsPascal : 1;
1531 unsigned NumConcatenated;
1551 return Create(C, Str, Kind, Pascal, Ty, &Loc, 1);
1558 assert(CharByteWidth==1
1559 &&
"This function is used in places that assume strings use char");
1560 return StringRef(StrData.asChar, getByteLength());
1567 if (CharByteWidth == 1)
1568 return StringRef(StrData.asChar, getByteLength());
1569 if (CharByteWidth == 4)
1570 return StringRef(reinterpret_cast<const char*>(StrData.asUInt32),
1572 assert(CharByteWidth == 2 &&
"unsupported CharByteWidth");
1573 return StringRef(reinterpret_cast<const char*>(StrData.asUInt16),
1577 void outputString(raw_ostream &OS)
const;
1580 assert(i < Length &&
"out of bounds access");
1581 if (CharByteWidth == 1)
1582 return static_cast<unsigned char>(StrData.asChar[i]);
1583 if (CharByteWidth == 4)
1584 return StrData.asUInt32[i];
1585 assert(CharByteWidth == 2 &&
"unsupported CharByteWidth");
1586 return StrData.asUInt16[i];
1594 void setString(
const ASTContext &C, StringRef Str,
1608 StringRef Str = getString();
1609 for (
unsigned i = 0, e = Str.size(); i != e; ++i)
1610 if (!
isASCII(Str[i]) || !Str[i])
1620 assert(TokNum < NumConcatenated &&
"Invalid tok number");
1621 return TokLocs[TokNum];
1624 assert(TokNum < NumConcatenated &&
"Invalid tok number");
1625 TokLocs[TokNum] = L;
1638 unsigned *StartToken =
nullptr,
1639 unsigned *StartTokenByteOffset =
nullptr)
const;
1643 tokloc_iterator
tokloc_end()
const {
return TokLocs + NumConcatenated; }
1647 return TokLocs[NumConcatenated - 1];
1670 :
Expr(ParenExprClass, val->getType(),
1671 val->getValueKind(), val->getObjectKind(),
1672 val->isTypeDependent(), val->isValueDependent(),
1673 val->isInstantiationDependent(),
1674 val->containsUnexpandedParameterPack()),
1675 L(l), R(r), Val(val) {}
1679 :
Expr(ParenExprClass, Empty) { }
1729 :
Expr(UnaryOperatorClass, type, VK, OK,
1730 input->isTypeDependent() || type->isDependentType(),
1731 input->isValueDependent(),
1732 (input->isInstantiationDependent() ||
1733 type->isInstantiationDependentType()),
1734 input->containsUnexpandedParameterPack()),
1735 Opc(opc), Loc(l), Val(input) {}
1739 :
Expr(UnaryOperatorClass, Empty), Opc(UO_AddrOf) { }
1741 Opcode
getOpcode()
const {
return static_cast<Opcode
>(Opc); }
1753 return Op == UO_PostInc || Op == UO_PostDec;
1758 return Op == UO_PreInc || Op == UO_PreDec;
1765 return Op == UO_PreInc || Op == UO_PostInc;
1772 return Op == UO_PreDec || Op == UO_PostDec;
1780 return isIncrementDecrementOp(
getOpcode());
1784 return Op >= UO_Plus && Op <= UO_LNot;
1790 static StringRef getOpcodeStr(Opcode Op);
1804 return isPostfix() ? Loc : Val->
getLocEnd();
1838 enum { MaskBits = 2, Mask = 0x03 };
1858 : Range(LBracketLoc, RBracketLoc), Data((Index << 2) | Array) {}
1862 : Range(DotLoc.isValid() ? DotLoc : NameLoc, NameLoc),
1868 : Range(DotLoc.isValid() ? DotLoc : NameLoc, NameLoc),
1869 Data(reinterpret_cast<
uintptr_t>(Name) | Identifier) {}
1937 size_t numTrailingObjects(OverloadToken<OffsetOfNode>)
const {
1946 explicit OffsetOfExpr(
unsigned numComps,
unsigned numExprs)
1948 TSInfo(
nullptr), NumComps(numComps), NumExprs(numExprs) {}
1958 unsigned NumComps,
unsigned NumExprs);
1976 assert(Idx < NumComps &&
"Subscript out of range");
1977 return getTrailingObjects<OffsetOfNode>()[Idx];
1981 assert(Idx < NumComps &&
"Subscript out of range");
1982 getTrailingObjects<OffsetOfNode>()[Idx] = ON;
1990 assert(Idx < NumExprs &&
"Subscript out of range");
1991 return getTrailingObjects<Expr *>()[Idx];
1995 assert(Idx < NumExprs &&
"Subscript out of range");
1996 return getTrailingObjects<Expr *>()[Idx];
2000 assert(Idx < NumComps &&
"Subscript out of range");
2001 getTrailingObjects<Expr *>()[Idx] = E;
2017 Stmt **begin =
reinterpret_cast<Stmt **
>(getTrailingObjects<Expr *>());
2021 Stmt *
const *begin =
2022 reinterpret_cast<Stmt *
const *
>(getTrailingObjects<Expr *>());
2045 TInfo->getType()->isDependentType(),
2046 TInfo->getType()->isInstantiationDependentType(),
2047 TInfo->getType()->containsUnexpandedParameterPack()),
2048 OpLoc(op), RParenLoc(rp) {
2049 UnaryExprOrTypeTraitExprBits.Kind = ExprKind;
2050 UnaryExprOrTypeTraitExprBits.IsType =
true;
2051 Argument.Ty = TInfo;
2060 :
Expr(UnaryExprOrTypeTraitExprClass, Empty) { }
2069 return getArgumentTypeInfo()->getType();
2072 assert(isArgumentType() &&
"calling getArgumentType() when arg is expr");
2076 assert(!isArgumentType() &&
"calling getArgumentExpr() when arg is type");
2077 return static_cast<Expr*
>(Argument.Ex);
2085 UnaryExprOrTypeTraitExprBits.IsType =
false;
2088 Argument.Ty = TInfo;
2089 UnaryExprOrTypeTraitExprBits.IsType =
true;
2095 return isArgumentType() ? getArgumentType() : getArgumentExpr()->getType();
2108 return T->
getStmtClass() == UnaryExprOrTypeTraitExprClass;
2122 enum { LHS, RHS, END_EXPR=2 };
2123 Stmt* SubExprs[END_EXPR];
2129 :
Expr(ArraySubscriptExprClass, t, VK, OK,
2130 lhs->isTypeDependent() || rhs->isTypeDependent(),
2131 lhs->isValueDependent() || rhs->isValueDependent(),
2132 (lhs->isInstantiationDependent() ||
2133 rhs->isInstantiationDependent()),
2134 (lhs->containsUnexpandedParameterPack() ||
2135 rhs->containsUnexpandedParameterPack())),
2136 RBracketLoc(rbracketloc) {
2137 SubExprs[LHS] = lhs;
2138 SubExprs[RHS] = rhs;
2143 :
Expr(ArraySubscriptExprClass, Shell) { }
2163 return cast<Expr>(getRHS()->getType()->isIntegerType() ? getLHS():getRHS());
2167 return cast<Expr>(getRHS()->getType()->isIntegerType() ? getLHS():getRHS());
2171 return cast<Expr>(getRHS()->getType()->isIntegerType() ? getRHS():getLHS());
2175 return cast<Expr>(getRHS()->getType()->isIntegerType() ? getRHS():getLHS());
2179 return getLHS()->getLocStart();
2187 return getBase()->getExprLoc();
2196 return child_range(&SubExprs[0], &SubExprs[0]+END_EXPR);
2210 enum { FN=0, PREARGS_START=1 };
2215 void updateDependenciesFromArg(
Expr *Arg);
2228 assert(i < getNumPreArgs() &&
"Prearg access out of range!");
2229 return SubExprs[PREARGS_START+i];
2232 assert(i < getNumPreArgs() &&
"Prearg access out of range!");
2233 return SubExprs[PREARGS_START+i];
2236 assert(i < getNumPreArgs() &&
"Prearg access out of range!");
2237 SubExprs[PREARGS_START+i] = PreArg;
2253 Decl *getCalleeDecl();
2255 return const_cast<CallExpr*
>(
this)->getCalleeDecl();
2261 return const_cast<CallExpr*
>(
this)->getDirectCallee();
2270 return reinterpret_cast<Expr **
>(SubExprs+getNumPreArgs()+PREARGS_START);
2273 return reinterpret_cast<Expr **
>(SubExprs + getNumPreArgs() +
2279 assert(Arg < NumArgs &&
"Arg access out of range!");
2280 return cast_or_null<Expr>(SubExprs[Arg + getNumPreArgs() + PREARGS_START]);
2283 assert(Arg < NumArgs &&
"Arg access out of range!");
2284 return cast_or_null<Expr>(SubExprs[Arg + getNumPreArgs() + PREARGS_START]);
2289 assert(Arg < NumArgs &&
"Arg access out of range!");
2290 SubExprs[Arg+getNumPreArgs()+PREARGS_START] = ArgExpr;
2296 void setNumArgs(
const ASTContext& C,
unsigned NumArgs);
2303 arg_range
arguments() {
return arg_range(arg_begin(), arg_end()); }
2305 return arg_const_range(arg_begin(), arg_end());
2308 arg_iterator
arg_begin() {
return SubExprs+PREARGS_START+getNumPreArgs(); }
2310 return SubExprs+PREARGS_START+getNumPreArgs()+getNumArgs();
2313 return SubExprs+PREARGS_START+getNumPreArgs();
2316 return SubExprs+PREARGS_START+getNumPreArgs()+getNumArgs();
2324 return llvm::makeArrayRef(SubExprs,
2325 getNumPreArgs() + PREARGS_START + getNumArgs());
2334 unsigned getBuiltinCallee()
const;
2338 bool isUnevaluatedBuiltinCall(
const ASTContext &Ctx)
const;
2365 &SubExprs[0]+NumArgs+getNumPreArgs()+PREARGS_START);
2370 getNumPreArgs() + PREARGS_START);
2390 ASTTemplateKWAndArgsInfo,
2391 TemplateArgumentLoc> {
2417 bool HasQualifierOrFoundDecl : 1;
2424 bool HasTemplateKWAndArgsInfo : 1;
2428 bool HadMultipleCandidates : 1;
2430 size_t numTrailingObjects(OverloadToken<MemberExprNameQualifier>)
const {
2431 return HasQualifierOrFoundDecl ? 1 : 0;
2434 size_t numTrailingObjects(OverloadToken<ASTTemplateKWAndArgsInfo>)
const {
2435 return HasTemplateKWAndArgsInfo ? 1 : 0;
2442 :
Expr(MemberExprClass, ty, VK, OK, base->isTypeDependent(),
2443 base->isValueDependent(), base->isInstantiationDependent(),
2444 base->containsUnexpandedParameterPack()),
2445 Base(base), MemberDecl(memberdecl), MemberDNLoc(NameInfo.
getInfo()),
2446 MemberLoc(NameInfo.getLoc()), OperatorLoc(operatorloc),
2447 IsArrow(isarrow), HasQualifierOrFoundDecl(
false),
2448 HasTemplateKWAndArgsInfo(
false), HadMultipleCandidates(
false) {
2459 :
Expr(MemberExprClass, ty, VK, OK, base->isTypeDependent(),
2460 base->isValueDependent(), base->isInstantiationDependent(),
2461 base->containsUnexpandedParameterPack()),
2462 Base(base), MemberDecl(memberdecl), MemberDNLoc(), MemberLoc(l),
2463 OperatorLoc(operatorloc), IsArrow(isarrow),
2464 HasQualifierOrFoundDecl(
false), HasTemplateKWAndArgsInfo(
false),
2465 HadMultipleCandidates(
false) {}
2488 if (!HasQualifierOrFoundDecl)
2490 getMemberDecl()->getAccess());
2491 return getTrailingObjects<MemberExprNameQualifier>()->FoundDecl;
2503 if (!HasQualifierOrFoundDecl)
2506 return getTrailingObjects<MemberExprNameQualifier>()->QualifierLoc;
2513 return getQualifierLoc().getNestedNameSpecifier();
2520 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->TemplateKWLoc;
2527 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->LAngleLoc;
2534 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->RAngleLoc;
2547 if (hasExplicitTemplateArgs())
2548 getTrailingObjects<ASTTemplateKWAndArgsInfo>()->copyInto(
2549 getTrailingObjects<TemplateArgumentLoc>(), List);
2555 if (!hasExplicitTemplateArgs())
2558 return getTrailingObjects<TemplateArgumentLoc>();
2564 if (!hasExplicitTemplateArgs())
2567 return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->NumTemplateArgs;
2571 return {getTemplateArgs(), getNumTemplateArgs()};
2577 MemberLoc, MemberDNLoc);
2597 return getBase() && getBase()->isImplicitCXXThis();
2603 return HadMultipleCandidates;
2609 HadMultipleCandidates = V;
2617 return LO.AppleKext || !hasQualifier();
2646 llvm::PointerIntPair<TypeSourceInfo *, 1, bool> TInfoAndScope;
2652 tinfo->getType()->isDependentType(),
2653 init->isValueDependent(),
2654 (init->isInstantiationDependent() ||
2655 tinfo->getType()->isInstantiationDependentType()),
2656 init->containsUnexpandedParameterPack()),
2657 LParenLoc(lparenloc), TInfoAndScope(tinfo, fileScope), Init(init) {}
2661 :
Expr(CompoundLiteralExprClass, Empty) { }
2674 return TInfoAndScope.getPointer();
2677 TInfoAndScope.setPointer(tinfo);
2714 bool CastConsistency()
const;
2717 return const_cast<CastExpr*
>(
this)->path_buffer();
2721 void setBasePathSize(
unsigned basePathSize) {
2722 CastExprBits.BasePathSize = basePathSize;
2723 assert(CastExprBits.BasePathSize == basePathSize &&
2724 "basePathSize doesn't fit in bits of CastExprBits.BasePathSize!");
2729 Expr *op,
unsigned BasePathSize)
2733 ty->isDependentType(),
2736 ty->isDependentType() || (op && op->isValueDependent()),
2737 (ty->isInstantiationDependentType() ||
2738 (op && op->isInstantiationDependent())),
2741 ((SC != ImplicitCastExprClass &&
2742 ty->containsUnexpandedParameterPack()) ||
2743 (op && op->containsUnexpandedParameterPack()))),
2745 CastExprBits.Kind =
kind;
2746 setBasePathSize(BasePathSize);
2747 assert(CastConsistency());
2753 setBasePathSize(BasePathSize);
2759 const char *getCastKindName()
const;
2768 Expr *getSubExprAsWritten();
2770 return const_cast<CastExpr *
>(
this)->getSubExprAsWritten();
2775 bool path_empty()
const {
return CastExprBits.BasePathSize == 0; }
2776 unsigned path_size()
const {
return CastExprBits.BasePathSize; }
2778 path_iterator
path_end() {
return path_buffer() + path_size(); }
2780 path_const_iterator
path_end()
const {
return path_buffer() + path_size(); }
2783 assert(getCastKind() == CK_ToUnion);
2784 return getTargetFieldForToUnionCast(getType(), getSubExpr()->getType());
2828 :
CastExpr(ImplicitCastExprClass, ty, VK, kind, op, BasePathLength) {
2833 :
CastExpr(ImplicitCastExprClass, Shell, PathSize) { }
2839 :
CastExpr(ImplicitCastExprClass, ty, VK, kind, op, 0) {
2851 return getSubExpr()->getLocStart();
2854 return getSubExpr()->getLocEnd();
2868 e = ice->getSubExpr();
2897 :
CastExpr(SC, exprTy, VK, kind, op, PathSize), TInfo(writtenTy) {}
2901 :
CastExpr(SC, Shell, PathSize) { }
2914 return T->
getStmtClass() >= firstExplicitCastExprConstant &&
2932 writtenTy), LPLoc(l), RPLoc(r) {}
2956 return getSubExpr()->getLocEnd();
2994 unsigned FPFeatures : 2;
2997 enum { LHS, RHS, END_EXPR };
2998 Stmt* SubExprs[END_EXPR];
3004 :
Expr(BinaryOperatorClass, ResTy, VK, OK,
3005 lhs->isTypeDependent() || rhs->isTypeDependent(),
3006 lhs->isValueDependent() || rhs->isValueDependent(),
3007 (lhs->isInstantiationDependent() ||
3008 rhs->isInstantiationDependent()),
3009 (lhs->containsUnexpandedParameterPack() ||
3010 rhs->containsUnexpandedParameterPack())),
3011 Opc(opc), FPFeatures(FPFeatures.getInt()), OpLoc(opLoc) {
3012 SubExprs[LHS] = lhs;
3013 SubExprs[RHS] = rhs;
3014 assert(!isCompoundAssignmentOp() &&
3015 "Use CompoundAssignOperator for compound assignments");
3020 :
Expr(BinaryOperatorClass, Empty), Opc(BO_Comma) { }
3026 Opcode
getOpcode()
const {
return static_cast<Opcode
>(Opc); }
3035 return getLHS()->getLocStart();
3038 return getRHS()->getLocEnd();
3043 static StringRef getOpcodeStr(Opcode Op);
3056 bool isPtrMemOp()
const {
return Opc == BO_PtrMemD || Opc == BO_PtrMemI; }
3058 return Opc >= BO_Mul && Opc <= BO_Rem;
3061 static bool isAdditiveOp(Opcode Opc) {
return Opc == BO_Add || Opc==BO_Sub; }
3063 static bool isShiftOp(Opcode Opc) {
return Opc == BO_Shl || Opc == BO_Shr; }
3066 static bool isBitwiseOp(Opcode Opc) {
return Opc >= BO_And && Opc <= BO_Or; }
3072 static bool isEqualityOp(Opcode Opc) {
return Opc == BO_EQ || Opc == BO_NE; }
3081 llvm_unreachable(
"Not a comparsion operator.");
3082 case BO_LT:
return BO_GE;
3083 case BO_GT:
return BO_LE;
3084 case BO_LE:
return BO_GT;
3085 case BO_GE:
return BO_LT;
3086 case BO_EQ:
return BO_NE;
3087 case BO_NE:
return BO_EQ;
3094 llvm_unreachable(
"Not a comparsion operator.");
3095 case BO_LT:
return BO_GT;
3096 case BO_GT:
return BO_LT;
3097 case BO_LE:
return BO_GE;
3098 case BO_GE:
return BO_LE;
3105 static bool isLogicalOp(Opcode Opc) {
return Opc == BO_LAnd || Opc==BO_LOr; }
3109 return Opc >= BO_Assign && Opc <= BO_OrAssign;
3114 return Opc > BO_Assign && Opc <= BO_OrAssign;
3117 return isCompoundAssignmentOp(
getOpcode());
3120 assert(isCompoundAssignmentOp(Opc));
3121 if (Opc >= BO_AndAssign)
3122 return Opcode(
unsigned(Opc) - BO_AndAssign + BO_And);
3124 return Opcode(
unsigned(Opc) - BO_MulAssign + BO_Mul);
3128 return Opc == BO_ShlAssign || Opc == BO_ShrAssign;
3137 static bool isNullPointerArithmeticExtension(
ASTContext &Ctx, Opcode Opc,
3141 return S->
getStmtClass() >= firstBinaryOperatorConstant &&
3147 return child_range(&SubExprs[0], &SubExprs[0]+END_EXPR);
3169 :
Expr(CompoundAssignOperatorClass, ResTy, VK, OK,
3170 lhs->isTypeDependent() || rhs->isTypeDependent(),
3171 lhs->isValueDependent() || rhs->isValueDependent(),
3172 (lhs->isInstantiationDependent() ||
3173 rhs->isInstantiationDependent()),
3174 (lhs->containsUnexpandedParameterPack() ||
3175 rhs->containsUnexpandedParameterPack())),
3176 Opc(opc), FPFeatures(FPFeatures.getInt()), OpLoc(opLoc) {
3177 SubExprs[LHS] = lhs;
3178 SubExprs[RHS] = rhs;
3182 :
Expr(SC, Empty), Opc(BO_MulAssign) { }
3199 :
BinaryOperator(lhs, rhs, opc, ResType, VK, OK, OpLoc, FPFeatures,
3201 ComputationLHSType(CompLHSType),
3202 ComputationResultType(CompResultType) {
3203 assert(isCompoundAssignmentOp() &&
3204 "Only should be used for compound assignments");
3221 return S->
getStmtClass() == CompoundAssignOperatorClass;
3234 bool TD,
bool VD,
bool ID,
3235 bool ContainsUnexpandedParameterPack,
3238 :
Expr(SC, T, VK, OK, TD, VD, ID, ContainsUnexpandedParameterPack),
3239 QuestionLoc(qloc), ColonLoc(cloc) {}
3242 :
Expr(SC, Empty) { }
3247 Expr *getCond()
const;
3251 Expr *getTrueExpr()
const;
3256 Expr *getFalseExpr()
const;
3262 return T->
getStmtClass() == ConditionalOperatorClass ||
3270 enum { COND, LHS, RHS, END_EXPR };
3271 Stmt* SubExprs[END_EXPR];
3282 (lhs->isTypeDependent() || rhs->isTypeDependent()),
3283 (cond->isValueDependent() || lhs->isValueDependent() ||
3284 rhs->isValueDependent()),
3285 (cond->isInstantiationDependent() ||
3286 lhs->isInstantiationDependent() ||
3287 rhs->isInstantiationDependent()),
3288 (cond->containsUnexpandedParameterPack() ||
3289 lhs->containsUnexpandedParameterPack() ||
3290 rhs->containsUnexpandedParameterPack()),
3292 SubExprs[COND] = cond;
3293 SubExprs[LHS] = lhs;
3294 SubExprs[RHS] = rhs;
3318 return getCond()->getLocStart();
3321 return getRHS()->getLocEnd();
3330 return child_range(&SubExprs[0], &SubExprs[0]+END_EXPR);
3343 enum { COMMON, COND, LHS, RHS, NUM_SUBEXPRS };
3350 Stmt *SubExprs[NUM_SUBEXPRS];
3360 (common->isTypeDependent() || rhs->isTypeDependent()),
3361 (common->isValueDependent() || rhs->isValueDependent()),
3362 (common->isInstantiationDependent() ||
3363 rhs->isInstantiationDependent()),
3364 (common->containsUnexpandedParameterPack() ||
3365 rhs->containsUnexpandedParameterPack()),
3367 OpaqueValue(opaqueValue) {
3368 SubExprs[COMMON] = common;
3369 SubExprs[COND] = cond;
3370 SubExprs[LHS] = lhs;
3371 SubExprs[RHS] = rhs;
3372 assert(OpaqueValue->
getSourceExpr() == common &&
"Wrong opaque value");
3395 return cast<Expr>(SubExprs[LHS]);
3402 return cast<Expr>(SubExprs[RHS]);
3406 return getCommon()->getLocStart();
3409 return getFalseExpr()->getLocEnd();
3413 return T->
getStmtClass() == BinaryConditionalOperatorClass;
3418 return child_range(SubExprs, SubExprs + NUM_SUBEXPRS);
3427 return co->getCond();
3428 return cast<BinaryConditionalOperator>(
this)->getCond();
3433 return co->getTrueExpr();
3434 return cast<BinaryConditionalOperator>(
this)->getTrueExpr();
3439 return co->getFalseExpr();
3440 return cast<BinaryConditionalOperator>(
this)->getFalseExpr();
3452 AmpAmpLoc(AALoc), LabelLoc(LLoc), Label(L) {}
3456 :
Expr(AddrLabelExprClass, Empty) { }
3499 SubStmt(substmt), LParenLoc(lp), RParenLoc(rp) { }
3549 :
Expr(ShuffleVectorExprClass, Empty), SubExprs(nullptr) { }
3574 assert((Index < NumExprs) &&
"Arg access out of range!");
3575 return cast<Expr>(SubExprs[Index]);
3578 assert((Index < NumExprs) &&
"Arg access out of range!");
3579 return cast<Expr>(SubExprs[Index]);
3585 assert((N < NumExprs - 2) &&
"Shuffle idx out of range!");
3586 return getExpr(N+2)->EvaluateKnownConstInt(Ctx);
3591 return child_range(&SubExprs[0], &SubExprs[0]+NumExprs);
3615 :
Expr(ConvertVectorExprClass, DstType, VK, OK,
3616 DstType->isDependentType(),
3617 DstType->isDependentType() || SrcExpr->isValueDependent(),
3618 (DstType->isInstantiationDependentType() ||
3619 SrcExpr->isInstantiationDependent()),
3620 (DstType->containsUnexpandedParameterPack() ||
3621 SrcExpr->containsUnexpandedParameterPack())),
3622 SrcExpr(SrcExpr), TInfo(TI), BuiltinLoc(BuiltinLoc), RParenLoc(RParenLoc) {}
3665 enum { COND, LHS, RHS, END_EXPR };
3666 Stmt* SubExprs[END_EXPR];
3673 bool TypeDependent,
bool ValueDependent)
3674 :
Expr(ChooseExprClass, t, VK, OK, TypeDependent, ValueDependent,
3675 (cond->isInstantiationDependent() ||
3676 lhs->isInstantiationDependent() ||
3677 rhs->isInstantiationDependent()),
3678 (cond->containsUnexpandedParameterPack() ||
3679 lhs->containsUnexpandedParameterPack() ||
3680 rhs->containsUnexpandedParameterPack())),
3681 BuiltinLoc(BLoc), RParenLoc(RP), CondIsTrue(condIsTrue) {
3682 SubExprs[COND] = cond;
3683 SubExprs[LHS] = lhs;
3684 SubExprs[RHS] = rhs;
3693 assert(!isConditionDependent() &&
3694 "Dependent condition isn't true or false");
3700 return getCond()->isTypeDependent() || getCond()->isValueDependent();
3706 return isConditionTrue() ? getLHS() : getRHS();
3731 return child_range(&SubExprs[0], &SubExprs[0]+END_EXPR);
3780 llvm::PointerIntPair<TypeSourceInfo *, 1, bool> TInfo;
3786 false, (TInfo->getType()->isInstantiationDependentType() ||
3787 e->isInstantiationDependent()),
3788 (TInfo->getType()->containsUnexpandedParameterPack() ||
3789 e->containsUnexpandedParameterPack())),
3790 Val(e), TInfo(TInfo, IsMS), BuiltinLoc(BLoc), RParenLoc(RPLoc) {}
3794 :
Expr(VAArgExprClass, Empty), Val(nullptr), TInfo(nullptr,
false) {}
3875 InitExprsTy InitExprs;
3883 llvm::PointerIntPair<InitListExpr *, 1, bool> AltForm;
3892 llvm::PointerUnion<Expr *, FieldDecl *> ArrayFillerOrUnionFieldInit;
3900 :
Expr(InitListExprClass, Empty), AltForm(nullptr,
true) { }
3909 return reinterpret_cast<Expr *
const *
>(InitExprs.
data());
3913 return llvm::makeArrayRef(
getInits(), getNumInits());
3917 return llvm::makeArrayRef(
getInits(), getNumInits());
3921 assert(Init < getNumInits() &&
"Initializer access out of range!");
3922 return cast_or_null<Expr>(InitExprs[Init]);
3926 assert(Init < getNumInits() &&
"Initializer access out of range!");
3927 return cast_or_null<Expr>(InitExprs[Init]);
3931 assert(Init < getNumInits() &&
"Initializer access out of range!");
3932 InitExprs[Init] =
expr;
3938 ExprBits.ContainsUnexpandedParameterPack |=
3944 void reserveInits(
const ASTContext &C,
unsigned NumInits);
3952 void resizeInits(
const ASTContext &Context,
unsigned NumInits);
3967 return ArrayFillerOrUnionFieldInit.dyn_cast<
Expr *>();
3970 return const_cast<InitListExpr *
>(
this)->getArrayFiller();
3972 void setArrayFiller(
Expr *filler);
3985 return ArrayFillerOrUnionFieldInit.dyn_cast<
FieldDecl *>();
3988 return const_cast<InitListExpr *
>(
this)->getInitializedFieldInUnion();
3991 assert((FD ==
nullptr 3992 || getInitializedFieldInUnion() ==
nullptr 3993 || getInitializedFieldInUnion() == FD)
3994 &&
"Only one field of a union may be initialized at a time!");
3995 ArrayFillerOrUnionFieldInit = FD;
4006 bool isStringLiteralInit()
const;
4011 bool isTransparent()
const;
4015 bool isIdiomaticZeroInitializer(
const LangOptions &LangOpts)
const;
4024 return isSemanticForm() ? nullptr : AltForm.getPointer();
4027 return !AltForm.getInt() || !AltForm.getPointer();
4030 return isSemanticForm() ? AltForm.getPointer() :
nullptr;
4034 AltForm.setPointer(Init);
4035 AltForm.setInt(
true);
4036 Init->AltForm.setPointer(
this);
4037 Init->AltForm.setInt(
false);
4041 return InitListExprBits.HadArrayRangeDesignator != 0;
4044 InitListExprBits.HadArrayRangeDesignator = ARD;
4063 if (InitExprs.
empty())
4076 const_iterator
end()
const {
return InitExprs.
end(); }
4080 const_reverse_iterator
rend()
const {
return InitExprs.
rend(); }
4120 unsigned GNUSyntax : 1;
4123 unsigned NumDesignators : 15;
4128 unsigned NumSubExprs : 16;
4141 NumDesignators(0), NumSubExprs(NumSubExprs), Designators(
nullptr) { }
4186 ArrayRangeDesignator
4204 Field.NameOrField =
reinterpret_cast<uintptr_t>(FieldName) | 0x01;
4212 : Kind(ArrayDesignator) {
4213 ArrayOrRange.
Index = Index;
4222 : Kind(ArrayRangeDesignator) {
4223 ArrayOrRange.
Index = Index;
4236 assert(Kind ==
FieldDesignator &&
"Only valid on a field designator");
4237 if (
Field.NameOrField & 0x01)
4244 assert(Kind ==
FieldDesignator &&
"Only valid on a field designator");
4249 assert(Kind ==
FieldDesignator &&
"Only valid on a field designator");
4254 assert(Kind ==
FieldDesignator &&
"Only valid on a field designator");
4259 assert((Kind == ArrayDesignator || Kind == ArrayRangeDesignator) &&
4260 "Only valid on an array or array-range designator");
4265 assert((Kind == ArrayDesignator || Kind == ArrayRangeDesignator) &&
4266 "Only valid on an array or array-range designator");
4271 assert(Kind == ArrayRangeDesignator &&
4272 "Only valid on an array-range designator");
4277 assert((Kind == ArrayDesignator || Kind == ArrayRangeDesignator) &&
4278 "Only valid on an array or array-range designator");
4279 return ArrayOrRange.
Index;
4284 return getDotLoc().
isInvalid()? getFieldLoc() : getDotLoc();
4286 return getLBracketLoc();
4300 bool GNUSyntax,
Expr *Init);
4303 unsigned NumIndexExprs);
4306 unsigned size()
const {
return NumDesignators; }
4310 return {Designators, NumDesignators};
4314 return {Designators, NumDesignators};
4319 return &designators()[Idx];
4323 unsigned NumDesigs);
4345 *child_begin() = init;
4355 assert(Idx < NumSubExprs &&
"Subscript out of range");
4356 return cast<Expr>(getTrailingObjects<Stmt *>()[Idx]);
4360 assert(Idx < NumSubExprs &&
"Subscript out of range");
4361 getTrailingObjects<Stmt *>()[Idx] = E;
4366 void ExpandDesignator(
const ASTContext &C,
unsigned Idx,
4380 Stmt **begin = getTrailingObjects<Stmt *>();
4384 Stmt *
const *begin = getTrailingObjects<Stmt *>();
4407 :
Expr(NoInitExprClass, Empty) { }
4439 Stmt *BaseAndUpdaterExprs[2];
4446 :
Expr(DesignatedInitUpdateExprClass, Empty) { }
4452 return T->
getStmtClass() == DesignatedInitUpdateExprClass;
4459 return cast<InitListExpr>(BaseAndUpdaterExprs[1]);
4466 return child_range(&BaseAndUpdaterExprs[0], &BaseAndUpdaterExprs[0] + 2);
4470 &BaseAndUpdaterExprs[0] + 2);
4494 :
Expr(ArrayInitLoopExprClass, Empty), SubExprs{} {}
4499 CommonInit->isValueDependent() || ElementInit->isValueDependent(),
4500 T->isInstantiationDependentType(),
4501 CommonInit->containsUnexpandedParameterPack() ||
4502 ElementInit->containsUnexpandedParameterPack()),
4503 SubExprs{CommonInit, ElementInit} {}
4508 return cast<OpaqueValueExpr>(SubExprs[0]);
4515 return cast<ConstantArrayType>(getType()->castAsArrayTypeUnsafe())
4524 return getCommonExpr()->getLocStart();
4527 return getCommonExpr()->getLocEnd();
4547 :
Expr(ArrayInitIndexExprClass, Empty) {}
4588 :
Expr(ImplicitValueInitExprClass, Empty) { }
4591 return T->
getStmtClass() == ImplicitValueInitExprClass;
4621 assert(Init < getNumExprs() &&
"Initializer access out of range!");
4622 return cast_or_null<Expr>(Exprs[Init]);
4626 assert(Init < getNumExprs() &&
"Initializer access out of range!");
4627 return cast_or_null<Expr>(Exprs[Init]);
4633 return llvm::makeArrayRef(getExprs(), getNumExprs());
4648 return child_range(&Exprs[0], &Exprs[0]+NumExprs);
4685 enum { CONTROLLING, END_EXPR };
4688 unsigned NumAssocs, ResultIndex;
4697 bool ContainsUnexpandedParameterPack,
4698 unsigned ResultIndex);
4706 bool ContainsUnexpandedParameterPack);
4709 :
Expr(GenericSelectionExprClass, Empty) { }
4718 return cast<Expr>(SubExprs[END_EXPR+i]);
4723 ? llvm::makeArrayRef(
4724 &reinterpret_cast<Expr **>(SubExprs)[END_EXPR], NumAssocs)
4728 return AssocTypes[i];
4732 return NumAssocs ? llvm::makeArrayRef(&AssocTypes[0], NumAssocs) :
None;
4737 return TS->getType();
4743 return cast<Expr>(SubExprs[CONTROLLING]);
4754 assert(!isResultDependent() &&
"Generic selection is result-dependent");
4771 return child_range(SubExprs, SubExprs+END_EXPR+NumAssocs);
4797 :
Expr(ExtVectorElementExprClass, ty, VK,
4799 base->isTypeDependent(), base->isValueDependent(),
4800 base->isInstantiationDependent(),
4801 base->containsUnexpandedParameterPack()),
4802 Base(base), Accessor(&accessor), AccessorLoc(loc) {}
4806 :
Expr(ExtVectorElementExprClass, Empty) { }
4819 unsigned getNumElements()
const;
4823 bool containsDuplicateElements()
const;
4830 return getBase()->getLocStart();
4836 bool isArrow()
const;
4857 ty->isDependentType(), ty->isDependentType(),
4858 ty->isInstantiationDependentType() || BD->isDependentContext(),
4871 const Stmt *getBody()
const;
4909 :
Expr(AsTypeExprClass, DstType, VK, OK,
4910 DstType->isDependentType(),
4911 DstType->isDependentType() || SrcExpr->isValueDependent(),
4912 (DstType->isInstantiationDependentType() ||
4913 SrcExpr->isInstantiationDependent()),
4914 (DstType->containsUnexpandedParameterPack() ||
4915 SrcExpr->containsUnexpandedParameterPack())),
4916 SrcExpr(SrcExpr), BuiltinLoc(BuiltinLoc), RParenLoc(RParenLoc) {}
4983 Expr **getSubExprsBuffer() {
return getTrailingObjects<Expr *>(); }
4984 const Expr *
const *getSubExprsBuffer()
const {
4985 return getTrailingObjects<Expr *>();
4990 unsigned resultIndex);
4992 PseudoObjectExpr(
EmptyShell shell,
unsigned numSemanticExprs);
4994 unsigned getNumSubExprs()
const {
4995 return PseudoObjectExprBits.NumSubExprs;
5001 enum :
unsigned { NoResult = ~0U };
5005 unsigned resultIndex);
5008 unsigned numSemanticExprs);
5019 if (PseudoObjectExprBits.ResultIndex == 0)
return NoResult;
5020 return PseudoObjectExprBits.ResultIndex - 1;
5025 if (PseudoObjectExprBits.ResultIndex == 0)
5027 return getSubExprsBuffer()[PseudoObjectExprBits.ResultIndex];
5030 return const_cast<PseudoObjectExpr*
>(
this)->getResultExpr();
5038 return getSubExprsBuffer() + 1;
5041 return getSubExprsBuffer() + 1;
5044 return getSubExprsBuffer() + getNumSubExprs();
5047 return getSubExprsBuffer() + getNumSubExprs();
5051 return llvm::make_range(semantics_begin(), semantics_end());
5053 llvm::iterator_range<const_semantics_iterator>
semantics()
const {
5054 return llvm::make_range(semantics_begin(), semantics_end());
5058 assert(index + 1 < getNumSubExprs());
5059 return getSubExprsBuffer()[index + 1];
5062 return const_cast<PseudoObjectExpr*
>(
this)->getSemanticExpr(index);
5066 return getSyntacticForm()->getExprLoc();
5070 return getSyntacticForm()->getLocStart();
5073 return getSyntacticForm()->getLocEnd();
5078 const_cast<const PseudoObjectExpr *
>(
this)->
children();
5083 Stmt *
const *cs =
const_cast<Stmt *
const *
>(
5084 reinterpret_cast<const Stmt *
const *
>(getSubExprsBuffer()));
5106 #define BUILTIN(ID, TYPE, ATTRS) 5107 #define ATOMIC_BUILTIN(ID, TYPE, ATTRS) AO ## ID, 5108 #include "clang/Basic/Builtins.def" 5117 enum {
PTR, ORDER, VAL1, ORDER_FAIL, VAL2, WEAK, END_EXPR };
5118 Stmt *SubExprs[END_EXPR + 1];
5119 unsigned NumSubExprs;
5130 static unsigned getNumSubExprs(
AtomicOp Op);
5136 return cast<Expr>(SubExprs[
PTR]);
5139 return cast<Expr>(SubExprs[ORDER]);
5142 assert(getScopeModel() &&
"No scope");
5143 return cast<Expr>(SubExprs[NumSubExprs - 1]);
5146 if (Op == AO__c11_atomic_init || Op == AO__opencl_atomic_init)
5147 return cast<Expr>(SubExprs[ORDER]);
5148 assert(NumSubExprs > VAL1);
5149 return cast<Expr>(SubExprs[VAL1]);
5152 assert(NumSubExprs > ORDER_FAIL);
5153 return cast<Expr>(SubExprs[ORDER_FAIL]);
5156 if (Op == AO__atomic_exchange)
5157 return cast<Expr>(SubExprs[ORDER_FAIL]);
5158 assert(NumSubExprs > VAL2);
5159 return cast<Expr>(SubExprs[VAL2]);
5162 assert(NumSubExprs > WEAK);
5163 return cast<Expr>(SubExprs[WEAK]);
5172 return reinterpret_cast<Expr *
const *
>(SubExprs);
5176 return getPtr()->getType()->getPointeeType().isVolatileQualified();
5180 return getOp() == AO__c11_atomic_compare_exchange_strong ||
5181 getOp() == AO__c11_atomic_compare_exchange_weak ||
5182 getOp() == AO__opencl_atomic_compare_exchange_strong ||
5183 getOp() == AO__opencl_atomic_compare_exchange_weak ||
5184 getOp() == AO__atomic_compare_exchange ||
5185 getOp() == AO__atomic_compare_exchange_n;
5189 return getOp() >= AO__opencl_atomic_init &&
5190 getOp() <= AO__opencl_atomic_fetch_max;
5205 return child_range(SubExprs, SubExprs+NumSubExprs);
5216 (Op >= AO__opencl_atomic_load && Op <= AO__opencl_atomic_fetch_max)
5226 return getScopeModel(getOp());
5240 assert(T->
isDependentType() &&
"TypoExpr given a non-dependent type");
5260 #endif // LLVM_CLANG_AST_EXPR_H 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.
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
An instance of this class is created to represent 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.
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.
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 '('.
Expr(StmtClass SC, QualType T, ExprValueKind VK, ExprObjectKind OK, bool TD, bool VD, bool ID, bool ContainsUnexpandedParameterPack)
Expr * getExpr(unsigned Index)
getExpr - Return the Expr at the specified index.
llvm::APFloat getValue(const llvm::fltSemantics &Semantics) const
Designator(unsigned Index, SourceLocation LBracketLoc, SourceLocation RBracketLoc)
Initializes an array designator.
unsigned FieldLoc
The location of the field name in the designated initializer.
CharacterLiteral(EmptyShell Empty)
Construct an empty character literal.
unsigned getNumSubExprs() const
getNumSubExprs - Return the size of the SubExprs array.
unsigned getResultIndex() const
The zero-based index of the result expression's generic association in the generic selection's associ...
SourceLocation getLocEnd() const LLVM_READONLY
CompoundStmt * getSubStmt()
InitExprsTy::const_iterator const_iterator
SourceLocation getLocEnd() 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
Expr *const * semantics_iterator
Stmt - This represents one statement.
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this call.
CompoundLiteralExpr(EmptyShell Empty)
Construct an empty compound literal.
SourceLocation getOperatorLoc() const
getOperatorLoc - Return the location of the operator.
SourceLocation getRParenLoc() const
SourceLocation getLocation() const
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
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.
const Expr * getSubExpr() const
const_child_range children() const
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.
Stmt * IgnoreImplicit()
Skip past any implicit AST nodes which might surround this statement, such as ExprWithCleanups or Imp...
Floating point control options.
SourceLocation getLocStart() const LLVM_READONLY
SourceLocation getLocStart() const LLVM_READONLY
static bool classof(const Stmt *T)
const_child_range children() const
SourceLocation getExprLoc() 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
Expr * getIndexExpr(unsigned Idx)
const Expr * getIndexExpr(unsigned Idx) const
const CXXBaseSpecifier *const * path_const_iterator
SourceLocation getLocStart() const LLVM_READONLY
VarDecl - An instance of this class is created to represent a variable declaration or definition...
UnaryOperator(Expr *input, Opcode opc, QualType type, ExprValueKind VK, ExprObjectKind OK, SourceLocation l)
GenericSelectionExpr(EmptyShell Empty)
SourceLocation getLocEnd() const LLVM_READONLY
bool hasTemplateKWAndArgsInfo() const
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)
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
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
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
const Expr * IgnoreParenNoopCasts(ASTContext &Ctx) const LLVM_READONLY
bool isAdditiveOp() const
SourceLocation getLocStart() const LLVM_READONLY
bool isEqualityOp() const
SourceLocation getBuiltinLoc() const
IdentifierInfo * getIdentifier() const
getIdentifier - 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
RecordDecl - 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
getDeclName - 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
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 getAmpAmpLoc() const
static SourceLocation getFromRawEncoding(unsigned Encoding)
Turn a raw encoding of a SourceLocation object into a real SourceLocation.
SourceLocation getLocStart() const LLVM_READONLY
FieldDecl - An instance of this class is created by Sema::ActOnField to represent a member of a struc...
void setIsMicrosoftABI(bool IsMS)
Represents a place-holder for an object not to be initialized by anything.
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.
void setRParen(SourceLocation Loc)
GNUNullExpr(EmptyShell Empty)
Build an empty GNU __null expression.
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 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 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)
const_child_range children() const
unsigned getCharByteWidth() const
bool isAssignmentOp() const
NestedNameSpecifierLoc QualifierLoc
The nested-name-specifier that qualifies the name, including source-location information.
void setRParenLoc(SourceLocation L)
static bool classof(const Stmt *T)
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)
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
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
AsTypeExpr(Expr *SrcExpr, QualType DstType, ExprValueKind VK, ExprObjectKind OK, SourceLocation BuiltinLoc, SourceLocation RParenLoc)
void setValue(const ASTContext &C, const llvm::APInt &Val)
SourceLocation getLocEnd() const LLVM_READONLY
void setBuiltinLoc(SourceLocation L)
SmallVectorImpl< PartialDiagnosticAt > * Diag
Diag - If this is non-null, it will be filled in with a stack of notes indicating why evaluation fail...
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.
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...
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.
SourceLocation getLocEnd() const LLVM_READONLY
static std::unique_ptr< AtomicScopeModel > getScopeModel(AtomicOp Op)
Get atomic scope model for the atomic op code.
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.
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.
unsigned getValue() const
Exposes information about the current target.
Expr * getSrcExpr() const
getSrcExpr - Return the Expr to be converted.
CompoundAssignOperator(Expr *lhs, Expr *rhs, Opcode opc, QualType ResType, ExprValueKind VK, ExprObjectKind OK, QualType CompLHSType, QualType CompResultType, SourceLocation OpLoc, FPOptions FPFeatures)
llvm::APSInt getShuffleMaskIdx(const ASTContext &Ctx, unsigned N) const
const_child_range children() const
void setLocation(SourceLocation Location)
SourceLocation getLocStart() const LLVM_READONLY
BlockDecl - This represents a block literal declaration, which is like an unnamed FunctionDecl...
llvm::MutableArrayRef< Designator > designators()
static bool classof(const Stmt *T)
DeclAccessPair getFoundDecl() const
Retrieves the declaration found by lookup.
ValueDecl - Represent the declaration of a variable (in which case it is an lvalue) a function (in wh...
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
const FunctionProtoType * T
static bool classof(const Stmt *T)
void setSyntacticForm(InitListExpr *Init)
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.
const Expr * getCallee() const
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
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.
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
const_arg_iterator arg_end() const
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 ...
__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
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...
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
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 getRAngleLoc() const
Retrieve the location of the right angle bracket ending the explicit template argument list following...
ConstExprIterator const_arg_iterator
void setAccessorLoc(SourceLocation L)
const_child_range children() const
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)
MutableArrayRef< Expr * > getInits()
const NamedDecl * getFoundDecl() const
Get the NamedDecl through which this reference occurred.
SourceLocation getOperatorLoc() const
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.
static bool classof(const Stmt *T)
LabelDecl - Represents the declaration of a label.
static bool classof(const Stmt *T)
void setLabelLoc(SourceLocation L)
const Expr * getExpr(unsigned Init) const
ExprObjectKind
A further classification of the kind of object referenced by an l-value or x-value.
const Expr * ignoreParenBaseCasts() const LLVM_READONLY
SourceLocation getStrTokenLoc(unsigned TokNum) const
StmtExpr(EmptyShell Empty)
Build an empty statement expression.
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
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 getLParenLoc() const
const_child_range children() const
void setDecl(ValueDecl *NewD)
void setArgument(TypeSourceInfo *TInfo)
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
std::pair< SourceLocation, PartialDiagnostic > PartialDiagnosticAt
A partial diagnostic along with the source location where this diagnostic occurs. ...
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.
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
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
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 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_child_range children() const
const Expr * getArrayFiller() const
Expression is a Null pointer constant built from a zero integer expression that is not a simple...
llvm::iterator_range< const_semantics_iterator > semantics() const
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.
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)
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)
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
static bool classof(const Stmt *T)
FieldDecl * getField() const
const_child_range children() const
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 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...
Expr * getSrcExpr() const
getSrcExpr - Return the Expr to be converted.
bool isArithmeticOp() const
ImplicitValueInitExpr(EmptyShell Empty)
Construct an empty implicit value initialization.
BinaryOperatorKind Opcode
static bool classof(const Stmt *T)
ArrayRef< TemplateArgumentLoc > template_arguments() const
static bool classof(const Stmt *T)
void setBuiltinLoc(SourceLocation L)
static bool classof(const Stmt *T)
Expression is a Null pointer constant built from a literal zero.
SourceLocation 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.
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...
SourceLocation getLocEnd() const LLVM_READONLY
bool containsUnexpandedParameterPack() const
Whether this expression contains an unexpanded parameter pack (for C++11 variadic templates)...
unsigned kind
All of the diagnostics that can be emitted by the frontend.
This class is used for builtin types like 'int'.
Expr * getInit(unsigned Init)
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]).
const MemberPointerType * MPT
llvm::ArrayRef< Designator > designators() const
Designator * getDesignator(unsigned Idx)
AbstractConditionalOperator(StmtClass SC, QualType T, ExprValueKind VK, ExprObjectKind OK, bool TD, bool VD, bool ID, bool ContainsUnexpandedParameterPack, SourceLocation qloc, SourceLocation cloc)
static Decl::Kind getKind(const Decl *D)
static bool classof(const Stmt *T)
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 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.
NamedDecl - This represents a decl with 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 getLocEnd() 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.
SourceLocation getLocStart() const LLVM_READONLY
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()...
QualType getType() const
Return the type wrapped by this type source info.
const FunctionDecl * getDirectCallee() const
InitListExpr * getSemanticForm() const
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)
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