clang API Documentation

Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions
clang::Expr Class Reference

#include <Expr.h>

Inherits clang::Stmt.

Inherited by clang::AbstractConditionalOperator, clang::AddrLabelExpr, clang::ArraySubscriptExpr, clang::ArrayTypeTraitExpr, clang::AsTypeExpr, clang::AtomicExpr, clang::BinaryOperator, clang::BlockExpr, clang::CallExpr, clang::CastExpr, clang::CharacterLiteral, clang::ChooseExpr, clang::CompoundLiteralExpr, clang::ConvertVectorExpr, clang::CXXBindTemporaryExpr, clang::CXXBoolLiteralExpr, clang::CXXConstructExpr, clang::CXXDefaultArgExpr, clang::CXXDefaultInitExpr, clang::CXXDeleteExpr, clang::CXXDependentScopeMemberExpr, clang::CXXFoldExpr, clang::CXXNewExpr, clang::CXXNoexceptExpr, clang::CXXNullPtrLiteralExpr, clang::CXXPseudoDestructorExpr, clang::CXXScalarValueInitExpr, clang::CXXStdInitializerListExpr, clang::CXXThisExpr, clang::CXXThrowExpr, clang::CXXTypeidExpr, clang::CXXUnresolvedConstructExpr, clang::CXXUuidofExpr, clang::DeclRefExpr, clang::DependentScopeDeclRefExpr, clang::DesignatedInitExpr, clang::ExpressionTraitExpr, clang::ExprWithCleanups, clang::ExtVectorElementExpr, clang::FloatingLiteral, clang::FunctionParmPackExpr, clang::GenericSelectionExpr, clang::GNUNullExpr, clang::ImaginaryLiteral, clang::ImplicitValueInitExpr, clang::InitListExpr, clang::IntegerLiteral, clang::LambdaExpr, clang::MaterializeTemporaryExpr, clang::MemberExpr, clang::MSPropertyRefExpr, clang::ObjCArrayLiteral, clang::ObjCBoolLiteralExpr, clang::ObjCBoxedExpr, clang::ObjCDictionaryLiteral, clang::ObjCEncodeExpr, clang::ObjCIndirectCopyRestoreExpr, clang::ObjCIsaExpr, clang::ObjCIvarRefExpr, clang::ObjCMessageExpr, clang::ObjCPropertyRefExpr, clang::ObjCProtocolExpr, clang::ObjCSelectorExpr, clang::ObjCStringLiteral, clang::ObjCSubscriptRefExpr, clang::OffsetOfExpr, clang::OpaqueValueExpr, clang::OverloadExpr, clang::PackExpansionExpr, clang::ParenExpr, clang::ParenListExpr, clang::PredefinedExpr, clang::PseudoObjectExpr, clang::ShuffleVectorExpr, clang::SizeOfPackExpr, clang::StmtExpr, clang::StringLiteral, clang::SubstNonTypeTemplateParmExpr, clang::SubstNonTypeTemplateParmPackExpr, clang::TypeTraitExpr, clang::TypoExpr, clang::UnaryExprOrTypeTraitExpr, clang::UnaryOperator, and clang::VAArgExpr.

Collaboration diagram for clang::Expr:
Collaboration graph
[legend]

List of all members.

Classes

class  Classification
 The return type of classify(). Represents the C++11 expression taxonomy. More...
struct  EvalResult
 EvalResult is a struct with detailed info about an evaluated expression. More...
struct  EvalStatus
 EvalStatus is a struct with detailed info about an evaluation in progress. More...

Public Types

enum  LValueClassification {
  LV_Valid, LV_NotObjectType, LV_IncompleteVoidType, LV_DuplicateVectorComponents,
  LV_InvalidExpression, LV_InvalidMessageExpression, LV_MemberFunction, LV_SubObjCPropertySetting,
  LV_ClassTemporary, LV_ArrayTemporary
}
enum  isModifiableLvalueResult {
  MLV_Valid, MLV_NotObjectType, MLV_IncompleteVoidType, MLV_DuplicateVectorComponents,
  MLV_InvalidExpression, MLV_LValueCast, MLV_IncompleteType, MLV_ConstQualified,
  MLV_ArrayType, MLV_NoSetterProperty, MLV_MemberFunction, MLV_SubObjCPropertySetting,
  MLV_InvalidMessageExpression, MLV_ClassTemporary, MLV_ArrayTemporary
}
enum  SideEffectsKind { SE_NoSideEffects, SE_AllowSideEffects }
enum  NullPointerConstantKind {
  NPCK_NotNull = 0, NPCK_ZeroExpression, NPCK_ZeroLiteral, NPCK_CXX11_nullptr,
  NPCK_GNUNull
}
 Enumeration used to describe the kind of Null pointer constant returned from isNullPointerConstant(). More...
enum  NullPointerConstantValueDependence { NPC_NeverValueDependent = 0, NPC_ValueDependentIsNull, NPC_ValueDependentIsNotNull }
 Enumeration used to describe how isNullPointerConstant() should cope with value-dependent expressions. More...

Public Member Functions

QualType getType () const
void setType (QualType t)
bool isValueDependent () const
void setValueDependent (bool VD)
 Set whether this expression is value-dependent or not.
bool isTypeDependent () const
void setTypeDependent (bool TD)
 Set whether this expression is type-dependent or not.
bool isInstantiationDependent () const
 Whether this expression is instantiation-dependent, meaning that it depends in some way on a template parameter, even if neither its type nor (constant) value can change due to the template instantiation.
void setInstantiationDependent (bool ID)
 Set whether this expression is instantiation-dependent or not.
bool containsUnexpandedParameterPack () const
 Whether this expression contains an unexpanded parameter pack (for C++11 variadic templates).
void setContainsUnexpandedParameterPack (bool PP=true)
 Set the bit that describes whether this expression contains an unexpanded parameter pack.
SourceLocation getExprLoc () const LLVM_READONLY
bool isUnusedResultAWarning (const Expr *&WarnExpr, SourceLocation &Loc, SourceRange &R1, SourceRange &R2, ASTContext &Ctx) const
 isUnusedResultAWarning - Return true if this immediate expression should be warned about if the result is unused. If so, fill in Loc and Ranges with location to warn on and the source range[s] to report with the warning.
bool isLValue () const
bool isRValue () const
bool isXValue () const
bool isGLValue () const
LValueClassification ClassifyLValue (ASTContext &Ctx) const
 Reasons why an expression might not be an l-value.
isModifiableLvalueResult isModifiableLvalue (ASTContext &Ctx, SourceLocation *Loc=nullptr) const
Classification Classify (ASTContext &Ctx) const
 Classify - Classify this expression according to the C++11 expression taxonomy.
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.
ExprValueKind getValueKind () const
 getValueKind - The value kind that this expression produces.
ExprObjectKind getObjectKind () const
bool isOrdinaryOrBitFieldObject () const
void setValueKind (ExprValueKind Cat)
 setValueKind - Set the value kind produced by this expression.
void setObjectKind (ExprObjectKind Cat)
 setObjectKind - Set the object kind produced by this expression.
bool refersToBitField () const
 Returns true if this expression is a gl-value that potentially refers to a bit-field.
FieldDeclgetSourceBitField ()
 If this expression refers to a bit-field, retrieve the declaration of that bit-field.
const FieldDeclgetSourceBitField () const
const ObjCPropertyRefExprgetObjCProperty () const
 If this expression is an l-value for an Objective C property, find the underlying property reference expression.
bool isObjCSelfExpr () const
 Check if this expression is the ObjC 'self' implicit parameter.
bool refersToVectorElement () const
 Returns whether this expression refers to a vector element.
bool hasPlaceholderType () const
 Returns whether this expression has a placeholder type.
bool hasPlaceholderType (BuiltinType::Kind K) const
 Returns whether this expression has a specific placeholder type.
bool isKnownToHaveBooleanValue () const
bool isIntegerConstantExpr (llvm::APSInt &Result, const ASTContext &Ctx, SourceLocation *Loc=nullptr, bool isEvaluated=true) const
bool isIntegerConstantExpr (const ASTContext &Ctx, SourceLocation *Loc=nullptr) const
bool isCXX98IntegralConstantExpr (const ASTContext &Ctx) const
bool isCXX11ConstantExpr (const ASTContext &Ctx, APValue *Result=nullptr, SourceLocation *Loc=nullptr) const
bool isConstantInitializer (ASTContext &Ctx, bool ForRef, const Expr **Culprit=nullptr) const
bool EvaluateAsRValue (EvalResult &Result, const ASTContext &Ctx) const
 EvaluateAsRValue - Return true if this is a constant which we can fold using any crazy technique (that has nothing to do with language standards) that we want to. If this function returns true, it returns the folded constant in Result. If this expression is a glvalue, an lvalue-to-rvalue conversion will be applied to the result.
bool EvaluateAsBooleanCondition (bool &Result, const ASTContext &Ctx) const
bool EvaluateAsInt (llvm::APSInt &Result, const ASTContext &Ctx, SideEffectsKind AllowSideEffects=SE_NoSideEffects) const
bool isEvaluatable (const ASTContext &Ctx) const
bool HasSideEffects (const ASTContext &Ctx) const
bool hasNonTrivialCall (ASTContext &Ctx)
 Determine whether this expression involves a call to any function that is not trivial.
llvm::APSInt EvaluateKnownConstInt (const ASTContext &Ctx, SmallVectorImpl< PartialDiagnosticAt > *Diag=nullptr) const
void EvaluateForOverflow (const ASTContext &Ctx) const
bool EvaluateAsLValue (EvalResult &Result, const ASTContext &Ctx) const
bool EvaluateAsInitializer (APValue &Result, const ASTContext &Ctx, const VarDecl *VD, SmallVectorImpl< PartialDiagnosticAt > &Notes) const
bool EvaluateWithSubstitution (APValue &Value, ASTContext &Ctx, const FunctionDecl *Callee, ArrayRef< const Expr * > Args) const
NullPointerConstantKind isNullPointerConstant (ASTContext &Ctx, NullPointerConstantValueDependence NPC) const
 isNullPointerConstant - C99 6.3.2.3p3 - Return whether this is a null pointer constant or not, as well as the specific kind of constant detected. Null pointer constants can be integer constant expressions with the value zero, casts of zero to void*, nullptr (C++0X), or __null (a GNU extension).
bool isOBJCGCCandidate (ASTContext &Ctx) const
 isOBJCGCCandidate - Check if an expression is objc gc'able. returns true, if it is; false otherwise.
bool isBoundMemberFunction (ASTContext &Ctx) const
 Returns true if this expression is a bound member function.
ExprIgnoreImpCasts () LLVM_READONLY
ExprIgnoreImplicit () LLVM_READONLY
const ExprIgnoreImplicit () const LLVM_READONLY
ExprIgnoreParens () LLVM_READONLY
ExprIgnoreParenCasts () LLVM_READONLY
 IgnoreParenCasts - Ignore parentheses and casts. Strip off any ParenExpr or CastExprs or ImplicitCastExprs, returning their operand.
ExprIgnoreCasts () LLVM_READONLY
 Ignore casts. Strip off any CastExprs, returning their operand.
ExprIgnoreParenImpCasts () LLVM_READONLY
ExprIgnoreConversionOperator () LLVM_READONLY
const ExprIgnoreConversionOperator () const LLVM_READONLY
const ExprIgnoreParenImpCasts () const LLVM_READONLY
ExprIgnoreParenLValueCasts () LLVM_READONLY
 IgnoreParenLValueCasts - Ignore parentheses and lvalue-to-rvalue casts. This is intended purely as a temporary workaround for code that hasn't yet been rewritten to do the right thing about those casts, and may disappear along with the last internal use.
const ExprIgnoreParenLValueCasts () const LLVM_READONLY
ExprIgnoreParenNoopCasts (ASTContext &Ctx) LLVM_READONLY
ExprignoreParenBaseCasts () LLVM_READONLY
 Ignore parentheses and derived-to-base casts.
const ExprignoreParenBaseCasts () const LLVM_READONLY
bool isDefaultArgument () const
 Determine whether this expression is a default function argument.
bool isTemporaryObject (ASTContext &Ctx, const CXXRecordDecl *TempTy) const
 Determine whether the result of this expression is a temporary object of the given class type.
bool isImplicitCXXThis () const
 Whether this expression is an implicit reference to 'this' in C++.
const ExprIgnoreImpCasts () const LLVM_READONLY
const ExprIgnoreParens () const LLVM_READONLY
const ExprIgnoreParenCasts () const LLVM_READONLY
const ExprIgnoreCasts () const LLVM_READONLY
 Strip off casts, but keep parentheses.
const ExprIgnoreParenNoopCasts (ASTContext &Ctx) const LLVM_READONLY
const CXXRecordDeclgetBestDynamicClassType () const
 For an expression of class type or pointer to class type, return the most derived class decl the expression is known to refer to.
const ExprskipRValueSubobjectAdjustments (SmallVectorImpl< const Expr * > &CommaLHS, SmallVectorImpl< SubobjectAdjustment > &Adjustments) const

Static Public Member Functions

static ExprValueKind getValueKindForType (QualType T)
static bool isPotentialConstantExpr (const FunctionDecl *FD, SmallVectorImpl< PartialDiagnosticAt > &Diags)
static bool isPotentialConstantExprUnevaluated (Expr *E, const FunctionDecl *FD, SmallVectorImpl< PartialDiagnosticAt > &Diags)
static QualType findBoundMemberType (const Expr *expr)
 Given an expression of bound-member type, find the type of the member. Returns null if this is an *overloaded* bound member expression.
static bool hasAnyTypeDependentArguments (ArrayRef< Expr * > Exprs)
 hasAnyTypeDependentArguments - Determines if any of the expressions in Exprs is type-dependent.
static bool classof (const Stmt *T)

Protected Member Functions

 Expr (StmtClass SC, QualType T, ExprValueKind VK, ExprObjectKind OK, bool TD, bool VD, bool ID, bool ContainsUnexpandedParameterPack)
 Expr (StmtClass SC, EmptyShell)
 Construct an empty expression.

Detailed Description

Expr - This represents one expression. Note that Expr's are subclasses of Stmt. This allows an expression to be transparently used any place a Stmt is required.

Definition at line 104 of file Expr.h.


Member Enumeration Documentation

Enumerator:
MLV_Valid 
MLV_NotObjectType 
MLV_IncompleteVoidType 
MLV_DuplicateVectorComponents 
MLV_InvalidExpression 
MLV_LValueCast 
MLV_IncompleteType 
MLV_ConstQualified 
MLV_ArrayType 
MLV_NoSetterProperty 
MLV_MemberFunction 
MLV_SubObjCPropertySetting 
MLV_InvalidMessageExpression 
MLV_ClassTemporary 
MLV_ArrayTemporary 

Definition at line 270 of file Expr.h.

Enumerator:
LV_Valid 
LV_NotObjectType 
LV_IncompleteVoidType 
LV_DuplicateVectorComponents 
LV_InvalidExpression 
LV_InvalidMessageExpression 
LV_MemberFunction 
LV_SubObjCPropertySetting 
LV_ClassTemporary 
LV_ArrayTemporary 

Definition at line 255 of file Expr.h.

Enumeration used to describe the kind of Null pointer constant returned from isNullPointerConstant().

Enumerator:
NPCK_NotNull 

Expression is not a Null pointer constant.

NPCK_ZeroExpression 

Expression is a Null pointer constant built from a zero integer expression that is not a simple, possibly parenthesized, zero literal. C++ Core Issue 903 will classify these expressions as "not pointers" once it is adopted. http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#903.

NPCK_ZeroLiteral 

Expression is a Null pointer constant built from a literal zero.

NPCK_CXX11_nullptr 

Expression is a C++11 nullptr.

NPCK_GNUNull 

Expression is a GNU-style __null constant.

Definition at line 626 of file Expr.h.

Enumeration used to describe how isNullPointerConstant() should cope with value-dependent expressions.

Enumerator:
NPC_NeverValueDependent 

Specifies that the expression should never be value-dependent.

NPC_ValueDependentIsNull 

Specifies that a value-dependent expression of integral or dependent type should be considered a null pointer constant.

NPC_ValueDependentIsNotNull 

Specifies that a value-dependent expression should be considered to never be a null pointer constant.

Definition at line 649 of file Expr.h.

Enumerator:
SE_NoSideEffects 
SE_AllowSideEffects 

Definition at line 576 of file Expr.h.


Constructor & Destructor Documentation

clang::Expr::Expr ( StmtClass  SC,
QualType  T,
ExprValueKind  VK,
ExprObjectKind  OK,
bool  TD,
bool  VD,
bool  ID,
bool  ContainsUnexpandedParameterPack 
) [inline, protected]

Definition at line 108 of file Expr.h.

References clang::Stmt::ExprBits, and setType().

clang::Expr::Expr ( StmtClass  SC,
EmptyShell   
) [inline, explicit, protected]

Construct an empty expression.

Definition at line 122 of file Expr.h.


Member Function Documentation

Classification clang::Expr::Classify ( ASTContext Ctx) const [inline]

Classify - Classify this expression according to the C++11 expression taxonomy.

C++11 defines ([basic.lval]) a new taxonomy of expressions to replace the old lvalue vs rvalue. This function determines the type of expression this is. There are three expression types:

  • lvalues are classical lvalues as in C++03.
  • prvalues are equivalent to rvalues in C++03.
  • xvalues are expressions yielding unnamed rvalue references, e.g. a function returning an rvalue reference. lvalues and xvalues are collectively referred to as glvalues, while prvalues and xvalues together form rvalues.

Definition at line 374 of file Expr.h.

Referenced by clang::Sema::AddConversionCandidate(), clang::Sema::AddSurrogateCandidate(), AdjustFunctionParmAndArgTypesForDeduction(), clang::Sema::BuildCallToMemberFunction(), clang::Sema::BuildCallToObjectOfClassType(), clang::Sema::BuildOverloadedArrowExpr(), clang::canTypeidThrow(), clang::Sema::CheckPointerToMemberOperands(), ClassifyLValue(), isTemporaryObject(), clang::Sema::LookupSpecialMember(), clang::Sema::PerformObjectArgumentInitialization(), TryReferenceInit(), and TryReferenceInitializationCore().

ClassifyModifiable - Classify this expression according to the C++11 expression taxonomy, and see if it is valid on the left side of an assignment.

This function extends classify in that it also tests whether the expression is modifiable (C99 6.3.2.1p1).

Parameters:
LocA source location that might be filled with a relevant location if the expression is not modifiable.

Definition at line 386 of file Expr.h.

Referenced by isModifiableLvalue().

static bool clang::Expr::classof ( const Stmt T) [inline, static]

Reimplemented in clang::AtomicExpr, clang::PseudoObjectExpr, clang::AsTypeExpr, clang::BlockExpr, clang::ExtVectorElementExpr, clang::GenericSelectionExpr, clang::ParenListExpr, clang::ImplicitValueInitExpr, clang::DesignatedInitExpr, clang::InitListExpr, clang::CXXFoldExpr, clang::MaterializeTemporaryExpr, clang::VAArgExpr, clang::FunctionParmPackExpr, clang::GNUNullExpr, clang::SubstNonTypeTemplateParmPackExpr, clang::ChooseExpr, clang::SubstNonTypeTemplateParmExpr, clang::ConvertVectorExpr, clang::SizeOfPackExpr, clang::ShuffleVectorExpr, clang::PackExpansionExpr, clang::StmtExpr, clang::AddrLabelExpr, clang::CXXNoexceptExpr, clang::BinaryConditionalOperator, clang::UnresolvedMemberExpr, clang::ConditionalOperator, clang::AbstractConditionalOperator, clang::CXXDependentScopeMemberExpr, clang::CompoundAssignOperator, clang::BinaryOperator, clang::CXXUnresolvedConstructExpr, clang::CStyleCastExpr, clang::ExplicitCastExpr, clang::ExprWithCleanups, clang::ImplicitCastExpr, clang::CastExpr, clang::DependentScopeDeclRefExpr, clang::CompoundLiteralExpr, clang::MemberExpr, clang::UnresolvedLookupExpr, clang::OverloadExpr, clang::CallExpr, clang::ExpressionTraitExpr, clang::ArrayTypeTraitExpr, clang::TypeTraitExpr, clang::ArraySubscriptExpr, clang::UnaryExprOrTypeTraitExpr, clang::CXXPseudoDestructorExpr, clang::OffsetOfExpr, clang::CXXDeleteExpr, clang::CXXNewExpr, clang::UnaryOperator, clang::ParenExpr, clang::CXXScalarValueInitExpr, clang::StringLiteral, clang::ObjCBridgedCastExpr, clang::LambdaExpr, clang::ObjCIndirectCopyRestoreExpr, clang::ObjCIsaExpr, clang::ImaginaryLiteral, clang::FloatingLiteral, clang::ObjCMessageExpr, clang::CharacterLiteral, clang::CXXTemporaryObjectExpr, clang::IntegerLiteral, clang::CXXFunctionalCastExpr, clang::CXXConstructExpr, clang::PredefinedExpr, clang::DeclRefExpr, clang::CXXBindTemporaryExpr, clang::CXXDefaultInitExpr, clang::CXXDefaultArgExpr, clang::OpaqueValueExpr, clang::CXXThrowExpr, clang::ObjCSubscriptRefExpr, clang::CXXThisExpr, clang::CXXUuidofExpr, clang::ObjCPropertyRefExpr, clang::MSPropertyRefExpr, clang::CXXTypeidExpr, clang::ObjCIvarRefExpr, clang::CXXStdInitializerListExpr, clang::CXXNullPtrLiteralExpr, clang::ObjCProtocolExpr, clang::CXXBoolLiteralExpr, clang::UserDefinedLiteral, clang::ObjCSelectorExpr, clang::ObjCEncodeExpr, clang::CXXConstCastExpr, clang::ObjCDictionaryLiteral, clang::CXXReinterpretCastExpr, clang::CXXDynamicCastExpr, clang::CXXStaticCastExpr, clang::CXXNamedCastExpr, clang::CUDAKernelCallExpr, clang::ObjCArrayLiteral, clang::CXXMemberCallExpr, clang::ObjCBoxedExpr, clang::CXXOperatorCallExpr, clang::ObjCBoolLiteralExpr, and clang::ObjCStringLiteral.

Definition at line 796 of file Expr.h.

References clang::Stmt::getStmtClass().

bool Expr::EvaluateAsBooleanCondition ( bool Result,
const ASTContext Ctx 
) const

EvaluateAsBooleanCondition - Return true if this is a constant which we we can fold and convert to a boolean condition using any crazy technique that we want to, even if the expression has side-effects.

Definition at line 8432 of file ExprConstant.cpp.

References EvaluateAsRValue(), and HandleConversionToBool().

Referenced by CheckNonNullExpr(), EvaluatesAsFalse(), and EvaluatesAsTrue().

bool Expr::EvaluateAsInitializer ( APValue Result,
const ASTContext Ctx,
const VarDecl VD,
SmallVectorImpl< PartialDiagnosticAt > &  Notes 
) const

EvaluateAsInitializer - Evaluate an expression as if it were the initializer of the given declaration. Returns true if the initializer can be folded to a constant, and produces any relevant notes. In C++11, notes will be produced if the expression is not a constant expression.

Definition at line 8466 of file ExprConstant.cpp.

References CheckConstantExpression(), clang::Expr::EvalStatus::Diag, EvaluateInPlace(), clang::ASTContext::getLangOpts(), clang::Decl::getLocation(), getType(), clang::ValueDecl::getType(), clang::VarDecl::hasLocalStorage(), clang::Expr::EvalStatus::HasSideEffects, isRecordType(), clang::Type::isReferenceType(), and isRValue().

Referenced by clang::VarDecl::evaluateValue().

bool Expr::EvaluateAsInt ( llvm::APSInt &  Result,
const ASTContext Ctx,
SideEffectsKind  AllowSideEffects = SE_NoSideEffects 
) const
bool Expr::EvaluateAsLValue ( EvalResult Result,
const ASTContext Ctx 
) const

EvaluateAsLValue - Evaluate an expression to see if we can fold it to an lvalue with link time known address, with no side-effects.

Definition at line 8453 of file ExprConstant.cpp.

References CheckLValueConstantExpression(), EvaluateLValue(), getExprLoc(), clang::ASTContext::getLValueReferenceType(), and getType().

Referenced by clang::CodeGen::CodeGenModule::EmitConstantExpr(), isConstantInitializer(), and clang::CodeGen::CodeGenFunction::tryEmitAsConstant().

bool Expr::EvaluateAsRValue ( EvalResult Result,
const ASTContext Ctx 
) const

EvaluateAsRValue - Return true if this is a constant which we can fold using any crazy technique (that has nothing to do with language standards) that we want to. If this function returns true, it returns the folded constant in Result. If this expression is a glvalue, an lvalue-to-rvalue conversion will be applied to the result.

EvaluateAsRValue - Return true if this is a constant which we can fold to an rvalue using any crazy technique (that has nothing to do with language standards) that we want to, even if the expression has side-effects. If this function returns true, it returns the folded constant in Result. If the expression is a glvalue, an lvalue-to-rvalue conversion will be applied.

Definition at line 8423 of file ExprConstant.cpp.

References FastEvaluateAsRValue().

Referenced by clang::Sema::CheckConvertedConstantExpression(), CheckEvalInICE(), clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(), clang::CodeGen::CodeGenModule::EmitConstantExpr(), EvaluateAsBooleanCondition(), EvaluateAsInt(), EvaluateBuiltinConstantP(), EvaluateForOverflow(), EvaluateKnownConstInt(), clang::CodeGen::CodeGenModule::GetAddrOfGlobalTemporary(), isCXX11ConstantExpr(), isEvaluatable(), isNullPointerValueTemplateArgument(), clang::CodeGen::CodeGenFunction::tryEmitAsConstant(), and clang::Sema::VerifyIntegerConstantExpression().

void Expr::EvaluateForOverflow ( const ASTContext Ctx) const

Definition at line 8524 of file ExprConstant.cpp.

References EvaluateAsRValue(), and FastEvaluateAsRValue().

APSInt Expr::EvaluateKnownConstInt ( const ASTContext Ctx,
SmallVectorImpl< PartialDiagnosticAt > *  Diag = nullptr 
) const
bool Expr::EvaluateWithSubstitution ( APValue Value,
ASTContext Ctx,
const FunctionDecl Callee,
ArrayRef< const Expr * >  Args 
) const

EvaluateWithSubstitution - Evaluate an expression as if from the context of a call to the given function with the given arguments, inside an unevaluated context. Returns true if the expression could be folded to a constant.

Definition at line 9038 of file ExprConstant.cpp.

References Evaluate(), and clang::Decl::getLocation().

QualType Expr::findBoundMemberType ( const Expr expr) [static]

Given an expression of bound-member type, find the type of the member. Returns null if this is an *overloaded* bound member expression.

Definition at line 2369 of file Expr.cpp.

References clang::Type::castAs(), hasPlaceholderType(), IgnoreParens(), clang::Type::isFunctionType(), and clang::ast_matchers::type.

Referenced by clang::CallExpr::getCallReturnType().

For an expression of class type or pointer to class type, return the most derived class decl the expression is known to refer to.

If this expression is a cast, this method looks through it to find the most derived decl that can be inferred from the expression. This is valid because derived-to-base conversions have undefined behavior if the object isn't dynamically of the derived type.

Definition at line 39 of file Expr.cpp.

References clang::Type::castAs(), clang::Type::getAs(), clang::RecordType::getDecl(), clang::Type::getPointeeType(), getType(), ignoreParenBaseCasts(), and clang::Type::isDependentType().

Referenced by clang::CodeGen::CodeGenFunction::CanDevirtualizeMemberFunctionCall(), clang::CodeGen::CodeGenFunction::EmitCXXMemberCallExpr(), and MarkExprReferenced().

getExprLoc - Return the preferred location for the arrow when diagnosing a problem with a generic expression.

Reimplemented in clang::PseudoObjectExpr, clang::UnresolvedMemberExpr, clang::BinaryOperator, clang::MemberExpr, clang::ArraySubscriptExpr, clang::UnaryOperator, clang::ObjCIndirectCopyRestoreExpr, clang::ObjCIsaExpr, clang::CXXDefaultArgExpr, and clang::OpaqueValueExpr.

Definition at line 193 of file Expr.cpp.

References clang::Stmt::getStmtClass(), and clang::Stmt::NoStmtClass.

Referenced by clang::Sema::ActOnCaseStmt(), clang::Sema::ActOnConditionalOp(), clang::Sema::ActOnCXXDelete(), clang::Sema::ActOnDecltypeExpression(), clang::Sema::ActOnExprStmt(), clang::Sema::ActOnFinishFullExpr(), clang::Sema::ActOnFinishSwitchStmt(), clang::Sema::ActOnOpenMPFinalClause(), clang::Sema::ActOnOpenMPFirstprivateClause(), clang::Sema::ActOnOpenMPIfClause(), clang::Sema::ActOnOpenMPPrivateClause(), clang::Sema::ActOnSEHExceptBlock(), clang::Sema::ActOnStartLinkageSpecification(), clang::Sema::AddConversionCandidate(), clang::Sema::AddInitializerToDecl(), clang::Sema::AddOverloadedCallCandidates(), applyCocoaAPICheck(), clang::Sema::BuildCXXMemberCallExpr(), clang::Sema::BuildOverloadedArrowExpr(), clang::Sema::BuildOverloadedCallExpr(), BuildRecoveryCallExpr(), clang::Sema::BuildTypeofExprType(), clang::Sema::BuildVectorLiteral(), clang::Sema::CheckAddressOfOperand(), CheckAlignOfExpr(), clang::Sema::CheckCompleteVariableDeclaration(), clang::Sema::CheckCXXThrowOperand(), CheckedIntArithmetic(), CheckFoldOperand(), clang::Sema::CheckForConstantInitializer(), CheckForDanglingReferenceOrPointer(), CheckForReference(), CheckIfAnyEnclosingLambdasMustCaptureAnyPotentialCaptures(), checkIndirectCopyRestoreSource(), clang::Sema::CheckLogicalOperands(), clang::Sema::CheckLoopHintExpr(), clang::Sema::CheckMemberPointerConversion(), clang::Sema::CheckObjCARCConversion(), clang::Sema::CheckOMPThreadPrivateDecl(), CheckOpenMPIterationSpace(), clang::Sema::CheckPointerConversion(), clang::Sema::CheckSingleAssignmentConstraints(), clang::Sema::CheckSubscriptingKind(), clang::Sema::CheckTemplateArgument(), CheckTemplateArgumentAddressOfObjectOrFunction(), CheckTemplateArgumentPointerToMember(), checkUInt32Argument(), clang::Sema::CheckUnaryExprOrTypeTraitOperand(), clang::Sema::CodeCompleteCall(), commonEmitCXXMemberOrOperatorCall(), clang::Sema::CreateBuiltinBinOp(), clang::Sema::CreateUnaryExprOrTypeTraitExpr(), clang::Sema::DeduceAutoType(), clang::Sema::DeduceFunctionTypeFromReturnExpr(), clang::Sema::DefaultArgumentPromotion(), clang::Sema::DefaultFunctionArrayConversion(), clang::Sema::DefaultLvalueConversion(), clang::Sema::DefaultVariadicArgumentPromotion(), clang::Sema::DiagnoseAlwaysNonNullPointer(), clang::Sema::DiagnoseAssignmentEnum(), DiagnoseBadFunctionCast(), DiagnoseCastOfObjCSEL(), clang::Sema::DiagnoseConditionalForNull(), DiagnoseCStringFormatDirectiveInCFAPI(), DiagnoseCStringFormatDirectiveInObjCAPI(), DiagnoseDirectIsaAccess(), clang::Sema::DiagnoseMultipleUserDefinedConversion(), diagnoseNoViableConversion(), diagnoseObjCARCConversion(), diagnoseRetainCycle(), diagnoseUnknownAnyExpr(), clang::CodeGen::CodeGenFunction::EmitAsmStmt(), clang::CodeGen::CodeGenFunction::EmitAtomicExpr(), clang::CodeGen::CodeGenFunction::EmitBoundsCheck(), clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitCallArgs(), clang::CodeGen::CodeGenFunction::EmitCastLValue(), clang::CodeGen::CodeGenFunction::EmitCheckedLValue(), clang::CodeGen::CodeGenFunction::EmitCXXMemberPointerCallExpr(), clang::CodeGen::CodeGenFunction::EmitCXXThrowExpr(), clang::CodeGen::CodeGenFunction::EmitDeclRefLValue(), EmitGlobalVarDeclLValue(), clang::CodeGen::CodeGenFunction::EmitMaterializeTemporaryExpr(), clang::CodeGen::CodeGenFunction::EmitReferenceBindingToExpr(), clang::CodeGen::CodeGenFunction::EmitScalarInit(), EvaluateAsLValue(), EvaluateAsRValue(), EvaluateCPlusPlus11IntegralConstantExpr(), fillAttributedTypeLoc(), findCompleteObject(), clang::CodeGen::CodeGenFunction::GenerateCXXGlobalVarDeclInitFunc(), clang::threadSafety::ThreadSafetyAnalyzer::getEdgeLockset(), clang::OpaqueValueExpr::getExprLoc(), clang::ObjCIndirectCopyRestoreExpr::getExprLoc(), clang::ArraySubscriptExpr::getExprLoc(), clang::PseudoObjectExpr::getExprLoc(), GetTypeOfFunction(), clang::consumed::ConsumedStmtVisitor::handleCall(), handleCleanupAttr(), HandleLValueArrayAdjustment(), HandleLValueComplexElement(), LogicalErrorHandler::HasMacroID(), clang::Sema::IgnoredValueConversions(), isCXX11ConstantExpr(), isIdenticalStmt(), isLibstdcxxPointerReturnFalseHack(), isNullPointerValueTemplateArgument(), IsTailPaddedMemberArray(), isUnusedResultAWarning(), IsUserDefinedConversion(), clang::Sema::MakeFullDiscardedValueExpr(), clang::Sema::MakeFullExpr(), clang::Sema::MaybeBindToTemporary(), clang::Sema::MaybeConvertParenListExprToParenExpr(), NoteLValueLocation(), clang::Sema::PerformImplicitConversion(), clang::Sema::RebuildExprInCurrentInstantiation(), recordConversion(), clang::Sema::RequireCompleteExprType(), clang::Sema::ResolveSingleFunctionTemplateSpecialization(), rewriteToNumericBoxedExpression(), TryInitializerListConstruction(), clang::Sema::tryToRecoverWithCall(), TryUserDefinedConversion(), clang::threadSafety::warnInvalidLock(), and warnOnLifetimeExtension().

If this expression is an l-value for an Objective C property, find the underlying property reference expression.

Definition at line 3250 of file Expr.cpp.

References clang::BO_Comma, getObjectKind(), getValueKind(), IgnoreParenCasts(), clang::OK_ObjCProperty, and clang::VK_LValue.

If this expression refers to a bit-field, retrieve the declaration of that bit-field.

Note that this returns a non-null pointer in subtly different places than refersToBitField returns true. In particular, this can return a non-null pointer even for r-values loaded from bit-fields, but it will return null for a conditional bit-field.

Definition at line 3288 of file Expr.cpp.

References clang::BO_Comma, clang::CK_LValueToRValue, clang::CK_NoOp, getSourceBitField(), IgnoreParens(), and clang::VK_RValue.

Referenced by getSourceBitField(), clang::Sema::IsIntegralPromotion(), clang::ASTContext::isPromotableBitField(), and clang::InitializationSequence::Perform().

const FieldDecl* clang::Expr::getSourceBitField ( ) const [inline]

Definition at line 445 of file Expr.h.

References getSourceBitField().

QualType clang::Expr::getType ( ) const [inline]

Definition at line 125 of file Expr.h.

Referenced by clang::Sema::ActOnArraySubscriptExpr(), clang::Sema::ActOnAsTypeExpr(), clang::Sema::ActOnCallExpr(), clang::Sema::ActOnCapScopeReturnStmt(), clang::Sema::ActOnCastExpr(), clang::Sema::ActOnChooseExpr(), clang::Sema::ActOnConditionalOp(), clang::Sema::ActOnCXXDelete(), clang::Sema::ActOnCXXNamedCast(), clang::Sema::ActOnDecltypeExpression(), clang::Sema::ActOnEnumBody(), clang::Sema::ActOnFinishFullExpr(), clang::Sema::ActOnFinishSwitchStmt(), clang::Sema::ActOnGCCAsmStmt(), clang::Sema::ActOnIndirectGotoStmt(), clang::Sema::ActOnInstanceMessage(), clang::Sema::ActOnMemberAccessExpr(), clang::Sema::ActOnNumericConstant(), clang::Sema::ActOnObjCAtSynchronizedOperand(), clang::Sema::ActOnOpenMPAlignedClause(), clang::Sema::ActOnOpenMPAtomicDirective(), clang::Sema::ActOnOpenMPFirstprivateClause(), clang::Sema::ActOnOpenMPPrivateClause(), clang::Sema::ActOnSEHExceptBlock(), clang::Sema::ActOnStartCXXMemberReference(), clang::Sema::ActOnStmtExpr(), clang::Sema::AddConversionCandidate(), clang::Sema::AddInitializerToDecl(), clang::Sema::AddSurrogateCandidate(), adjustBlockReturnsToEnum(), AdjustFunctionParmAndArgTypesForDeduction(), clang::ASTContext::AtomicUsesUnsupportedLibcall(), clang::Sema::BuildAnonymousStructUnionMemberReference(), clang::Sema::BuildArrayType(), clang::Sema::BuildBinOp(), clang::Sema::BuildBlockForLambdaConversion(), clang::Sema::BuildBuiltinOffsetOf(), clang::Sema::BuildCallToMemberFunction(), clang::Sema::BuildCallToObjectOfClassType(), BuildCounterUpdate(), BuildCXXCastArgument(), clang::Sema::BuildCXXForRangeStmt(), clang::Sema::BuildCXXNew(), clang::Sema::BuildCXXTypeConstructExpr(), clang::Sema::BuildCXXTypeId(), clang::Sema::BuildCXXUuidof(), clang::Sema::BuildExpressionTrait(), BuildFieldReferenceExpr(), clang::Sema::BuildForRangeBeginEndCall(), buildGlobalBlock(), clang::Sema::BuildInstanceMessage(), clang::Sema::BuildMemberReferenceExpr(), buildMemcpyForAssignmentOp(), BuildNonArrayForRange(), clang::Sema::BuildObjCAtThrowStmt(), clang::Sema::BuildObjCBoxedExpr(), clang::Sema::BuildObjCBridgedCast(), clang::Sema::BuildObjCNumericLiteral(), clang::Sema::BuildOverloadedArrowExpr(), BuildOverloadedBinOp(), clang::Sema::BuildResolvedCallExpr(), clang::Sema::BuildReturnStmt(), clang::Sema::BuildTypeofExprType(), clang::Sema::BuildUnaryOp(), clang::Sema::BuildVAArgExpr(), clang::Sema::CallExprUnaryConversions(), clang::canTypeidThrow(), CastForMoving(), clang::Sema::CheckAdditionOperands(), clang::Sema::CheckAddressOfOperand(), CheckAggExprForMemSetUse(), checkArithmeticBinOpPointerOperands(), checkArithmeticIncompletePointerType(), checkArithmeticNull(), checkArithmeticOnObjCPointer(), checkArithmeticOpPointerOperand(), CheckArrow(), clang::Sema::CheckAssignmentConstraints(), clang::Sema::CheckAssignmentOperands(), checkAttrArgsAreCapabilityObjs(), clang::Sema::CheckBitwiseOperands(), clang::Sema::CheckBooleanCondition(), clang::Sema::CheckCaseExpression(), clang::Sema::CheckCastAlign(), CheckCommaOperands(), clang::Sema::CheckCompareOperands(), checkCondition(), checkConditionalBlockPointerCompatibility(), checkConditionalConvertScalarsToVectors(), checkConditionalObjectPointersCompatibility(), clang::Sema::CheckConditionalOperands(), checkConditionalPointerCompatibility(), checkConditionalVoidType(), clang::Sema::CheckConvertedConstantExpression(), CheckCXX98CompatAccessibleCopy(), clang::Sema::CheckCXXThrowOperand(), CheckedIntArithmetic(), checkElementNonNil(), checkEnumComparison(), clang::Sema::CheckEnumConstant(), clang::Sema::CheckExceptionSpecCompatibility(), clang::Sema::checkExceptionSpecification(), clang::Sema::CheckExtVectorCast(), CheckFallThroughForBody(), clang::Sema::CheckFormatString(), checkFormatStringExpr(), CheckForModifiableLvalue(), CheckICE(), CheckIncrementDecrementOperand(), CheckIndirectionOperand(), checkIntToPointerCast(), CheckLiteralType(), clang::Sema::CheckLogicalOperands(), clang::Sema::CheckLoopHintExpr(), clang::Sema::CheckMemberOperatorAccess(), clang::Sema::CheckMemberPointerConversion(), clang::Sema::CheckMultiplyDivideOperands(), CheckNonNullArguments(), CheckNonNullExpr(), clang::Sema::CheckObjCARCConversion(), CheckObjCBridgeCFCast(), CheckObjCBridgeNSCast(), clang::Sema::CheckObjCBridgeRelatedCast(), CheckObjCCollectionLiteralElement(), clang::Sema::CheckObjCForCollectionOperand(), checkObjCPointerIntrospection(), CheckOpenMPLoop(), clang::Sema::CheckPlaceholderExpr(), checkPlaceholderForOverload(), clang::Sema::CheckPointerConversion(), checkPointerIntegerMismatch(), clang::Sema::CheckPointerToMemberOperands(), clang::Sema::checkPseudoObjectAssignment(), CheckRealImagOperand(), clang::Sema::CheckRemainderOperands(), clang::Sema::CheckShiftOperands(), clang::Sema::CheckSingleAssignmentConstraints(), clang::Sema::CheckStaticArrayArgument(), CheckStringInit(), clang::Sema::CheckSubscriptingKind(), clang::Sema::CheckSubtractionOperands(), clang::Sema::CheckTemplateArgument(), CheckTemplateArgumentAddressOfObjectOrFunction(), CheckTemplateArgumentIsCompatibleWithParameter(), CheckTemplateArgumentPointerToMember(), clang::Sema::CheckTollFreeBridgeCast(), clang::Sema::CheckTollFreeBridgeStaticCast(), clang::Sema::CheckTransparentUnionArgumentConstraints(), clang::Sema::CheckUnaryExprOrTypeTraitOperand(), clang::Sema::checkUnknownAnyArg(), clang::Sema::checkUnsafeExprAssigns(), clang::Sema::checkVariadicArgument(), clang::Sema::CheckVectorCompareOperands(), clang::Sema::CheckVectorLogicalOperands(), clang::Sema::CheckVectorOperands(), ClassifyBinaryOp(), ClassifyConditional(), ClassifyExprValueKind(), ClassifyInternal(), ClassifyMemberExpr(), clang::Sema::CodeCompleteCall(), clang::Sema::CodeCompleteCase(), clang::Sema::CodeCompleteMemberReferenceExpr(), clang::Sema::CodeCompleteObjCInstanceMessage(), CollectVRQualifiers(), clang::ento::SymbolManager::conjureSymbol(), clang::ento::SValBuilder::conjureSymbolVal(), clang::Sema::ConvertArgumentsForCall(), convertPointersToCompositeType(), CopyObject(), clang::CXXBindTemporaryExpr::Create(), clang::Sema::CreateBuiltinArraySubscriptExpr(), clang::Sema::CreateBuiltinBinOp(), clang::Sema::CreateBuiltinUnaryOp(), clang::Sema::CreateGenericSelectionExpr(), clang::Sema::CreateOverloadedArraySubscriptExpr(), clang::Sema::CreateOverloadedBinOp(), clang::Sema::CreateOverloadedUnaryOp(), createReferenceTemporary(), clang::Sema::CreateUnaryExprOrTypeTraitExpr(), clang::Sema::CXXCheckConditionalOperands(), clang::Sema::DeduceAutoType(), clang::Sema::deduceClosureReturnType(), clang::Sema::DeduceFunctionTypeFromReturnExpr(), DeduceTemplateArgumentByListElement(), clang::Sema::DeduceTemplateArguments(), clang::Sema::DefaultArgumentPromotion(), clang::Sema::DefaultFunctionArrayConversion(), clang::Sema::DefaultLvalueConversion(), clang::Sema::DefaultVariadicArgumentPromotion(), clang::Sema::DefineImplicitLambdaToBlockPointerConversion(), clang::TypeOfExprType::desugar(), DiagnoseARCUseOfWeakReceiver(), diagnoseArithmeticOnFunctionPointer(), diagnoseArithmeticOnTwoFunctionPointers(), clang::Sema::DiagnoseAutoDeductionFailure(), diagnoseBadCast(), DiagnoseBadFunctionCast(), DiagnoseBadShiftValues(), DiagnoseBaseOrMemInitializerOrder(), DiagnoseBinOpPrecedence(), DiagnoseCastOfObjCSEL(), clang::Sema::DiagnoseConditionalForNull(), DiagnoseDirectIsaAccess(), diagnoseDistinctPointerComparison(), diagnoseFunctionPointerToVoidComparison(), diagnoseLogicalNotOnLHSofComparison(), clang::Sema::DiagnoseMultipleUserDefinedConversion(), diagnoseNoViableConversion(), diagnoseObjCARCConversion(), diagnosePointerIncompatibility(), DiagnoseReinterpretUpDownCast(), DiagnoseSelfAssignment(), diagnoseStringPlusChar(), diagnoseStringPlusInt(), diagnoseUnreadableFields(), doRewriteToUTF8StringBoxedExpressionHelper(), clang::CodeGen::CodeGenFunction::EmitAArch64BuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitAggExpr(), clang::CodeGen::CodeGenFunction::EmitAggExprToLValue(), clang::CodeGen::CodeGenFunction::EmitAnyExpr(), EmitAnyExprToExn(), clang::CodeGen::CodeGenFunction::EmitAnyExprToMem(), clang::CodeGen::CodeGenFunction::EmitAnyExprToTemp(), clang::CodeGen::CodeGenFunction::EmitARCExtendBlockObject(), clang::CodeGen::CodeGenFunction::EmitARCRetainAutoreleaseScalarExpr(), clang::CodeGen::CodeGenFunction::EmitARCRetainScalarExpr(), clang::CodeGen::CodeGenFunction::EmitARCStoreStrong(), clang::CodeGen::CodeGenFunction::EmitARMBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitArraySubscriptExpr(), clang::CodeGen::CodeGenFunction::EmitAsmStmt(), emitAtomicCmpXchg(), clang::CodeGen::CodeGenFunction::EmitAtomicExpr(), clang::CodeGen::CodeGenFunction::EmitAtomicInit(), clang::CodeGen::CGObjCRuntime::EmitAtSynchronizedStmt(), emitBadConversionNotes(), EmitBinaryAtomic(), EmitBinaryAtomicPost(), clang::CodeGen::CodeGenFunction::EmitBinaryOperatorLValue(), clang::CodeGen::CodeGenFunction::EmitBlockCallExpr(), clang::CodeGen::CodeGenFunction::EmitBlockLiteral(), clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitCallArg(), clang::CodeGen::CodeGenFunction::EmitCallArgs(), clang::CodeGen::CodeGenFunction::EmitCallExpr(), clang::CodeGen::CodeGenFunction::EmitCallExprLValue(), clang::CodeGen::CodeGenFunction::EmitCastLValue(), clang::CodeGen::CodeGenFunction::EmitCheckedLValue(), clang::CodeGen::CodeGenFunction::EmitCommonNeonBuiltinExpr(), EmitCommonNeonSISDBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitComplexExpr(), clang::CodeGen::CodeGenFunction::EmitComplexExprIntoLValue(), clang::CodeGen::CodeGenFunction::EmitComplexPrePostIncDec(), clang::CodeGen::CodeGenFunction::EmitCompoundLiteralLValue(), clang::CodeGen::CodeGenFunction::EmitConditionalOperatorLValue(), clang::CodeGen::CodeGenModule::EmitConstantExpr(), clang::CodeGen::CodeGenModule::EmitConstantInit(), clang::CodeGen::CodeGenModule::EmitConstantValue(), clang::CodeGen::CGCUDARuntime::EmitCUDAKernelCallExpr(), clang::CodeGen::CodeGenFunction::EmitCXXBindTemporaryLValue(), clang::CodeGen::CodeGenFunction::EmitCXXConstructExpr(), clang::CodeGen::CodeGenFunction::EmitCXXConstructLValue(), clang::CodeGen::CodeGenFunction::EmitCXXDeleteExpr(), clang::CodeGen::CodeGenFunction::EmitCXXMemberCallExpr(), clang::CodeGen::CodeGenFunction::EmitCXXMemberPointerCallExpr(), EmitCXXNewAllocSize(), clang::CodeGen::CodeGenFunction::EmitCXXNewExpr(), clang::CodeGen::CodeGenFunction::EmitCXXOperatorMemberCallExpr(), clang::CodeGen::CodeGenFunction::EmitCXXThrowExpr(), clang::CodeGen::CodeGenFunction::EmitCXXTypeidExpr(), clang::CodeGen::CodeGenFunction::EmitCXXTypeidLValue(), clang::CodeGen::CodeGenFunction::EmitCXXUuidofExpr(), clang::CodeGen::CodeGenFunction::EmitCXXUuidofLValue(), clang::CodeGen::CodeGenFunction::EmitDeclRefLValue(), clang::CodeGen::CodeGenFunction::EmitDynamicCast(), clang::CodeGen::CodeGenFunction::EmitExtVectorElementExpr(), EmitFunctionDeclLValue(), EmitGlobalVarDeclLValue(), clang::CodeGen::CodeGenFunction::EmitLambdaExpr(), clang::CodeGen::CodeGenFunction::EmitLambdaLValue(), emitLibraryCall(), clang::CodeGen::CodeGenFunction::EmitLValue(), clang::CodeGen::CodeGenFunction::EmitMaterializeTemporaryExpr(), clang::CodeGen::CodeGenFunction::EmitMemberExpr(), clang::CodeGen::CGCXXABI::EmitMemberPointerConversion(), clang::CodeGen::CodeGenFunction::EmitNewArrayInitializer(), clang::CodeGen::CodeGenFunction::EmitObjCBoxedExpr(), clang::CodeGen::CodeGenFunction::EmitObjCCollectionLiteral(), clang::CodeGen::CodeGenFunction::EmitObjCEncodeExprLValue(), clang::CodeGen::CodeGenFunction::EmitObjCForCollectionStmt(), clang::CodeGen::CodeGenFunction::EmitObjCIsaExpr(), clang::CodeGen::CodeGenFunction::EmitObjCIvarRefLValue(), clang::CodeGen::CodeGenFunction::EmitObjCMessageExpr(), clang::CodeGen::CodeGenFunction::EmitObjCMessageExprLValue(), clang::CodeGen::CodeGenFunction::EmitObjCSelectorLValue(), clang::CodeGen::CodeGenFunction::EmitObjCStringLiteral(), clang::CodeGen::CodeGenFunction::EmitOMPAggregateAssign(), emitPointerArithmetic(), clang::CodeGen::CodeGenFunction::EmitPointerToDataMemberBinaryExpr(), clang::CodeGen::CodeGenFunction::EmitPredefinedLValue(), clang::CodeGen::CodeGenFunction::EmitReferenceBindingToExpr(), clang::Sema::EmitRelatedResultTypeNote(), clang::CodeGen::CodeGenFunction::EmitReturnStmt(), clang::CodeGen::CodeGenFunction::EmitScalarExpr(), clang::CodeGen::CodeGenFunction::EmitStmtExprLValue(), clang::CodeGen::CodeGenFunction::EmitStringLiteralLValue(), clang::CodeGen::CodeGenFunction::EmitSynthesizedCXXCopyCtor(), clang::CodeGen::CodeGenFunction::EmitSynthesizedCXXCopyCtorCall(), EmitTypeidFromVTable(), clang::CodeGen::CodeGenFunction::EmitUnaryOpLValue(), clang::CodeGen::CodeGenFunction::EmitUnsupportedLValue(), clang::CodeGen::CodeGenFunction::EmitUnsupportedRValue(), EmitValToTemp(), emitWritebackArg(), clang::CodeGen::CodeGenFunction::EmitX86BuiltinExpr(), EvalAddr(), EvalAndBitcastToAPInt(), clang::ento::StoreManager::evalDerivedToBase(), clang::ento::ExprEngine::evalEagerlyAssumeBinOpBifurcation(), Evaluate(), EvaluateArray(), EvaluateAsInitializer(), EvaluateAsInt(), EvaluateAsLValue(), EvaluateAsRValue(), EvaluateAtomic(), EvaluateBuiltinClassifyType(), EvaluateBuiltinConstantP(), EvaluateComplex(), EvaluateCPlusPlus11IntegralConstantExpr(), clang::CodeGen::CodeGenFunction::EvaluateExprAsBool(), EvaluateFloat(), EvaluateInPlace(), EvaluateIntegerOrLValue(), EvaluateLValue(), EvaluateMemberPointer(), EvaluateObjectArgument(), EvaluatePointer(), EvaluateRecord(), EvaluateTemporary(), EvaluateVector(), EvaluateVoid(), EvalVal(), expandStringLiteral(), ExprLooksBoolean(), extractStringLiteralCharacter(), FastEvaluateAsRValue(), clang::OverloadExpr::find(), clang::Sema::FindAssociatedClassesAndNamespaces(), FindBaseInitializer(), clang::Sema::FindCompositeObjCPointerType(), clang::Sema::FindCompositePointerType(), FindConditionalOverload(), findEnumForBlockReturn(), finishContextualImplicitConversion(), FinishForRangeVarDecl(), clang::Sema::FixOverloadedFunctionReference(), clang::Sema::FormatStringHasSArg(), clang::Sema::GatherArgumentsForCall(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicGetterCopyHelperFunction(), clang::CodeGen::CodeGenFunction::generateObjCSetterBody(), clang::CodeGen::CodeGenModule::GetAddrOfConstantStringFromLiteral(), clang::CodeGen::CodeGenModule::GetAddrOfGlobalTemporary(), GetAlignOfExpr(), clang::CXXNewExpr::getAllocatedType(), getArrayIndexingBound(), GetAssumedMessageSendExprType(), clang::ArraySubscriptExpr::getBase(), getBestDynamicClassType(), clang::CallExpr::getCallReturnType(), clang::ento::SValBuilder::getConjuredHeapSymbolVal(), clang::CodeGen::CodeGenModule::GetConstantArrayFromStringLiteral(), clang::ento::SValBuilder::getConstantVal(), getCXXRecord(), getDecltypeForExpr(), clang::CXXDeleteExpr::getDestroyedType(), getElementType(), clang::BlockExpr::getFunctionType(), clang::ArraySubscriptExpr::getIdx(), clang::LambdaExpr::getLambdaClass(), clang::CodeGen::CGCXXABI::getMemberPointerAdjustment(), clang::CodeGen::CodeGenModule::getMemberPointerConstant(), clang::StandardConversionSequence::getNarrowingKind(), clang::ExtVectorElementExpr::getNumElements(), GetNumNonZeroBytesInInit(), clang::ASTContext::getObjCEncodingForBlock(), clang::ObjCMessageExpr::getReceiverType(), clang::CXXMemberCallExpr::getRecordDecl(), clang::CodeGen::CodeGenFunction::ConstantEmission::getReferenceLValue(), clang::ento::CallEvent::getResultType(), GetReturnType(), clang::ObjCPropertyRefExpr::getSetterArgType(), clang::CallEventManager::getSimpleCall(), GetTypeBeforeIntegralPromotion(), clang::UnaryExprOrTypeTraitExpr::getTypeOfArgument(), clang::ASTContext::getTypeOfExprType(), clang::CXXUuidofExpr::getUuidAsStringRef(), clang::ento::StringRegion::getValueType(), clang::ento::ObjCStringRegion::getValueType(), clang::ento::CompoundLiteralRegion::getValueType(), clang::ento::CXXTempObjectRegion::getValueType(), clang::Sema::getVariadicCallType(), HandleBaseToDerivedCast(), clang::Sema::HandleExprEvaluationContextForTypeof(), handleIntIntBinOp(), handleLValueToRValueConversion(), HandleMemberPointerAccess(), clang::Sema::hasCStrMethod(), hasIsEqualMethod(), hasPlaceholderType(), HasSideEffects(), clang::Sema::IgnoredValueConversions(), IgnoreParenNoopCasts(), clang::Sema::ImpCastExprToType(), clang::BadConversionSequence::init(), clang::InitializationSequence::InitializeFrom(), clang::Sema::InvalidOperands(), clang::CXXDynamicCastExpr::isAlwaysNull(), clang::ObjCSubscriptRefExpr::isArraySubscriptRefExpr(), clang::ExtVectorElementExpr::isArrow(), isConstantInitializer(), isFlexibleArrayMemberExpr(), isIntOrBool(), isInvalidICRSource(), isKnownToHaveBooleanValue(), IsModifiable(), isNullPointerConstant(), isNullPointerConstantForConversion(), isNullPointerValueTemplateArgument(), clang::CXXTypeidExpr::isPotentiallyEvaluated(), isReferenceToNonConstCapture(), clang::ASTContext::isSentinelNullExpr(), isSimpleArrayDecayOperand(), isSimpleZero(), IsStandardConversion(), clang::InitListExpr::isStringLiteralInit(), isTemporaryObject(), IsTransparentUnionStandardConversion(), isUnusedResultAWarning(), IsUserDefinedConversion(), clang::AtomicExpr::isVolatile(), clang::Sema::LookupInlineAsmIdentifier(), LookupMemberExprInRecord(), LookupMethodInReceiverType(), clang::ento::SValBuilder::makeIntVal(), clang::Sema::MarkBaseAndMemberDestructorsReferenced(), maybeAdjustInterfaceForSubscriptingCheck(), clang::Sema::MaybeBindToTemporary(), maybeExtendBlockObject(), maybeRebuildARCConsumingStmt(), clang::Sema::NoteAllOverloadCandidates(), ObjCEnumerationCollection(), objectifyExpr(), clang::Sema::ParseObjCStringLiteral(), clang::ento::ConditionBRVisitor::patternMatch(), clang::InitializationSequence::Perform(), clang::Sema::PerformContextualImplicitConversion(), clang::Sema::PerformContextuallyConvertToBool(), clang::Sema::PerformImplicitConversion(), clang::Sema::PerformMemberExprBaseConversion(), clang::Sema::PerformMoveOrCopyInitialization(), clang::Sema::PerformObjectArgumentInitialization(), clang::Sema::PerformObjectMemberConversion(), clang::Sema::PrepareCastToObjCObjectPointer(), clang::Sema::PrepareScalarCast(), print_elem(), PrintFloatingLiteral(), clang::APValue::printPretty(), clang::ento::ExprEngine::processBranch(), clang::ento::ExprEngine::processSwitch(), clang::ento::ExprEngine::ProcessTemporaryDtor(), pushTemporaryCleanup(), clang::TreeTransform< Derived >::RebuildCXXForRangeStmt(), clang::TreeTransform< Derived >::RebuildCXXOperatorCallExpr(), clang::TreeTransform< Derived >::RebuildCXXPseudoDestructorExpr(), clang::TreeTransform< Derived >::RebuildExtVectorElementExpr(), RebuildForRangeWithDereference(), clang::TreeTransform< Derived >::RebuildMemberExpr(), clang::TreeTransform< Derived >::RebuildObjCIsaExpr(), clang::TreeTransform< Derived >::RebuildObjCIvarRefExpr(), clang::TreeTransform< Derived >::RebuildObjCMessageExpr(), clang::TreeTransform< Derived >::RebuildObjCPropertyRefExpr(), recordConversion(), RecoverCastedSymbol(), clang::Sema::recreateSyntacticForm(), refersToVectorElement(), clang::Sema::RequireCompleteExprType(), clang::Sema::ResolveAddressOfOverloadedFunction(), clang::Sema::ResolveAndFixSingleFunctionTemplateSpecialization(), clang::InitializationSequence::RewrapReferenceInitList(), rewriteToNumberLiteral(), rewriteToNumericBoxedExpression(), SemaBuiltinAnnotation(), clang::Sema::SemaBuiltinShuffleVector(), clang::Sema::SemaConvertVectorExpr(), clang::Sema::SetCtorInitializers(), clang::BadConversionSequence::setFromExpr(), setObjCGCLValueClass(), clang::CodeGen::CodeGenFunction::OpaqueValueMappingData::shouldBindAsLValue(), shouldEmitSeparateBlockRetain(), shouldExtendReceiverForInnerPointerMessage(), ShouldTryAgainWithRedefinitionType(), skipRValueSubobjectAdjustments(), TryClassUnification(), TryConstCast(), tryDiagnoseOverloadedCast(), tryEmitARCRetainLoadOfScalar(), tryEmitARCRetainScalarExpr(), clang::CodeGen::CodeGenFunction::tryEmitAsConstant(), clang::Sema::tryExprAsCall(), TryImplicitConversion(), TryListConversion(), TryListInitialization(), TryLValueToRValueCast(), tryObjCWritebackConversion(), TryReferenceInit(), TryReferenceInitialization(), TryReferenceListInitialization(), TryRefInitWithConversionFunction(), TryReinterpretCast(), TryStaticCast(), TryStaticMemberPointerUpcast(), TryStaticReferenceDowncast(), TryUserDefinedConversion(), clang::Sema::UsualArithmeticConversions(), clang::Sema::UsualUnaryConversions(), clang::Sema::VerifyIntegerConstantExpression(), clang::ento::ExprEngine::Visit(), clang::ASTNodeImporter::VisitBinaryOperator(), clang::ento::ExprEngine::VisitBinaryOperator(), clang::ento::ExprEngine::VisitBlockExpr(), clang::ento::ExprEngine::VisitCast(), clang::ASTNodeImporter::VisitCharacterLiteral(), clang::ASTNodeImporter::VisitCompoundAssignOperator(), clang::ento::ExprEngine::VisitCompoundLiteralExpr(), clang::ento::ConditionBRVisitor::VisitConditionVariable(), clang::ASTNodeImporter::VisitCStyleCastExpr(), clang::ento::ExprEngine::VisitCXXConstructExpr(), clang::ento::ExprEngine::VisitCXXNewExpr(), clang::ento::ExprEngine::VisitCXXThisExpr(), clang::ASTNodeImporter::VisitDeclRefExpr(), clang::ASTNodeImporter::VisitImplicitCastExpr(), clang::ento::ExprEngine::VisitIncrementDecrementOperator(), clang::ento::ExprEngine::VisitInitListExpr(), clang::ASTNodeImporter::VisitIntegerLiteral(), clang::ento::ExprEngine::VisitLogicalExpr(), clang::ento::ExprEngine::VisitLvalArraySubscriptExpr(), clang::ento::ExprEngine::VisitMemberExpr(), clang::ento::ExprEngine::VisitOffsetOfExpr(), clang::ASTNodeImporter::VisitUnaryExprOrTypeTraitExpr(), clang::ento::ExprEngine::VisitUnaryExprOrTypeTraitExpr(), clang::ASTNodeImporter::VisitUnaryOperator(), clang::ento::ExprEngine::VisitUnaryOperator(), warnOnSizeofOnArrayDecay(), and WidenIterationCount().

getValueKind - The value kind that this expression produces.

Definition at line 402 of file Expr.h.

References clang::Stmt::ExprBits.

Referenced by clang::Sema::ActOnChooseExpr(), clang::Sema::ActOnConditionalOp(), clang::Sema::BuildCXXTypeId(), BuildFieldReferenceExpr(), clang::Sema::CheckCXXThrowOperand(), clang::Sema::CheckPointerToMemberOperands(), CheckTemplateArgumentPointerToMember(), clang::Sema::checkUnknownAnyCast(), ClassifyInternal(), convertQualifiersAndValueKindIfNecessary(), clang::Sema::CreateBuiltinArraySubscriptExpr(), clang::Sema::CreateBuiltinBinOp(), clang::Sema::CreateBuiltinUnaryOp(), clang::Sema::CXXCheckConditionalOperands(), diagnoseNoViableConversion(), EvalVal(), clang::Sema::FixOverloadedFunctionReference(), getDecltypeForExpr(), getObjCProperty(), clang::ento::CallEvent::getResultType(), clang::MaterializeTemporaryExpr::isBoundToLvalueReference(), isGLValue(), isLValue(), isRValue(), isXValue(), maybeRebuildARCConsumingStmt(), clang::InitializationSequence::Perform(), clang::Sema::PerformImplicitConversion(), clang::Sema::PerformObjectArgumentInitialization(), clang::Sema::PerformObjectMemberConversion(), clang::TreeTransform< Derived >::RebuildMemberExpr(), recordConversion(), clang::ASTNodeImporter::VisitBinaryOperator(), clang::ASTNodeImporter::VisitCompoundAssignOperator(), clang::ASTNodeImporter::VisitCStyleCastExpr(), clang::ASTNodeImporter::VisitDeclRefExpr(), clang::ASTNodeImporter::VisitImplicitCastExpr(), and clang::ASTNodeImporter::VisitUnaryOperator().

bool Expr::hasAnyTypeDependentArguments ( ArrayRef< Expr * >  Exprs) [static]

hasAnyTypeDependentArguments - Determines if any of the expressions in Exprs is type-dependent.

Definition at line 2704 of file Expr.cpp.

References isTypeDependent().

Referenced by clang::Sema::ActOnCallExpr(), clang::Sema::BuildCXXNew(), clang::Sema::BuildCXXTypeConstructExpr(), clang::Sema::CodeCompleteCall(), and clang::InitializationSequence::InitializeFrom().

Determine whether this expression involves a call to any function that is not trivial.

Definition at line 3130 of file Expr.cpp.

References Finder.

Referenced by evaluateTypeTrait().

Returns whether this expression has a specific placeholder type.

Definition at line 465 of file Expr.h.

References getType(), and clang::BuiltinType::isPlaceholderTypeKind().

bool Expr::HasSideEffects ( const ASTContext Ctx) const

Ignore casts. Strip off any CastExprs, returning their operand.

Definition at line 2446 of file Expr.cpp.

References P.

Referenced by IgnoreCasts().

const Expr* clang::Expr::IgnoreCasts ( ) const [inline]

Strip off casts, but keep parentheses.

Definition at line 770 of file Expr.h.

References IgnoreCasts().

IgnoreConversionOperator - Ignore conversion operator. If this Expr is a call to a conversion operator, return the argument.

Definition at line 2533 of file Expr.cpp.

Referenced by IgnoreConversionOperator(), and IsArithmeticBinaryExpr().

const Expr* clang::Expr::IgnoreConversionOperator ( ) const [inline]

Definition at line 716 of file Expr.h.

References IgnoreConversionOperator().

const Expr* clang::Expr::IgnoreImpCasts ( ) const [inline]

Definition at line 760 of file Expr.h.

References IgnoreImpCasts().

IgnoreImplicit - Skip past any implicit AST nodes which might surround this expression.

Reimplemented from clang::Stmt.

Definition at line 687 of file Expr.h.

Referenced by BuildCounterUpdate(), clang::Sema::CodeCompleteCase(), clang::CXXConstructorDecl::getTargetConstructor(), IgnoreImplicit(), IsCallableWithAppend(), clang::ento::ExprEngine::ProcessInitializer(), and clang::consumed::ConsumedStmtVisitor::VisitVarDecl().

const Expr* clang::Expr::IgnoreImplicit ( ) const [inline]

Definition at line 691 of file Expr.h.

References IgnoreImplicit().

const Expr* clang::Expr::ignoreParenBaseCasts ( ) const [inline]

Definition at line 740 of file Expr.h.

References ignoreParenBaseCasts().

IgnoreParenCasts - Ignore parentheses and casts. Strip off any ParenExpr or CastExprs or ImplicitCastExprs, returning their operand.

IgnoreParenCasts - Ignore parentheses and casts. Strip off any ParenExpr or CastExprs, returning their operand.

Definition at line 2424 of file Expr.cpp.

References IgnoreParens(), and P.

Referenced by clang::Sema::ActOnFinishSwitchStmt(), clang::Sema::BuildCallToMemberFunction(), clang::Sema::CheckAssignmentOperands(), clang::Sema::CheckCompareOperands(), checkFormatStringExpr(), CheckForModifiableLvalue(), CheckForNullPointerDereference(), CheckICE(), CheckIndirectionOperand(), checkObjCPointerIntrospection(), clang::Sema::CheckSingleAssignmentConstraints(), clang::Sema::checkStringLiteralArgumentAttr(), CheckTemplateArgumentAddressOfObjectOrFunction(), clang::Sema::CodeCompleteCall(), clang::Sema::CodeCompleteCase(), clang::Sema::CreateBuiltinBinOp(), clang::Sema::DefaultLvalueConversion(), diagnoseObjCLiteralComparison(), clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(), findCapturingExpr(), GenerateMinimalPathDiagnostic(), clang::CallExpr::getCalleeDecl(), clang::ento::bugreporter::getDerefExpr(), getIncrementedVar(), getNSArrayObjects(), getObjCProperty(), clang::arcmt::trans::hasSideEffects(), ignoreLiteralAdditions(), IgnoreParenCasts(), clang::threadSafety::isCalleeArrow(), isCapturedBy(), IsControlFlowExpr(), clang::arcmt::trans::isGlobalVar(), clang::arcmt::trans::isPlusOne(), clang::ASTContext::isSentinelNullExpr(), isTrivialDoWhile(), isTrivialExpression(), LookThroughTransitiveAssignmentsAndCommaOperators(), LookupMemberExpr(), clang::sema::FunctionScopeInfo::markSafeWeakUse(), maybeAdjustInterfaceForSubscriptingCheck(), clang::ento::ConditionBRVisitor::patternMatch(), peelOffOuterExpr(), clang::TreeTransform< Derived >::RebuildCXXOperatorCallExpr(), RemoveSelectorFromWarningCache(), scan_ivar_release(), SemaBuiltinAnnotation(), clang::ento::bugreporter::trackNullOrUndefValue(), TryEvaluateBuiltinNaN(), clang::ConversionFixItGenerator::tryToFixConversion(), UseNSOptionsMacro(), clang::threadSafety::VarMapBuilder::VisitBinaryOperator(), clang::ento::FindLastStoreBRVisitor::VisitNode(), and clang::ento::ConditionBRVisitor::VisitTrueTest().

const Expr* clang::Expr::IgnoreParenCasts ( ) const [inline]

Definition at line 766 of file Expr.h.

References IgnoreParenCasts().

const Expr* clang::Expr::IgnoreParenImpCasts ( ) const [inline]

Definition at line 720 of file Expr.h.

References IgnoreParenImpCasts().

IgnoreParenLValueCasts - Ignore parentheses and lvalue-to-rvalue casts. This is intended purely as a temporary workaround for code that hasn't yet been rewritten to do the right thing about those casts, and may disappear along with the last internal use.

Ignore parentheses and lvalue casts. Strip off any ParenExpr and CastExprs that represent lvalue casts, returning their operand.

Definition at line 2471 of file Expr.cpp.

References clang::CK_LValueToRValue, IgnoreParens(), and P.

Referenced by IgnoreParenLValueCasts(), and clang::Sema::isSelfExpr().

const Expr* clang::Expr::IgnoreParenLValueCasts ( ) const [inline]

Definition at line 728 of file Expr.h.

References IgnoreParenLValueCasts().

IgnoreParenNoopCasts - Ignore parentheses and casts that do not change the value (including ptr->int casts of the same size). Strip off any ParenExpr or CastExprs, returning their operand.

Definition at line 2544 of file Expr.cpp.

References getType(), clang::ASTContext::getTypeSize(), clang::ASTContext::hasSameUnqualifiedType(), IgnoreParens(), clang::Type::isIntegralType(), clang::Type::isPointerType(), and P.

Referenced by CheckAsmLValue(), clang::CodeGen::CodeGenFunction::EmitAsmStmt(), and IgnoreParenNoopCasts().

const Expr* clang::Expr::IgnoreParenNoopCasts ( ASTContext Ctx) const [inline]

Definition at line 774 of file Expr.h.

References IgnoreParenNoopCasts().

IgnoreParens - Ignore parentheses. If this Expr is a ParenExpr, return its subexpression. If that subexpression is also a ParenExpr, then this method recursively returns its subexpression, and so forth. Otherwise, the method returns the current Expr.

Definition at line 2393 of file Expr.cpp.

References P, and clang::UO_Extension.

Referenced by clang::Sema::ActOnCallExpr(), clang::Sema::ActOnCXXThrow(), clang::ento::ProgramState::addTaint(), clang::Sema::BuildCallToMemberFunction(), clang::Sema::BuildCXXMemberCallExpr(), clang::Sema::BuildObjCBoxedExpr(), clang::Sema::canThrow(), clang::Sema::CheckAddressOfOperand(), CheckAlignOfExpr(), CheckForDanglingReferenceOrPointer(), clang::Sema::CheckLiteralKind(), clang::Sema::CheckPointerToMemberOperands(), clang::Sema::checkPseudoObjectAssignment(), clang::Sema::checkPseudoObjectIncDec(), clang::Sema::checkPseudoObjectRValue(), CheckStringInit(), clang::Sema::CheckUnaryExprOrTypeTraitOperand(), clang::Sema::checkUnknownAnyArg(), clang::Sema::checkUnsafeExprAssigns(), clang::Sema::CheckVecStepExpr(), ClassifyInternal(), ClassifyMemberExpr(), clang::ento::ExprEngine::CreateCXXTemporaryObject(), clang::Sema::CreateGenericSelectionExpr(), clang::Sema::diagnoseARCUnbridgedCast(), DiagnoseBadConversion(), clang::Sema::DiagnoseEqualityWithExtraParens(), DoMarkVarDeclReferenced(), doRewriteToUTF8StringBoxedExpressionHelper(), clang::CodeGen::CodeGenFunction::EmitBranchOnBoolExpr(), clang::CodeGen::CodeGenFunction::EmitCallExpr(), clang::CodeGen::CodeGenFunction::EmitCXXMemberCallExpr(), clang::CodeGen::CodeGenFunction::EmitCXXMemberPointerCallExpr(), EmitLValueOrThrowExpression(), EvalAddr(), EvalVal(), clang::OverloadExpr::find(), clang::Sema::FindAssociatedClassesAndNamespaces(), findBoundMemberType(), findEnumForBlockReturn(), findPeephole(), findRetainCycleOwner(), GetAlignOfExpr(), getArrayIndexingBound(), clang::ento::SValBuilder::getConstantVal(), clang::Sema::getCopyElisionCandidate(), getDecltypeForExpr(), clang::CXXMemberCallExpr::getImplicitObjectArgument(), clang::CXXMemberCallExpr::getMethodDecl(), GetNumNonZeroBytesInInit(), getRightmostLeaf(), getSourceBitField(), clang::CFGBlock::getTerminatorCondition(), ignoreParenBaseCasts(), IgnoreParenCasts(), IgnoreParenImpCasts(), IgnoreParenLValueCasts(), IgnoreParenNoopCasts(), IgnoreParens(), ignoreTransparentExprs(), clang::InitializationSequence::InitializeFrom(), isBlockVarRef(), isCheapEnoughToEvaluateUnconditionally(), isFlexibleArrayMemberExpr(), isGLValueFromPointerDeref(), isInvalidICRSource(), isKnownToHaveBooleanValue(), IsModifiable(), isOBJCGCCandidate(), isParenthesizedADLCallee(), isReferenceToNonConstCapture(), isSimpleZero(), IsSpecialDiscardedValue(), IsStandardConversion(), IsStringInit(), clang::InitListExpr::isStringLiteralInit(), clang::Sema::IsStringLiteralToNonConstPointerConversion(), clang::ento::ProgramState::isTainted(), isUnusedResultAWarning(), clang::Sema::MaybeBindToTemporary(), maybeGetUnaryAddrOfOperand(), optimizeEdges(), clang::ento::ExprEngine::processBranch(), refersToVectorElement(), clang::Sema::RequireCompleteExprType(), ResolveCondition(), shouldEmitSeparateBlockRetain(), shouldExtendReceiverForInnerPointerMessage(), skipRValueSubobjectAdjustments(), skipTemporaryBindingsNoOpCastsAndParens(), stripOpaqueValuesFromPseudoObjectRef(), tryEmitARCRetainLoadOfScalar(), tryEmitARCRetainScalarExpr(), clang::Sema::tryExprAsCall(), clang::Sema::UpdateMarkingForLValueToRValue(), clang::ento::ExprEngine::VisitBinaryOperator(), clang::ento::ExprEngine::VisitGuardedExpr(), clang::ento::ExprEngine::VisitIncrementDecrementOperator(), clang::ento::ExprEngine::VisitLvalArraySubscriptExpr(), and clang::ento::ExprEngine::VisitUnaryOperator().

const Expr* clang::Expr::IgnoreParens ( ) const [inline]

Definition at line 763 of file Expr.h.

References IgnoreParens().

Returns true if this expression is a bound member function.

Definition at line 2363 of file Expr.cpp.

References ClassifyLValue(), isTypeDependent(), and LV_MemberFunction.

bool Expr::isConstantInitializer ( ASTContext Ctx,
bool  ForRef,
const Expr **  Culprit = nullptr 
) const

isConstantInitializer - Returns true if this expression can be emitted to IR as a constant, and thus can be used as a constant initializer in C. If this expression is not constant and Culprit is non-null, it is used to store the address of first non constant expr.

Definition at line 2712 of file Expr.cpp.

References clang::CK_AtomicToNonAtomic, clang::CK_ConstructorConversion, clang::CK_LValueToRValue, clang::CK_NonAtomicToAtomic, clang::CK_NoOp, clang::CK_ToUnion, EvaluateAsInt(), EvaluateAsLValue(), clang::CXXConstructExpr::getArg(), clang::Type::getAs(), clang::CastExpr::getCastKind(), clang::CXXConstructExpr::getConstructor(), clang::InitListExpr::getInit(), clang::InitListExpr::getInitializedFieldInUnion(), clang::CXXConstructExpr::getNumArgs(), clang::InitListExpr::getNumInits(), clang::UnaryOperator::getOpcode(), clang::CXXMethodDecl::getParent(), clang::Stmt::getStmtClass(), clang::UnaryOperator::getSubExpr(), clang::CastExpr::getSubExpr(), getType(), clang::Expr::EvalStatus::HasSideEffects, clang::CXXRecordDecl::hasTrivialDestructor(), clang::Type::isArrayType(), isConstantInitializer(), isEvaluatable(), clang::Type::isRecordType(), clang::Type::isReferenceType(), clang::FunctionDecl::isTrivial(), clang::TagDecl::isUnion(), and clang::UO_Extension.

Referenced by clang::Sema::AddInitializerToDecl(), clang::Sema::CheckCompleteVariableDeclaration(), clang::Sema::CheckForConstantInitializer(), clang::CodeGen::CodeGenFunction::EmitAutoVarAlloca(), clang::Sema::InstantiateVariableInitializer(), and isConstantInitializer().

bool Expr::isCXX11ConstantExpr ( const ASTContext Ctx,
APValue Result = nullptr,
SourceLocation Loc = nullptr 
) const

isCXX11ConstantExpr - Return true if this expression is a constant expression in C++11. Can only be used in C++.

Note: This does not perform the implicit conversions required by C++11 [expr.const]p5.

Definition at line 9012 of file ExprConstant.cpp.

References clang::Expr::EvalStatus::Diag, EvaluateAsRValue(), getExprLoc(), and clang::ASTContext::getLangOpts().

Referenced by EvaluateCPlusPlus11IntegralConstantExpr(), and clang::StandardConversionSequence::getNarrowingKind().

isCXX98IntegralConstantExpr - Return true if this expression is an integral constant expression in C++98. Can only be used in C++.

Definition at line 9008 of file ExprConstant.cpp.

References CheckICE().

Referenced by isNullPointerConstant().

Determine whether this expression is a default function argument.

Default arguments are implicitly generated in the abstract syntax tree by semantic analysis for function calls, object constructions, etc. in C++. Default arguments are represented by CXXDefaultArgExpr nodes; this routine also looks through any implicit casts to determine whether the expression is a default argument.

Definition at line 2579 of file Expr.cpp.

Referenced by clang::TreeTransform< Derived >::DropCallArgument(), and clang::CXXConstructExpr::getLocEnd().

bool Expr::isEvaluatable ( const ASTContext Ctx) const

isEvaluatable - Call EvaluateAsRValue to see if this expression can be constant folded without side-effects, but discard the result.

isEvaluatable - Call EvaluateAsRValue to see if this expression can be constant folded, but discard the result.

Definition at line 8507 of file ExprConstant.cpp.

References EvaluateAsRValue().

Referenced by clang::Sema::ActOnGCCAsmStmt(), clang::Sema::AddInitializerToDecl(), clang::CodeGen::CodeGenFunction::EmitReturnStmt(), EvaluateBuiltinConstantP(), isCheapEnoughToEvaluateUnconditionally(), and isConstantInitializer().

bool clang::Expr::isGLValue ( ) const [inline]

Definition at line 253 of file Expr.h.

References getValueKind(), and clang::VK_RValue.

Referenced by clang::Sema::ActOnConditionalOp(), clang::Sema::BuildCXXTypeId(), clang::ento::SValBuilder::conjureSymbolVal(), convertQualifiersAndValueKindIfNecessary(), clang::Sema::DefaultArgumentPromotion(), clang::Sema::DefaultLvalueConversion(), clang::CodeGen::CodeGenFunction::EmitCallArg(), clang::CodeGen::CodeGenFunction::EmitConditionalOperatorLValue(), clang::CodeGen::CodeGenFunction::EmitExtVectorElementExpr(), clang::CodeGen::CodeGenFunction::EmitInitListLValue(), Evaluate(), EvaluateAsRValue(), EvaluateBuiltinConstantP(), EvaluateLValue(), EvaluateObjectArgument(), clang::ento::SValBuilder::getConstantVal(), hasTrivialGetExpr(), clang::Sema::IgnoredValueConversions(), clang::CXXTypeidExpr::isPotentiallyEvaluated(), IsStandardConversion(), isTemporaryPRValue(), isUnusedResultAWarning(), clang::InitializationSequence::Perform(), clang::CodeGen::CodeGenFunction::OpaqueValueMappingData::shouldBindAsLValue(), TryLValueToRValueCast(), tryObjCWritebackConversion(), TryReinterpretCast(), clang::ento::ExprEngine::VisitBinaryOperator(), clang::ento::ExprEngine::VisitCast(), clang::ento::ExprEngine::VisitCommonDeclRefExpr(), clang::ento::ExprEngine::VisitCompoundLiteralExpr(), clang::ento::ExprEngine::VisitIncrementDecrementOperator(), clang::ento::ExprEngine::VisitInitListExpr(), clang::ento::ExprEngine::VisitLvalArraySubscriptExpr(), clang::ento::ExprEngine::VisitMemberExpr(), and clang::ento::ExprEngine::VisitUnaryOperator().

Whether this expression is instantiation-dependent, meaning that it depends in some way on a template parameter, even if neither its type nor (constant) value can change due to the template instantiation.

In the following example, the expression sizeof(sizeof(T() + T())) is instantiation-dependent (since it involves a template parameter T), but is neither type- nor value-dependent, since the type of the inner sizeof is known (std::size_t) and therefore the size of the outer sizeof is known.

 template<typename T>
 void f(T x, T y) {
   sizeof(sizeof(T() + T());
 }

Definition at line 192 of file Expr.h.

References clang::Stmt::ExprBits.

Referenced by clang::Sema::ActOnOpenMPAtomicDirective(), clang::Sema::ActOnOpenMPFinalClause(), clang::Sema::ActOnOpenMPIfClause(), clang::Sema::ActOnOpenMPLinearClause(), clang::Sema::ActOnOpenMPScheduleClause(), clang::AtomicExpr::AtomicExpr(), clang::CallExpr::CallExpr(), CheckIfAnyEnclosingLambdasMustCaptureAnyPotentialCaptures(), clang::CXXConstructExpr::CXXConstructExpr(), clang::CXXNewExpr::CXXNewExpr(), findTemplateParameter(), clang::ASTContext::getDecltypeType(), HasSideEffects(), clang::InitListExpr::InitListExpr(), clang::TemplateArgument::isInstantiationDependent(), clang::DecltypeType::isSugared(), clang::ParenListExpr::ParenListExpr(), clang::InitListExpr::setInit(), and clang::ShuffleVectorExpr::ShuffleVectorExpr().

bool Expr::isIntegerConstantExpr ( llvm::APSInt &  Result,
const ASTContext Ctx,
SourceLocation Loc = nullptr,
bool  isEvaluated = true 
) const

isIntegerConstantExpr - Return true if this expression is a valid integer constant expression, and, if so, return its value in Result. If not a valid i-c-e, return false and fill in Loc (if specified) with the location of the invalid expression.

Note: This does not perform the implicit conversions required by C++11 [expr.const]p5.

Definition at line 8996 of file ExprConstant.cpp.

References EvaluateAsInt(), EvaluateCPlusPlus11IntegralConstantExpr(), and clang::ASTContext::getLangOpts().

Referenced by clang::Sema::ActOnOpenMPLinearClause(), clang::Sema::ActOnOpenMPNumThreadsClause(), clang::Sema::ActOnOpenMPScheduleClause(), clang::Sema::ActOnPragmaPack(), clang::Sema::AddAssumeAlignedAttr(), clang::Sema::AddInitializerToDecl(), clang::Sema::BuildCXXNew(), clang::Sema::BuildExtVectorType(), clang::Sema::CheckCaseExpression(), checkFunctionOrMethodParameterIndex(), clang::VarDecl::checkInitIsICE(), checkIntToPointerCast(), CheckOpenMPLoop(), checkUInt32Argument(), clang::Sema::DiagnoseAssignmentEnum(), DiagnoseBadShiftValues(), clang::CodeGen::CodeGenFunction::EmitAArch64BuiltinExpr(), EmitAArch64TblBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitARMBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitCommonNeonBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitX86BuiltinExpr(), clang::Sema::FinalizeDeclaration(), FitsInto(), clang::StandardConversionSequence::getNarrowingKind(), clang::FunctionProtoType::getNoexceptSpec(), HandleAddressSpaceTypeAttribute(), handleMSP430InterruptAttr(), HandleNeonVectorTypeAttr(), handleSentinelAttr(), HandleVectorSizeAttr(), isNullPointerConstant(), IsStandardConversion(), clang::Sema::SemaBuiltinShuffleVector(), TryOCLSamplerInitialization(), TryOCLZeroEventInitialization(), and clang::Sema::VerifyIntegerConstantExpression().

bool Expr::isIntegerConstantExpr ( const ASTContext Ctx,
SourceLocation Loc = nullptr 
) const

isKnownToHaveBooleanValue - Return true if this is an integer expression that is known to return 0 or 1. This happens for _Bool/bool expressions but also int expressions which are produced by things like comparisons in C.

Definition at line 112 of file Expr.cpp.

References clang::BO_And, clang::BO_Assign, clang::BO_Comma, clang::BO_EQ, clang::BO_GE, clang::BO_GT, clang::BO_LAnd, clang::BO_LE, clang::BO_LOr, clang::BO_LT, clang::BO_NE, clang::BO_Or, clang::BO_Xor, getType(), IgnoreParens(), clang::Type::isBooleanType(), clang::Type::isIntegralOrEnumerationType(), clang::UO_LNot, and clang::UO_Plus.

Referenced by clang::Sema::ActOnFinishSwitchStmt().

bool clang::Expr::isLValue ( ) const [inline]

isLValue - True if this expression is an "l-value" according to the rules of the current language. C and C++ give somewhat different rules for this concept, but in general, the result of an l-value expression identifies a specific object whereas the result of an r-value expression is a value detached from any specific storage.

C++11 divides the concept of "r-value" into pure r-values ("pr-values") and so-called expiring values ("x-values"), which identify specific objects that can be safely cannibalized for their resources. This is an unfortunate abuse of terminology on the part of the C++ committee. In Clang, when we say "r-value", we generally mean a pr-value.

Definition at line 250 of file Expr.h.

References getValueKind(), and clang::VK_LValue.

Referenced by clang::Sema::ActOnObjCForCollectionStmt(), clang::Sema::ActOnOpenMPAtomicDirective(), AdjustFunctionParmAndArgTypesForDeduction(), CheckAsmLValue(), clang::Sema::DefaultFunctionArrayConversion(), DiagnoseBadConversion(), EvaluateExpressionTrait(), IsGlobalLValue(), clang::ento::ExplodedGraph::isInterestingLValueExpr(), isReferenceToNonConstCapture(), TryClassUnification(), TryConstCast(), TryStaticReferenceDowncast(), and clang::ConversionFixItGenerator::tryToFixConversion().

isModifiableLvalue - C99 6.3.2.1: an lvalue that does not have array type, does not have an incomplete type, does not have a const-qualified type, and if it is a structure or union, does not have any member (including, recursively, any member or element of all contained aggregates or unions) with a const-qualified type.

Parameters:
Loc[in,out] - A source location which *may* be filled in with the location of the expression making this a non-modifiable lvalue, if specified.

Definition at line 650 of file ExprClassification.cpp.

References clang::Expr::Classification::CL_AddressableVoid, clang::Expr::Classification::CL_ArrayTemporary, clang::Expr::Classification::CL_ClassTemporary, clang::Expr::Classification::CL_DuplicateVectorComponents, clang::Expr::Classification::CL_Function, clang::Expr::Classification::CL_LValue, clang::Expr::Classification::CL_MemberFunction, clang::Expr::Classification::CL_ObjCMessageRValue, clang::Expr::Classification::CL_PRValue, clang::Expr::Classification::CL_SubObjCPropertySetting, clang::Expr::Classification::CL_Void, clang::Expr::Classification::CL_XValue, ClassifyModifiable(), clang::Expr::Classification::CM_ArrayType, clang::Expr::Classification::CM_ConstQualified, clang::Expr::Classification::CM_Function, clang::Expr::Classification::CM_IncompleteType, clang::Expr::Classification::CM_LValueCast, clang::Expr::Classification::CM_Modifiable, clang::Expr::Classification::CM_NoSetterProperty, clang::Expr::Classification::CM_RValue, clang::Expr::Classification::CM_Untested, clang::Expr::Classification::getKind(), clang::Expr::Classification::getModifiable(), MLV_ArrayTemporary, MLV_ArrayType, MLV_ClassTemporary, MLV_ConstQualified, MLV_DuplicateVectorComponents, MLV_IncompleteType, MLV_IncompleteVoidType, MLV_InvalidExpression, MLV_InvalidMessageExpression, MLV_LValueCast, MLV_MemberFunction, MLV_NoSetterProperty, MLV_NotObjectType, MLV_SubObjCPropertySetting, and MLV_Valid.

Referenced by CheckForModifiableLvalue().

isNullPointerConstant - C99 6.3.2.3p3 - Return whether this is a null pointer constant or not, as well as the specific kind of constant detected. Null pointer constants can be integer constant expressions with the value zero, casts of zero to void*, nullptr (C++0X), or __null (a GNU extension).

isNullPointerConstant - C99 6.3.2.3p3 - Test if this reduces down to a Null pointer constant. The return value can further distinguish the kind of NULL pointer constant that was detected.

Definition at line 3142 of file Expr.cpp.

References EvaluateKnownConstInt(), clang::Type::getAs(), clang::ASTContext::getLangOpts(), clang::Type::getPointeeType(), getType(), clang::APIntStorage::getValue(), clang::QualType::hasQualifiers(), isCXX98IntegralConstantExpr(), clang::Type::isEnumeralType(), isIntegerConstantExpr(), isNullPointerConstant(), isTypeDependent(), isValueDependent(), clang::Type::isVoidType(), NPC_NeverValueDependent, NPC_ValueDependentIsNotNull, NPC_ValueDependentIsNull, NPCK_CXX11_nullptr, NPCK_GNUNull, NPCK_NotNull, NPCK_ZeroExpression, and NPCK_ZeroLiteral.

Referenced by clang::Sema::BuildCXXUuidof(), clang::Sema::BuildInstanceMessage(), clang::Sema::CheckCompareOperands(), checkConditionalNullPointer(), checkFormatStringExpr(), clang::Sema::CheckMemberPointerConversion(), clang::Sema::CheckPointerConversion(), clang::Sema::CheckSingleAssignmentConstraints(), clang::Sema::CheckStaticArrayArgument(), clang::Sema::CheckTransparentUnionArgumentConstraints(), clang::Sema::DiagnoseConditionalForNull(), diagnoseObjCLiteralComparison(), clang::Sema::FindCompositePointerType(), clang::ento::SValBuilder::getConstantVal(), clang::CXXUuidofExpr::getUuidAsStringRef(), isInvalidICRSource(), clang::Sema::IsMemberPointerConversion(), isNullPointerConstant(), isNullPointerConstantForConversion(), isNullPointerValueTemplateArgument(), clang::ASTContext::isSentinelNullExpr(), and clang::Sema::PrepareScalarCast().

isOBJCGCCandidate - Check if an expression is objc gc'able. returns true, if it is; false otherwise.

isOBJCGCCandidate - Return true if this expression may be used in a read/ write barrier.

Definition at line 2324 of file Expr.cpp.

References clang::MemberExpr::getBase(), clang::ASTContext::getObjCGCAttrKind(), clang::Stmt::getStmtClass(), IgnoreParens(), isOBJCGCCandidate(), clang::Type::isPointerType(), and clang::Qualifiers::Weak.

Referenced by clang::CodeGen::CodeGenFunction::EmitArraySubscriptExpr(), clang::CodeGen::CodeGenFunction::EmitUnaryOpLValue(), and isOBJCGCCandidate().

Check if this expression is the ObjC 'self' implicit parameter.

Definition at line 3270 of file Expr.cpp.

References clang::DeclRefExpr::getDecl(), clang::Decl::getDeclContext(), clang::ObjCMethodDecl::getSelfDecl(), and IgnoreParenImpCasts().

bool Expr::isPotentialConstantExpr ( const FunctionDecl FD,
SmallVectorImpl< PartialDiagnosticAt > &  Diags 
) [static]

isPotentialConstantExpr - Return true if this function's definition might be usable in a constant expression in C++11, if it were marked constexpr. Return false if the function can never produce a constant expression, along with diagnostics describing why not.

Definition at line 9060 of file ExprConstant.cpp.

References clang::Expr::EvalStatus::Diag, clang::Decl::getASTContext(), clang::FunctionDecl::getBody(), clang::Decl::getLocation(), clang::DeclContext::getParent(), HandleConstructorCall(), HandleFunctionCall(), and clang::DeclContext::isDependentContext().

Referenced by clang::Sema::CheckConstexprFunctionBody().

bool Expr::isPotentialConstantExprUnevaluated ( Expr E,
const FunctionDecl FD,
SmallVectorImpl< PartialDiagnosticAt > &  Diags 
) [static]

isPotentialConstantExprUnevaluted - Return true if this expression might be usable in a constant expression in C++11 in an unevaluated context, if it were in function FD marked constexpr. Return false if the function can never produce a constant expression, along with diagnostics describing why not.

Definition at line 9101 of file ExprConstant.cpp.

References clang::Expr::EvalStatus::Diag, Evaluate(), EvaluateArgs(), and clang::Decl::getASTContext().

Referenced by handleEnableIfAttr(), and instantiateDependentEnableIfAttr().

bool clang::Expr::isRValue ( ) const [inline]
bool Expr::isTemporaryObject ( ASTContext Ctx,
const CXXRecordDecl TempTy 
) const

Determine whether the result of this expression is a temporary object of the given class type.

isTemporaryObject - Determines if this expression produces a temporary of the given class type.

Definition at line 2618 of file Expr.cpp.

References clang::CK_DerivedToBase, clang::CK_UncheckedDerivedToBase, Classify(), getType(), clang::ASTContext::getTypeDeclType(), clang::ASTContext::hasSameUnqualifiedType(), clang::Expr::Classification::isPRValue(), and skipTemporaryBindingsNoOpCastsAndParens().

Referenced by clang::Sema::BuildCXXConstructExpr(), CopyObject(), and clang::CodeGen::CodeGenFunction::EmitCXXConstructExpr().

bool clang::Expr::isTypeDependent ( ) const [inline]

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. For example, the expressions "x" and "x + y" are type-dependent in the following code, but "y" is not type-dependent:

 template<typename T>
 void add(T x, int y) {
   x + y;
 }

Definition at line 166 of file Expr.h.

References clang::Stmt::ExprBits.

Referenced by clang::Sema::ActOnArraySubscriptExpr(), clang::Sema::ActOnCallExpr(), clang::Sema::ActOnCapScopeReturnStmt(), clang::Sema::ActOnCaseStmt(), clang::Sema::ActOnChooseExpr(), clang::Sema::ActOnConditionalOp(), clang::Sema::ActOnCXXDelete(), clang::Sema::ActOnDesignatedInitializer(), clang::Sema::ActOnFinishCXXInClassMemberInitializer(), clang::Sema::ActOnFinishSwitchStmt(), clang::Sema::ActOnGCCAsmStmt(), clang::Sema::ActOnIndirectGotoStmt(), clang::Sema::ActOnObjCForCollectionStmt(), clang::Sema::ActOnOpenMPFinalClause(), clang::Sema::ActOnOpenMPIfClause(), clang::Sema::ActOnOpenMPLinearClause(), clang::Sema::ActOnOpenMPNumThreadsClause(), clang::Sema::ActOnOpenMPScheduleClause(), clang::Sema::ActOnPragmaPack(), clang::Sema::ActOnStmtExpr(), clang::Sema::AddAlignedAttr(), clang::AtomicExpr::AtomicExpr(), clang::Sema::BuildArrayType(), clang::Sema::BuildBaseInitializer(), clang::Sema::BuildBinOp(), clang::Sema::BuildBuiltinOffsetOf(), clang::Sema::BuildCompoundLiteralExpr(), clang::Sema::BuildCXXNamedCast(), clang::Sema::BuildCXXNew(), clang::Sema::BuildCXXThrow(), clang::Sema::BuildCXXTypeId(), clang::Sema::BuildExpressionTrait(), clang::Sema::BuildExtVectorType(), clang::Sema::BuildInstanceMessage(), clang::Sema::BuildMemberInitializer(), clang::Sema::BuildObjCBoxedExpr(), clang::Sema::BuildObjCBridgedCast(), clang::Sema::BuildObjCSubscriptExpression(), clang::Sema::BuildReturnStmt(), clang::Sema::BuildStaticAssertDeclaration(), clang::Sema::BuildTypeofExprType(), clang::Sema::BuildVAArgExpr(), clang::CallExpr::CallExpr(), clang::canDynamicCastThrow(), clang::Sema::canThrow(), clang::canTypeidThrow(), clang::Sema::CheckAddressOfOperand(), CheckAlignOfExpr(), CheckArrow(), CheckAsmLValue(), checkAttrArgsAreCapabilityObjs(), clang::Sema::CheckBooleanCondition(), clang::Sema::CheckCaseExpression(), clang::Sema::CheckEnumConstant(), clang::Sema::checkExceptionSpecification(), checkFormatStringExpr(), checkFunctionOrMethodParameterIndex(), CheckIncrementDecrementOperand(), CheckIndirectionOperand(), CheckObjCCollectionLiteralElement(), clang::Sema::CheckObjCForCollectionOperand(), clang::Sema::checkPseudoObjectAssignment(), clang::Sema::checkPseudoObjectIncDec(), CheckRealImagOperand(), clang::Sema::CheckTemplateArgument(), CheckTemplateArgumentPointerToMember(), checkUInt32Argument(), clang::Sema::CheckVecStepExpr(), clang::Sema::CodeCompleteCall(), clang::Sema::CreateBuiltinArraySubscriptExpr(), clang::Sema::CreateGenericSelectionExpr(), clang::Sema::CreateOverloadedUnaryOp(), clang::Sema::CreateUnaryExprOrTypeTraitExpr(), clang::Sema::CXXCheckConditionalOperands(), clang::Sema::DeduceAutoType(), DeduceNonTypeTemplateArgument(), clang::Sema::DiagnoseAssignmentEnum(), clang::Sema::DiagnoseEqualityWithExtraParens(), doRewriteToUTF8StringBoxedExpressionHelper(), EvalAddr(), EvalVal(), getDecltypeForExpr(), clang::ASTContext::getDependentSizedArrayType(), clang::ASTContext::getTypeOfExprType(), clang::ArrayTypeTraitExpr::getValue(), HandleAddressSpaceTypeAttribute(), handleEnableIfAttr(), HandleNeonVectorTypeAttr(), handleSentinelAttr(), HandleVectorSizeAttr(), hasAnyTypeDependentArguments(), clang::InitListExpr::InitListExpr(), instantiateDependentEnableIfAttr(), isBoundMemberFunction(), clang::ChooseExpr::isConditionDependent(), isNullPointerConstant(), isNullPointerConstantForConversion(), isNullPointerValueTemplateArgument(), clang::ASTContext::isPromotableBitField(), clang::TypeOfExprType::isSugared(), isUnusedResultAWarning(), ObjCEnumerationCollection(), clang::OverloadExpr::OverloadExpr(), clang::ParenListExpr::ParenListExpr(), clang::Sema::PerformContextualImplicitConversion(), clang::TreeTransform< Derived >::RebuildCXXForRangeStmt(), clang::TreeTransform< Derived >::RebuildCXXPseudoDestructorExpr(), rewriteToNumericBoxedExpression(), clang::Sema::SemaBuiltinShuffleVector(), clang::InitListExpr::setInit(), clang::ShuffleVectorExpr::ShuffleVectorExpr(), clang::Sema::tryExprAsCall(), and clang::Sema::VerifyBitField().

bool Expr::isUnusedResultAWarning ( const Expr *&  WarnExpr,
SourceLocation Loc,
SourceRange R1,
SourceRange R2,
ASTContext Ctx 
) const

isUnusedResultAWarning - Return true if this immediate expression should be warned about if the result is unused. If so, fill in Loc and Ranges with location to warn on and the source range[s] to report with the warning.

isUnusedResultAWarning - Return true if this immediate expression should be warned about if the result is unused. If so, fill in expr, location, and ranges with expr to warn on and source locations/ranges appropriate for a warning.

Definition at line 1999 of file Expr.cpp.

References clang::BO_Comma, clang::BO_LAnd, clang::BO_LOr, clang::CompoundStmt::body_back(), clang::CompoundStmt::body_empty(), clang::CK_ConstructorConversion, clang::CK_LValueToRValue, clang::CK_ToVoid, clang::CallExpr::getArg(), clang::Type::getAsCXXRecordDecl(), clang::CallExpr::getCallee(), clang::CallExpr::getCalleeDecl(), clang::CallExpr::getCallReturnType(), clang::ASTContext::getCanonicalType(), clang::CastExpr::getCastKind(), clang::DeclRefExpr::getDecl(), getExprLoc(), clang::ASTContext::getLangOpts(), clang::BinaryOperator::getLHS(), clang::ConditionalOperator::getLHS(), clang::Stmt::getLocEnd(), clang::Stmt::getLocStart(), clang::CStyleCastExpr::getLParenLoc(), clang::ObjCMessageExpr::getMethodDecl(), clang::ObjCMessageExpr::getMethodFamily(), clang::CallExpr::getNumArgs(), clang::UnaryOperator::getOpcode(), clang::BinaryOperator::getOpcode(), clang::CXXOperatorCallExpr::getOperator(), clang::CXXOperatorCallExpr::getOperatorLoc(), clang::UnaryOperator::getOperatorLoc(), clang::BinaryOperator::getOperatorLoc(), clang::ObjCMessageExpr::getReceiverType(), clang::BinaryOperator::getRHS(), clang::ConditionalOperator::getRHS(), clang::CXXOperatorCallExpr::getSourceRange(), clang::Stmt::getSourceRange(), clang::Stmt::getStmtClass(), clang::UnaryOperator::getSubExpr(), clang::CastExpr::getSubExpr(), clang::PseudoObjectExpr::getSyntacticForm(), getType(), IgnoreParens(), clang::BinaryOperator::isAssignmentOp(), isGLValue(), clang::ObjCMessageExpr::isInstanceMessage(), clang::Type::isObjCIdType(), clang::Type::isReferenceType(), isTypeDependent(), isUnusedResultAWarning(), clang::Type::isVoidType(), clang::QualType::isVolatileQualified(), clang::OMF_init, clang::UO_AddrOf, clang::UO_Deref, clang::UO_Extension, clang::UO_Imag, clang::UO_LNot, clang::UO_Minus, clang::UO_Not, clang::UO_Plus, clang::UO_PostDec, clang::UO_PostInc, clang::UO_PreDec, clang::UO_PreInc, and clang::UO_Real.

Referenced by isUnusedResultAWarning().

bool clang::Expr::isValueDependent ( ) const [inline]

isValueDependent - Determines whether this expression is value-dependent (C++ [temp.dep.constexpr]). For example, the array bound of "Chars" in the following example is value-dependent.

 template<int Size, char (&Chars)[Size]> struct meta_string;

Definition at line 146 of file Expr.h.

References clang::Stmt::ExprBits.

Referenced by clang::Sema::ActOnCaseStmt(), clang::Sema::ActOnChooseExpr(), clang::Sema::ActOnDesignatedInitializer(), clang::Sema::ActOnFinishSwitchStmt(), clang::Sema::ActOnOpenMPFinalClause(), clang::Sema::ActOnOpenMPIfClause(), clang::Sema::ActOnOpenMPLinearClause(), clang::Sema::ActOnOpenMPNumThreadsClause(), clang::Sema::ActOnOpenMPScheduleClause(), clang::Sema::ActOnPragmaPack(), clang::Sema::AddAlignedAttr(), clang::Sema::AddAlignValueAttr(), clang::Sema::AddAssumeAlignedAttr(), clang::Sema::AddInitializerToDecl(), clang::AtomicExpr::AtomicExpr(), clang::Sema::BuildArrayType(), clang::Sema::BuildBuiltinOffsetOf(), clang::Sema::BuildCompoundLiteralExpr(), clang::Sema::BuildCXXNamedCast(), clang::Sema::BuildCXXNew(), clang::Sema::BuildExtVectorType(), clang::Sema::BuildStaticAssertDeclaration(), clang::CallExpr::CallExpr(), clang::Sema::canThrow(), clang::Sema::CheckCaseExpression(), clang::Sema::CheckCompleteVariableDeclaration(), clang::Sema::CheckEnumConstant(), clang::Sema::checkExceptionSpecification(), checkFormatStringExpr(), checkFunctionOrMethodParameterIndex(), CheckICE(), clang::VarDecl::checkInitIsICE(), clang::Sema::CheckLogicalOperands(), clang::Sema::CheckLoopHintExpr(), clang::Sema::CheckMultiplyDivideOperands(), CheckNonNullExpr(), clang::Sema::CheckRemainderOperands(), clang::Sema::CheckTemplateArgument(), CheckTemplateArgumentAddressOfObjectOrFunction(), CheckTemplateArgumentPointerToMember(), checkUInt32Argument(), clang::CXXConstructExpr::CXXConstructExpr(), DeduceNonTypeTemplateArgument(), clang::Sema::DiagnoseAssignmentEnum(), DiagnoseBadShiftValues(), clang::Sema::DiagnoseSentinelCalls(), EvaluateDecl(), EvaluateInPlace(), EvaluatesAsFalse(), EvaluatesAsTrue(), clang::VarDecl::evaluateValue(), evaluateVarDeclInit(), clang::ASTContext::getDependentSizedArrayType(), clang::FunctionProtoType::getNoexceptSpec(), clang::SizeOfPackExpr::getPackLength(), clang::TypeTraitExpr::getValue(), HandleAddressSpaceTypeAttribute(), handleEnableIfAttr(), HandleNeonVectorTypeAttr(), handleSentinelAttr(), HandleVectorSizeAttr(), clang::InitListExpr::InitListExpr(), instantiateDependentEnableIfAttr(), clang::ChooseExpr::isConditionDependent(), isNullPointerConstant(), isNullPointerConstantForConversion(), isNullPointerValueTemplateArgument(), clang::ASTContext::isPromotableBitField(), IsVariableNonDependentAndAConstantExpression(), clang::ParenListExpr::ParenListExpr(), clang::InitializationSequence::Perform(), clang::Sema::SemaBuiltinShuffleVector(), clang::InitListExpr::setInit(), clang::ShuffleVectorExpr::ShuffleVectorExpr(), clang::TreeTransform< Derived >::TransformExceptionSpec(), VariableCanNeverBeAConstantExpression(), clang::Sema::VerifyBitField(), and clang::EvaluatedExprVisitor< ImplClass >::VisitChooseExpr().

bool clang::Expr::isXValue ( ) const [inline]

Definition at line 252 of file Expr.h.

References getValueKind(), and clang::VK_XValue.

Referenced by tryEmitARCRetainLoadOfScalar().

bool clang::Expr::refersToBitField ( ) const [inline]

Returns true if this expression is a gl-value that potentially refers to a bit-field.

In C++, whether a gl-value refers to a bitfield is essentially an aspect of the value-kind type system.

Definition at line 434 of file Expr.h.

References getObjectKind(), and clang::OK_BitField.

Referenced by convertQualifiersAndValueKindIfNecessary(), clang::Sema::CreateUnaryExprOrTypeTraitExpr(), clang::InitializationSequence::Perform(), and TryConstCast().

Returns whether this expression refers to a vector element.

Definition at line 3329 of file Expr.cpp.

References clang::CK_NoOp, getType(), IgnoreParens(), clang::Type::isVectorType(), and clang::VK_RValue.

Referenced by convertQualifiersAndValueKindIfNecessary(), and clang::InitializationSequence::Perform().

Set the bit that describes whether this expression contains an unexpanded parameter pack.

Definition at line 221 of file Expr.h.

References clang::Stmt::ExprBits.

Set whether this expression is instantiation-dependent or not.

Definition at line 197 of file Expr.h.

References clang::Stmt::ExprBits.

Referenced by clang::MemberExpr::Create().

setObjectKind - Set the object kind produced by this expression.

Definition at line 422 of file Expr.h.

References clang::Stmt::ExprBits.

Referenced by clang::Sema::BuildDeclRefExpr().

void clang::Expr::setType ( QualType  t) [inline]
void clang::Expr::setTypeDependent ( bool  TD) [inline]

Set whether this expression is type-dependent or not.

Definition at line 169 of file Expr.h.

References clang::Stmt::ExprBits.

Referenced by clang::Sema::buildOverloadedCallSet(), and clang::MemberExpr::Create().

void clang::Expr::setValueDependent ( bool  VD) [inline]

Set whether this expression is value-dependent or not.

Definition at line 149 of file Expr.h.

References clang::Stmt::ExprBits.

Referenced by clang::MemberExpr::Create().

void clang::Expr::setValueKind ( ExprValueKind  Cat) [inline]

setValueKind - Set the value kind produced by this expression.

Definition at line 419 of file Expr.h.

References clang::Stmt::ExprBits.

Referenced by clang::Sema::BuildResolvedCallExpr(), and clang::InitializationSequence::Perform().

const Expr * Expr::skipRValueSubobjectAdjustments ( SmallVectorImpl< const Expr * > &  CommaLHS,
SmallVectorImpl< SubobjectAdjustment > &  Adjustments 
) const

Walk outwards from an expression we want to bind a reference to and find the expression whose lifetime needs to be extended. Record the LHSs of comma expressions and adjustments needed along the path.

Definition at line 54 of file Expr.cpp.

References clang::BO_Comma, clang::CK_DerivedToBase, clang::CK_NoOp, clang::CK_UncheckedDerivedToBase, clang::Type::getAs(), getType(), IgnoreParens(), and clang::Type::isRecordType().

Referenced by clang::CodeGen::CodeGenFunction::EmitMaterializeTemporaryExpr(), performLifetimeExtension(), and performReferenceExtension().


The documentation for this class was generated from the following files: