29 if (
const DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(E)) {
30 const VarDecl *Var = dyn_cast<VarDecl>(DRE->getDecl());
31 return (Var && Var->
hasAttr<BlocksAttr>());
40 if (Op->isAssignmentOp() || Op->isPtrMemOp())
44 if (Op->getOpcode() == BO_Comma)
52 dyn_cast<AbstractConditionalOperator>(E)) {
58 if (
const Expr *Src = Op->getSourceExpr())
65 }
else if (
const CastExpr *Cast = dyn_cast<CastExpr>(E)) {
66 if (Cast->getCastKind() == CK_LValueToRValue)
72 }
else if (
const UnaryOperator *UOp = dyn_cast<UnaryOperator>(E)) {
76 }
else if (
const MemberExpr *Mem = dyn_cast<MemberExpr>(E)) {
107 if (
const auto *ILE = dyn_cast<InitListExpr>(E)) {
108 if (ILE->getNumInits())
113 if (
const auto *Cons = dyn_cast_or_null<CXXConstructExpr>(E))
114 return Cons->getConstructor()->isDefaultConstructor() &&
115 Cons->getConstructor()->isTrivial();
123 if (!PD->isInlineBuiltinDeclaration())
Defines the clang::Expr interface and subclasses for C++ expressions.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
const VariableArrayType * getAsVariableArrayType(QualType T) const
AbstractConditionalOperator - An abstract base class for ConditionalOperator and BinaryConditionalOpe...
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
QualType getElementType() const
A builtin binary operation expression such as "x + y" or "x <= y".
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
A reference to a declared variable, function, enum, etc.
This represents one expression.
Expr * IgnoreParens() LLVM_READONLY
Skip past any parentheses which might surround this expression until reaching a fixed point.
bool isEvaluatable(const ASTContext &Ctx, SideEffectsKind AllowSideEffects=SE_NoSideEffects) const
isEvaluatable - Call EvaluateAsRValue to see if this expression can be constant folded without side-e...
Represents a function declaration or definition.
FunctionDecl * getPreviousDecl()
Return the previous declaration of this declaration or NULL if this is the first declaration.
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class.
A (possibly-)qualified type.
UnaryOperator - This represents the unary-expression's (except sizeof and alignof),...
Represents a variable declaration or definition.
Represents a C array with a specified size that is not an integer-constant-expression.
QualType getFixedSizeElementType(const ASTContext &Ctx, const VariableArrayType *VLA)
Strip off the variably-modified array types wrapping VLA and return the first element type that has a...
bool isTrivialFiller(const Expr *E)
Check whether E is a trivial array filler, that is, one that is equivalent to zero-initialization.
bool isCheapEnoughToEvaluateUnconditionally(const Expr *E, const ASTContext &Ctx)
Check whether E is cheap enough and side-effect-free enough to evaluate unconditionally instead of co...
bool isBlockVarRef(const Expr *E)
Check whether the value of E is possibly a reference to or into a __block variable.
bool onlyHasInlineBuiltinDeclaration(const FunctionDecl *FD)
Detect the unusual situation where an inline version of a builtin is shadowed by a non-inline version...
bool isa(CodeGen::Address addr)