clang API Documentation
#include "clang/Sema/SemaInternal.h"
#include "TreeTransform.h"
#include "clang/AST/ASTConsumer.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/ASTLambda.h"
#include "clang/AST/ASTMutationListener.h"
#include "clang/AST/CXXInheritance.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/DeclTemplate.h"
#include "clang/AST/EvaluatedExprVisitor.h"
#include "clang/AST/Expr.h"
#include "clang/AST/ExprCXX.h"
#include "clang/AST/ExprObjC.h"
#include "clang/AST/RecursiveASTVisitor.h"
#include "clang/AST/TypeLoc.h"
#include "clang/Basic/PartialDiagnostic.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Basic/TargetInfo.h"
#include "clang/Lex/LiteralSupport.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Sema/AnalysisBasedWarnings.h"
#include "clang/Sema/DeclSpec.h"
#include "clang/Sema/DelayedDiagnostic.h"
#include "clang/Sema/Designator.h"
#include "clang/Sema/Initialization.h"
#include "clang/Sema/Lookup.h"
#include "clang/Sema/ParsedTemplate.h"
#include "clang/Sema/Scope.h"
#include "clang/Sema/ScopeInfo.h"
#include "clang/Sema/SemaFixItUtils.h"
#include "clang/Sema/Template.h"
#include "llvm/Support/ConvertUTF.h"
#include "clang/AST/DeclNodes.inc"
#include "clang/AST/BuiltinTypes.def"
#include "clang/AST/TypeNodes.def"
Go to the source code of this file.
Defines | |
#define | ABSTRACT_DECL(kind) |
#define | VALUE(type, base) |
#define | DECL(type, base) case Decl::type: |
#define | PLACEHOLDER_TYPE(ID, SINGLETON_ID) |
#define | BUILTIN_TYPE(ID, SINGLETON_ID) case BuiltinType::ID: |
#define | TYPE(Class, Base) |
#define | ABSTRACT_TYPE(Class, Base) |
#define | NON_CANONICAL_TYPE(Class, Base) |
#define | DEPENDENT_TYPE(Class, Base) case Type::Class: |
#define | NON_CANONICAL_UNLESS_DEPENDENT_TYPE(Class, Base) |
#define | BUILTIN_TYPE(Id, SingletonId) case BuiltinType::Id: |
#define | PLACEHOLDER_TYPE(Id, SingletonId) |
Typedefs | |
typedef ExprResult | PerformCastFn (Sema &S, Expr *operand, QualType toType) |
Enumerations | |
enum | NonConstCaptureKind { NCCK_None, NCCK_Block, NCCK_Lambda } |
enum | |
Functions | |
static void | DiagnoseUnusedOfDecl (Sema &S, NamedDecl *D, SourceLocation Loc) |
static AvailabilityResult | DiagnoseAvailabilityOfDecl (Sema &S, NamedDecl *D, SourceLocation Loc, const ObjCInterfaceDecl *UnknownObjCClass, bool ObjCPropertyAccess) |
static bool | hasAnyExplicitStorageClass (const FunctionDecl *D) |
Determine whether a FunctionDecl was ever declared with an explicit storage class. | |
static void | diagnoseUseOfInternalDeclInInlineFunction (Sema &S, const NamedDecl *D, SourceLocation Loc) |
Check whether we're in an extern inline function and referring to a variable or function with internal linkage (C11 6.7.4p3). | |
static void | CheckForNullPointerDereference (Sema &S, Expr *E) |
static void | DiagnoseDirectIsaAccess (Sema &S, const ObjCIvarRefExpr *OIRE, SourceLocation AssignLoc, const Expr *RHS) |
static bool | handleIntegerToComplexFloatConversion (Sema &S, ExprResult &IntExpr, ExprResult &ComplexExpr, QualType IntTy, QualType ComplexTy, bool SkipCast) |
Converts an integer to complex float type. Helper function of UsualArithmeticConversions() | |
static QualType | handleComplexFloatConversion (Sema &S, ExprResult &LHS, ExprResult &RHS, QualType LHSType, QualType RHSType, bool IsCompAssign) |
Handle arithmetic conversion with complex types. Helper function of UsualArithmeticConversions() | |
static QualType | handleIntToFloatConversion (Sema &S, ExprResult &FloatExpr, ExprResult &IntExpr, QualType FloatTy, QualType IntTy, bool ConvertFloat, bool ConvertInt) |
Hande arithmetic conversion from integer to float. Helper function of UsualArithmeticConversions() | |
static QualType | handleFloatConversion (Sema &S, ExprResult &LHS, ExprResult &RHS, QualType LHSType, QualType RHSType, bool IsCompAssign) |
Handle arithmethic conversion with floating point types. Helper function of UsualArithmeticConversions() | |
template<PerformCastFn doLHSCast, PerformCastFn doRHSCast> | |
static QualType | handleIntegerConversion (Sema &S, ExprResult &LHS, ExprResult &RHS, QualType LHSType, QualType RHSType, bool IsCompAssign) |
Handle integer arithmetic conversions. Helper function of UsualArithmeticConversions() | |
static QualType | handleComplexIntConversion (Sema &S, ExprResult &LHS, ExprResult &RHS, QualType LHSType, QualType RHSType, bool IsCompAssign) |
Handle conversions with GCC complex int extension. Helper function of UsualArithmeticConversions() | |
static SourceLocation | getUDSuffixLoc (Sema &S, SourceLocation TokLoc, unsigned Offset) |
static ExprResult | BuildCookedLiteralOperatorCall (Sema &S, Scope *Scope, IdentifierInfo *UDSuffix, SourceLocation UDSuffixLoc, ArrayRef< Expr * > Args, SourceLocation LitEndLoc) |
static Expr * | recoverFromMSUnqualifiedLookup (Sema &S, ASTContext &Context, DeclarationNameInfo &NameInfo, SourceLocation TemplateKWLoc, const TemplateArgumentListInfo *TemplateArgs) |
static bool | CheckDeclInExpr (Sema &S, SourceLocation Loc, NamedDecl *D) |
static void | ConvertUTF8ToWideString (unsigned CharByteWidth, StringRef Source, SmallString< 32 > &Target) |
static Expr * | BuildFloatingLiteral (Sema &S, NumericLiteralParser &Literal, QualType Ty, SourceLocation Loc) |
static bool | CheckVecStepTraitOperandType (Sema &S, QualType T, SourceLocation Loc, SourceRange ArgRange) |
static bool | CheckExtensionTraitOperandType (Sema &S, QualType T, SourceLocation Loc, SourceRange ArgRange, UnaryExprOrTypeTrait TraitKind) |
static bool | CheckObjCTraitOperandConstraints (Sema &S, QualType T, SourceLocation Loc, SourceRange ArgRange, UnaryExprOrTypeTrait TraitKind) |
static void | warnOnSizeofOnArrayDecay (Sema &S, SourceLocation Loc, QualType T, Expr *E) |
Check whether E is a pointer from a decayed array type (the decayed pointer type is equal to T) and emit a warning if it is. | |
static bool | CheckAlignOfExpr (Sema &S, Expr *E) |
static QualType | CheckRealImagOperand (Sema &S, ExprResult &V, SourceLocation Loc, bool IsReal) |
static bool | checkArithmeticOnObjCPointer (Sema &S, SourceLocation opLoc, Expr *op) |
Diagnose if arithmetic on the given ObjC pointer is illegal. | |
static TypoCorrection | TryTypoCorrectionForCall (Sema &S, Expr *Fn, FunctionDecl *FDecl, ArrayRef< Expr * > Args) |
static void | DiagnoseCalleeStaticArrayParam (Sema &S, ParmVarDecl *PVD) |
static ExprResult | rebuildUnknownAnyFunction (Sema &S, Expr *fn) |
static bool | isPlaceholderToRemoveAsArg (QualType type) |
static bool | checkArgsForPlaceholders (Sema &S, MultiExprArg args) |
static void | maybeExtendBlockObject (Sema &S, ExprResult &E) |
Do an explicit extend of the given block pointer if we're in ARC. | |
static bool | breakDownVectorType (QualType type, uint64_t &len, QualType &eltType) |
static bool | VectorTypesMatch (Sema &S, QualType srcTy, QualType destTy) |
static bool | checkCondition (Sema &S, Expr *Cond) |
Return false if the condition expression is valid, true otherwise. | |
static bool | checkConditionalConvertScalarsToVectors (Sema &S, ExprResult &LHS, ExprResult &RHS, QualType CondTy) |
Return false if the two expressions can be converted to a vector, true otherwise. | |
static QualType | checkConditionalVoidType (Sema &S, ExprResult &LHS, ExprResult &RHS) |
Handle when one or both operands are void type. | |
static bool | checkConditionalNullPointer (Sema &S, ExprResult &NullExpr, QualType PointerTy) |
Return false if the NullExpr can be promoted to PointerTy, true otherwise. | |
static QualType | checkConditionalPointerCompatibility (Sema &S, ExprResult &LHS, ExprResult &RHS, SourceLocation Loc) |
Checks compatibility between two pointers and return the resulting type. | |
static bool | isObjCPtrBlockCompatible (Sema &S, ASTContext &C, QualType QT) |
Returns true if QT is quelified-id and implements 'NSObject' and/or 'NSCopying' protocols (and nothing else); or QT is an NSObject and optionally implements 'NSObject' and/or NSCopying' protocols (and nothing else). | |
static QualType | checkConditionalBlockPointerCompatibility (Sema &S, ExprResult &LHS, ExprResult &RHS, SourceLocation Loc) |
Return the resulting type when the operands are both block pointers. | |
static QualType | checkConditionalObjectPointersCompatibility (Sema &S, ExprResult &LHS, ExprResult &RHS, SourceLocation Loc) |
Return the resulting type when the operands are both pointers. | |
static bool | checkPointerIntegerMismatch (Sema &S, ExprResult &Int, Expr *PointerExpr, SourceLocation Loc, bool IsIntFirstExpr) |
Return false if the first expression is not an integer and the second expression is not a pointer, true otherwise. | |
static void | SuggestParentheses (Sema &Self, SourceLocation Loc, const PartialDiagnostic &Note, SourceRange ParenRange) |
static bool | IsArithmeticOp (BinaryOperatorKind Opc) |
static bool | IsArithmeticBinaryExpr (Expr *E, BinaryOperatorKind *Opcode, Expr **RHSExprs) |
static bool | IsLogicOp (BinaryOperatorKind Opc) |
static bool | ExprLooksBoolean (Expr *E) |
static void | DiagnoseConditionalPrecedence (Sema &Self, SourceLocation OpLoc, Expr *Condition, Expr *LHSExpr, Expr *RHSExpr) |
static Sema::AssignConvertType | checkPointerTypesForAssignment (Sema &S, QualType LHSType, QualType RHSType) |
static Sema::AssignConvertType | checkBlockPointerTypesForAssignment (Sema &S, QualType LHSType, QualType RHSType) |
static Sema::AssignConvertType | checkObjCPointerTypesForAssignment (Sema &S, QualType LHSType, QualType RHSType) |
static void | ConstructTransparentUnion (Sema &S, ASTContext &C, ExprResult &EResult, QualType UnionType, FieldDecl *Field) |
Constructs a transparent union from an expression that is used to initialize the transparent union. | |
static bool | tryVectorConvertAndSplat (Sema &S, ExprResult *scalar, QualType scalarTy, QualType vectorEltTy, QualType vectorTy) |
static void | checkArithmeticNull (Sema &S, ExprResult &LHS, ExprResult &RHS, SourceLocation Loc, bool IsCompare) |
static void | diagnoseArithmeticOnTwoVoidPointers (Sema &S, SourceLocation Loc, Expr *LHSExpr, Expr *RHSExpr) |
Diagnose invalid arithmetic on two void pointers. | |
static void | diagnoseArithmeticOnVoidPointer (Sema &S, SourceLocation Loc, Expr *Pointer) |
Diagnose invalid arithmetic on a void pointer. | |
static void | diagnoseArithmeticOnTwoFunctionPointers (Sema &S, SourceLocation Loc, Expr *LHS, Expr *RHS) |
Diagnose invalid arithmetic on two function pointers. | |
static void | diagnoseArithmeticOnFunctionPointer (Sema &S, SourceLocation Loc, Expr *Pointer) |
Diagnose invalid arithmetic on a function pointer. | |
static bool | checkArithmeticIncompletePointerType (Sema &S, SourceLocation Loc, Expr *Operand) |
Emit error if Operand is incomplete pointer type. | |
static bool | checkArithmeticOpPointerOperand (Sema &S, SourceLocation Loc, Expr *Operand) |
Check the validity of an arithmetic pointer operand. | |
static bool | checkArithmeticBinOpPointerOperands (Sema &S, SourceLocation Loc, Expr *LHSExpr, Expr *RHSExpr) |
Check the validity of a binary arithmetic operation w.r.t. pointer operands. | |
static void | diagnoseStringPlusInt (Sema &Self, SourceLocation OpLoc, Expr *LHSExpr, Expr *RHSExpr) |
static void | diagnoseStringPlusChar (Sema &Self, SourceLocation OpLoc, Expr *LHSExpr, Expr *RHSExpr) |
Emit a warning when adding a char literal to a string. | |
static void | diagnosePointerIncompatibility (Sema &S, SourceLocation Loc, Expr *LHSExpr, Expr *RHSExpr) |
Emit error when two pointers are incompatible. | |
static bool | isScopedEnumerationType (QualType T) |
static void | DiagnoseBadShiftValues (Sema &S, ExprResult &LHS, ExprResult &RHS, SourceLocation Loc, unsigned Opc, QualType LHSType) |
static bool | IsWithinTemplateSpecialization (Decl *D) |
static void | checkEnumComparison (Sema &S, SourceLocation Loc, Expr *LHS, Expr *RHS) |
If two different enums are compared, raise a warning. | |
static void | diagnoseDistinctPointerComparison (Sema &S, SourceLocation Loc, ExprResult &LHS, ExprResult &RHS, bool IsError) |
Diagnose bad pointer comparisons. | |
static bool | convertPointersToCompositeType (Sema &S, SourceLocation Loc, ExprResult &LHS, ExprResult &RHS) |
Returns false if the pointers are converted to a composite type, true otherwise. | |
static void | diagnoseFunctionPointerToVoidComparison (Sema &S, SourceLocation Loc, ExprResult &LHS, ExprResult &RHS, bool IsError) |
static bool | isObjCObjectLiteral (ExprResult &E) |
static bool | hasIsEqualMethod (Sema &S, const Expr *LHS, const Expr *RHS) |
static void | diagnoseObjCLiteralComparison (Sema &S, SourceLocation Loc, ExprResult &LHS, ExprResult &RHS, BinaryOperator::Opcode Opc) |
static void | diagnoseLogicalNotOnLHSofComparison (Sema &S, ExprResult &LHS, ExprResult &RHS, SourceLocation Loc, unsigned OpaqueOpc) |
static ValueDecl * | getCompareDecl (Expr *E) |
static bool | IsReadonlyMessage (Expr *E, Sema &S) |
static NonConstCaptureKind | isReferenceToNonConstCapture (Sema &S, Expr *E) |
static bool | CheckForModifiableLvalue (Expr *E, SourceLocation Loc, Sema &S) |
static void | CheckIdentityFieldAssignment (Expr *LHSExpr, Expr *RHSExpr, SourceLocation Loc, Sema &Sema) |
static QualType | CheckCommaOperands (Sema &S, ExprResult &LHS, ExprResult &RHS, SourceLocation Loc) |
static QualType | CheckIncrementDecrementOperand (Sema &S, Expr *Op, ExprValueKind &VK, ExprObjectKind &OK, SourceLocation OpLoc, bool IsInc, bool IsPrefix) |
static ValueDecl * | getPrimaryDecl (Expr *E) |
static void | diagnoseAddressOfInvalidType (Sema &S, SourceLocation Loc, Expr *E, unsigned Type) |
Diagnose invalid operand for address of operations. | |
static QualType | CheckIndirectionOperand (Sema &S, Expr *Op, ExprValueKind &VK, SourceLocation OpLoc) |
CheckIndirectionOperand - Type check unary indirection (prefix '*'). | |
static UnaryOperatorKind | ConvertTokenKindToUnaryOpcode (tok::TokenKind Kind) |
static void | DiagnoseSelfAssignment (Sema &S, Expr *LHSExpr, Expr *RHSExpr, SourceLocation OpLoc) |
static void | checkObjCPointerIntrospection (Sema &S, ExprResult &L, ExprResult &R, SourceLocation OpLoc) |
static void | DiagnoseBitwisePrecedence (Sema &Self, BinaryOperatorKind Opc, SourceLocation OpLoc, Expr *LHSExpr, Expr *RHSExpr) |
static void | EmitDiagnosticForBitwiseAndInBitwiseOr (Sema &Self, SourceLocation OpLoc, BinaryOperator *Bop) |
It accepts a '&' expr that is inside a '|' one. Emit a diagnostic together with a fixit hint that wraps the '&' expression in parentheses. | |
static void | EmitDiagnosticForLogicalAndInLogicalOr (Sema &Self, SourceLocation OpLoc, BinaryOperator *Bop) |
It accepts a '&&' expr that is inside a '||' one. Emit a diagnostic together with a fixit hint that wraps the '&&' expression in parentheses. | |
static bool | EvaluatesAsTrue (Sema &S, Expr *E) |
Returns true if the given expression can be evaluated as a constant 'true'. | |
static bool | EvaluatesAsFalse (Sema &S, Expr *E) |
Returns true if the given expression can be evaluated as a constant 'false'. | |
static void | DiagnoseLogicalAndInLogicalOrLHS (Sema &S, SourceLocation OpLoc, Expr *LHSExpr, Expr *RHSExpr) |
Look for '&&' in the left hand of a '||' expr. | |
static void | DiagnoseLogicalAndInLogicalOrRHS (Sema &S, SourceLocation OpLoc, Expr *LHSExpr, Expr *RHSExpr) |
Look for '&&' in the right hand of a '||' expr. | |
static void | DiagnoseBitwiseAndInBitwiseOr (Sema &S, SourceLocation OpLoc, Expr *OrArg) |
Look for '&' in the left or right hand of a '|' expr. | |
static void | DiagnoseAdditionInShift (Sema &S, SourceLocation OpLoc, Expr *SubExpr, StringRef Shift) |
static void | DiagnoseShiftCompare (Sema &S, SourceLocation OpLoc, Expr *LHSExpr, Expr *RHSExpr) |
static void | DiagnoseBinOpPrecedence (Sema &Self, BinaryOperatorKind Opc, SourceLocation OpLoc, Expr *LHSExpr, Expr *RHSExpr) |
static ExprResult | BuildOverloadedBinOp (Sema &S, Scope *Sc, SourceLocation OpLoc, BinaryOperatorKind Opc, Expr *LHS, Expr *RHS) |
Build an overloaded binary operator expression in the given scope. | |
static bool | isQualifiedMemberAccess (Expr *E) |
Determine whether the given expression is a qualified member access expression, of a form that could be turned into a pointer to member with the address-of operator. | |
static Expr * | maybeRebuildARCConsumingStmt (Stmt *Statement) |
static bool | IsPotentiallyEvaluatedContext (Sema &SemaRef) |
static void | diagnoseUncapturableValueReference (Sema &S, SourceLocation loc, VarDecl *var, DeclContext *DC) |
static bool | isVariableAlreadyCapturedInScopeInfo (CapturingScopeInfo *CSI, VarDecl *Var, bool &SubCapturesAreNested, QualType &CaptureType, QualType &DeclRefType) |
static DeclContext * | getParentOfCapturingContextOrNull (DeclContext *DC, VarDecl *Var, SourceLocation Loc, const bool Diagnose, Sema &S) |
static bool | isVariableCapturable (CapturingScopeInfo *CSI, VarDecl *Var, SourceLocation Loc, const bool Diagnose, Sema &S) |
static bool | captureInBlock (BlockScopeInfo *BSI, VarDecl *Var, SourceLocation Loc, const bool BuildAndDiagnose, QualType &CaptureType, QualType &DeclRefType, const bool Nested, Sema &S) |
static bool | captureInCapturedRegion (CapturedRegionScopeInfo *RSI, VarDecl *Var, SourceLocation Loc, const bool BuildAndDiagnose, QualType &CaptureType, QualType &DeclRefType, const bool RefersToEnclosingLocal, Sema &S) |
Capture the given variable in the captured region. | |
static ExprResult | addAsFieldToClosureType (Sema &S, LambdaScopeInfo *LSI, VarDecl *Var, QualType FieldType, QualType DeclRefType, SourceLocation Loc, bool RefersToEnclosingLocal) |
Create a field within the lambda class for the variable being captured. Handle Array captures. | |
static bool | captureInLambda (LambdaScopeInfo *LSI, VarDecl *Var, SourceLocation Loc, const bool BuildAndDiagnose, QualType &CaptureType, QualType &DeclRefType, const bool RefersToEnclosingLocal, const Sema::TryCaptureKind Kind, SourceLocation EllipsisLoc, const bool IsTopScope, Sema &S) |
Capture the given variable in the lambda. | |
static bool | IsVariableNonDependentAndAConstantExpression (VarDecl *Var, ASTContext &Context) |
static void | DoMarkVarDeclReferenced (Sema &SemaRef, SourceLocation Loc, VarDecl *Var, Expr *E) |
static void | MarkExprReferenced (Sema &SemaRef, SourceLocation Loc, Decl *D, Expr *E, bool OdrUse) |
static ExprResult | diagnoseUnknownAnyExpr (Sema &S, Expr *E) |
#define ABSTRACT_DECL | ( | kind | ) |
#define ABSTRACT_TYPE | ( | Class, | |
Base | |||
) |
#define BUILTIN_TYPE | ( | ID, | |
SINGLETON_ID | |||
) | case BuiltinType::ID: |
#define BUILTIN_TYPE | ( | Id, | |
SingletonId | |||
) | case BuiltinType::Id: |
#define DECL | ( | type, | |
base | |||
) | case Decl::type: |
#define DEPENDENT_TYPE | ( | Class, | |
Base | |||
) | case Type::Class: |
#define NON_CANONICAL_TYPE | ( | Class, | |
Base | |||
) |
#define NON_CANONICAL_UNLESS_DEPENDENT_TYPE | ( | Class, | |
Base | |||
) |
#define PLACEHOLDER_TYPE | ( | ID, | |
SINGLETON_ID | |||
) |
#define PLACEHOLDER_TYPE | ( | Id, | |
SingletonId | |||
) |
#define VALUE | ( | type, | |
base | |||
) |
typedef ExprResult PerformCastFn(Sema &S, Expr *operand, QualType toType) |
Definition at line 1063 of file SemaExpr.cpp.
anonymous enum |
Definition at line 8906 of file SemaExpr.cpp.
enum NonConstCaptureKind |
Is the given expression (which must be 'const') a reference to a variable which was originally non-const, but which has become 'const' due to being captured within a block?
Definition at line 8461 of file SemaExpr.cpp.
static ExprResult addAsFieldToClosureType | ( | Sema & | S, |
LambdaScopeInfo * | LSI, | ||
VarDecl * | Var, | ||
QualType | FieldType, | ||
QualType | DeclRefType, | ||
SourceLocation | Loc, | ||
bool | RefersToEnclosingLocal | ||
) | [static] |
Create a field within the lambda class for the variable being captured. Handle Array captures.
Definition at line 11868 of file SemaExpr.cpp.
References clang::DeclContext::addDecl(), clang::sema::LambdaScopeInfo::ArrayIndexStarts, clang::sema::LambdaScopeInfo::ArrayIndexVars, clang::AS_private, clang::Sema::BuildDeclRefExpr(), clang::Sema::CleanupVarDeclMarking(), clang::Sema::Context, clang::VarDecl::Create(), clang::FieldDecl::Create(), clang::Sema::CreateBuiltinArraySubscriptExpr(), clang::InitializationKind::CreateDirect(), clang::Sema::CurContext, clang::Sema::DefaultLvalueConversion(), clang::Sema::DiscardCleanupsInEvaluationContext(), clang::ExprError(), clang::Sema::ExprNeedsCleanups, clang::sema::LambdaScopeInfo::ExprNeedsCleanups, clang::IdentifierTable::get(), clang::ASTContext::getAsConstantArrayType(), clang::NamedDecl::getIdentifier(), clang::ASTContext::getSizeType(), clang::ASTContext::getTrivialTypeSourceInfo(), clang::ValueDecl::getType(), clang::ICIS_NoInit, clang::ASTContext::Idents, clang::InitializedEntity::InitializeElement(), clang::InitializedEntity::InitializeLambdaCapture(), clang::ActionResult< PtrTy, CompressInvalid >::isInvalid(), clang::sema::LambdaScopeInfo::Lambda, clang::Decl::markUsed(), clang::Sema::PotentiallyEvaluated, clang::SC_None, clang::Decl::setAccess(), clang::Decl::setImplicit(), clang::Decl::setReferenced(), and clang::VK_LValue.
Referenced by captureInLambda().
static bool breakDownVectorType | ( | QualType | type, |
uint64_t & | len, | ||
QualType & | eltType | ||
) | [static] |
Definition at line 5103 of file SemaExpr.cpp.
References clang::Type::getAs(), clang::Type::isRealType(), clang::Type::isScalarType(), and clang::ast_matchers::type.
Referenced by VectorTypesMatch().
static ExprResult BuildCookedLiteralOperatorCall | ( | Sema & | S, |
Scope * | Scope, | ||
IdentifierInfo * | UDSuffix, | ||
SourceLocation | UDSuffixLoc, | ||
ArrayRef< Expr * > | Args, | ||
SourceLocation | LitEndLoc | ||
) | [static] |
BuildCookedLiteralOperatorCall - A user-defined literal was found. Look up the corresponding cooked (non-raw) literal operator, and build a call to it.
Definition at line 1421 of file SemaExpr.cpp.
References clang::Sema::BuildLiteralOperatorCall(), clang::Sema::Context, clang::ASTContext::DeclarationNames, clang::ExprError(), clang::ASTContext::getArrayDecayedType(), clang::DeclarationNameTable::getCXXLiteralOperatorName(), clang::Sema::LOLR_Error, clang::Sema::LookupLiteralOperator(), clang::Sema::LookupOrdinaryName, and clang::DeclarationNameInfo::setCXXLiteralOperatorNameLoc().
Referenced by clang::Sema::ActOnCharacterConstant().
static Expr* BuildFloatingLiteral | ( | Sema & | S, |
NumericLiteralParser & | Literal, | ||
QualType | Ty, | ||
SourceLocation | Loc | ||
) | [static] |
Definition at line 2994 of file SemaExpr.cpp.
References clang::Sema::Context, clang::FloatingLiteral::Create(), clang::Sema::Diag(), clang::ASTContext::getFloatTypeSemantics(), and clang::NumericLiteralParser::GetFloatValue().
Referenced by clang::Sema::ActOnNumericConstant().
static ExprResult BuildOverloadedBinOp | ( | Sema & | S, |
Scope * | Sc, | ||
SourceLocation | OpLoc, | ||
BinaryOperatorKind | Opc, | ||
Expr * | LHS, | ||
Expr * | RHS | ||
) | [static] |
Build an overloaded binary operator expression in the given scope.
Definition at line 9718 of file SemaExpr.cpp.
References clang::Sema::CreateOverloadedBinOp(), clang::BinaryOperator::getOverloadedOperator(), clang::Expr::getType(), clang::Sema::LookupOverloadedOperatorName(), and clang::OO_None.
Referenced by clang::Sema::BuildBinOp().
static bool captureInBlock | ( | BlockScopeInfo * | BSI, |
VarDecl * | Var, | ||
SourceLocation | Loc, | ||
const bool | BuildAndDiagnose, | ||
QualType & | CaptureType, | ||
QualType & | DeclRefType, | ||
const bool | Nested, | ||
Sema & | S | ||
) | [static] |
Definition at line 11732 of file SemaExpr.cpp.
References clang::sema::CapturingScopeInfo::addCapture(), clang::Sema::Context, clang::Sema::Diag(), clang::Sema::FinalizeVarWithDestructor(), clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::Type::getAs(), clang::NamedDecl::getDeclName(), clang::Sema::getLangOpts(), clang::Decl::getLocation(), clang::QualType::getNonReferenceType(), clang::QualType::getObjCLifetime(), clang::Decl::hasAttr(), clang::InitializedEntity::InitializeBlock(), clang::Type::isArrayType(), clang::ActionResult< PtrTy, CompressInvalid >::isInvalid(), clang::Type::isReferenceType(), clang::Sema::MaybeCreateExprWithCleanups(), clang::Qualifiers::OCL_Autoreleasing, clang::Sema::PerformCopyInitialization(), clang::Sema::PotentiallyEvaluated, Record, clang::VK_LValue, and clang::QualType::withConst().
Referenced by clang::Sema::tryCaptureVariable().
static bool captureInCapturedRegion | ( | CapturedRegionScopeInfo * | RSI, |
VarDecl * | Var, | ||
SourceLocation | Loc, | ||
const bool | BuildAndDiagnose, | ||
QualType & | CaptureType, | ||
QualType & | DeclRefType, | ||
const bool | RefersToEnclosingLocal, | ||
Sema & | S | ||
) | [static] |
Capture the given variable in the captured region.
Definition at line 11823 of file SemaExpr.cpp.
References clang::sema::CapturingScopeInfo::addCapture(), clang::DeclContext::addDecl(), clang::AS_private, clang::Sema::Context, clang::FieldDecl::Create(), clang::ASTContext::getLValueReferenceType(), clang::ASTContext::getTrivialTypeSourceInfo(), clang::ICIS_NoInit, clang::Decl::markUsed(), clang::Decl::setAccess(), clang::Decl::setImplicit(), clang::Decl::setReferenced(), clang::sema::CapturedRegionScopeInfo::TheRecordDecl, and clang::VK_LValue.
Referenced by clang::Sema::tryCaptureVariable().
static bool captureInLambda | ( | LambdaScopeInfo * | LSI, |
VarDecl * | Var, | ||
SourceLocation | Loc, | ||
const bool | BuildAndDiagnose, | ||
QualType & | CaptureType, | ||
QualType & | DeclRefType, | ||
const bool | RefersToEnclosingLocal, | ||
const Sema::TryCaptureKind | Kind, | ||
SourceLocation | EllipsisLoc, | ||
const bool | IsTopScope, | ||
Sema & | S | ||
) | [static] |
Capture the given variable in the lambda.
Definition at line 11990 of file SemaExpr.cpp.
References addAsFieldToClosureType(), clang::sema::CapturingScopeInfo::addCapture(), clang::QualType::addConst(), clang::Sema::Context, clang::Sema::Diag(), clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::Type::getAs(), clang::NamedDecl::getDeclName(), clang::Decl::getLocation(), clang::ASTContext::getLValueReferenceType(), clang::QualType::getNonReferenceType(), clang::QualType::getObjCLifetime(), clang::Type::getPointeeType(), clang::sema::CapturingScopeInfo::ImpCap_LambdaByref, clang::sema::CapturingScopeInfo::ImpCaptureStyle, clang::Type::isDependentType(), clang::ActionResult< PtrTy, CompressInvalid >::isInvalid(), clang::Type::isReferenceType(), clang::sema::LambdaScopeInfo::Mutable, clang::Qualifiers::OCL_Autoreleasing, clang::Sema::RequireCompleteType(), clang::Sema::RequireNonAbstractType(), clang::Sema::TryCapture_ExplicitByRef, and clang::Sema::TryCapture_Implicit.
Referenced by clang::Sema::tryCaptureVariable().
static bool CheckAlignOfExpr | ( | Sema & | S, |
Expr * | E | ||
) | [static] |
Definition at line 3546 of file SemaExpr.cpp.
References clang::Sema::CheckUnaryExprOrTypeTraitOperand(), clang::Sema::Diag(), clang::Expr::getExprLoc(), clang::Expr::getObjectKind(), clang::Stmt::getSourceRange(), clang::Expr::IgnoreParens(), clang::Expr::isTypeDependent(), clang::OK_BitField, and clang::UETT_AlignOf.
Referenced by clang::Sema::CreateUnaryExprOrTypeTraitExpr().
static bool checkArgsForPlaceholders | ( | Sema & | S, |
MultiExprArg | args | ||
) | [static] |
Check an argument list for placeholders that we won't try to handle later.
Definition at line 4456 of file SemaExpr.cpp.
References clang::Sema::CheckPlaceholderExpr(), clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::ActionResult< PtrTy, CompressInvalid >::isInvalid(), and isPlaceholderToRemoveAsArg().
Referenced by clang::Sema::ActOnCallExpr().
static bool checkArithmeticBinOpPointerOperands | ( | Sema & | S, |
SourceLocation | Loc, | ||
Expr * | LHSExpr, | ||
Expr * | RHSExpr | ||
) | [static] |
Check the validity of a binary arithmetic operation w.r.t. pointer operands.
This routine will diagnose any invalid arithmetic on pointer operands much like
Definition at line 7117 of file SemaExpr.cpp.
References checkArithmeticIncompletePointerType(), diagnoseArithmeticOnFunctionPointer(), diagnoseArithmeticOnTwoFunctionPointers(), diagnoseArithmeticOnTwoVoidPointers(), diagnoseArithmeticOnVoidPointer(), clang::Sema::getLangOpts(), clang::Type::getPointeeType(), clang::Expr::getType(), clang::Type::isAnyPointerType(), clang::Type::isFunctionType(), and clang::Type::isVoidType().
Referenced by clang::Sema::CheckSubtractionOperands().
static bool checkArithmeticIncompletePointerType | ( | Sema & | S, |
SourceLocation | Loc, | ||
Expr * | Operand | ||
) | [static] |
Emit error if Operand is incomplete pointer type.
Definition at line 7071 of file SemaExpr.cpp.
References clang::Type::getPointeeType(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::Type::isAnyPointerType(), clang::Type::isDependentType(), and clang::Sema::RequireCompleteType().
Referenced by checkArithmeticBinOpPointerOperands(), checkArithmeticOpPointerOperand(), and CheckIncrementDecrementOperand().
static void checkArithmeticNull | ( | Sema & | S, |
ExprResult & | LHS, | ||
ExprResult & | RHS, | ||
SourceLocation | Loc, | ||
bool | IsCompare | ||
) | [static] |
Definition at line 6927 of file SemaExpr.cpp.
References clang::Sema::Diag(), clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::Stmt::getSourceRange(), clang::Expr::getType(), and clang::Expr::IgnoreParenImpCasts().
Referenced by clang::Sema::CheckAdditionOperands(), clang::Sema::CheckBitwiseOperands(), clang::Sema::CheckCompareOperands(), clang::Sema::CheckMultiplyDivideOperands(), clang::Sema::CheckRemainderOperands(), clang::Sema::CheckShiftOperands(), and clang::Sema::CheckSubtractionOperands().
static bool checkArithmeticOnObjCPointer | ( | Sema & | S, |
SourceLocation | opLoc, | ||
Expr * | op | ||
) | [static] |
Diagnose if arithmetic on the given ObjC pointer is illegal.
Definition at line 3751 of file SemaExpr.cpp.
References clang::ObjCRuntime::allowsPointerArithmetic(), clang::Type::castAs(), clang::Sema::Diag(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::Type::isObjCObjectPointerType(), clang::Sema::LangOpts, and clang::LangOptions::ObjCRuntime.
Referenced by clang::Sema::CheckAdditionOperands(), CheckIncrementDecrementOperand(), and clang::Sema::CheckSubtractionOperands().
static bool checkArithmeticOpPointerOperand | ( | Sema & | S, |
SourceLocation | Loc, | ||
Expr * | Operand | ||
) | [static] |
Check the validity of an arithmetic pointer operand.
If the operand has pointer type, this code will check for pointer types which are invalid in arithmetic operations. These will be diagnosed appropriately, including whether or not the use is supported as an extension.
Definition at line 7089 of file SemaExpr.cpp.
References checkArithmeticIncompletePointerType(), diagnoseArithmeticOnFunctionPointer(), diagnoseArithmeticOnVoidPointer(), clang::Sema::getLangOpts(), clang::Type::getPointeeType(), clang::Expr::getType(), clang::Type::isAnyPointerType(), clang::Type::isFunctionType(), and clang::Type::isVoidType().
Referenced by clang::Sema::CheckAdditionOperands(), CheckIncrementDecrementOperand(), and clang::Sema::CheckSubtractionOperands().
static Sema::AssignConvertType checkBlockPointerTypesForAssignment | ( | Sema & | S, |
QualType | LHSType, | ||
QualType | RHSType | ||
) | [static] |
checkBlockPointerTypesForAssignment - This routine determines whether two block pointer types are compatible or whether a block and normal pointer are compatible. It is more restrict than comparing two function pointer
Definition at line 6255 of file SemaExpr.cpp.
References clang::Sema::Compatible, clang::Sema::CompatiblePointerDiscardsQualifiers, clang::Sema::Context, clang::Sema::getLangOpts(), clang::Sema::IncompatibleBlockPointer, clang::QualType::isCanonical(), and clang::ASTContext::typesAreBlockPointerCompatible().
Referenced by clang::Sema::CheckAssignmentConstraints().
static QualType CheckCommaOperands | ( | Sema & | S, |
ExprResult & | LHS, | ||
ExprResult & | RHS, | ||
SourceLocation | Loc | ||
) | [static] |
Definition at line 8737 of file SemaExpr.cpp.
References clang::Sema::CheckPlaceholderExpr(), clang::Sema::DefaultFunctionArrayLvalueConversion(), clang::Sema::DiagnoseUnusedExprResult(), clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::Sema::getLangOpts(), clang::Expr::getType(), clang::Sema::IgnoredValueConversions(), clang::ActionResult< PtrTy, CompressInvalid >::isInvalid(), clang::Type::isVoidType(), and clang::Sema::RequireCompleteType().
Referenced by clang::Sema::CreateBuiltinBinOp().
static bool checkCondition | ( | Sema & | S, |
Expr * | Cond | ||
) | [static] |
Return false if the condition expression is valid, true otherwise.
Definition at line 5422 of file SemaExpr.cpp.
References clang::Sema::Diag(), clang::Sema::getLangOpts(), clang::Stmt::getLocStart(), clang::Expr::getType(), clang::Type::isScalarType(), and clang::Type::isVectorType().
Referenced by clang::Sema::CheckConditionalOperands().
static QualType checkConditionalBlockPointerCompatibility | ( | Sema & | S, |
ExprResult & | LHS, | ||
ExprResult & | RHS, | ||
SourceLocation | Loc | ||
) | [static] |
Return the resulting type when the operands are both block pointers.
Definition at line 5596 of file SemaExpr.cpp.
References checkConditionalPointerCompatibility(), clang::CK_BitCast, clang::Sema::Context, clang::Sema::Diag(), clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::ASTContext::getPointerType(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::Sema::ImpCastExprToType(), clang::Type::isBlockPointerType(), clang::Type::isVoidPointerType(), and clang::ASTContext::VoidTy.
Referenced by clang::Sema::CheckConditionalOperands().
static bool checkConditionalConvertScalarsToVectors | ( | Sema & | S, |
ExprResult & | LHS, | ||
ExprResult & | RHS, | ||
QualType | CondTy | ||
) | [static] |
Return false if the two expressions can be converted to a vector, true otherwise.
Definition at line 5442 of file SemaExpr.cpp.
References clang::CK_IntegralCast, clang::Sema::Diag(), clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::Stmt::getLocStart(), clang::Expr::getType(), clang::Sema::ImpCastExprToType(), and clang::Type::isScalarType().
Referenced by clang::Sema::CheckConditionalOperands().
static bool checkConditionalNullPointer | ( | Sema & | S, |
ExprResult & | NullExpr, | ||
QualType | PointerTy | ||
) | [static] |
Return false if the NullExpr can be promoted to PointerTy, true otherwise.
Definition at line 5482 of file SemaExpr.cpp.
References clang::CK_NullToPointer, clang::Sema::Context, clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::Sema::ImpCastExprToType(), clang::Type::isAnyPointerType(), clang::Type::isBlockPointerType(), clang::Expr::isNullPointerConstant(), and clang::Expr::NPC_ValueDependentIsNull.
Referenced by clang::Sema::CheckConditionalOperands().
static QualType checkConditionalObjectPointersCompatibility | ( | Sema & | S, |
ExprResult & | LHS, | ||
ExprResult & | RHS, | ||
SourceLocation | Loc | ||
) | [static] |
Return the resulting type when the operands are both pointers.
Definition at line 5622 of file SemaExpr.cpp.
References checkConditionalPointerCompatibility(), clang::CK_BitCast, clang::CK_NoOp, clang::Sema::Context, clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::Type::getAs(), clang::ASTContext::getPointerType(), clang::ASTContext::getQualifiedType(), clang::QualType::getQualifiers(), clang::Expr::getType(), clang::Sema::ImpCastExprToType(), clang::Type::isIncompleteOrObjectType(), and clang::Type::isVoidType().
Referenced by clang::Sema::CheckConditionalOperands().
static QualType checkConditionalPointerCompatibility | ( | Sema & | S, |
ExprResult & | LHS, | ||
ExprResult & | RHS, | ||
SourceLocation | Loc | ||
) | [static] |
Checks compatibility between two pointers and return the resulting type.
Definition at line 5495 of file SemaExpr.cpp.
References clang::Type::castAs(), clang::CK_BitCast, clang::Sema::Context, clang::Sema::Diag(), clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::Type::getAs(), clang::ASTContext::getBlockPointerType(), clang::Qualifiers::getCVRQualifiers(), clang::Type::getPointeeType(), clang::ASTContext::getPointerType(), clang::ASTContext::getQualifiedType(), clang::QualType::getQualifiers(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::QualType::getUnqualifiedType(), clang::ASTContext::hasSameType(), clang::Sema::ImpCastExprToType(), clang::QualType::isNull(), clang::ASTContext::mergeTypes(), clang::Qualifiers::removeCVRQualifiers(), clang::ASTContext::VoidTy, and clang::QualType::withCVRQualifiers().
Referenced by checkConditionalBlockPointerCompatibility(), and checkConditionalObjectPointersCompatibility().
static QualType checkConditionalVoidType | ( | Sema & | S, |
ExprResult & | LHS, | ||
ExprResult & | RHS | ||
) | [static] |
Handle when one or both operands are void type.
Definition at line 5464 of file SemaExpr.cpp.
References clang::CK_ToVoid, clang::Sema::Context, clang::Sema::Diag(), clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::Stmt::getLocStart(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::Sema::ImpCastExprToType(), clang::Type::isVoidType(), and clang::ASTContext::VoidTy.
Referenced by clang::Sema::CheckConditionalOperands().
static bool CheckDeclInExpr | ( | Sema & | S, |
SourceLocation | Loc, | ||
NamedDecl * | D | ||
) | [static] |
Diagnoses obvious problems with the use of the given declaration as an expression. This is only actually called for lookups that were not overloaded, and it doesn't promise that the declaration will in fact be used.
Definition at line 2597 of file SemaExpr.cpp.
References clang::Sema::Diag(), and clang::NamedDecl::getDeclName().
Referenced by clang::Sema::BuildDeclarationNameExpr().
static void checkEnumComparison | ( | Sema & | S, |
SourceLocation | Loc, | ||
Expr * | LHS, | ||
Expr * | RHS | ||
) | [static] |
If two different enums are compared, raise a warning.
Definition at line 7556 of file SemaExpr.cpp.
References clang::Sema::Context, clang::Sema::Diag(), clang::Type::getAs(), clang::EnumType::getDecl(), clang::NamedDecl::getIdentifier(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::ASTContext::hasSameUnqualifiedType(), and clang::Expr::IgnoreParenImpCasts().
Referenced by clang::Sema::CheckCompareOperands().
static bool CheckExtensionTraitOperandType | ( | Sema & | S, |
QualType | T, | ||
SourceLocation | Loc, | ||
SourceRange | ArgRange, | ||
UnaryExprOrTypeTrait | TraitKind | ||
) | [static] |
Definition at line 3342 of file SemaExpr.cpp.
References clang::Sema::Diag(), clang::Type::isFunctionType(), clang::Type::isVoidType(), clang::Sema::LangOpts, clang::UETT_AlignOf, and clang::UETT_SizeOf.
Referenced by clang::Sema::CheckUnaryExprOrTypeTraitOperand().
static bool CheckForModifiableLvalue | ( | Expr * | E, |
SourceLocation | Loc, | ||
Sema & | S | ||
) | [static] |
CheckForModifiableLvalue - Verify that E is a modifiable lvalue. If not, emit an error and return true. If so, return false.
Definition at line 8491 of file SemaExpr.cpp.
References clang::Sema::Context, Diag(), clang::Sema::Diag(), clang::Sema::getCurMethodDecl(), clang::DeclRefExpr::getDecl(), clang::Sema::getLangOpts(), clang::ObjCMethodDecl::getSelfDecl(), clang::Stmt::getSourceRange(), clang::TypeSourceInfo::getType(), clang::Expr::getType(), clang::DeclaratorDecl::getTypeSourceInfo(), clang::Expr::hasPlaceholderType(), clang::Expr::IgnoreParenCasts(), clang::VarDecl::isARCPseudoStrong(), clang::ObjCMethodDecl::isClassMethod(), clang::QualType::isConstQualified(), clang::Expr::isModifiableLvalue(), IsReadonlyMessage(), isReferenceToNonConstCapture(), clang::Expr::MLV_ArrayTemporary, clang::Expr::MLV_ArrayType, clang::Expr::MLV_ClassTemporary, clang::Expr::MLV_ConstQualified, clang::Expr::MLV_DuplicateVectorComponents, clang::Expr::MLV_IncompleteType, clang::Expr::MLV_IncompleteVoidType, clang::Expr::MLV_InvalidExpression, clang::Expr::MLV_InvalidMessageExpression, clang::Expr::MLV_LValueCast, clang::Expr::MLV_MemberFunction, clang::Expr::MLV_NoSetterProperty, clang::Expr::MLV_NotObjectType, clang::Expr::MLV_SubObjCPropertySetting, clang::Expr::MLV_Valid, NCCK_Block, and clang::Sema::RequireCompleteType().
Referenced by clang::Sema::BuildVAArgExpr(), clang::Sema::CheckAssignmentOperands(), and CheckIncrementDecrementOperand().
static void CheckForNullPointerDereference | ( | Sema & | S, |
Expr * | E | ||
) | [static] |
Definition at line 475 of file SemaExpr.cpp.
References clang::Sema::Context, clang::Sema::DiagRuntimeBehavior(), clang::Expr::IgnoreParenCasts(), clang::Expr::NPC_ValueDependentIsNotNull, clang::Sema::PDiag(), and clang::UO_Deref.
Referenced by clang::Sema::CheckAssignmentOperands(), and clang::Sema::DefaultLvalueConversion().
static void CheckIdentityFieldAssignment | ( | Expr * | LHSExpr, |
Expr * | RHSExpr, | ||
SourceLocation | Loc, | ||
Sema & | Sema | ||
) | [static] |
Definition at line 8599 of file SemaExpr.cpp.
References clang::Sema::Diag(), clang::ObjCIvarRefExpr::getBase(), clang::MemberExpr::getBase(), clang::ObjCIvarRefExpr::getDecl(), clang::DeclRefExpr::getDecl(), clang::MemberExpr::getMemberDecl(), and clang::Expr::IgnoreImpCasts().
Referenced by clang::Sema::CheckAssignmentOperands().
static QualType CheckIncrementDecrementOperand | ( | Sema & | S, |
Expr * | Op, | ||
ExprValueKind & | VK, | ||
ExprObjectKind & | OK, | ||
SourceLocation | OpLoc, | ||
bool | IsInc, | ||
bool | IsPrefix | ||
) | [static] |
CheckIncrementDecrementOperand - unlike most "Check" methods, this routine doesn't need to call UsualUnaryConversions or UsualArithmeticConversions.
Definition at line 8770 of file SemaExpr.cpp.
References checkArithmeticIncompletePointerType(), checkArithmeticOnObjCPointer(), checkArithmeticOpPointerOperand(), CheckForModifiableLvalue(), clang::Sema::CheckPlaceholderExpr(), clang::Sema::Context, clang::ASTContext::DependentTy, clang::Sema::Diag(), clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::Type::getAs(), getElementType(), clang::Sema::getLangOpts(), clang::Expr::getObjectKind(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::Type::isIntegerType(), clang::ActionResult< PtrTy, CompressInvalid >::isInvalid(), clang::Expr::isTypeDependent(), clang::VK_LValue, and clang::VK_RValue.
Referenced by clang::Sema::CreateBuiltinUnaryOp().
static QualType CheckIndirectionOperand | ( | Sema & | S, |
Expr * | Op, | ||
ExprValueKind & | VK, | ||
SourceLocation | OpLoc | ||
) | [static] |
CheckIndirectionOperand - Type check unary indirection (prefix '*').
Definition at line 9125 of file SemaExpr.cpp.
References clang::Sema::CheckCompatibleReinterpretCast(), clang::Sema::CheckPlaceholderExpr(), clang::Sema::Context, clang::ASTContext::DependentTy, clang::Sema::Diag(), clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::Type::getAs(), clang::Sema::getLangOpts(), clang::Type::getPointeeType(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::Expr::IgnoreParenCasts(), clang::QualType::isCForbiddenLValueType(), clang::ActionResult< PtrTy, CompressInvalid >::isInvalid(), clang::QualType::isNull(), clang::Expr::isTypeDependent(), clang::Type::isVoidType(), clang::Sema::UsualUnaryConversions(), clang::VK_LValue, and clang::VK_RValue.
Referenced by clang::Sema::CreateBuiltinUnaryOp().
static void checkObjCPointerIntrospection | ( | Sema & | S, |
ExprResult & | L, | ||
ExprResult & | R, | ||
SourceLocation | OpLoc | ||
) | [static] |
Check if a bitwise-& is performed on an Objective-C pointer. This is usually indicative of introspection within the Objective-C pointer.
Definition at line 9280 of file SemaExpr.cpp.
References Diag(), clang::Sema::Diag(), clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::Sema::getLangOpts(), clang::Selector::getNameForSlot(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::Expr::IgnoreParenCasts(), and clang::Type::isObjCObjectPointerType().
Referenced by clang::Sema::CreateBuiltinBinOp().
static Sema::AssignConvertType checkObjCPointerTypesForAssignment | ( | Sema & | S, |
QualType | LHSType, | ||
QualType | RHSType | ||
) | [static] |
checkObjCPointerTypesForAssignment - Compares two objective-c pointer types for assignment compatibility.
Definition at line 6285 of file SemaExpr.cpp.
References clang::Sema::Compatible, clang::Sema::CompatiblePointerDiscardsQualifiers, clang::Sema::Context, clang::Type::getAs(), clang::Sema::IncompatibleObjCQualifiedId, clang::Sema::IncompatiblePointer, clang::QualType::isAtLeastAsQualifiedAs(), clang::QualType::isCanonical(), clang::Type::isObjCBuiltinType(), clang::Type::isObjCClassType(), clang::Type::isObjCQualifiedClassType(), clang::Type::isObjCQualifiedIdType(), and clang::ASTContext::typesAreCompatible().
Referenced by clang::Sema::CheckAssignmentConstraints().
static bool CheckObjCTraitOperandConstraints | ( | Sema & | S, |
QualType | T, | ||
SourceLocation | Loc, | ||
SourceRange | ArgRange, | ||
UnaryExprOrTypeTrait | TraitKind | ||
) | [static] |
Definition at line 3371 of file SemaExpr.cpp.
References clang::ObjCRuntime::allowsSizeofAlignof(), clang::Sema::Diag(), clang::Type::isObjCObjectType(), clang::Sema::LangOpts, clang::LangOptions::ObjCRuntime, and clang::UETT_SizeOf.
Referenced by clang::Sema::CheckUnaryExprOrTypeTraitOperand().
static bool checkPointerIntegerMismatch | ( | Sema & | S, |
ExprResult & | Int, | ||
Expr * | PointerExpr, | ||
SourceLocation | Loc, | ||
bool | IsIntFirstExpr | ||
) | [static] |
Return false if the first expression is not an integer and the second expression is not a pointer, true otherwise.
Definition at line 5661 of file SemaExpr.cpp.
References clang::CK_IntegralToPointer, clang::Sema::Diag(), clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::Sema::ImpCastExprToType(), clang::Type::isIntegerType(), and clang::Type::isPointerType().
Referenced by clang::Sema::CheckConditionalOperands().
static Sema::AssignConvertType checkPointerTypesForAssignment | ( | Sema & | S, |
QualType | LHSType, | ||
QualType | RHSType | ||
) | [static] |
Definition at line 6131 of file SemaExpr.cpp.
References clang::Sema::Compatible, clang::Sema::CompatiblePointerDiscardsQualifiers, clang::Qualifiers::compatiblyIncludes(), clang::Qualifiers::compatiblyIncludesObjCLifetime(), clang::Sema::Context, clang::Sema::FunctionVoidPointer, clang::Qualifiers::getAddressSpace(), clang::ASTContext::getCorrespondingUnsignedType(), clang::Sema::getLangOpts(), clang::Qualifiers::getObjCLifetime(), clang::Sema::IncompatibleNestedPointerQualifiers, clang::Sema::IncompatiblePointer, clang::Sema::IncompatiblePointerDiscardsQualifiers, clang::Sema::IncompatiblePointerSign, clang::QualType::isCanonical(), clang::Sema::IsNoReturnConversion(), clang::Qualifiers::removeObjCLifetime(), clang::ASTContext::typesAreCompatible(), clang::ASTContext::UnsignedCharTy, clang::Qualifiers::withoutObjCGCAttr(), and clang::Qualifiers::withoutObjCLifetime().
Referenced by clang::Sema::CheckAssignmentConstraints().
static QualType CheckRealImagOperand | ( | Sema & | S, |
ExprResult & | V, | ||
SourceLocation | Loc, | ||
bool | IsReal | ||
) | [static] |
Definition at line 3694 of file SemaExpr.cpp.
References clang::Sema::CheckPlaceholderExpr(), clang::Sema::Context, clang::Sema::DefaultLvalueConversion(), clang::ASTContext::DependentTy, clang::Sema::Diag(), clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::Type::getAs(), clang::Expr::getObjectKind(), clang::Expr::getType(), clang::Type::isArithmeticType(), clang::ActionResult< PtrTy, CompressInvalid >::isInvalid(), clang::Expr::isTypeDependent(), and clang::OK_Ordinary.
Referenced by clang::Sema::CreateBuiltinUnaryOp().
static bool CheckVecStepTraitOperandType | ( | Sema & | S, |
QualType | T, | ||
SourceLocation | Loc, | ||
SourceRange | ArgRange | ||
) | [static] |
Definition at line 3324 of file SemaExpr.cpp.
References clang::Sema::Diag(), clang::Type::isArithmeticType(), clang::Type::isIncompleteType(), clang::Type::isVectorType(), and clang::Type::isVoidType().
Referenced by clang::Sema::CheckUnaryExprOrTypeTraitOperand().
static void ConstructTransparentUnion | ( | Sema & | S, |
ASTContext & | C, | ||
ExprResult & | EResult, | ||
QualType | UnionType, | ||
FieldDecl * | Field | ||
) | [static] |
Constructs a transparent union from an expression that is used to initialize the transparent union.
Definition at line 6614 of file SemaExpr.cpp.
References AttributeLangSupport::C, clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::ASTContext::getTrivialTypeSourceInfo(), clang::InitListExpr::setInitializedFieldInUnion(), clang::Expr::setType(), and clang::VK_RValue.
Referenced by clang::Sema::CheckTransparentUnionArgumentConstraints().
static bool convertPointersToCompositeType | ( | Sema & | S, |
SourceLocation | Loc, | ||
ExprResult & | LHS, | ||
ExprResult & | RHS | ||
) | [static] |
Returns false if the pointers are converted to a composite type, true otherwise.
Definition at line 7594 of file SemaExpr.cpp.
References clang::CK_BitCast, clang::Sema::Diag(), diagnoseDistinctPointerComparison(), clang::Sema::FindCompositePointerType(), clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::Sema::ImpCastExprToType(), clang::Type::isMemberPointerType(), clang::QualType::isNull(), clang::Type::isPointerType(), and clang::Sema::isSFINAEContext().
Referenced by clang::Sema::CheckCompareOperands().
static UnaryOperatorKind ConvertTokenKindToUnaryOpcode | ( | tok::TokenKind | Kind | ) | [inline, static] |
Definition at line 9224 of file SemaExpr.cpp.
References 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_PreDec, clang::UO_PreInc, and clang::UO_Real.
Referenced by clang::Sema::ActOnUnaryOp().
static void ConvertUTF8ToWideString | ( | unsigned | CharByteWidth, |
StringRef | Source, | ||
SmallString< 32 > & | Target | ||
) | [static] |
Definition at line 2858 of file SemaExpr.cpp.
Referenced by clang::Sema::BuildPredefinedExpr().
static void DiagnoseAdditionInShift | ( | Sema & | S, |
SourceLocation | OpLoc, | ||
Expr * | SubExpr, | ||
StringRef | Shift | ||
) | [static] |
Definition at line 9627 of file SemaExpr.cpp.
References clang::BO_Add, clang::BO_Sub, clang::Sema::Diag(), clang::Sema::PDiag(), and SuggestParentheses().
Referenced by DiagnoseBinOpPrecedence().
static void diagnoseAddressOfInvalidType | ( | Sema & | S, |
SourceLocation | Loc, | ||
Expr * | E, | ||
unsigned | Type | ||
) | [static] |
Diagnose invalid operand for address of operations.
Type | The type of operand which cannot have its address taken. |
Definition at line 8917 of file SemaExpr.cpp.
References clang::Sema::Diag(), and clang::Stmt::getSourceRange().
Referenced by clang::Sema::CheckAddressOfOperand().
static void diagnoseArithmeticOnFunctionPointer | ( | Sema & | S, |
SourceLocation | Loc, | ||
Expr * | Pointer | ||
) | [static] |
Diagnose invalid arithmetic on a function pointer.
Definition at line 7057 of file SemaExpr.cpp.
References clang::Sema::Diag(), clang::Sema::getLangOpts(), clang::Type::getPointeeType(), clang::Stmt::getSourceRange(), clang::Expr::getType(), and clang::Type::isAnyPointerType().
Referenced by checkArithmeticBinOpPointerOperands(), and checkArithmeticOpPointerOperand().
static void diagnoseArithmeticOnTwoFunctionPointers | ( | Sema & | S, |
SourceLocation | Loc, | ||
Expr * | LHS, | ||
Expr * | RHS | ||
) | [static] |
Diagnose invalid arithmetic on two function pointers.
Definition at line 7041 of file SemaExpr.cpp.
References clang::Sema::Context, clang::Sema::Diag(), clang::Sema::getLangOpts(), clang::Type::getPointeeType(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::ASTContext::hasSameUnqualifiedType(), and clang::Type::isAnyPointerType().
Referenced by checkArithmeticBinOpPointerOperands().
static void diagnoseArithmeticOnTwoVoidPointers | ( | Sema & | S, |
SourceLocation | Loc, | ||
Expr * | LHSExpr, | ||
Expr * | RHSExpr | ||
) | [static] |
Diagnose invalid arithmetic on two void pointers.
Definition at line 7022 of file SemaExpr.cpp.
References clang::Sema::Diag(), clang::Sema::getLangOpts(), and clang::Stmt::getSourceRange().
Referenced by checkArithmeticBinOpPointerOperands().
static void diagnoseArithmeticOnVoidPointer | ( | Sema & | S, |
SourceLocation | Loc, | ||
Expr * | Pointer | ||
) | [static] |
Diagnose invalid arithmetic on a void pointer.
Definition at line 7032 of file SemaExpr.cpp.
References clang::Sema::Diag(), clang::Sema::getLangOpts(), and clang::Stmt::getSourceRange().
Referenced by checkArithmeticBinOpPointerOperands(), and checkArithmeticOpPointerOperand().
static AvailabilityResult DiagnoseAvailabilityOfDecl | ( | Sema & | S, |
NamedDecl * | D, | ||
SourceLocation | Loc, | ||
const ObjCInterfaceDecl * | UnknownObjCClass, | ||
bool | ObjCPropertyAccess | ||
) | [static] |
Definition at line 85 of file SemaExpr.cpp.
References clang::Sema::AD_Deprecation, clang::Sema::AD_Unavailable, clang::AR_Available, clang::AR_Deprecated, clang::AR_NotYetIntroduced, clang::AR_Unavailable, clang::Sema::EmitAvailabilityWarning(), clang::ObjCPropertyDecl::findPropertyDecl(), clang::Decl::getAvailability(), and clang::Sema::getCurContextAvailability().
Referenced by clang::Sema::DiagnoseUseOfDecl().
static void DiagnoseBadShiftValues | ( | Sema & | S, |
ExprResult & | LHS, | ||
ExprResult & | RHS, | ||
SourceLocation | Loc, | ||
unsigned | Opc, | ||
QualType | LHSType | ||
) | [static] |
Definition at line 7429 of file SemaExpr.cpp.
References clang::BO_Shl, clang::Sema::Context, clang::Sema::Diag(), clang::Sema::DiagRuntimeBehavior(), clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::Sema::getLangOpts(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::ASTContext::getTypeSize(), clang::Type::hasUnsignedIntegerRepresentation(), clang::Expr::isIntegerConstantExpr(), clang::Expr::isValueDependent(), and clang::Sema::PDiag().
Referenced by clang::Sema::CheckShiftOperands().
static void DiagnoseBinOpPrecedence | ( | Sema & | Self, |
BinaryOperatorKind | Opc, | ||
SourceLocation | OpLoc, | ||
Expr * | LHSExpr, | ||
Expr * | RHSExpr | ||
) | [static] |
DiagnoseBinOpPrecedence - Emit warnings for expressions with tricky precedence.
Definition at line 9670 of file SemaExpr.cpp.
References clang::BO_LOr, clang::BO_Or, clang::BO_Shl, clang::BO_Shr, DiagnoseAdditionInShift(), DiagnoseBitwiseAndInBitwiseOr(), DiagnoseBitwisePrecedence(), DiagnoseLogicalAndInLogicalOrLHS(), DiagnoseLogicalAndInLogicalOrRHS(), DiagnoseShiftCompare(), clang::Sema::getASTContext(), clang::BinaryOperator::getOpcodeStr(), clang::Expr::getType(), clang::BinaryOperator::isBitwiseOp(), clang::BinaryOperator::isComparisonOp(), clang::Type::isIntegralType(), clang::SourceLocation::isMacroID(), and clang::prec::Shift.
Referenced by clang::Sema::ActOnBinOp().
static void DiagnoseBitwiseAndInBitwiseOr | ( | Sema & | S, |
SourceLocation | OpLoc, | ||
Expr * | OrArg | ||
) | [static] |
Look for '&' in the left or right hand of a '|' expr.
Definition at line 9619 of file SemaExpr.cpp.
References clang::BO_And, and EmitDiagnosticForBitwiseAndInBitwiseOr().
Referenced by DiagnoseBinOpPrecedence().
static void DiagnoseBitwisePrecedence | ( | Sema & | Self, |
BinaryOperatorKind | Opc, | ||
SourceLocation | OpLoc, | ||
Expr * | LHSExpr, | ||
Expr * | RHSExpr | ||
) | [static] |
DiagnoseBitwisePrecedence - Emit a warning when bitwise and comparison operators are mixed in a way that suggests that the programmer forgot that comparison operators have higher precedence. The most typical example of such code is "flags & 0x0020 != 0", which is equivalent to "flags & 1".
Definition at line 9497 of file SemaExpr.cpp.
References clang::Sema::Diag(), clang::Stmt::getLocEnd(), clang::Stmt::getLocStart(), clang::BinaryOperator::getOpcodeStr(), clang::BinaryOperator::getRHS(), clang::BinaryOperator::isBitwiseOp(), clang::BinaryOperator::isComparisonOp(), clang::Sema::PDiag(), and SuggestParentheses().
Referenced by DiagnoseBinOpPrecedence().
static void DiagnoseCalleeStaticArrayParam | ( | Sema & | S, |
ParmVarDecl * | PVD | ||
) | [static] |
Definition at line 4353 of file SemaExpr.cpp.
References clang::Sema::Diag(), clang::TypeLoc::getAs(), clang::Decl::getLocation(), clang::TypeSourceInfo::getTypeLoc(), and clang::DeclaratorDecl::getTypeSourceInfo().
Referenced by clang::Sema::CheckStaticArrayArgument().
static void DiagnoseConditionalPrecedence | ( | Sema & | Self, |
SourceLocation | OpLoc, | ||
Expr * | Condition, | ||
Expr * | LHSExpr, | ||
Expr * | RHSExpr | ||
) | [static] |
DiagnoseConditionalPrecedence - Emit a warning when a conditional operator and binary operator are mixed in a way that suggests the programmer assumed the conditional operator has higher precedence, for example: "int x = a + someBinaryCondition ? 1 : 2".
Definition at line 6030 of file SemaExpr.cpp.
References clang::Sema::Diag(), ExprLooksBoolean(), clang::Stmt::getLocEnd(), clang::Stmt::getLocStart(), clang::BinaryOperator::getOpcodeStr(), clang::Stmt::getSourceRange(), IsArithmeticBinaryExpr(), clang::Sema::PDiag(), and SuggestParentheses().
Referenced by clang::Sema::ActOnConditionalOp().
static void DiagnoseDirectIsaAccess | ( | Sema & | S, |
const ObjCIvarRefExpr * | OIRE, | ||
SourceLocation | AssignLoc, | ||
const Expr * | RHS | ||
) | [static] |
Definition at line 494 of file SemaExpr.cpp.
References clang::Sema::Context, clang::FixItHint::CreateInsertion(), clang::FixItHint::CreateReplacement(), clang::Sema::Diag(), clang::IdentifierTable::get(), clang::Type::getAs(), clang::DeclarationName::getAsIdentifierInfo(), clang::ObjCIvarRefExpr::getBase(), clang::ObjCIvarRefExpr::getDecl(), clang::NamedDecl::getDeclName(), clang::Expr::getExprLoc(), clang::Decl::getLocation(), clang::ObjCIvarRefExpr::getLocation(), clang::Stmt::getLocEnd(), clang::ObjCIvarRefExpr::getLocEnd(), clang::Preprocessor::getLocForEndOfToken(), clang::ObjCIvarRefExpr::getLocStart(), clang::ObjCIvarRefExpr::getOpLoc(), clang::Type::getPointeeType(), clang::ObjCInterfaceDecl::getSuperClass(), clang::Expr::getType(), clang::ASTContext::Idents, clang::ObjCIvarRefExpr::isArrow(), clang::IdentifierInfo::isStr(), clang::ObjCInterfaceDecl::ivar_begin(), clang::Sema::LookupOrdinaryName, clang::Sema::LookupSingleName(), clang::Sema::PP, and clang::Sema::TUScope.
Referenced by clang::Sema::CreateBuiltinBinOp(), and clang::Sema::DefaultLvalueConversion().
static void diagnoseDistinctPointerComparison | ( | Sema & | S, |
SourceLocation | Loc, | ||
ExprResult & | LHS, | ||
ExprResult & | RHS, | ||
bool | IsError | ||
) | [static] |
Diagnose bad pointer comparisons.
Definition at line 7583 of file SemaExpr.cpp.
References clang::Sema::Diag(), clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::Stmt::getSourceRange(), and clang::Expr::getType().
Referenced by clang::Sema::CheckCompareOperands(), and convertPointersToCompositeType().
static void diagnoseFunctionPointerToVoidComparison | ( | Sema & | S, |
SourceLocation | Loc, | ||
ExprResult & | LHS, | ||
ExprResult & | RHS, | ||
bool | IsError | ||
) | [static] |
Definition at line 7639 of file SemaExpr.cpp.
References clang::Sema::Diag(), clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::Stmt::getSourceRange(), and clang::Expr::getType().
Referenced by clang::Sema::CheckCompareOperands().
static void DiagnoseLogicalAndInLogicalOrLHS | ( | Sema & | S, |
SourceLocation | OpLoc, | ||
Expr * | LHSExpr, | ||
Expr * | RHSExpr | ||
) | [static] |
Look for '&&' in the left hand of a '||' expr.
Definition at line 9582 of file SemaExpr.cpp.
References clang::BO_LAnd, clang::BO_LOr, EmitDiagnosticForLogicalAndInLogicalOr(), EvaluatesAsFalse(), and EvaluatesAsTrue().
Referenced by DiagnoseBinOpPrecedence().
static void DiagnoseLogicalAndInLogicalOrRHS | ( | Sema & | S, |
SourceLocation | OpLoc, | ||
Expr * | LHSExpr, | ||
Expr * | RHSExpr | ||
) | [static] |
Look for '&&' in the right hand of a '||' expr.
Definition at line 9604 of file SemaExpr.cpp.
References clang::BO_LAnd, EmitDiagnosticForLogicalAndInLogicalOr(), EvaluatesAsFalse(), and EvaluatesAsTrue().
Referenced by DiagnoseBinOpPrecedence().
static void diagnoseLogicalNotOnLHSofComparison | ( | Sema & | S, |
ExprResult & | LHS, | ||
ExprResult & | RHS, | ||
SourceLocation | Loc, | ||
unsigned | OpaqueOpc | ||
) | [static] |
Definition at line 7803 of file SemaExpr.cpp.
References clang::FixItHint::CreateInsertion(), clang::Sema::Diag(), clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::Sema::getLangOpts(), clang::Stmt::getLocEnd(), clang::Preprocessor::getLocForEndOfToken(), clang::Stmt::getLocStart(), clang::UnaryOperator::getOpcode(), clang::UnaryOperator::getOperatorLoc(), clang::Sema::getPreprocessor(), clang::UnaryOperator::getSubExpr(), clang::Expr::getType(), clang::Expr::IgnoreImpCasts(), clang::Type::isBooleanType(), clang::SourceLocation::isInvalid(), and clang::UO_LNot.
Referenced by clang::Sema::CheckCompareOperands().
static void diagnoseObjCLiteralComparison | ( | Sema & | S, |
SourceLocation | Loc, | ||
ExprResult & | LHS, | ||
ExprResult & | RHS, | ||
BinaryOperator::Opcode | Opc | ||
) | [static] |
Definition at line 7754 of file SemaExpr.cpp.
References clang::BO_EQ, clang::Sema::CheckLiteralKind(), clang::FixItHint::CreateInsertion(), clang::FixItHint::CreateReplacement(), clang::Sema::Diag(), clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::Sema::getASTContext(), clang::CharSourceRange::getCharRange(), clang::Stmt::getLocEnd(), clang::Preprocessor::getLocForEndOfToken(), clang::Stmt::getLocStart(), clang::Stmt::getSourceRange(), hasIsEqualMethod(), clang::Expr::IgnoreParenCasts(), clang::BinaryOperator::isEqualityOp(), clang::Expr::isNullPointerConstant(), isObjCObjectLiteral(), clang::Sema::LK_Block, clang::Sema::LK_None, clang::Sema::LK_String, clang::Expr::NPC_ValueDependentIsNotNull, and clang::Sema::PP.
Referenced by clang::Sema::CheckCompareOperands().
static void diagnosePointerIncompatibility | ( | Sema & | S, |
SourceLocation | Loc, | ||
Expr * | LHSExpr, | ||
Expr * | RHSExpr | ||
) | [static] |
Emit error when two pointers are incompatible.
Definition at line 7249 of file SemaExpr.cpp.
References clang::Sema::Diag(), clang::Stmt::getSourceRange(), clang::Expr::getType(), and clang::Type::isAnyPointerType().
Referenced by clang::Sema::CheckSubtractionOperands().
static void DiagnoseSelfAssignment | ( | Sema & | S, |
Expr * | LHSExpr, | ||
Expr * | RHSExpr, | ||
SourceLocation | OpLoc | ||
) | [static] |
DiagnoseSelfAssignment - Emits a warning if a value is assigned to itself. This warning is only emitted for builtin assignment operations. It is also suppressed in the event of macro expansions.
Definition at line 9247 of file SemaExpr.cpp.
References clang::Sema::ActiveTemplateInstantiations, clang::Sema::Diag(), clang::Type::getAs(), clang::Decl::getCanonicalDecl(), clang::DeclRefExpr::getDecl(), clang::DeclRefExpr::getLocation(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::ValueDecl::getType(), clang::Expr::IgnoreParenImpCasts(), clang::SourceLocation::isInvalid(), clang::SourceLocation::isMacroID(), and clang::QualType::isVolatileQualified().
Referenced by clang::Sema::CreateBuiltinBinOp().
static void DiagnoseShiftCompare | ( | Sema & | S, |
SourceLocation | OpLoc, | ||
Expr * | LHSExpr, | ||
Expr * | RHSExpr | ||
) | [static] |
Definition at line 9641 of file SemaExpr.cpp.
References clang::Sema::Diag(), clang::CallExpr::getArg(), clang::CallExpr::getDirectCallee(), clang::Stmt::getLocEnd(), clang::Stmt::getLocStart(), clang::CXXOperatorCallExpr::getOperatorLoc(), clang::FunctionDecl::getOverloadedOperator(), clang::CXXOperatorCallExpr::getSourceRange(), clang::Stmt::getSourceRange(), clang::FunctionDecl::isOverloadedOperator(), clang::Sema::PDiag(), and SuggestParentheses().
Referenced by DiagnoseBinOpPrecedence().
static void diagnoseStringPlusChar | ( | Sema & | Self, |
SourceLocation | OpLoc, | ||
Expr * | LHSExpr, | ||
Expr * | RHSExpr | ||
) | [static] |
Emit a warning when adding a char literal to a string.
Definition at line 7198 of file SemaExpr.cpp.
References clang::ASTContext::CharTy, clang::FixItHint::CreateInsertion(), clang::FixItHint::CreateReplacement(), clang::Sema::Diag(), clang::Sema::getASTContext(), clang::ASTContext::getCharWidth(), clang::Stmt::getLocEnd(), clang::Preprocessor::getLocForEndOfToken(), clang::Stmt::getLocStart(), clang::Type::getPointeeType(), clang::Expr::getType(), clang::Expr::IgnoreImpCasts(), clang::Type::isAnyCharacterType(), clang::Type::isAnyPointerType(), and clang::Sema::PP.
Referenced by clang::Sema::CheckAdditionOperands().
static void diagnoseStringPlusInt | ( | Sema & | Self, |
SourceLocation | OpLoc, | ||
Expr * | LHSExpr, | ||
Expr * | RHSExpr | ||
) | [static] |
diagnoseStringPlusInt - Emit a warning when adding an integer to a string literal.
Definition at line 7159 of file SemaExpr.cpp.
References clang::FixItHint::CreateInsertion(), clang::FixItHint::CreateReplacement(), clang::Sema::Diag(), clang::Sema::getASTContext(), clang::StringLiteral::getLength(), clang::Stmt::getLocEnd(), clang::Preprocessor::getLocForEndOfToken(), clang::Stmt::getLocStart(), clang::Expr::getType(), clang::Expr::IgnoreImpCasts(), clang::Type::isIntegralOrUnscopedEnumerationType(), and clang::Sema::PP.
Referenced by clang::Sema::CheckAdditionOperands().
static void diagnoseUncapturableValueReference | ( | Sema & | S, |
SourceLocation | loc, | ||
VarDecl * | var, | ||
DeclContext * | DC | ||
) | [static] |
Definition at line 11584 of file SemaExpr.cpp.
References clang::Sema::CurContext, clang::Sema::Diag(), clang::Decl::getDeclContext(), clang::NamedDecl::getIdentifier(), clang::Sema::getLangOpts(), clang::Decl::getLocation(), clang::DeclContext::getParent(), and clang::DeclContext::isFunctionOrMethod().
Referenced by getParentOfCapturingContextOrNull(), and clang::Sema::tryCaptureVariable().
static ExprResult diagnoseUnknownAnyExpr | ( | Sema & | S, |
Expr * | E | ||
) | [static] |
Definition at line 13475 of file SemaExpr.cpp.
References clang::Sema::Diag(), clang::ExprError(), clang::Expr::getExprLoc(), clang::Stmt::getSourceRange(), and clang::Expr::IgnoreParenImpCasts().
Referenced by clang::Sema::CheckPlaceholderExpr().
static void DiagnoseUnusedOfDecl | ( | Sema & | S, |
NamedDecl * | D, | ||
SourceLocation | Loc | ||
) | [static] |
Definition at line 76 of file SemaExpr.cpp.
References clang::Sema::Diag(), clang::Sema::getCurObjCLexicalContext(), clang::NamedDecl::getDeclName(), and clang::Decl::hasAttr().
Referenced by clang::Sema::DiagnoseUseOfDecl().
static void diagnoseUseOfInternalDeclInInlineFunction | ( | Sema & | S, |
const NamedDecl * | D, | ||
SourceLocation | Loc | ||
) | [static] |
Check whether we're in an extern inline function and referring to a variable or function with internal linkage (C11 6.7.4p3).
This is only a warning because we used to silently accept this code, but in many cases it will not behave correctly. This is not enabled in C++ mode because the restriction language is a bit weaker (C++11 [basic.def.odr]p6) and so while there may still be user mistakes, most of the time we can't prove that there are errors.
Definition at line 196 of file SemaExpr.cpp.
References Current, clang::Sema::Diag(), clang::Sema::getCurFunctionDecl(), clang::NamedDecl::getFormalLinkage(), clang::Sema::getLangOpts(), clang::Sema::getSourceManager(), clang::Decl::hasAttr(), clang::InternalLinkage, clang::NamedDecl::isExternallyVisible(), clang::FunctionDecl::isInlined(), clang::SourceManager::isInMainFile(), and clang::Sema::MaybeSuggestAddingStaticToDecl().
Referenced by clang::Sema::DiagnoseUseOfDecl().
static void DoMarkVarDeclReferenced | ( | Sema & | SemaRef, |
SourceLocation | Loc, | ||
VarDecl * | Var, | ||
Expr * | E | ||
) | [static] |
Definition at line 12467 of file SemaExpr.cpp.
References clang::TemplateSpecializationType::anyDependentTemplateArguments(), clang::Sema::Context, clang::Sema::CurContext, clang::Sema::getASTMutationListener(), clang::Sema::getCurLambda(), clang::Decl::getDeclContext(), clang::VarDecl::getPointOfInstantiation(), clang::VarTemplateSpecializationDecl::getTemplateArgsInfo(), clang::VarDecl::getTemplateSpecializationKind(), clang::ValueDecl::getType(), clang::VarDecl::hasLocalStorage(), clang::Expr::IgnoreParens(), clang::Sema::InstantiateVariableDefinition(), clang::DeclContext::isFunctionOrMethod(), clang::SourceLocation::isInvalid(), IsPotentiallyEvaluatedContext(), clang::Type::isReferenceType(), clang::isTemplateInstantiation(), clang::Sema::isUnevaluatedContext(), clang::VarDecl::isUsableInConstantExpressions(), clang::IsVariableAConstantExpression(), IsVariableNonDependentAndAConstantExpression(), clang::MarkVarDeclODRUsed(), clang::Sema::MaybeODRUseExprs, clang::Sema::PendingInstantiations, clang::Decl::setReferenced(), clang::VarDecl::setTemplateSpecializationKind(), and clang::TSK_ImplicitInstantiation.
Referenced by MarkExprReferenced(), and clang::Sema::MarkVariableReferenced().
static void EmitDiagnosticForBitwiseAndInBitwiseOr | ( | Sema & | Self, |
SourceLocation | OpLoc, | ||
BinaryOperator * | Bop | ||
) | [static] |
It accepts a '&' expr that is inside a '|' one. Emit a diagnostic together with a fixit hint that wraps the '&' expression in parentheses.
Definition at line 9539 of file SemaExpr.cpp.
References clang::BO_And, clang::Sema::Diag(), clang::BinaryOperator::getOpcode(), clang::BinaryOperator::getOpcodeStr(), clang::BinaryOperator::getOperatorLoc(), clang::Stmt::getSourceRange(), clang::Sema::PDiag(), and SuggestParentheses().
Referenced by DiagnoseBitwiseAndInBitwiseOr().
static void EmitDiagnosticForLogicalAndInLogicalOr | ( | Sema & | Self, |
SourceLocation | OpLoc, | ||
BinaryOperator * | Bop | ||
) | [static] |
It accepts a '&&' expr that is inside a '||' one. Emit a diagnostic together with a fixit hint that wraps the '&&' expression in parentheses.
Definition at line 9554 of file SemaExpr.cpp.
References clang::BO_LAnd, clang::Sema::Diag(), clang::BinaryOperator::getOpcode(), clang::BinaryOperator::getOpcodeStr(), clang::BinaryOperator::getOperatorLoc(), clang::Stmt::getSourceRange(), clang::Sema::PDiag(), and SuggestParentheses().
Referenced by DiagnoseLogicalAndInLogicalOrLHS(), and DiagnoseLogicalAndInLogicalOrRHS().
static bool EvaluatesAsFalse | ( | Sema & | S, |
Expr * | E | ||
) | [static] |
Returns true if the given expression can be evaluated as a constant 'false'.
Definition at line 9575 of file SemaExpr.cpp.
References clang::Expr::EvaluateAsBooleanCondition(), clang::Sema::getASTContext(), and clang::Expr::isValueDependent().
Referenced by DiagnoseLogicalAndInLogicalOrLHS(), and DiagnoseLogicalAndInLogicalOrRHS().
static bool EvaluatesAsTrue | ( | Sema & | S, |
Expr * | E | ||
) | [static] |
Returns true if the given expression can be evaluated as a constant 'true'.
Definition at line 9567 of file SemaExpr.cpp.
References clang::Expr::EvaluateAsBooleanCondition(), clang::Sema::getASTContext(), and clang::Expr::isValueDependent().
Referenced by DiagnoseLogicalAndInLogicalOrLHS(), and DiagnoseLogicalAndInLogicalOrRHS().
static bool ExprLooksBoolean | ( | Expr * | E | ) | [static] |
ExprLooksBoolean - Returns true if E looks boolean, i.e. it has boolean type or is a logical expression such as (x==y) which has int type, but is commonly interpreted as boolean.
Definition at line 6013 of file SemaExpr.cpp.
References clang::Expr::getType(), clang::Expr::IgnoreParenImpCasts(), clang::Type::isBooleanType(), IsLogicOp(), and clang::UO_LNot.
Referenced by DiagnoseConditionalPrecedence().
static ValueDecl* getCompareDecl | ( | Expr * | E | ) | [static] |
Definition at line 7848 of file SemaExpr.cpp.
Referenced by clang::Sema::CheckCompareOperands().
static DeclContext* getParentOfCapturingContextOrNull | ( | DeclContext * | DC, |
VarDecl * | Var, | ||
SourceLocation | Loc, | ||
const bool | Diagnose, | ||
Sema & | S | ||
) | [static] |
Definition at line 11656 of file SemaExpr.cpp.
References diagnoseUncapturableValueReference(), clang::getLambdaAwareParentOfDeclContext(), and clang::isLambdaCallOperator().
Referenced by clang::Sema::tryCaptureVariable().
static ValueDecl* getPrimaryDecl | ( | Expr * | E | ) | [static] |
getPrimaryDecl - Helper function for CheckAddressOfOperand(). This routine allows us to typecheck complex/recursive expressions where the declaration is needed for type checking. We only need to handle cases when the expression references a function designator or is an lvalue. Here are some examples:
Definition at line 8860 of file SemaExpr.cpp.
References clang::UnaryOperator::getOpcode(), clang::Stmt::getStmtClass(), clang::UnaryOperator::getSubExpr(), clang::UO_Extension, clang::UO_Imag, and clang::UO_Real.
Referenced by clang::Sema::CheckAddressOfOperand().
static SourceLocation getUDSuffixLoc | ( | Sema & | S, |
SourceLocation | TokLoc, | ||
unsigned | Offset | ||
) | [static] |
getUDSuffixLoc - Create a SourceLocation for a ud-suffix, given the location of the token and the offset of the ud-suffix within it.
Definition at line 1413 of file SemaExpr.cpp.
References clang::Lexer::AdvanceToTokenCharacter(), clang::Sema::getLangOpts(), and clang::Sema::getSourceManager().
Referenced by clang::Sema::ActOnCharacterConstant(), clang::Sema::ActOnNumericConstant(), and clang::Sema::ActOnStringLiteral().
static QualType handleComplexFloatConversion | ( | Sema & | S, |
ExprResult & | LHS, | ||
ExprResult & | RHS, | ||
QualType | LHSType, | ||
QualType | RHSType, | ||
bool | IsCompAssign | ||
) | [static] |
Handle arithmetic conversion with complex types. Helper function of UsualArithmeticConversions()
Definition at line 945 of file SemaExpr.cpp.
References clang::CK_FloatingCast, clang::CK_FloatingComplexCast, clang::Sema::Context, clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::ASTContext::getComplexType(), clang::ASTContext::getFloatingTypeOrder(), handleIntegerToComplexFloatConversion(), and clang::Sema::ImpCastExprToType().
Referenced by clang::Sema::UsualArithmeticConversions().
static QualType handleComplexIntConversion | ( | Sema & | S, |
ExprResult & | LHS, | ||
ExprResult & | RHS, | ||
QualType | LHSType, | ||
QualType | RHSType, | ||
bool | IsCompAssign | ||
) | [static] |
Handle conversions with GCC complex int extension. Helper function of UsualArithmeticConversions()
Definition at line 1131 of file SemaExpr.cpp.
References clang::CK_IntegralRealToComplex, clang::Type::getAsComplexIntegerType(), clang::ComplexType::getElementType(), and S.
Referenced by clang::Sema::UsualArithmeticConversions().
static QualType handleFloatConversion | ( | Sema & | S, |
ExprResult & | LHS, | ||
ExprResult & | RHS, | ||
QualType | LHSType, | ||
QualType | RHSType, | ||
bool | IsCompAssign | ||
) | [static] |
Handle arithmethic conversion with floating point types. Helper function of UsualArithmeticConversions()
Definition at line 1032 of file SemaExpr.cpp.
References clang::CK_FloatingCast, clang::Sema::Context, clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::ASTContext::getFloatingTypeOrder(), handleIntToFloatConversion(), clang::Sema::ImpCastExprToType(), and clang::Type::isRealFloatingType().
Referenced by clang::Sema::UsualArithmeticConversions().
static QualType handleIntegerConversion | ( | Sema & | S, |
ExprResult & | LHS, | ||
ExprResult & | RHS, | ||
QualType | LHSType, | ||
QualType | RHSType, | ||
bool | IsCompAssign | ||
) | [static] |
Handle integer arithmetic conversions. Helper function of UsualArithmeticConversions()
Definition at line 1081 of file SemaExpr.cpp.
References clang::Sema::Context, clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::ASTContext::getCorrespondingUnsignedType(), clang::ASTContext::getIntegerTypeOrder(), clang::ASTContext::getIntWidth(), clang::Type::hasSignedIntegerRepresentation(), and S.
static bool handleIntegerToComplexFloatConversion | ( | Sema & | S, |
ExprResult & | IntExpr, | ||
ExprResult & | ComplexExpr, | ||
QualType | IntTy, | ||
QualType | ComplexTy, | ||
bool | SkipCast | ||
) | [static] |
Converts an integer to complex float type. Helper function of UsualArithmeticConversions()
Definition at line 923 of file SemaExpr.cpp.
References clang::CK_FloatingRealToComplex, clang::CK_IntegralComplexToFloatingComplex, clang::CK_IntegralToFloating, clang::ActionResult< PtrTy, CompressInvalid >::get(), getElementType(), clang::Sema::ImpCastExprToType(), clang::Type::isComplexIntegerType(), clang::Type::isComplexType(), clang::Type::isIntegerType(), and clang::Type::isRealFloatingType().
Referenced by handleComplexFloatConversion().
static QualType handleIntToFloatConversion | ( | Sema & | S, |
ExprResult & | FloatExpr, | ||
ExprResult & | IntExpr, | ||
QualType | FloatTy, | ||
QualType | IntTy, | ||
bool | ConvertFloat, | ||
bool | ConvertInt | ||
) | [static] |
Hande arithmetic conversion from integer to float. Helper function of UsualArithmeticConversions()
Definition at line 1001 of file SemaExpr.cpp.
References clang::CK_FloatingRealToComplex, clang::CK_IntegralComplexToFloatingComplex, clang::CK_IntegralToFloating, clang::Sema::Context, clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::ASTContext::getComplexType(), clang::Sema::ImpCastExprToType(), clang::Type::isComplexIntegerType(), and clang::Type::isIntegerType().
Referenced by handleFloatConversion().
static bool hasAnyExplicitStorageClass | ( | const FunctionDecl * | D | ) | [static] |
Determine whether a FunctionDecl was ever declared with an explicit storage class.
Definition at line 180 of file SemaExpr.cpp.
References clang::Redeclarable< decl_type >::redecls(), and clang::SC_None.
Referenced by clang::Sema::MaybeSuggestAddingStaticToDecl().
static bool hasIsEqualMethod | ( | Sema & | S, |
const Expr * | LHS, | ||
const Expr * | RHS | ||
) | [static] |
Definition at line 7662 of file SemaExpr.cpp.
References clang::Type::getAs(), clang::Type::getAsObjCQualifiedInterfaceType(), clang::ObjCObjectPointerType::getPointeeType(), clang::ObjCMethodDecl::getReturnType(), clang::Expr::getType(), clang::ObjCObjectPointerType::isObjCIdType(), clang::Type::isObjCObjectPointerType(), clang::Type::isScalarType(), clang::Sema::LookupInstanceMethodInGlobalPool(), clang::Sema::LookupMethodInObjectType(), clang::Sema::LookupMethodInQualifiedType(), clang::Sema::NSAPIObj, and clang::ObjCMethodDecl::parameters().
Referenced by diagnoseObjCLiteralComparison().
static bool IsArithmeticBinaryExpr | ( | Expr * | E, |
BinaryOperatorKind * | Opcode, | ||
Expr ** | RHSExprs | ||
) | [static] |
IsArithmeticBinaryExpr - Returns true if E is an arithmetic binary expression, either using a built-in or overloaded operator, and sets *OpCode to the opcode and *RHSExprs to the right-hand side expression.
Definition at line 5967 of file SemaExpr.cpp.
References clang::BinaryOperator::getOverloadedOpcode(), clang::Expr::IgnoreConversionOperator(), clang::Expr::IgnoreImpCasts(), and IsArithmeticOp().
Referenced by DiagnoseConditionalPrecedence().
static bool IsArithmeticOp | ( | BinaryOperatorKind | Opc | ) | [static] |
Definition at line 5959 of file SemaExpr.cpp.
References clang::BO_Mul, and clang::BO_Shr.
Referenced by IsArithmeticBinaryExpr().
static bool IsLogicOp | ( | BinaryOperatorKind | Opc | ) | [static] |
Definition at line 6006 of file SemaExpr.cpp.
References clang::BO_LAnd, clang::BO_LOr, clang::BO_LT, and clang::BO_NE.
Referenced by ExprLooksBoolean().
static bool isObjCObjectLiteral | ( | ExprResult & | E | ) | [static] |
Definition at line 7649 of file SemaExpr.cpp.
References clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::Stmt::getStmtClass(), and clang::Expr::IgnoreParenImpCasts().
Referenced by clang::Sema::CheckCompareOperands(), and diagnoseObjCLiteralComparison().
static bool isObjCPtrBlockCompatible | ( | Sema & | S, |
ASTContext & | C, | ||
QualType | QT | ||
) | [static] |
Returns true if QT is quelified-id and implements 'NSObject' and/or 'NSCopying' protocols (and nothing else); or QT is an NSObject and optionally implements 'NSObject' and/or NSCopying' protocols (and nothing else).
Definition at line 5568 of file SemaExpr.cpp.
References clang::declaresSameEntity(), clang::IdentifierTable::get(), clang::Type::getAs(), clang::ObjCObjectPointerType::getInterfaceDecl(), clang::ASTContext::Idents, clang::Type::isObjCIdType(), clang::Sema::LookupProtocol(), and clang::ObjCObjectPointerType::quals().
Referenced by clang::Sema::CheckAssignmentConstraints().
static bool isPlaceholderToRemoveAsArg | ( | QualType | type | ) | [static] |
Is the given type a placeholder that we need to lower out immediately during argument processing?
Definition at line 4415 of file SemaExpr.cpp.
References clang::BuiltinType::getKind(), and clang::ast_matchers::type.
Referenced by checkArgsForPlaceholders().
static bool IsPotentiallyEvaluatedContext | ( | Sema & | SemaRef | ) | [static] |
Definition at line 11375 of file SemaExpr.cpp.
References clang::Sema::ConstantEvaluated, clang::Sema::CurContext, clang::Sema::ExprEvalContexts, clang::DeclContext::isDependentContext(), clang::Sema::PotentiallyEvaluated, clang::Sema::PotentiallyEvaluatedIfUsed, clang::Sema::Unevaluated, and clang::Sema::UnevaluatedAbstract.
Referenced by DoMarkVarDeclReferenced(), and clang::Sema::MarkFunctionReferenced().
static bool isQualifiedMemberAccess | ( | Expr * | E | ) | [static] |
Determine whether the given expression is a qualified member access expression, of a form that could be turned into a pointer to member with the address-of operator.
Definition at line 9980 of file SemaExpr.cpp.
References clang::NamedDecl::isCXXClassMember().
Referenced by clang::Sema::BuildUnaryOp().
static bool IsReadonlyMessage | ( | Expr * | E, |
Sema & | S | ||
) | [static] |
Definition at line 8448 of file SemaExpr.cpp.
References clang::MemberExpr::getBase(), clang::MemberExpr::getMemberDecl(), clang::ObjCMessageExpr::getMethodDecl(), and clang::Expr::IgnoreParenImpCasts().
Referenced by CheckForModifiableLvalue().
static NonConstCaptureKind isReferenceToNonConstCapture | ( | Sema & | S, |
Expr * | E | ||
) | [static] |
Definition at line 8462 of file SemaExpr.cpp.
References clang::Sema::CurContext, clang::DeclRefExpr::getDecl(), clang::Decl::getDeclContext(), clang::DeclContext::getParent(), clang::Expr::getType(), clang::ValueDecl::getType(), clang::VarDecl::hasLocalStorage(), clang::Expr::IgnoreParens(), clang::QualType::isConstQualified(), clang::VarDecl::isInitCapture(), clang::Expr::isLValue(), NCCK_Block, NCCK_Lambda, NCCK_None, and clang::DeclRefExpr::refersToEnclosingLocal().
Referenced by CheckForModifiableLvalue().
static bool isScopedEnumerationType | ( | QualType | T | ) | [static] |
Definition at line 7423 of file SemaExpr.cpp.
Referenced by clang::Sema::CheckShiftOperands(), and clang::Sema::CreateBuiltinUnaryOp().
static bool isVariableAlreadyCapturedInScopeInfo | ( | CapturingScopeInfo * | CSI, |
VarDecl * | Var, | ||
bool & | SubCapturesAreNested, | ||
QualType & | CaptureType, | ||
QualType & | DeclRefType | ||
) | [static] |
Definition at line 11630 of file SemaExpr.cpp.
References clang::QualType::addConst(), clang::sema::CapturingScopeInfo::CaptureMap, clang::sema::CapturingScopeInfo::getCapture(), clang::sema::CapturingScopeInfo::Capture::getCaptureType(), clang::QualType::getNonReferenceType(), and clang::sema::CapturingScopeInfo::Capture::isCopyCapture().
Referenced by clang::Sema::tryCaptureVariable().
static bool isVariableCapturable | ( | CapturingScopeInfo * | CSI, |
VarDecl * | Var, | ||
SourceLocation | Loc, | ||
const bool | Diagnose, | ||
Sema & | S | ||
) | [static] |
Definition at line 11671 of file SemaExpr.cpp.
References clang::Sema::Diag(), clang::Type::getAs(), clang::NamedDecl::getDeclName(), clang::Decl::getLocation(), clang::ValueDecl::getType(), clang::Decl::hasAttr(), and clang::Type::isVariablyModifiedType().
Referenced by clang::Sema::tryCaptureVariable().
static bool IsVariableNonDependentAndAConstantExpression | ( | VarDecl * | Var, |
ASTContext & | Context | ||
) | [inline, static] |
Definition at line 12389 of file SemaExpr.cpp.
References clang::VarDecl::ensureEvaluatedStmt(), clang::VarDecl::getAnyInitializer(), clang::ValueDecl::getType(), clang::Type::isDependentType(), clang::Expr::isValueDependent(), clang::IsVariableAConstantExpression(), and clang::EvaluatedStmt::Value.
Referenced by DoMarkVarDeclReferenced(), and clang::Sema::UpdateMarkingForLValueToRValue().
static bool IsWithinTemplateSpecialization | ( | Decl * | D | ) | [static] |
Definition at line 7545 of file SemaExpr.cpp.
References clang::Decl::getDeclContext().
Referenced by clang::Sema::CheckCompareOperands().
static void MarkExprReferenced | ( | Sema & | SemaRef, |
SourceLocation | Loc, | ||
Decl * | D, | ||
Expr * | E, | ||
bool | OdrUse | ||
) | [static] |
Definition at line 12590 of file SemaExpr.cpp.
References DoMarkVarDeclReferenced(), clang::MemberExpr::getBase(), clang::Expr::getBestDynamicClassType(), clang::CXXMethodDecl::getCorrespondingMethodInClass(), clang::MemberExpr::getMemberDecl(), clang::MemberExpr::hasQualifier(), clang::FunctionDecl::isPure(), clang::CXXMethodDecl::isVirtual(), and clang::Sema::MarkAnyDeclReferenced().
Referenced by clang::Sema::MarkDeclRefReferenced(), and clang::Sema::MarkMemberReferenced().
static void maybeExtendBlockObject | ( | Sema & | S, |
ExprResult & | E | ||
) | [static] |
Do an explicit extend of the given block pointer if we're in ARC.
Definition at line 4907 of file SemaExpr.cpp.
References clang::CK_ARCExtendBlockObject, clang::Sema::Context, clang::ImplicitCastExpr::Create(), clang::Sema::ExprNeedsCleanups, clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::Sema::getLangOpts(), clang::Expr::getType(), clang::Type::isBlockPointerType(), clang::Expr::isRValue(), and clang::VK_RValue.
Referenced by clang::Sema::CheckAssignmentConstraints(), clang::Sema::PrepareCastToObjCObjectPointer(), and clang::Sema::PrepareScalarCast().
static Expr* maybeRebuildARCConsumingStmt | ( | Stmt * | Statement | ) | [static] |
Given the last statement in a statement-expression, check whether the result is a producing expression (like a call to an ns_returns_retained function) and, if so, rebuild it to hoist the release out of the full-expression. Otherwise, return null. Cannot fail.
Definition at line 10086 of file SemaExpr.cpp.
References clang::CK_ARCConsumeObject, clang::CastExpr::getCastKind(), clang::CastExpr::getSubExpr(), clang::ExprWithCleanups::getSubExpr(), clang::Expr::getType(), clang::Expr::getValueKind(), and clang::ExprWithCleanups::setSubExpr().
Referenced by clang::Sema::ActOnStmtExpr().
static ExprResult rebuildUnknownAnyFunction | ( | Sema & | S, |
Expr * | FunctionExpr | ||
) | [static] |
Given a function expression of unknown-any type, try to rebuild it to have a function type.
Definition at line 13085 of file SemaExpr.cpp.
References clang::Sema::DefaultFunctionArrayConversion(), clang::ExprError(), clang::ActionResult< PtrTy, CompressInvalid >::get(), and clang::ActionResult< PtrTy, CompressInvalid >::isInvalid().
Referenced by clang::Sema::ActOnCallExpr(), and clang::Sema::BuildResolvedCallExpr().
static Expr* recoverFromMSUnqualifiedLookup | ( | Sema & | S, |
ASTContext & | Context, | ||
DeclarationNameInfo & | NameInfo, | ||
SourceLocation | TemplateKWLoc, | ||
const TemplateArgumentListInfo * | TemplateArgs | ||
) | [static] |
In Microsoft mode, if we are inside a template class whose parent class has dependent base classes, and we can't resolve an unqualified identifier, then assume the identifier is a member of a dependent base class. We can only recover successfully in static methods, instance methods, and other contexts where 'this' is available. This doesn't precisely match MSVC's instantiation model, but it's close enough.
Definition at line 1908 of file SemaExpr.cpp.
References clang::NestedNameSpecifier::Create(), clang::DependentScopeDeclRefExpr::Create(), clang::CXXDependentScopeMemberExpr::Create(), clang::FixItHint::CreateInsertion(), clang::Sema::CurContext, clang::Sema::Diag(), clang::Type::getAsCXXRecordDecl(), clang::Sema::getCurrentThisType(), clang::DeclarationNameInfo::getLoc(), clang::DeclarationNameInfo::getName(), clang::DeclContext::getParent(), clang::Type::getPointeeType(), clang::TypeDecl::getTypeForDecl(), clang::CXXScopeSpec::getWithLocInContext(), clang::CXXRecordDecl::hasAnyDependentBases(), clang::QualType::isNull(), and clang::CXXScopeSpec::MakeTrivial().
Referenced by clang::Sema::ActOnIdExpression().
static void SuggestParentheses | ( | Sema & | Self, |
SourceLocation | Loc, | ||
const PartialDiagnostic & | Note, | ||
SourceRange | ParenRange | ||
) | [static] |
SuggestParentheses - Emit a note with a fixit hint that wraps ParenRange in parentheses.
Definition at line 5944 of file SemaExpr.cpp.
References clang::FixItHint::CreateInsertion(), clang::Sema::Diag(), clang::SourceRange::getBegin(), clang::SourceRange::getEnd(), clang::Preprocessor::getLocForEndOfToken(), clang::SourceLocation::isFileID(), clang::SourceLocation::isValid(), and clang::Sema::PP.
Referenced by DiagnoseAdditionInShift(), DiagnoseBitwisePrecedence(), DiagnoseConditionalPrecedence(), DiagnoseShiftCompare(), EmitDiagnosticForBitwiseAndInBitwiseOr(), and EmitDiagnosticForLogicalAndInLogicalOr().
static TypoCorrection TryTypoCorrectionForCall | ( | Sema & | S, |
Expr * | Fn, | ||
FunctionDecl * | FDecl, | ||
ArrayRef< Expr * > | Args | ||
) | [static] |
Definition at line 4087 of file SemaExpr.cpp.
References clang::AS_none, clang::OverloadCandidateSet::BestViableFunction(), clang::Sema::CorrectTypo(), clang::OverloadCandidateSet::CSK_Normal, clang::Sema::CTK_ErrorRecovery, clang::Sema::CurContext, clang::NamedDecl::getDeclName(), clang::Stmt::getLocStart(), clang::MemberExpr::getMemberLoc(), clang::Sema::getScopeForContext(), clang::Sema::LookupOrdinaryName, clang::DeclAccessPair::make(), clang::OR_Success, and S.
Referenced by clang::Sema::ConvertArgumentsForCall().
static bool tryVectorConvertAndSplat | ( | Sema & | S, |
ExprResult * | scalar, | ||
QualType | scalarTy, | ||
QualType | vectorEltTy, | ||
QualType | vectorTy | ||
) | [static] |
Try to convert a value of non-vector type to a vector type by converting the type to the element type of the vector and then performing a splat. If the language is OpenCL, we only use conversions that promote scalar rank; for C, Obj-C, and C++ we allow any real scalar conversion except for float->int.
scalar | - if non-null, actually perform the conversions |
Definition at line 6806 of file SemaExpr.cpp.
References clang::CK_FloatingCast, clang::CK_IntegralCast, clang::CK_IntegralToFloating, clang::CK_Invalid, clang::CK_VectorSplat, clang::Sema::Context, clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::ASTContext::getFloatingTypeOrder(), clang::ASTContext::getIntegerTypeOrder(), clang::Sema::getLangOpts(), clang::Sema::ImpCastExprToType(), clang::Type::isIntegralType(), and clang::Type::isRealFloatingType().
Referenced by clang::Sema::CheckVectorOperands().
static bool VectorTypesMatch | ( | Sema & | S, |
QualType | srcTy, | ||
QualType | destTy | ||
) | [static] |
Definition at line 5122 of file SemaExpr.cpp.
References breakDownVectorType(), clang::Sema::Context, and clang::ASTContext::getTypeSize().
Referenced by clang::Sema::CheckExtVectorCast(), clang::Sema::CheckVectorCast(), and clang::Sema::isLaxVectorConversion().
static void warnOnSizeofOnArrayDecay | ( | Sema & | S, |
SourceLocation | Loc, | ||
QualType | T, | ||
Expr * | E | ||
) | [static] |
Check whether E is a pointer from a decayed array type (the decayed pointer type is equal to T) and emit a warning if it is.
Definition at line 3389 of file SemaExpr.cpp.
References clang::CK_ArrayToPointerDecay, clang::Sema::Diag(), clang::CastExpr::getCastKind(), clang::Stmt::getSourceRange(), clang::CastExpr::getSubExpr(), and clang::Expr::getType().
Referenced by clang::Sema::CheckUnaryExprOrTypeTraitOperand().