clang 19.0.0git
|
#include "clang/AST/APValue.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/Attr.h"
#include "clang/AST/AttrIterator.h"
#include "clang/AST/CharUnits.h"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclBase.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/DeclarationName.h"
#include "clang/AST/EvaluatedExprVisitor.h"
#include "clang/AST/Expr.h"
#include "clang/AST/ExprCXX.h"
#include "clang/AST/ExprObjC.h"
#include "clang/AST/ExprOpenMP.h"
#include "clang/AST/FormatString.h"
#include "clang/AST/IgnoreExpr.h"
#include "clang/AST/NSAPI.h"
#include "clang/AST/NonTrivialTypeVisitor.h"
#include "clang/AST/OperationKinds.h"
#include "clang/AST/RecordLayout.h"
#include "clang/AST/Stmt.h"
#include "clang/AST/TemplateBase.h"
#include "clang/AST/Type.h"
#include "clang/AST/TypeLoc.h"
#include "clang/AST/UnresolvedSet.h"
#include "clang/Basic/AddressSpaces.h"
#include "clang/Basic/CharInfo.h"
#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/IdentifierTable.h"
#include "clang/Basic/LLVM.h"
#include "clang/Basic/LangOptions.h"
#include "clang/Basic/OpenCLOptions.h"
#include "clang/Basic/OperatorKinds.h"
#include "clang/Basic/PartialDiagnostic.h"
#include "clang/Basic/SourceLocation.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Basic/Specifiers.h"
#include "clang/Basic/SyncScope.h"
#include "clang/Basic/TargetBuiltins.h"
#include "clang/Basic/TargetCXXABI.h"
#include "clang/Basic/TargetInfo.h"
#include "clang/Basic/TypeTraits.h"
#include "clang/Lex/Lexer.h"
#include "clang/Sema/Initialization.h"
#include "clang/Sema/Lookup.h"
#include "clang/Sema/Ownership.h"
#include "clang/Sema/Scope.h"
#include "clang/Sema/ScopeInfo.h"
#include "clang/Sema/Sema.h"
#include "clang/Sema/SemaInternal.h"
#include "llvm/ADT/APFloat.h"
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/APSInt.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/FoldingSet.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallBitVector.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/StringSet.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/Support/AtomicOrdering.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/ConvertUTF.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/Locale.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/SaveAndRestore.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/TargetParser/RISCVTargetParser.h"
#include "llvm/TargetParser/Triple.h"
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cstddef>
#include <cstdint>
#include <functional>
#include <limits>
#include <optional>
#include <string>
#include <tuple>
#include <utility>
#include "clang/Basic/Builtins.inc"
#include "clang/Basic/arm_sme_builtins_za_state.inc"
#include "clang/Basic/arm_sme_streaming_attrs.inc"
#include "clang/Basic/arm_sme_sema_rangechecks.inc"
#include "clang/Basic/arm_sve_streaming_attrs.inc"
#include "clang/Basic/arm_sve_sema_rangechecks.inc"
#include "clang/Basic/arm_neon.inc"
#include "clang/Basic/arm_fp16.inc"
#include "clang/Basic/arm_mve_builtin_sema.inc"
#include "clang/Basic/arm_cde_builtin_sema.inc"
#include "clang/Basic/PPCTypes.def"
#include "clang/Basic/BuiltinsPPC.def"
Go to the source code of this file.
Macros | |
#define | BUILTIN(ID, TYPE, ATTRS) |
#define | ATOMIC_BUILTIN(ID, TYPE, ATTRS) |
#define | GET_SME_BUILTIN_GET_STATE |
#define | GET_SME_STREAMING_ATTRS |
#define | GET_SME_IMMEDIATE_CHECK |
#define | GET_SVE_STREAMING_ATTRS |
#define | GET_SVE_IMMEDIATE_CHECK |
#define | GET_NEON_BUILTINS |
#define | TARGET_BUILTIN(id, ...) case NEON::BI##id: |
#define | BUILTIN(id, ...) case NEON::BI##id: |
#define | GET_NEON_OVERLOAD_CHECK |
#define | GET_NEON_IMMEDIATE_CHECK |
#define | PPC_VECTOR_TYPE(typeName, Id, size) case size: Type = Context.Id##Ty; break; |
#define | CUSTOM_BUILTIN(Name, Intr, Types, Acc, Feature) |
#define | PPC_VECTOR_TYPE(Name, Id, Size) || CoreType == Context.Id##Ty |
#define | BUILTIN_ROW(x) |
Enumerations | |
enum | ArmStreamingType { ArmNonStreaming , ArmStreaming , ArmStreamingCompatible , ArmStreamingOrSVE2p1 } |
enum | ArmSMEState : unsigned { ArmNoState = 0 , ArmInZA = 0b01 , ArmOutZA = 0b10 , ArmInOutZA = 0b11 , ArmZAMask = 0b11 , ArmInZT0 = 0b01 << 2 , ArmOutZT0 = 0b10 << 2 , ArmInOutZT0 = 0b11 << 2 , ArmZT0Mask = 0b11 << 2 } |
enum | { TileRegLow = 0 , TileRegHigh = 7 } |
enum | AbsoluteValueKind { AVK_Integer , AVK_Floating , AVK_Complex } |
Functions | |
static constexpr unsigned short | combineFAPK (Sema::FormatArgumentPassingKind A, Sema::FormatArgumentPassingKind B) |
static bool | checkArgCountAtLeast (Sema &S, CallExpr *Call, unsigned MinArgCount) |
Checks that a call expression's argument count is at least the desired number. | |
static bool | checkArgCountAtMost (Sema &S, CallExpr *Call, unsigned MaxArgCount) |
Checks that a call expression's argument count is at most the desired number. | |
static bool | checkArgCountRange (Sema &S, CallExpr *Call, unsigned MinArgCount, unsigned MaxArgCount) |
Checks that a call expression's argument count is in the desired range. | |
static bool | checkArgCount (Sema &S, CallExpr *Call, unsigned DesiredArgCount) |
Checks that a call expression's argument count is the desired number. | |
static bool | convertArgumentToType (Sema &S, Expr *&Value, QualType Ty) |
static bool | BuiltinAnnotation (Sema &S, CallExpr *TheCall) |
Check that the first argument to __builtin_annotation is an integer and the second argument is a non-wide string literal. | |
static bool | BuiltinMSVCAnnotation (Sema &S, CallExpr *TheCall) |
static bool | BuiltinAddressof (Sema &S, CallExpr *TheCall) |
Check that the argument to __builtin_addressof is a glvalue, and set the result type to the corresponding pointer type. | |
static bool | BuiltinFunctionStart (Sema &S, CallExpr *TheCall) |
Check that the argument to __builtin_function_start is a function. | |
static bool | BuiltinPreserveAI (Sema &S, CallExpr *TheCall) |
Check the number of arguments and set the result type to the argument type. | |
static bool | BuiltinAlignment (Sema &S, CallExpr *TheCall, unsigned ID) |
Check that the value argument for __builtin_is_aligned(value, alignment) and __builtin_aligned_{up,down}(value, alignment) is an integer or a pointer type (but not a function pointer) and that the alignment is a power-of-two. | |
static bool | BuiltinOverflow (Sema &S, CallExpr *TheCall, unsigned BuiltinID) |
static ExprResult | BuiltinDumpStruct (Sema &S, CallExpr *TheCall) |
static bool | BuiltinCallWithStaticChain (Sema &S, CallExpr *BuiltinCall) |
static bool | ProcessFormatStringLiteral (const Expr *FormatExpr, StringRef &FormatStrRef, size_t &StrLen, ASTContext &Context) |
static bool | BuiltinSEHScopeCheck (Sema &SemaRef, CallExpr *TheCall, Scope::ScopeFlags NeededScopeFlags, unsigned DiagID) |
static bool | isBlockPointer (Expr *Arg) |
static bool | checkOpenCLBlockArgs (Sema &S, Expr *BlockArg) |
OpenCL C v2.0, s6.13.17.2 - Checks that the block parameters are all local void*, which is a requirement of device side enqueue. | |
static bool | checkOpenCLSubgroupExt (Sema &S, CallExpr *Call) |
static bool | OpenCLBuiltinNDRangeAndBlock (Sema &S, CallExpr *TheCall) |
static bool | OpenCLBuiltinKernelWorkGroupSize (Sema &S, CallExpr *TheCall) |
OpenCL C v2.0, s6.13.17.6 - Check the argument to the get_kernel_work_group_size and get_kernel_preferred_work_group_size_multiple builtin functions. | |
static bool | checkOpenCLEnqueueIntType (Sema &S, Expr *E, const QualType &IntType) |
Diagnose integer type and any valid implicit conversion to it. | |
static bool | checkOpenCLEnqueueLocalSizeArgs (Sema &S, CallExpr *TheCall, unsigned Start, unsigned End) |
static bool | checkOpenCLEnqueueVariadicArgs (Sema &S, CallExpr *TheCall, Expr *BlockArg, unsigned NumNonVarArgs) |
OpenCL v2.0, s6.13.17.1 - Check that sizes are provided for all 'local void*' parameter of passed block. | |
static bool | OpenCLBuiltinEnqueueKernel (Sema &S, CallExpr *TheCall) |
OpenCL C v2.0, s6.13.17 - Enqueue kernel function contains four different overload formats specified in Table 6.13.17.1. | |
static OpenCLAccessAttr * | getOpenCLArgAccess (const Decl *D) |
Returns OpenCL access qual. | |
static bool | checkOpenCLPipeArg (Sema &S, CallExpr *Call) |
Returns true if pipe element type is different from the pointer. | |
static bool | checkOpenCLPipePacketType (Sema &S, CallExpr *Call, unsigned Idx) |
Returns true if pipe element type is different from the pointer. | |
static bool | BuiltinRWPipe (Sema &S, CallExpr *Call) |
static bool | BuiltinReserveRWPipe (Sema &S, CallExpr *Call) |
static bool | BuiltinCommitRWPipe (Sema &S, CallExpr *Call) |
static bool | BuiltinPipePackets (Sema &S, CallExpr *Call) |
static bool | OpenCLBuiltinToAddr (Sema &S, unsigned BuiltinID, CallExpr *Call) |
static bool | checkPointerAuthEnabled (Sema &S, Expr *E) |
static bool | checkPointerAuthKey (Sema &S, Expr *&Arg) |
static bool | checkPointerAuthValue (Sema &S, Expr *&Arg, PointerAuthOpKind OpKind) |
static ExprResult | PointerAuthStrip (Sema &S, CallExpr *Call) |
static ExprResult | PointerAuthBlendDiscriminator (Sema &S, CallExpr *Call) |
static ExprResult | PointerAuthSignGenericData (Sema &S, CallExpr *Call) |
static ExprResult | PointerAuthSignOrAuth (Sema &S, CallExpr *Call, PointerAuthOpKind OpKind) |
static ExprResult | PointerAuthAuthAndResign (Sema &S, CallExpr *Call) |
static ExprResult | BuiltinLaunder (Sema &S, CallExpr *TheCall) |
static bool | CheckBuiltinTargetNotInUnsupported (Sema &S, unsigned BuiltinID, CallExpr *TheCall, ArrayRef< llvm::Triple::ObjectFormatType > UnsupportedObjectFormatTypes) |
static bool | CheckBuiltinTargetInSupported (Sema &S, unsigned BuiltinID, CallExpr *TheCall, ArrayRef< llvm::Triple::ArchType > SupportedArchs) |
static void | CheckNonNullArgument (Sema &S, const Expr *ArgExpr, SourceLocation CallSiteLoc) |
static bool | checkMathBuiltinElementType (Sema &S, SourceLocation Loc, QualType ArgTy, int ArgIndex) |
static bool | checkFPMathBuiltinElementType (Sema &S, SourceLocation Loc, QualType ArgTy, int ArgIndex) |
static bool | BuiltinCpu (Sema &S, const TargetInfo &TI, CallExpr *TheCall, const TargetInfo *AuxTI, unsigned BuiltinID) |
BuiltinCpu{Supports|Is} - Handle __builtin_cpu_{supports|is}(char *). | |
static bool | BuiltinPopcountg (Sema &S, CallExpr *TheCall) |
Checks that __builtin_popcountg was called with a single argument, which is an unsigned integer. | |
static bool | BuiltinCountZeroBitsGeneric (Sema &S, CallExpr *TheCall) |
Checks that __builtin_{clzg,ctzg} was called with a first argument, which is an unsigned integer, and an optional second argument, which is promoted to an 'int'. | |
static unsigned | RFT (unsigned t, bool shift=false, bool ForceQuad=false) |
static QualType | getNeonEltType (NeonTypeFlags Flags, ASTContext &Context, bool IsPolyUnsigned, bool IsInt64Long) |
getNeonEltType - Return the QualType corresponding to the elements of the vector type specified by the NeonTypeFlags. | |
static ArmStreamingType | getArmStreamingFnType (const FunctionDecl *FD) |
static void | checkArmStreamingBuiltin (Sema &S, CallExpr *TheCall, const FunctionDecl *FD, ArmStreamingType BuiltinType) |
static bool | hasArmZAState (const FunctionDecl *FD) |
static bool | hasArmZT0State (const FunctionDecl *FD) |
static ArmSMEState | getSMEState (unsigned BuiltinID) |
static bool | isValidBPFPreserveFieldInfoArg (Expr *Arg) |
static bool | isValidBPFPreserveTypeInfoArg (Expr *Arg) |
static bool | isValidBPFPreserveEnumValueArg (Expr *Arg) |
static QualType | DecodePPCMMATypeFromStr (ASTContext &Context, const char *&Str, unsigned &Mask) |
DecodePPCMMATypeFromStr - This decodes one PPC MMA type descriptor from Str, advancing the pointer over the consumed characters. | |
static bool | isPPC_64Builtin (unsigned BuiltinID) |
bool | CheckVectorElementCallArgs (Sema *S, CallExpr *TheCall) |
bool | CheckArgsTypesAreCorrect (Sema *S, CallExpr *TheCall, QualType ExpectedType, llvm::function_ref< bool(clang::QualType PassedType)> Check) |
bool | CheckAllArgsHaveFloatRepresentation (Sema *S, CallExpr *TheCall) |
bool | CheckFloatOrHalfRepresentations (Sema *S, CallExpr *TheCall) |
bool | CheckNoDoubleVectors (Sema *S, CallExpr *TheCall) |
bool | CheckUnsignedIntRepresentation (Sema *S, CallExpr *TheCall) |
void | SetElementTypeAsReturnType (Sema *S, CallExpr *TheCall, QualType ReturnType) |
static bool | CheckInvalidVLENandLMUL (const TargetInfo &TI, CallExpr *TheCall, Sema &S, QualType Type, int EGW) |
static bool | isX86_32Builtin (unsigned BuiltinID) |
static bool | CheckNonNullExpr (Sema &S, const Expr *Expr) |
Checks if a the given expression evaluates to null. | |
static void | DiagnoseCStringFormatDirectiveInCFAPI (Sema &S, const NamedDecl *FDecl, Expr **Args, unsigned NumArgs) |
Diagnose use of s directive in an NSString which is being passed as formatting string to formatting method. | |
static bool | isNonNullType (QualType type) |
Determine whether the given type has a non-null nullability annotation. | |
static void | CheckNonNullArguments (Sema &S, const NamedDecl *FDecl, const FunctionProtoType *Proto, ArrayRef< const Expr * > Args, SourceLocation CallSiteLoc) |
static bool | isValidOrderingForOp (int64_t Ordering, AtomicExpr::AtomicOp Op) |
static bool | checkBuiltinArgument (Sema &S, CallExpr *E, unsigned ArgIndex) |
checkBuiltinArgument - Given a call to a builtin function, perform normal type-checking on the given argument, updating the call in place. | |
static bool | checkVAStartABI (Sema &S, unsigned BuiltinID, Expr *Fn) |
Check that the user is calling the appropriate va_start builtin for the target and calling convention. | |
static bool | checkVAStartIsInVariadicFunction (Sema &S, Expr *Fn, ParmVarDecl **LastParam=nullptr) |
static bool | IsShiftedByte (llvm::APSInt Value) |
static void | sumOffsets (llvm::APSInt &Offset, llvm::APSInt Addend, BinaryOperatorKind BinOpKind, bool AddendIsRight) |
static void | CheckFormatString (Sema &S, const FormatStringLiteral *FExpr, const Expr *OrigFormatExpr, ArrayRef< const Expr * > Args, Sema::FormatArgumentPassingKind APK, unsigned format_idx, unsigned firstDataArg, Sema::FormatStringType Type, bool inFunctionCall, Sema::VariadicCallType CallType, llvm::SmallBitVector &CheckedVarArgs, UncoveredArgHandler &UncoveredArg, bool IgnoreStringsWithoutSpecifiers) |
static const Expr * | maybeConstEvalStringLiteral (ASTContext &Context, const Expr *E) |
static StringLiteralCheckType | checkFormatStringExpr (Sema &S, const Expr *E, ArrayRef< const Expr * > Args, Sema::FormatArgumentPassingKind APK, unsigned format_idx, unsigned firstDataArg, Sema::FormatStringType Type, Sema::VariadicCallType CallType, bool InFunctionCall, llvm::SmallBitVector &CheckedVarArgs, UncoveredArgHandler &UncoveredArg, llvm::APSInt Offset, bool IgnoreStringsWithoutSpecifiers=false) |
template<typename MemberKind > | |
static llvm::SmallPtrSet< MemberKind *, 1 > | CXXRecordMembersNamed (StringRef Name, Sema &S, QualType Ty) |
static bool | requiresParensToAddCast (const Expr *E) |
static std::pair< QualType, StringRef > | shouldNotPrintDirectly (const ASTContext &Context, QualType IntendedTy, const Expr *E) |
static bool | isArithmeticArgumentPromotion (Sema &S, const ImplicitCastExpr *ICE) |
Return true if ICE is an implicit argument promotion of an arithmetic type. | |
static analyze_format_string::ArgType::MatchKind | handleFormatSignedness (analyze_format_string::ArgType::MatchKind Match, DiagnosticsEngine &Diags, SourceLocation Loc) |
static unsigned | getLargerAbsoluteValueFunction (unsigned AbsFunction) |
static QualType | getAbsoluteValueArgumentType (ASTContext &Context, unsigned AbsType) |
static unsigned | getBestAbsFunction (ASTContext &Context, QualType ArgType, unsigned AbsFunctionKind) |
static AbsoluteValueKind | getAbsoluteValueKind (QualType T) |
static unsigned | changeAbsFunction (unsigned AbsKind, AbsoluteValueKind ValueKind) |
static unsigned | getAbsoluteValueFunctionKind (const FunctionDecl *FDecl) |
static void | emitReplacement (Sema &S, SourceLocation Loc, SourceRange Range, unsigned AbsKind, QualType ArgType) |
template<std::size_t StrLen> | |
static bool | IsStdFunction (const FunctionDecl *FDecl, const char(&Str)[StrLen]) |
static bool | CheckMemorySizeofForComparison (Sema &S, const Expr *E, IdentifierInfo *FnName, SourceLocation FnLoc, SourceLocation RParenLoc) |
Takes the expression passed to the size_t parameter of functions such as memcmp, strncat, etc and warns if it's a comparison. | |
static const CXXRecordDecl * | getContainedDynamicClass (QualType T, bool &IsContained) |
Determine whether the given type is or contains a dynamic class type (e.g., whether it has a vtable). | |
static const UnaryExprOrTypeTraitExpr * | getAsSizeOfExpr (const Expr *E) |
static const Expr * | getSizeOfExprArg (const Expr *E) |
If E is a sizeof expression, returns its argument expression, otherwise returns NULL. | |
static QualType | getSizeOfArgType (const Expr *E) |
If E is a sizeof expression, returns its argument type. | |
static bool | doesExprLikelyComputeSize (const Expr *SizeofExpr) |
Detect if SizeofExpr is likely to calculate the sizeof an object. | |
static bool | isArgumentExpandedFromMacro (SourceManager &SM, SourceLocation CallLoc, SourceLocation ArgLoc) |
Check if the ArgLoc originated from a macro passed to the call at CallLoc. | |
static void | CheckMemaccessSize (Sema &S, unsigned BId, const CallExpr *Call) |
Diagnose cases like 'memset(buf, sizeof(buf), 0)', which should have the last two arguments transposed. | |
static const Expr * | ignoreLiteralAdditions (const Expr *Ex, ASTContext &Ctx) |
static bool | isConstantSizeArrayWithMoreThanOneElement (QualType Ty, ASTContext &Context) |
static bool | referToTheSameDecl (const Expr *E1, const Expr *E2) |
Check if two expressions refer to the same declaration. | |
static const Expr * | getStrlenExprArg (const Expr *E) |
static IntRange | GetValueRange (ASTContext &C, llvm::APSInt &value, unsigned MaxWidth) |
static IntRange | GetValueRange (ASTContext &C, APValue &result, QualType Ty, unsigned MaxWidth) |
static QualType | GetExprType (const Expr *E) |
static IntRange | GetExprRange (ASTContext &C, const Expr *E, unsigned MaxWidth, bool InConstantContext, bool Approximate) |
Pseudo-evaluate the given integer expression, estimating the range of values it might take. | |
static IntRange | GetExprRange (ASTContext &C, const Expr *E, bool InConstantContext, bool Approximate) |
static bool | IsSameFloatAfterCast (const llvm::APFloat &value, const llvm::fltSemantics &Src, const llvm::fltSemantics &Tgt) |
Checks whether the given value, which currently has the given source semantics, has the same value when coerced through the target semantics. | |
static bool | IsSameFloatAfterCast (const APValue &value, const llvm::fltSemantics &Src, const llvm::fltSemantics &Tgt) |
Checks whether the given value, which currently has the given source semantics, has the same value when coerced through the target semantics. | |
static void | AnalyzeImplicitConversions (Sema &S, Expr *OrigE, SourceLocation CC, bool IsListInit) |
AnalyzeImplicitConversions - Find and report any interesting implicit conversions in the given expression. | |
static bool | IsEnumConstOrFromMacro (Sema &S, Expr *E) |
static bool | isKnownToHaveUnsignedValue (Expr *E) |
static bool | HasEnumType (Expr *E) |
static int | classifyConstantValue (Expr *Constant) |
static bool | CheckTautologicalComparison (Sema &S, BinaryOperator *E, Expr *Constant, Expr *Other, const llvm::APSInt &Value, bool RhsConstant) |
static void | AnalyzeImpConvsInComparison (Sema &S, BinaryOperator *E) |
Analyze the operands of the given comparison. | |
static void | AnalyzeComparison (Sema &S, BinaryOperator *E) |
Implements -Wsign-compare. | |
static bool | AnalyzeBitFieldAssignment (Sema &S, FieldDecl *Bitfield, Expr *Init, SourceLocation InitLoc) |
Analyzes an attempt to assign the given value to a bitfield. | |
static void | AnalyzeAssignment (Sema &S, BinaryOperator *E) |
Analyze the given simple or compound assignment for warning-worthy operations. | |
static void | DiagnoseImpCast (Sema &S, Expr *E, QualType SourceType, QualType T, SourceLocation CContext, unsigned diag, bool pruneControlFlow=false) |
Diagnose an implicit cast; purely a helper for CheckImplicitConversion. | |
static void | DiagnoseImpCast (Sema &S, Expr *E, QualType T, SourceLocation CContext, unsigned diag, bool pruneControlFlow=false) |
Diagnose an implicit cast; purely a helper for CheckImplicitConversion. | |
static bool | isObjCSignedCharBool (Sema &S, QualType Ty) |
static void | adornObjCBoolConversionDiagWithTernaryFixit (Sema &S, Expr *SourceExpr, const Sema::SemaDiagnosticBuilder &Builder) |
static void | DiagnoseFloatingImpCast (Sema &S, Expr *E, QualType T, SourceLocation CContext) |
Diagnose an implicit cast from a floating point value to an integer value. | |
static void | AnalyzeCompoundAssignment (Sema &S, BinaryOperator *E) |
Analyze the given compound assignment for the possible losing of floating-point precision. | |
static std::string | PrettyPrintInRange (const llvm::APSInt &Value, IntRange Range) |
static bool | IsImplicitBoolFloatConversion (Sema &S, Expr *Ex, bool ToBool) |
static void | CheckImplicitArgumentConversions (Sema &S, CallExpr *TheCall, SourceLocation CC) |
static void | DiagnoseNullConversion (Sema &S, Expr *E, QualType T, SourceLocation CC) |
static void | checkObjCArrayLiteral (Sema &S, QualType TargetType, ObjCArrayLiteral *ArrayLiteral) |
Check an Objective-C array literal being converted to the given target type. | |
static void | checkObjCDictionaryLiteral (Sema &S, QualType TargetType, ObjCDictionaryLiteral *DictionaryLiteral) |
Check an Objective-C dictionary literal being converted to the given target type. | |
static void | checkObjCCollectionLiteralElement (Sema &S, QualType TargetElementType, Expr *Element, unsigned ElementKind) |
Check a single element within a collection literal against the target element type. | |
static bool | isSameWidthConstantConversion (Sema &S, Expr *E, QualType T, SourceLocation CC) |
static const IntegerLiteral * | getIntegerLiteral (Expr *E) |
static void | DiagnoseIntInBoolContext (Sema &S, Expr *E) |
static void | CheckImplicitConversion (Sema &S, Expr *E, QualType T, SourceLocation CC, bool *ICContext=nullptr, bool IsListInit=false) |
static void | CheckConditionalOperator (Sema &S, AbstractConditionalOperator *E, SourceLocation CC, QualType T) |
static void | CheckConditionalOperand (Sema &S, Expr *E, QualType T, SourceLocation CC, bool &ICContext) |
static void | CheckBoolLikeConversion (Sema &S, Expr *E, SourceLocation CC) |
Check conversion of given expression to boolean. | |
static void | AnalyzeImplicitConversions (Sema &S, AnalyzeImplicitConversionsWorkItem Item, llvm::SmallVectorImpl< AnalyzeImplicitConversionsWorkItem > &WorkList) |
Data recursive variant of AnalyzeImplicitConversions. | |
static bool | CheckForReference (Sema &SemaRef, const Expr *E, const PartialDiagnostic &PD) |
static bool | IsInAnyMacroBody (const SourceManager &SM, SourceLocation Loc) |
static void | diagnoseArrayStarInParamType (Sema &S, QualType PType, SourceLocation Loc) |
static std::optional< std::pair< CharUnits, CharUnits > > | getBaseAlignmentAndOffsetFromPtr (const Expr *E, ASTContext &Ctx) |
This helper function takes a pointer expression and returns the alignment of a VarDecl and a constant offset from the VarDecl. | |
static std::pair< CharUnits, CharUnits > | getDerivedToBaseAlignmentAndOffset (const CastExpr *CE, QualType DerivedType, CharUnits BaseAlignment, CharUnits Offset, ASTContext &Ctx) |
Compute the alignment and offset of the base class object given the derived-to-base cast expression and the alignment and offset of the derived class object. | |
static std::optional< std::pair< CharUnits, CharUnits > > | getAlignmentAndOffsetFromBinAddOrSub (const Expr *PtrE, const Expr *IntE, bool IsSub, ASTContext &Ctx) |
Compute the alignment and offset of a binary additive operator. | |
static std::optional< std::pair< CharUnits, CharUnits > > | getBaseAlignmentAndOffsetFromLValue (const Expr *E, ASTContext &Ctx) |
This helper function takes an lvalue expression and returns the alignment of a VarDecl and a constant offset from the VarDecl. | |
static CharUnits | getPresumedAlignmentOfPointer (const Expr *E, Sema &S) |
static bool | considerVariable (VarDecl *var, Expr *ref, RetainCycleOwner &owner) |
Consider whether capturing the given variable can possibly lead to a retain cycle. | |
static bool | findRetainCycleOwner (Sema &S, Expr *e, RetainCycleOwner &owner) |
static Expr * | findCapturingExpr (Sema &S, Expr *e, RetainCycleOwner &owner) |
Check whether the given argument is a block which captures a variable. | |
static void | diagnoseRetainCycle (Sema &S, Expr *capturer, RetainCycleOwner &owner) |
static bool | isSetterLikeSelector (Selector sel) |
Check for a keyword selector that starts with the word 'add' or 'set'. | |
static std::optional< int > | GetNSMutableArrayArgumentIndex (Sema &S, ObjCMessageExpr *Message) |
static std::optional< int > | GetNSMutableDictionaryArgumentIndex (Sema &S, ObjCMessageExpr *Message) |
static std::optional< int > | GetNSSetArgumentIndex (Sema &S, ObjCMessageExpr *Message) |
static bool | checkUnsafeAssignLiteral (Sema &S, SourceLocation Loc, Expr *RHS, bool isProperty) |
static bool | checkUnsafeAssignObject (Sema &S, SourceLocation Loc, Qualifiers::ObjCLifetime LT, Expr *RHS, bool isProperty) |
static bool | ShouldDiagnoseEmptyStmtBody (const SourceManager &SourceMgr, SourceLocation StmtLoc, const NullStmt *Body) |
static bool | isLayoutCompatible (ASTContext &C, QualType T1, QualType T2) |
Check if two types are layout-compatible in C++11 sense. | |
static bool | isLayoutCompatible (ASTContext &C, EnumDecl *ED1, EnumDecl *ED2) |
Check if two enumeration types are layout-compatible. | |
static bool | isLayoutCompatible (ASTContext &C, FieldDecl *Field1, FieldDecl *Field2, bool AreUnionMembers=false) |
Check if two fields are layout-compatible. | |
static bool | isLayoutCompatibleStruct (ASTContext &C, RecordDecl *RD1, RecordDecl *RD2) |
Check if two standard-layout structs are layout-compatible. | |
static bool | isLayoutCompatibleUnion (ASTContext &C, RecordDecl *RD1, RecordDecl *RD2) |
Check if two standard-layout unions are layout-compatible. | |
static bool | isLayoutCompatible (ASTContext &C, RecordDecl *RD1, RecordDecl *RD2) |
static bool | FindTypeTagExpr (const Expr *TypeExpr, const ASTContext &Ctx, const ValueDecl **VD, uint64_t *MagicValue, bool isConstantEvaluated) |
Given a type tag expression find the type tag itself. | |
static bool | GetMatchingCType (const IdentifierInfo *ArgumentKind, const Expr *TypeExpr, const ASTContext &Ctx, const llvm::DenseMap< Sema::TypeTagMagicValue, Sema::TypeTagData > *MagicValues, bool &FoundWrongKind, Sema::TypeTagData &TypeInfo, bool isConstantEvaluated) |
Retrieve the C type corresponding to type tag TypeExpr. | |
static bool | IsSameCharType (QualType T1, QualType T2) |
static std::optional< unsigned > | getAndVerifyMatrixDimension (Expr *Expr, StringRef Name, Sema &S) |
static bool | CheckWasmBuiltinArgIsTable (Sema &S, CallExpr *E, unsigned ArgIndex, QualType &ElTy) |
Checks the argument at the given index is a WebAssembly table and if it is, sets ElTy to the element type. | |
static bool | CheckWasmBuiltinArgIsInteger (Sema &S, CallExpr *E, unsigned ArgIndex) |
Checks the argument at the given index is an integer. | |
#define BUILTIN | ( | id, | |
... | |||
) | case NEON::BI##id: |
#define BUILTIN_ROW | ( | x | ) |
#define CUSTOM_BUILTIN | ( | Name, | |
Intr, | |||
Types, | |||
Acc, | |||
Feature | |||
) |
#define GET_NEON_BUILTINS |
#define GET_NEON_IMMEDIATE_CHECK |
#define GET_NEON_OVERLOAD_CHECK |
#define GET_SME_BUILTIN_GET_STATE |
#define GET_SME_IMMEDIATE_CHECK |
#define GET_SME_STREAMING_ATTRS |
#define GET_SVE_IMMEDIATE_CHECK |
#define GET_SVE_STREAMING_ATTRS |
#define PPC_VECTOR_TYPE | ( | Name, | |
Id, | |||
Size | |||
) | || CoreType == Context.Id##Ty |
#define PPC_VECTOR_TYPE | ( | typeName, | |
Id, | |||
size | |||
) | case size: Type = Context.Id##Ty; break; |
#define TARGET_BUILTIN | ( | id, | |
... | |||
) | case NEON::BI##id: |
anonymous enum |
Enumerator | |
---|---|
TileRegLow | |
TileRegHigh |
Definition at line 7140 of file SemaChecking.cpp.
enum AbsoluteValueKind |
Enumerator | |
---|---|
AVK_Integer | |
AVK_Floating | |
AVK_Complex |
Definition at line 13253 of file SemaChecking.cpp.
enum ArmSMEState : unsigned |
Enumerator | |
---|---|
ArmNoState | |
ArmInZA | |
ArmOutZA | |
ArmInOutZA | |
ArmZAMask | |
ArmInZT0 | |
ArmOutZT0 | |
ArmInOutZT0 | |
ArmZT0Mask |
Definition at line 3355 of file SemaChecking.cpp.
enum ArmStreamingType |
Enumerator | |
---|---|
ArmNonStreaming | |
ArmStreaming | |
ArmStreamingCompatible | |
ArmStreamingOrSVE2p1 |
Definition at line 3348 of file SemaChecking.cpp.
|
static |
Definition at line 15689 of file SemaChecking.cpp.
References clang::FixItHint::CreateInsertion(), clang::Stmt::getBeginLoc(), clang::Stmt::getEndLoc(), clang::Sema::getLocForEndOfToken(), and clang::Expr::IgnoreImplicit().
Referenced by CheckImplicitConversion(), and DiagnoseFloatingImpCast().
|
static |
Analyze the given simple or compound assignment for warning-worthy operations.
Definition at line 15640 of file SemaChecking.cpp.
References AnalyzeBitFieldAssignment(), AnalyzeImplicitConversions(), clang::SemaBase::Diag(), clang::Stmt::getBeginLoc(), clang::BinaryOperator::getLHS(), clang::BinaryOperator::getOperatorLoc(), clang::BinaryOperator::getRHS(), clang::Expr::getSourceBitField(), clang::Expr::getType(), clang::Expr::IgnoreParenImpCasts(), and clang::Type::isAtomicType().
Referenced by AnalyzeImplicitConversions().
|
static |
Analyzes an attempt to assign the given value to a bitfield.
Returns true if there was something fishy about the attempt.
Definition at line 15501 of file SemaChecking.cpp.
References clang::Type::castAs(), clang::Sema::Context, clang::SemaBase::Diag(), clang::Expr::EvaluateAsInt(), clang::Sema::findMacroSpelling(), clang::Type::getAs(), clang::Stmt::getBeginLoc(), clang::FieldDecl::getBitWidth(), clang::FieldDecl::getBitWidthValue(), clang::Expr::getExprLoc(), clang::EnumDecl::getIntegerTypeSourceInfo(), clang::Sema::getLangOpts(), clang::EnumDecl::getNumNegativeBits(), clang::EnumDecl::getNumPositiveBits(), clang::Stmt::getSourceRange(), clang::TypeLoc::getSourceRange(), clang::ValueDecl::getType(), clang::Expr::getType(), clang::TypeSourceInfo::getTypeLoc(), clang::DeclaratorDecl::getTypeSourceInfo(), clang::DeclaratorDecl::getTypeSpecStartLoc(), clang::Init, clang::FieldDecl::isBitField(), clang::Type::isBooleanType(), clang::Type::isEnumeralType(), clang::SourceManager::isInSystemMacro(), clang::Decl::isInvalidDecl(), clang::Type::isSignedIntegerType(), clang::Expr::isTypeDependent(), clang::Expr::isValueDependent(), clang::Sema::LangOpts, clang::Result, clang::Expr::SE_AllowSideEffects, clang::Sema::SourceMgr, and toString().
Referenced by AnalyzeAssignment().
|
static |
Implements -Wsign-compare.
E | the binary operator to check for warnings |
Definition at line 15384 of file SemaChecking.cpp.
References AnalyzeImpConvsInComparison(), AnalyzeImplicitConversions(), bool, CheckTautologicalComparison(), clang::Sema::Context, clang::Sema::DiagRuntimeBehavior(), GetExprRange(), clang::Expr::getIntegerConstantExpr(), clang::ASTContext::getIntWidth(), clang::Sema::getLangOpts(), clang::BinaryOperator::getLHS(), clang::BinaryOperator::getOperatorLoc(), clang::BinaryOperator::getRHS(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::ASTContext::hasSameUnqualifiedType(), clang::Type::hasSignedIntegerRepresentation(), clang::Type::hasUnsignedIntegerRepresentation(), clang::Expr::IgnoreParenImpCasts(), clang::Sema::isConstantEvaluatedContext(), clang::BinaryOperator::isEqualityOp(), clang::Type::isIntegralType(), clang::Expr::isValueDependent(), clang::Other, clang::Sema::PDiag(), and clang::T.
Referenced by AnalyzeImplicitConversions().
|
static |
Analyze the given compound assignment for the possible losing of floating-point precision.
Definition at line 15822 of file SemaChecking.cpp.
References AnalyzeImplicitConversions(), clang::SemaBase::Diag(), DiagnoseImpCast(), clang::Type::getAs(), clang::Sema::getASTContext(), clang::BinaryOperator::getExprLoc(), clang::ASTContext::getFloatingTypeSemanticOrder(), clang::BinaryOperator::getLHS(), clang::BinaryOperator::getOperatorLoc(), clang::BinaryOperator::getRHS(), clang::Expr::getType(), clang::Type::isAtomicType(), clang::BuiltinType::isFloatingPoint(), clang::SourceManager::isInSystemMacro(), and clang::Sema::SourceMgr.
Referenced by AnalyzeImplicitConversions().
|
static |
Analyze the operands of the given comparison.
Implements the fallback case from AnalyzeComparison.
Definition at line 15376 of file SemaChecking.cpp.
References AnalyzeImplicitConversions(), clang::BinaryOperator::getLHS(), clang::BinaryOperator::getOperatorLoc(), and clang::BinaryOperator::getRHS().
Referenced by AnalyzeComparison().
|
static |
Data recursive variant of AnalyzeImplicitConversions.
Subexpressions that should be visited are added to WorkList.
Definition at line 16686 of file SemaChecking.cpp.
References AnalyzeAssignment(), AnalyzeComparison(), AnalyzeCompoundAssignment(), clang::Call, CheckBoolLikeConversion(), CheckConditionalOperator(), CheckImplicitArgumentConversions(), CheckImplicitConversion(), clang::Stmt::children(), clang::Sema::Context, clang::FixItHint::CreateReplacement(), clang::SemaBase::Diag(), clang::Stmt::getBeginLoc(), clang::BinaryOperator::getExprLoc(), clang::Expr::getExprLoc(), clang::Sema::getLangOpts(), clang::BinaryOperator::getLHS(), clang::Lexer::getLocForEndOfToken(), clang::BinaryOperator::getOpcode(), clang::BinaryOperator::getRHS(), clang::Sema::getSourceManager(), clang::Stmt::getSourceRange(), clang::Lexer::getSourceText(), clang::CharSourceRange::getTokenRange(), clang::Expr::getType(), clang::Expr::IgnoreParenImpCasts(), clang::Type::isAtomicType(), clang::Type::isBooleanType(), clang::BinaryOperator::isLogicalOp(), clang::Expr::isTypeDependent(), clang::Expr::isValueDependent(), clang::Type::isVoidType(), SM, and clang::T.
|
static |
AnalyzeImplicitConversions - Find and report any interesting implicit conversions in the given expression.
There are a couple of competing diagnostics here, -Wconversion and -Wsign-compare.
Definition at line 16855 of file SemaChecking.cpp.
References AnalyzeImplicitConversions().
Referenced by AnalyzeAssignment(), AnalyzeComparison(), AnalyzeCompoundAssignment(), AnalyzeImpConvsInComparison(), AnalyzeImplicitConversions(), CheckConditionalOperand(), and CheckConditionalOperator().
Check that the argument to __builtin_addressof is a glvalue, and set the result type to the corresponding pointer type.
Definition at line 241 of file SemaChecking.cpp.
References clang::Sema::CheckAddressOfOperand(), checkArgCount(), clang::ActionResult< PtrTy, Compress >::get(), clang::CallExpr::getArg(), clang::CallExpr::getBeginLoc(), clang::QualType::isNull(), clang::CallExpr::setArg(), and clang::Expr::setType().
Check that the value argument for __builtin_is_aligned(value, alignment) and __builtin_aligned_{up,down}(value, alignment) is an integer or a pointer type (but not a function pointer) and that the alignment is a power-of-two.
Definition at line 291 of file SemaChecking.cpp.
References clang::ASTContext::BoolTy, clang::Type::canDecayToPointerType(), checkArgCount(), clang::Sema::Context, clang::SemaBase::Diag(), clang::Expr::EvaluateAsInt(), clang::ActionResult< PtrTy, Compress >::get(), clang::CallExpr::getArg(), clang::ASTContext::getDecayedType(), clang::Expr::getExprLoc(), clang::APValue::getInt(), clang::ASTContext::getIntWidth(), clang::Expr::getType(), clang::InitializedEntity::InitializeParameter(), clang::Type::isArrayType(), clang::Type::isFunctionPointerType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Type::isPointerType(), clang::Expr::isValueDependent(), clang::Sema::PerformCopyInitialization(), clang::Expr::SE_AllowSideEffects, clang::CallExpr::setArg(), clang::Expr::setType(), toString(), and clang::Expr::EvalResult::Val.
Check that the first argument to __builtin_annotation is an integer and the second argument is a non-wide string literal.
Definition at line 191 of file SemaChecking.cpp.
References checkArgCount(), clang::SemaBase::Diag(), clang::CallExpr::getArg(), clang::Stmt::getBeginLoc(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::Expr::IgnoreParenCasts(), clang::Type::isIntegerType(), and clang::Expr::setType().
Definition at line 763 of file SemaChecking.cpp.
References clang::Call, checkArgCount(), clang::Sema::Context, clang::SemaBase::Diag(), clang::ActionResult< PtrTy, Compress >::get(), clang::CallExpr::getArg(), clang::CallExpr::getBeginLoc(), clang::CallExpr::getCallee(), clang::ASTContext::getFunctionType(), clang::ASTContext::getPointerType(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::Expr::IgnoreImpCasts(), clang::Sema::ImpCastExprToType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Type::isPointerType(), clang::CallExpr::setArg(), clang::CallExpr::setCallee(), clang::Expr::setObjectKind(), clang::Expr::setType(), clang::Expr::setValueKind(), and clang::Sema::UsualUnaryConversions().
Definition at line 1891 of file SemaChecking.cpp.
References clang::Call, checkArgCount(), checkOpenCLPipeArg(), clang::Sema::Context, clang::SemaBase::Diag(), and clang::ASTContext::OCLReserveIDTy.
Checks that __builtin_{clzg,ctzg} was called with a first argument, which is an unsigned integer, and an optional second argument, which is promoted to an 'int'.
Definition at line 2404 of file SemaChecking.cpp.
References checkArgCountRange(), clang::Sema::DefaultLvalueConversion(), clang::SemaBase::Diag(), clang::ActionResult< PtrTy, Compress >::get(), clang::CallExpr::getArg(), clang::Stmt::getBeginLoc(), clang::CallExpr::getNumArgs(), clang::Expr::getType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Type::isSpecificBuiltinType(), clang::Type::isUnsignedIntegerType(), clang::CallExpr::setArg(), and clang::Sema::UsualUnaryConversions().
|
static |
BuiltinCpu{Supports|Is} - Handle __builtin_cpu_{supports|is}(char *).
This checks that the target supports the builtin and that the string argument is constant and valid.
Definition at line 2334 of file SemaChecking.cpp.
References clang::SemaBase::Diag(), clang::CallExpr::getArg(), clang::CallExpr::getBeginLoc(), clang::CallExpr::getEndLoc(), clang::Stmt::getSourceRange(), clang::TargetInfo::getTriple(), clang::Expr::IgnoreParenImpCasts(), clang::TargetInfo::supportsCpuIs(), clang::TargetInfo::supportsCpuSupports(), clang::TargetInfo::validateCpuIs(), and clang::TargetInfo::validateCpuSupports().
|
static |
Definition at line 697 of file SemaChecking.cpp.
References checkArgCountAtLeast(), clang::Sema::Context, clang::Sema::DefaultLvalueConversion(), clang::SemaBase::Diag(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::CallExpr::getArg(), clang::Type::getAs(), clang::Type::getAsRecordDecl(), clang::Stmt::getBeginLoc(), clang::CallExpr::getDirectCallee(), clang::Stmt::getEndLoc(), clang::Sema::getLangOpts(), clang::Sema::getLocForEndOfToken(), clang::Type::getPointeeType(), clang::Expr::getType(), clang::Type::isBlockPointerType(), clang::Type::isFunctionPointerType(), clang::Type::isFunctionType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Type::isPointerType(), clang::Type::isRecordType(), clang::Sema::RequireCompleteType(), and clang::CallExpr::setArg().
Check that the argument to __builtin_function_start is a function.
Definition at line 256 of file SemaChecking.cpp.
References clang::Sema::checkAddressOfFunctionIsAvailable(), checkArgCount(), clang::Sema::DefaultFunctionArrayLvalueConversion(), clang::SemaBase::Diag(), clang::ActionResult< PtrTy, Compress >::get(), clang::CallExpr::getArg(), clang::Expr::getAsBuiltinConstantDeclRef(), clang::Sema::getASTContext(), clang::CallExpr::getBeginLoc(), clang::Stmt::getSourceRange(), clang::ActionResult< PtrTy, Compress >::isInvalid(), and clang::CallExpr::setArg().
|
static |
Definition at line 2158 of file SemaChecking.cpp.
References checkArgCount(), clang::Sema::Context, clang::SemaBase::Diag(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::CallExpr::getArg(), clang::Type::getAsArrayTypeUnsafe(), clang::CallExpr::getBeginLoc(), clang::Type::getPointeeType(), clang::ASTContext::getPointerType(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::InitializedEntity::InitializeParameter(), clang::Type::isFunctionPointerType(), clang::Type::isFunctionType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Type::isObjectType(), clang::Type::isPointerType(), clang::Type::isVoidPointerType(), clang::Sema::PerformCopyInitialization(), clang::Sema::RequireCompleteType(), clang::CallExpr::setArg(), and clang::Expr::setType().
Definition at line 217 of file SemaChecking.cpp.
References clang::CallExpr::arguments(), clang::SemaBase::Diag(), clang::CallExpr::getCallee(), clang::CallExpr::getEndLoc(), clang::CallExpr::getNumArgs(), and clang::Stmt::getSourceRange().
Definition at line 369 of file SemaChecking.cpp.
References checkArgCount(), clang::Sema::DefaultFunctionArrayLvalueConversion(), clang::SemaBase::Diag(), clang::ActionResult< PtrTy, Compress >::get(), clang::CallExpr::getArg(), clang::Type::getAs(), clang::Sema::getASTContext(), clang::Stmt::getBeginLoc(), clang::Expr::getExprLoc(), clang::Lexer::getImmediateMacroName(), clang::ASTContext::getIntWidth(), clang::Sema::getLangOpts(), clang::Type::getPointeeType(), clang::Sema::getSourceManager(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::Type::isIntegerType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), P, and clang::CallExpr::setArg().
Definition at line 1914 of file SemaChecking.cpp.
References clang::Call, checkArgCount(), and clang::SemaBase::Diag().
Checks that __builtin_popcountg was called with a single argument, which is an unsigned integer.
Definition at line 2380 of file SemaChecking.cpp.
References checkArgCount(), clang::Sema::DefaultLvalueConversion(), clang::SemaBase::Diag(), clang::ActionResult< PtrTy, Compress >::get(), clang::CallExpr::getArg(), clang::Stmt::getBeginLoc(), clang::Expr::getType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Type::isUnsignedIntegerType(), and clang::CallExpr::setArg().
Check the number of arguments and set the result type to the argument type.
Definition at line 280 of file SemaChecking.cpp.
References checkArgCount(), clang::CallExpr::getArg(), clang::Expr::getType(), and clang::Expr::setType().
Definition at line 1862 of file SemaChecking.cpp.
References clang::Call, checkArgCount(), checkOpenCLPipeArg(), clang::Sema::Context, clang::SemaBase::Diag(), clang::ASTContext::OCLReserveIDTy, and clang::ASTContext::UnsignedIntTy.
Definition at line 1807 of file SemaChecking.cpp.
References clang::Call, checkOpenCLPipeArg(), checkOpenCLPipePacketType(), clang::Sema::Context, clang::SemaBase::Diag(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::Type::isIntegerType(), clang::Type::isUnsignedIntegerType(), clang::ASTContext::OCLReserveIDTy, and clang::ASTContext::UnsignedIntTy.
|
static |
Definition at line 1429 of file SemaChecking.cpp.
References clang::SemaBase::Diag(), clang::CallExpr::getCallee(), clang::Sema::getCurScope(), clang::Expr::getExprLoc(), clang::Expr::IgnoreParenCasts(), and clang::Sema::inTemplateInstantiation().
|
static |
Definition at line 13272 of file SemaChecking.cpp.
References AVK_Complex, AVK_Floating, and AVK_Integer.
Definition at line 5524 of file SemaChecking.cpp.
References CheckArgsTypesAreCorrect(), clang::Sema::Context, and clang::ASTContext::FloatTy.
Referenced by clang::Sema::CheckHLSLBuiltinFunctionCall().
Checks that a call expression's argument count is the desired number.
This is useful when doing custom type-checking. Returns true on error.
Definition at line 157 of file SemaChecking.cpp.
References clang::Call, checkArgCountAtLeast(), and clang::SemaBase::Diag().
Referenced by BuiltinAddressof(), BuiltinAlignment(), BuiltinAnnotation(), BuiltinCallWithStaticChain(), BuiltinCommitRWPipe(), BuiltinFunctionStart(), BuiltinLaunder(), BuiltinOverflow(), BuiltinPipePackets(), BuiltinPopcountg(), BuiltinPreserveAI(), BuiltinReserveRWPipe(), clang::Sema::BuiltinVectorMath(), clang::Sema::CheckHLSLBuiltinFunctionCall(), OpenCLBuiltinKernelWorkGroupSize(), OpenCLBuiltinNDRangeAndBlock(), OpenCLBuiltinToAddr(), PointerAuthAuthAndResign(), PointerAuthBlendDiscriminator(), PointerAuthSignGenericData(), PointerAuthSignOrAuth(), and PointerAuthStrip().
Checks that a call expression's argument count is at least the desired number.
This is useful when doing custom type-checking on a variadic function. Returns true on error.
Definition at line 122 of file SemaChecking.cpp.
References clang::Call, and clang::SemaBase::Diag().
Referenced by BuiltinDumpStruct(), checkArgCount(), and checkArgCountRange().
Checks that a call expression's argument count is at most the desired number.
This is useful when doing custom type-checking on a variadic function. Returns true on error.
Definition at line 136 of file SemaChecking.cpp.
References clang::Call, and clang::SemaBase::Diag().
Referenced by checkArgCountRange().
|
static |
Checks that a call expression's argument count is in the desired range.
This is useful when doing custom type-checking on a variadic function. Returns true on error.
Definition at line 149 of file SemaChecking.cpp.
References clang::Call, checkArgCountAtLeast(), and checkArgCountAtMost().
Referenced by BuiltinCountZeroBitsGeneric().
bool CheckArgsTypesAreCorrect | ( | Sema * | S, |
CallExpr * | TheCall, | ||
QualType | ExpectedType, | ||
llvm::function_ref< bool(clang::QualType PassedType)> | Check | ||
) |
Definition at line 5506 of file SemaChecking.cpp.
References clang::Sema::Context, clang::SemaBase::Diag(), clang::CallExpr::getArg(), clang::Type::getAs(), clang::Stmt::getBeginLoc(), clang::CallExpr::getNumArgs(), clang::Expr::getType(), and clang::ASTContext::getVectorType().
Referenced by CheckAllArgsHaveFloatRepresentation(), CheckFloatOrHalfRepresentations(), CheckNoDoubleVectors(), and CheckUnsignedIntRepresentation().
|
static |
Definition at line 3523 of file SemaChecking.cpp.
References ArmNonStreaming, ArmStreaming, ArmStreamingCompatible, ArmStreamingOrSVE2p1, clang::Sema::Context, clang::SemaBase::Diag(), clang::Builtin::evaluateRequiredTargetFeatures(), getArmStreamingFnType(), clang::CallExpr::getBeginLoc(), clang::ASTContext::getFunctionFeatureMap(), and clang::Stmt::getSourceRange().
|
static |
Check conversion of given expression to boolean.
Input argument E is a logical expression.
Definition at line 16665 of file SemaChecking.cpp.
References clang::ASTContext::BoolTy, CheckImplicitConversion(), clang::Sema::Context, clang::Sema::getLangOpts(), clang::Expr::getType(), clang::Expr::IgnoreParenImpCasts(), and clang::Type::isAtomicType().
Referenced by AnalyzeImplicitConversions().
checkBuiltinArgument - Given a call to a builtin function, perform normal type-checking on the given argument, updating the call in place.
This is useful when a builtin function requires custom type-checking for some of its arguments but not necessarily all of them.
Returns true on error.
Definition at line 8854 of file SemaChecking.cpp.
References clang::Sema::Context, clang::ActionResult< PtrTy, Compress >::get(), clang::CallExpr::getArg(), clang::CallExpr::getDirectCallee(), clang::FunctionDecl::getParamDecl(), clang::InitializedEntity::InitializeParameter(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Sema::PerformCopyInitialization(), and clang::CallExpr::setArg().
|
static |
Definition at line 2236 of file SemaChecking.cpp.
References clang::SemaBase::Diag(), clang::Sema::getASTContext(), clang::CallExpr::getBeginLoc(), clang::Stmt::getSourceRange(), clang::ASTContext::getTargetInfo(), and clang::TargetInfo::getTriple().
|
static |
Definition at line 2220 of file SemaChecking.cpp.
References clang::SemaBase::Diag(), clang::Sema::getASTContext(), clang::CallExpr::getBeginLoc(), clang::Stmt::getSourceRange(), clang::ASTContext::getTargetInfo(), and clang::TargetInfo::getTriple().
|
static |
Definition at line 16613 of file SemaChecking.cpp.
References AnalyzeImplicitConversions(), CheckConditionalOperator(), CheckImplicitConversion(), clang::Sema::getLangOpts(), clang::Expr::getType(), clang::Expr::IgnoreParenImpCasts(), clang::Type::isRecordType(), clang::Sema::RequireCompleteExprType(), and clang::T.
Referenced by CheckConditionalOperator().
|
static |
Definition at line 16628 of file SemaChecking.cpp.
References AnalyzeImplicitConversions(), CheckConditionalOperand(), CheckImplicitConversion(), DiagnoseIntInBoolContext(), clang::Sema::Diags, clang::AbstractConditionalOperator::getCond(), clang::AbstractConditionalOperator::getFalseExpr(), clang::AbstractConditionalOperator::getQuestionLoc(), clang::AbstractConditionalOperator::getTrueExpr(), clang::Expr::getType(), clang::Expr::IgnoreParenImpCasts(), clang::Type::isBooleanType(), clang::DiagnosticsEngine::isIgnored(), and clang::T.
Referenced by AnalyzeImplicitConversions(), and CheckConditionalOperand().
Definition at line 5532 of file SemaChecking.cpp.
References CheckArgsTypesAreCorrect(), clang::Sema::Context, clang::ASTContext::FloatTy, clang::Type::isFloat32Type(), clang::Type::isHalfType(), and clang::Type::isVectorType().
Referenced by clang::Sema::CheckHLSLBuiltinFunctionCall().
|
static |
Definition at line 13068 of file SemaChecking.cpp.
References clang::Sema::Context, clang::Sema::FST_FreeBSDKPrintf, clang::Sema::FST_NSString, clang::Sema::FST_OSLog, clang::Sema::FST_OSTrace, clang::Sema::FST_Printf, clang::Sema::FST_Scanf, clang::ASTContext::getAsConstantArrayType(), clang::Sema::getLangOpts(), clang::Stmt::getSourceRange(), clang::ASTContext::getTargetInfo(), clang::analyze_format_string::parseFormatStringHasFormattingSpecifiers(), clang::analyze_format_string::ParsePrintfString(), clang::analyze_format_string::ParseScanfString(), clang::Sema::PDiag(), and clang::T.
Referenced by checkFormatStringExpr().
|
static |
Definition at line 10923 of file SemaChecking.cpp.
References clang::Sema::FormatStringInfo::ArgPassingKind, clang::C, CheckFormatString(), checkFormatStringExpr(), combineFAPK(), clang::Sema::Context, clang::Expr::EvaluateAsInt(), clang::Sema::FAPK_Fixed, clang::Sema::FAPK_VAList, clang::Sema::FAPK_Variadic, clang::Sema::FormatStringInfo::FormatIdx, clang::CallExpr::getArg(), clang::Type::getAs(), clang::ASTContext::getAsArrayType(), clang::Sema::getASTContext(), clang::FunctionDecl::getBuiltinID(), clang::CallExpr::getCalleeDecl(), clang::DeclRefExpr::getDecl(), clang::Sema::getFormatStringInfo(), clang::Sema::GetFormatStringType(), clang::Decl::getFunctionType(), clang::NamedDecl::getIdentifier(), clang::APValue::getInt(), clang::StringLiteral::getLength(), clang::BinaryOperator::getLHS(), clang::UnaryOperator::getOpcode(), clang::BinaryOperator::getOpcode(), clang::Type::getPointeeType(), clang::BinaryOperator::getRHS(), clang::Stmt::getStmtClass(), clang::StringLiteral::getString(), clang::UnaryOperator::getSubExpr(), clang::Expr::getType(), clang::Expr::IgnoreParenCasts(), clang::Init, clang::BinaryOperator::isAdditiveOp(), clang::QualType::isConstant(), clang::Sema::isConstantEvaluatedContext(), clang::Expr::isNullPointerConstant(), clang::Type::isObjCObjectPointerType(), clang::IdentifierInfo::isStr(), clang::Expr::isTypeDependent(), clang::Expr::isValueDependent(), maybeConstEvalStringLiteral(), clang::Expr::NPC_ValueDependentIsNotNull, clang::Result, clang::Expr::SE_NoSideEffects, clang::Decl::specific_attrs(), sumOffsets(), clang::T, and clang::Expr::EvalResult::Val.
Referenced by checkFormatStringExpr().
|
static |
Definition at line 16880 of file SemaChecking.cpp.
References clang::Call, clang::Sema::Context, clang::SemaBase::Diag(), clang::DeclRefExpr::getDecl(), clang::Expr::getExprLoc(), clang::Decl::getLocation(), clang::ValueDecl::getType(), clang::Expr::IgnoreParenImpCasts(), and clang::Type::isReferenceType().
Referenced by clang::Sema::DiagnoseAlwaysNonNullPointer().
|
static |
Definition at line 2317 of file SemaChecking.cpp.
References clang::SemaBase::Diag(), clang::Type::getAs(), and clang::Type::isRealFloatingType().
|
static |
Definition at line 15887 of file SemaChecking.cpp.
References DiagnoseImpCast(), clang::CallExpr::getArg(), clang::CallExpr::getNumArgs(), clang::Expr::getType(), clang::Expr::IgnoreParenImpCasts(), and IsImplicitBoolFloatConversion().
Referenced by AnalyzeImplicitConversions().
|
static |
Definition at line 16127 of file SemaChecking.cpp.
References adornObjCBoolConversionDiagWithTernaryFixit(), clang::ASTContext::areCompatibleRVVTypes(), clang::ASTContext::areCompatibleSveTypes(), clang::ASTContext::areLaxCompatibleRVVTypes(), clang::ASTContext::areLaxCompatibleSveTypes(), clang::Type::canDecayToPointerType(), clang::Type::castAs(), checkObjCArrayLiteral(), checkObjCDictionaryLiteral(), clang::Sema::Context, clang::SemaBase::Diag(), clang::Sema::DiagnoseAlwaysNonNullPointer(), DiagnoseFloatingImpCast(), DiagnoseImpCast(), DiagnoseIntInBoolContext(), DiagnoseNullConversion(), clang::Sema::DiagRuntimeBehavior(), clang::Sema::DiscardMisalignedMemberAddress(), clang::Expr::EvaluateAsFixedPoint(), clang::Expr::EvaluateAsInt(), clang::Expr::EvaluateAsRValue(), clang::CallExpr::getArg(), clang::Type::getAs(), clang::Sema::getASTContext(), clang::ASTContext::getCanonicalType(), clang::Expr::getEnumCoercedType(), clang::Expr::getExprLoc(), GetExprRange(), clang::ASTContext::getFixedPointMax(), clang::ASTContext::getFixedPointMin(), clang::ASTContext::getFixedPointSemantics(), clang::ASTContext::getFloatingTypeSemanticOrder(), clang::ASTContext::getFloatTypeSemantics(), clang::Expr::getIntegerConstantExpr(), clang::ASTContext::getIntWidth(), clang::Sema::getLangOpts(), clang::CallExpr::getNumArgs(), clang::VectorType::getNumElements(), clang::Stmt::getSourceRange(), clang::Type::getSveEltType(), clang::Expr::getType(), clang::CanQual< T >::getTypePtr(), clang::QualType::getTypePtr(), clang::ASTContext::getTypeSize(), clang::Expr::IgnoreParenImpCasts(), clang::Type::isAtomicType(), clang::Type::isBooleanType(), clang::Type::isCharType(), clang::Sema::isConstantEvaluatedContext(), clang::Type::isFixedPointType(), clang::BuiltinType::isFloatingPoint(), clang::Type::isFloatingType(), clang::SourceManager::isInSystemMacro(), clang::BuiltinType::isInteger(), clang::Type::isIntegerType(), clang::Type::isIntegralType(), clang::SourceLocation::isInvalid(), clang::Expr::isKnownToHaveBooleanValue(), isObjCSignedCharBool(), clang::Type::isPointerType(), IsSameFloatAfterCast(), isSameWidthConstantConversion(), clang::BuiltinType::isSignedInteger(), clang::Type::isSignedIntegerType(), clang::Type::isSveVLSBuiltinType(), clang::Expr::isTypeDependent(), clang::Type::isUnsignedIntegerType(), clang::Expr::isValueDependent(), clang::Expr::NPCK_NotNull, clang::Sema::PDiag(), PrettyPrintInRange(), clang::Result, clang::Expr::SE_AllowSideEffects, clang::Sema::SourceMgr, clang::T, toString(), and clang::Expr::EvalResult::Val.
Referenced by AnalyzeImplicitConversions(), CheckBoolLikeConversion(), CheckConditionalOperand(), CheckConditionalOperator(), and checkOpenCLEnqueueIntType().
|
static |
Definition at line 5760 of file SemaChecking.cpp.
References clang::Type::castAs(), clang::Sema::Context, clang::SemaBase::Diag(), clang::ASTContext::BuiltinVectorTypeInfo::EC, clang::ASTContext::BuiltinVectorTypeInfo::ElementType, clang::CallExpr::getBeginLoc(), clang::ASTContext::getBuiltinVectorTypeInfo(), clang::ASTContext::getTypeSize(), and clang::TargetInfo::hasFeature().
|
static |
Definition at line 2306 of file SemaChecking.cpp.
References clang::SemaBase::Diag(), clang::Type::getAs(), and clang::MatrixType::isValidElementType().
Referenced by clang::Sema::BuiltinVectorMath().
Diagnose cases like 'memset(buf, sizeof(buf), 0)', which should have the last two arguments transposed.
Definition at line 13840 of file SemaChecking.cpp.
References clang::Call, clang::SemaBase::Diag(), doesExprLikelyComputeSize(), clang::Expr::getExprLoc(), clang::Lexer::getImmediateMacroName(), clang::Sema::getLangOpts(), clang::Sema::getSourceManager(), isArgumentExpandedFromMacro(), clang::SourceLocation::isMacroID(), and SM.
|
static |
Takes the expression passed to the size_t parameter of functions such as memcmp, strncat, etc and warns if it's a comparison.
This is to catch typos like if (memcmp(&a, &b, sizeof(a) > 0))
.
Definition at line 13629 of file SemaChecking.cpp.
References clang::FixItHint::CreateInsertion(), clang::FixItHint::CreateRemoval(), clang::SemaBase::Diag(), clang::SourceRange::getBegin(), clang::SourceRange::getEnd(), and clang::Sema::getLocForEndOfToken().
Definition at line 5544 of file SemaChecking.cpp.
References CheckArgsTypesAreCorrect(), clang::Sema::Context, and clang::ASTContext::FloatTy.
Referenced by clang::Sema::CheckHLSLBuiltinFunctionCall().
|
static |
Definition at line 7653 of file SemaChecking.cpp.
References CheckNonNullExpr(), clang::Sema::DiagRuntimeBehavior(), clang::Stmt::getSourceRange(), and clang::Sema::PDiag().
Referenced by clang::Sema::BuildAtomicExpr(), and CheckNonNullArguments().
|
static |
Definition at line 7722 of file SemaChecking.cpp.
References CheckNonNullArgument(), clang::FunctionProtoType::getParamTypes(), clang::ValueDecl::getType(), clang::Expr::getType(), clang::Decl::hasAttr(), clang::Sema::isConstantEvaluatedContext(), isNonNullType(), clang::Sema::isValidPointerAttrType(), clang::NonNull, clang::FunctionDecl::parameters(), clang::ast_matchers::pointerType, clang::Decl::specific_attrs(), and clang::ast_matchers::type.
Checks if a the given expression evaluates to null.
Returns true if the value evaluates to null.
Definition at line 7623 of file SemaChecking.cpp.
References clang::Sema::Context, clang::Expr::EvaluateAsBooleanCondition(), clang::Type::getAsUnionType(), clang::RecordType::getDecl(), clang::Type::getNullability(), clang::Expr::getType(), clang::Decl::hasAttr(), clang::IgnoreElidableImplicitConstructorSingleStep(), clang::IgnoreExprNodes(), clang::Expr::IgnoreImplicit(), clang::IgnoreImplicitAsWrittenSingleStep(), clang::Expr::isValueDependent(), clang::NonNull, and clang::Result.
Referenced by CheckNonNullArgument().
|
static |
Check an Objective-C array literal being converted to the given target type.
Definition at line 15996 of file SemaChecking.cpp.
References checkObjCCollectionLiteralElement(), clang::Type::getAs(), clang::ObjCInterfaceDecl::getCanonicalDecl(), clang::ObjCArrayLiteral::getElement(), clang::ObjCArrayLiteral::getNumElements(), clang::ObjCObjectPointerType::getTypeArgs(), and clang::Sema::NSArrayDecl.
Referenced by CheckImplicitConversion(), and checkObjCCollectionLiteralElement().
|
static |
Check a single element within a collection literal against the target element type.
Definition at line 15965 of file SemaChecking.cpp.
References checkObjCArrayLiteral(), checkObjCDictionaryLiteral(), clang::Sema::CheckSingleAssignmentConstraints(), clang::Sema::Compatible, clang::SemaBase::Diag(), and clang::Type::getAs().
Referenced by checkObjCArrayLiteral(), and checkObjCDictionaryLiteral().
|
static |
Check an Objective-C dictionary literal being converted to the given target type.
Definition at line 16025 of file SemaChecking.cpp.
References checkObjCCollectionLiteralElement(), clang::Type::getAs(), clang::ObjCInterfaceDecl::getCanonicalDecl(), clang::ObjCDictionaryLiteral::getKeyValueElement(), clang::ObjCDictionaryLiteral::getNumElements(), clang::ObjCObjectPointerType::getTypeArgs(), and clang::Sema::NSDictionaryDecl.
Referenced by CheckImplicitConversion(), and checkObjCCollectionLiteralElement().
OpenCL C v2.0, s6.13.17.2 - Checks that the block parameters are all local void*, which is a requirement of device side enqueue.
Definition at line 1457 of file SemaChecking.cpp.
References clang::Type::castAs(), clang::SemaBase::Diag(), clang::DeclaratorDecl::getBeginLoc(), clang::QualType::getCanonicalType(), clang::BlockDecl::getParamDecl(), clang::BlockPointerType::getPointeeType(), clang::Expr::getType(), and clang::opencl_local.
Referenced by OpenCLBuiltinEnqueueKernel(), OpenCLBuiltinKernelWorkGroupSize(), and OpenCLBuiltinNDRangeAndBlock().
Diagnose integer type and any valid implicit conversion to it.
Definition at line 16864 of file SemaChecking.cpp.
References CheckImplicitConversion(), clang::SemaBase::Diag(), clang::Stmt::getBeginLoc(), clang::Expr::getType(), and clang::Type::isIntegerType().
Referenced by checkOpenCLEnqueueLocalSizeArgs().
|
static |
Definition at line 1549 of file SemaChecking.cpp.
References checkOpenCLEnqueueIntType(), clang::Sema::Context, clang::CallExpr::getArg(), and clang::ASTContext::getSizeType().
Referenced by checkOpenCLEnqueueVariadicArgs().
|
static |
OpenCL v2.0, s6.13.17.1 - Check that sizes are provided for all 'local void*' parameter of passed block.
Definition at line 1560 of file SemaChecking.cpp.
References clang::Type::castAs(), checkOpenCLEnqueueLocalSizeArgs(), clang::SemaBase::Diag(), clang::CallExpr::getBeginLoc(), clang::QualType::getCanonicalType(), clang::CallExpr::getNumArgs(), clang::BlockPointerType::getPointeeType(), and clang::Expr::getType().
Referenced by OpenCLBuiltinEnqueueKernel().
Returns true if pipe element type is different from the pointer.
Definition at line 1734 of file SemaChecking.cpp.
References clang::Call, clang::SemaBase::Diag(), clang::Stmt::getBeginLoc(), getOpenCLArgAccess(), clang::Stmt::getSourceRange(), clang::Expr::getType(), and clang::Type::isPipeType().
Referenced by BuiltinCommitRWPipe(), BuiltinReserveRWPipe(), and BuiltinRWPipe().
Returns true if pipe element type is different from the pointer.
Definition at line 1784 of file SemaChecking.cpp.
References clang::Call, clang::Sema::Context, clang::SemaBase::Diag(), clang::Type::getAs(), clang::Type::getCanonicalTypeInternal(), clang::PipeType::getElementType(), clang::PointerType::getPointeeType(), clang::ASTContext::getPointerType(), clang::Stmt::getSourceRange(), clang::Expr::getType(), and clang::ASTContext::hasSameType().
Referenced by BuiltinRWPipe().
Definition at line 1490 of file SemaChecking.cpp.
References clang::Call, clang::SemaBase::Diag(), clang::Sema::getLangOpts(), clang::Sema::getOpenCLOptions(), and clang::OpenCLOptions::isSupported().
Referenced by OpenCLBuiltinNDRangeAndBlock().
Definition at line 1985 of file SemaChecking.cpp.
References clang::SemaBase::Diag(), clang::Expr::getExprLoc(), clang::Sema::getLangOpts(), and clang::Stmt::getSourceRange().
Referenced by PointerAuthAuthAndResign(), PointerAuthBlendDiscriminator(), PointerAuthSignGenericData(), PointerAuthSignOrAuth(), and PointerAuthStrip().
Definition at line 1993 of file SemaChecking.cpp.
References clang::Sema::checkConstantPointerAuthKey(), clang::Sema::Context, convertArgumentToType(), clang::ASTContext::IntTy, and clang::Expr::isValueDependent().
Referenced by PointerAuthAuthAndResign(), PointerAuthSignOrAuth(), and PointerAuthStrip().
Definition at line 2032 of file SemaChecking.cpp.
References clang::Sema::CheckPlaceholderExpr(), clang::Sema::Context, convertArgumentToType(), clang::SemaBase::Diag(), clang::ActionResult< PtrTy, Compress >::get(), clang::Expr::getExprLoc(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::ASTContext::getUIntPtrType(), clang::QualType::getUnqualifiedType(), clang::Expr::hasPlaceholderType(), clang::Type::isIntegralOrUnscopedEnumerationType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Expr::isNullPointerConstant(), clang::Type::isNullPtrType(), clang::Type::isPointerType(), clang::Expr::NPC_ValueDependentIsNull, and clang::ASTContext::VoidPtrTy.
Referenced by PointerAuthAuthAndResign(), PointerAuthBlendDiscriminator(), PointerAuthSignGenericData(), PointerAuthSignOrAuth(), and PointerAuthStrip().
|
static |
Definition at line 15222 of file SemaChecking.cpp.
References clang::ASTContext::CharTy, classifyConstantValue(), clang::Sema::Context, Diag(), clang::SemaBase::Diag(), clang::Sema::DiagRuntimeBehavior(), clang::Type::getAs(), GetExprRange(), clang::Sema::getLangOpts(), clang::BinaryOperator::getLHS(), clang::BinaryOperator::getOpcode(), clang::BinaryOperator::getOpcodeStr(), clang::BinaryOperator::getOperatorLoc(), clang::BinaryOperator::getRHS(), clang::Stmt::getSourceRange(), clang::Expr::getType(), HasEnumType(), clang::ASTContext::hasSameUnqualifiedType(), clang::Expr::IgnoreParenImpCasts(), clang::Sema::inTemplateInstantiation(), clang::Type::isBooleanType(), clang::Sema::isConstantEvaluatedContext(), IsEnumConstOrFromMacro(), clang::Type::isEnumeralType(), isKnownToHaveUnsignedValue(), clang::Type::isSpecificBuiltinType(), clang::Sema::NSAPIObj, clang::Other, clang::Sema::PDiag(), clang::Result, and clang::QualType::withoutLocalFastQualifiers().
Referenced by AnalyzeComparison().
|
static |
Definition at line 19229 of file SemaChecking.cpp.
References clang::Sema::CheckLiteralKind(), clang::SemaBase::Diag(), clang::Stmt::getSourceRange(), clang::Expr::IgnoreParenImpCasts(), clang::Sema::LK_None, and clang::Sema::LK_String.
Referenced by checkUnsafeAssignObject().
|
static |
Definition at line 19250 of file SemaChecking.cpp.
References clang::cast(), checkUnsafeAssignLiteral(), clang::SemaBase::Diag(), clang::Stmt::getSourceRange(), LT, clang::Qualifiers::OCL_ExplicitNone, and clang::Qualifiers::OCL_Weak.
Referenced by clang::Sema::checkUnsafeAssigns(), and clang::Sema::checkUnsafeExprAssigns().
Definition at line 5554 of file SemaChecking.cpp.
References CheckArgsTypesAreCorrect(), clang::Sema::Context, and clang::ASTContext::UnsignedIntTy.
Referenced by clang::Sema::CheckHLSLBuiltinFunctionCall().
Check that the user is calling the appropriate va_start builtin for the target and calling convention.
Definition at line 9409 of file SemaChecking.cpp.
References clang::Type::castAs(), clang::CC_C, clang::CC_Win64, clang::CC_X86_64SysV, clang::Sema::Context, clang::SemaBase::Diag(), clang::Stmt::getBeginLoc(), clang::Sema::getCurFunctionDecl(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTriple(), and clang::ValueDecl::getType().
|
static |
Definition at line 9444 of file SemaChecking.cpp.
References clang::Block, clang::Sema::CurContext, clang::SemaBase::Diag(), clang::Stmt::getBeginLoc(), clang::FunctionDecl::isVariadic(), and clang::FunctionDecl::parameters().
Definition at line 5456 of file SemaChecking.cpp.
References clang::SemaBase::Diag(), clang::ActionResult< PtrTy, Compress >::get(), clang::CallExpr::getArg(), clang::Type::getAs(), clang::CallExpr::getBeginLoc(), clang::Stmt::getBeginLoc(), clang::CallExpr::getDirectCallee(), clang::Stmt::getEndLoc(), clang::CallExpr::getNumArgs(), and clang::Expr::getType().
Referenced by clang::Sema::CheckHLSLBuiltinFunctionCall().
Checks the argument at the given index is an integer.
Definition at line 20597 of file SemaChecking.cpp.
References clang::SemaBase::Diag(), clang::CallExpr::getArg(), clang::Stmt::getBeginLoc(), clang::Stmt::getSourceRange(), clang::Expr::getType(), and clang::Type::isIntegerType().
|
static |
Checks the argument at the given index is a WebAssembly table and if it is, sets ElTy to the element type.
Definition at line 20583 of file SemaChecking.cpp.
References clang::SemaBase::Diag(), clang::CallExpr::getArg(), clang::Stmt::getBeginLoc(), clang::Stmt::getSourceRange(), and clang::Expr::getType().
Definition at line 15208 of file SemaChecking.cpp.
Referenced by CheckTautologicalComparison().
|
staticconstexpr |
Definition at line 114 of file SemaChecking.cpp.
Referenced by checkFormatStringExpr().
Consider whether capturing the given variable can possibly lead to a retain cycle.
Definition at line 18792 of file SemaChecking.cpp.
References clang::QualType::getObjCLifetime(), clang::ValueDecl::getType(), and clang::Qualifiers::OCL_Strong.
Referenced by clang::Sema::checkRetainCycles(), and findRetainCycleOwner().
Definition at line 175 of file SemaChecking.cpp.
References clang::Sema::Context, clang::InitializedEntity::InitializeParameter(), clang::Sema::PerformCopyInitialization(), and clang::Result.
Referenced by checkPointerAuthKey(), and checkPointerAuthValue().
|
static |
Definition at line 12096 of file SemaChecking.cpp.
References clang::LookupResult::begin(), clang::Sema::Context, clang::ast_matchers::decl, clang::LookupResult::end(), clang::IdentifierTable::get(), clang::Type::getAs(), clang::RecordType::getDecl(), clang::CXXRecordDecl::getDefinition(), clang::ASTContext::Idents, clang::Sema::LookupMemberName, clang::Sema::LookupQualifiedName(), and clang::LookupResult::suppressDiagnostics().
|
static |
DecodePPCMMATypeFromStr - This decodes one PPC MMA type descriptor from Str, advancing the pointer over the consumed characters.
The decoded type is returned. If the decoded type represents a constant integer with a constraint on its value then Mask is set to that value. The type descriptors used in Str are specific to PPC MMA builtins and are documented in the file defining the PPC builtins.
Definition at line 5169 of file SemaChecking.cpp.
References clang::AltiVecVector, clang::ASTContext::DecodeTypeStr(), clang::ASTContext::GE_None, clang::ASTContext::getPointerType(), clang::ASTContext::getVectorType(), clang::ASTContext::IntTy, and clang::ASTContext::UnsignedCharTy.
|
static |
Definition at line 18099 of file SemaChecking.cpp.
References clang::Sema::Context, clang::SemaBase::Diag(), diagnoseArrayStarInParamType(), clang::ASTContext::getAsArrayType(), clang::ArrayType::getElementType(), clang::ArrayType::getSizeModifier(), clang::Type::isVariablyModifiedType(), and clang::Star.
Referenced by clang::Sema::CheckParmsForFunctionDef(), and diagnoseArrayStarInParamType().
|
static |
Diagnose use of s directive in an NSString which is being passed as formatting string to formatting method.
Definition at line 7675 of file SemaChecking.cpp.
References clang::SemaBase::Diag(), clang::Sema::FormatStringHasSArg(), clang::NamedDecl::getDeclName(), clang::Expr::getExprLoc(), clang::Sema::GetFormatNSStringIdx(), clang::Decl::getLocation(), clang::NamedDecl::getObjCFStringFormattingFamily(), clang::StringLiteral::getString(), clang::Expr::IgnoreParenImpCasts(), clang::SFF_CFString, and clang::Decl::specific_attrs().
Referenced by clang::Sema::CheckFunctionCall().
|
static |
Diagnose an implicit cast from a floating point value to an integer value.
Definition at line 15705 of file SemaChecking.cpp.
References adornObjCBoolConversionDiagWithTernaryFixit(), clang::Sema::Context, clang::SemaBase::Diag(), DiagnoseImpCast(), clang::Sema::DiagRuntimeBehavior(), clang::Expr::EvaluateAsFloat(), clang::Expr::getExprLoc(), clang::ASTContext::getIntWidth(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::Type::hasUnsignedIntegerRepresentation(), clang::Expr::IgnoreParenImpCasts(), clang::Sema::inTemplateInstantiation(), isObjCSignedCharBool(), clang::Type::isSpecificBuiltinType(), clang::Sema::PDiag(), clang::Result, clang::Expr::SE_AllowSideEffects, and clang::T.
Referenced by CheckImplicitConversion().
|
static |
Diagnose an implicit cast; purely a helper for CheckImplicitConversion.
Definition at line 15663 of file SemaChecking.cpp.
References clang::SemaBase::Diag(), clang::Sema::DiagRuntimeBehavior(), clang::Expr::getExprLoc(), clang::Stmt::getSourceRange(), clang::Sema::PDiag(), and clang::T.
Referenced by AnalyzeCompoundAssignment(), CheckImplicitArgumentConversions(), CheckImplicitConversion(), DiagnoseFloatingImpCast(), and DiagnoseImpCast().
|
static |
Diagnose an implicit cast; purely a helper for CheckImplicitConversion.
Definition at line 15678 of file SemaChecking.cpp.
References DiagnoseImpCast(), clang::Expr::getType(), and clang::T.
Definition at line 16090 of file SemaChecking.cpp.
References clang::Sema::Context, clang::SemaBase::Diag(), clang::Expr::EvaluateAsInt(), clang::Expr::getExprLoc(), getIntegerLiteral(), clang::Expr::getType(), clang::Expr::IgnoreParenImpCasts(), clang::Type::isSignedIntegerType(), clang::Expr::isValueDependent(), clang::Result, and clang::Expr::SE_AllowSideEffects.
Referenced by CheckConditionalOperator(), and CheckImplicitConversion().
|
static |
Definition at line 15908 of file SemaChecking.cpp.
References clang::FixItHint::CreateReplacement(), clang::SemaBase::Diag(), clang::Sema::Diags, clang::SourceRange::getBegin(), clang::CharSourceRange::getBegin(), clang::Expr::getExprLoc(), clang::SourceManager::getFileID(), clang::Sema::getFixItZeroLiteralForType(), clang::SourceManager::getImmediateExpansionRange(), clang::Lexer::getImmediateMacroNameForDiagnostics(), clang::Sema::getLangOpts(), clang::Stmt::getSourceRange(), clang::SourceManager::getTopMacroCallerLoc(), clang::Expr::getType(), clang::Expr::IgnoreParenImpCasts(), clang::Type::isAnyPointerType(), clang::Type::isBlockPointerType(), clang::DiagnosticsEngine::isIgnored(), clang::SourceLocation::isMacroID(), clang::Type::isMemberPointerType(), clang::Type::isNullPtrType(), clang::Type::isScalarType(), clang::Sema::SourceMgr, and clang::T.
Referenced by CheckImplicitConversion().
Definition at line 18976 of file SemaChecking.cpp.
References clang::SemaBase::Diag(), clang::Expr::getExprLoc(), and clang::Stmt::getSourceRange().
Referenced by clang::Sema::checkRetainCycles().
Detect if SizeofExpr
is likely to calculate the sizeof an object.
Definition at line 13804 of file SemaChecking.cpp.
References doesExprLikelyComputeSize(), getAsSizeOfExpr(), and clang::Expr::IgnoreParenImpCasts().
Referenced by CheckMemaccessSize(), and doesExprLikelyComputeSize().
|
static |
Definition at line 13369 of file SemaChecking.cpp.
References clang::ASTContext::BuiltinInfo, clang::Sema::Context, clang::FixItHint::CreateReplacement(), clang::SemaBase::Diag(), clang::LookupResult::empty(), clang::IdentifierTable::get(), getAbsoluteValueKind(), clang::FunctionDecl::getBuiltinID(), clang::Sema::getCurScope(), clang::LookupResult::getFoundDecl(), clang::Builtin::Context::getHeaderName(), clang::Sema::getLangOpts(), clang::Builtin::Context::getName(), clang::FunctionDecl::getNumParams(), clang::FunctionDecl::getParamDecl(), clang::Sema::getStdNamespace(), clang::ValueDecl::getType(), clang::ASTContext::getTypeSize(), clang::ASTContext::Idents, clang::Type::isAnyComplexType(), clang::Type::isIntegralOrEnumerationType(), clang::Type::isRealFloatingType(), clang::LookupResult::isSingleResult(), clang::Sema::LookupAnyName, clang::Sema::LookupName(), clang::Sema::LookupQualifiedName(), Std, and clang::LookupResult::suppressDiagnostics().
Referenced by clang::syntax::computeReplacements().
Check whether the given argument is a block which captures a variable.
Definition at line 18941 of file SemaChecking.cpp.
References clang::BlockDecl::capturesVariable(), Cmd, clang::Sema::Context, clang::CallExpr::getArg(), clang::BlockExpr::getBlockDecl(), clang::BlockDecl::getBody(), clang::CallExpr::getCalleeDecl(), clang::NamedDecl::getIdentifier(), clang::CallExpr::getNumArgs(), clang::Expr::IgnoreParenCasts(), and clang::IdentifierInfo::isStr().
Referenced by clang::Sema::checkRetainCycles().
Definition at line 18805 of file SemaChecking.cpp.
References clang::cast(), considerVariable(), findRetainCycleOwner(), clang::ObjCPropertyRefExpr::getBase(), clang::Sema::getCurMethodDecl(), clang::ObjCPropertyRefExpr::getExplicitProperty(), clang::ObjCPropertyRefExpr::getLocation(), clang::QualType::getObjCLifetime(), clang::ObjCMethodDecl::getSelfDecl(), clang::Stmt::getSourceRange(), clang::ValueDecl::getType(), clang::Expr::IgnoreParens(), clang::ObjCPropertyRefExpr::isImplicitProperty(), clang::ObjCPropertyRefExpr::isSuperReceiver(), and clang::Qualifiers::OCL_Strong.
Referenced by clang::Sema::checkRetainCycles(), and findRetainCycleOwner().
|
static |
Given a type tag expression find the type tag itself.
TypeExpr | Type tag expression, as it appears in user's code. |
VD | Declaration of an identifier that appears in a type tag. |
MagicValue | Type tag magic value. |
isConstantEvaluated | whether the evalaution should be performed in constant context. |
Definition at line 19775 of file SemaChecking.cpp.
References clang::Expr::EvaluateAsBooleanCondition(), clang::AbstractConditionalOperator::getCond(), clang::DeclRefExpr::getDecl(), clang::AbstractConditionalOperator::getFalseExpr(), clang::UnaryOperator::getOpcode(), clang::BinaryOperator::getOpcode(), clang::BinaryOperator::getRHS(), clang::Stmt::getStmtClass(), clang::UnaryOperator::getSubExpr(), clang::AbstractConditionalOperator::getTrueExpr(), clang::APIntStorage::getValue(), clang::Expr::IgnoreParenCasts(), clang::Expr::IgnoreParenImpCasts(), and clang::Result.
Referenced by GetMatchingCType().
|
static |
Definition at line 13212 of file SemaChecking.cpp.
References clang::ASTContext::GE_None, clang::Type::getAs(), clang::ASTContext::GetBuiltinType(), clang::FunctionProtoType::getNumParams(), and clang::FunctionProtoType::getParamType().
Referenced by getBestAbsFunction().
|
static |
Definition at line 13336 of file SemaChecking.cpp.
References clang::FunctionDecl::getBuiltinID(), and clang::NamedDecl::getIdentifier().
|
static |
Definition at line 13259 of file SemaChecking.cpp.
References AVK_Complex, AVK_Floating, AVK_Integer, clang::Type::isAnyComplexType(), clang::Type::isIntegralOrEnumerationType(), clang::Type::isRealFloatingType(), and clang::T.
Referenced by emitReplacement().
|
static |
Compute the alignment and offset of a binary additive operator.
Definition at line 18262 of file SemaChecking.cpp.
References getBaseAlignmentAndOffsetFromPtr(), clang::Expr::getIntegerConstantExpr(), clang::Type::getPointeeType(), clang::Expr::getType(), clang::ASTContext::getTypeSizeInChars(), clang::Type::isConstantSizeType(), P, and clang::CharUnits::Zero().
Referenced by getBaseAlignmentAndOffsetFromLValue(), and getBaseAlignmentAndOffsetFromPtr().
|
static |
Definition at line 3507 of file SemaChecking.cpp.
References ArmNonStreaming, ArmStreaming, ArmStreamingCompatible, clang::ValueDecl::getType(), clang::QualType::getTypePtrOrNull(), clang::Decl::hasAttr(), clang::FunctionType::SME_PStateSMCompatibleMask, and clang::FunctionType::SME_PStateSMEnabledMask.
Referenced by checkArmStreamingBuiltin().
|
static |
Definition at line 13688 of file SemaChecking.cpp.
Referenced by doesExprLikelyComputeSize(), getSizeOfArgType(), and getSizeOfExprArg().
|
static |
This helper function takes an lvalue expression and returns the alignment of a VarDecl and a constant offset from the VarDecl.
Definition at line 18294 of file SemaChecking.cpp.
References clang::CharUnits::fromQuantity(), getAlignmentAndOffsetFromBinAddOrSub(), clang::ASTContext::getASTRecordLayout(), clang::ArraySubscriptExpr::getBase(), getBaseAlignmentAndOffsetFromLValue(), getBaseAlignmentAndOffsetFromPtr(), clang::ASTContext::getDeclAlign(), getDerivedToBaseAlignmentAndOffset(), clang::ASTRecordLayout::getFieldOffset(), clang::ArraySubscriptExpr::getIdx(), clang::UnaryOperator::getOpcode(), clang::BinaryOperator::getOpcode(), clang::DeclContext::getParent(), clang::BinaryOperator::getRHS(), clang::Stmt::getStmtClass(), clang::UnaryOperator::getSubExpr(), clang::ValueDecl::getType(), clang::Expr::getType(), clang::Expr::IgnoreParens(), clang::Type::isReferenceType(), P, and clang::CharUnits::Zero().
Referenced by getBaseAlignmentAndOffsetFromLValue(), and getBaseAlignmentAndOffsetFromPtr().
|
static |
This helper function takes a pointer expression and returns the alignment of a VarDecl and a constant offset from the VarDecl.
Definition at line 18387 of file SemaChecking.cpp.
References getAlignmentAndOffsetFromBinAddOrSub(), clang::Type::getAsCXXRecordDecl(), clang::ASTContext::getASTRecordLayout(), getBaseAlignmentAndOffsetFromLValue(), getBaseAlignmentAndOffsetFromPtr(), getDerivedToBaseAlignmentAndOffset(), clang::BinaryOperator::getLHS(), clang::ASTRecordLayout::getNonVirtualAlignment(), clang::UnaryOperator::getOpcode(), clang::BinaryOperator::getOpcode(), clang::Type::getPointeeType(), clang::BinaryOperator::getRHS(), clang::Stmt::getStmtClass(), clang::UnaryOperator::getSubExpr(), clang::Expr::getType(), clang::Expr::IgnoreParens(), P, and clang::CharUnits::Zero().
Referenced by getAlignmentAndOffsetFromBinAddOrSub(), getBaseAlignmentAndOffsetFromLValue(), getBaseAlignmentAndOffsetFromPtr(), and getPresumedAlignmentOfPointer().
|
static |
Definition at line 13234 of file SemaChecking.cpp.
References getAbsoluteValueArgumentType(), getLargerAbsoluteValueFunction(), clang::ASTContext::getTypeSize(), and clang::ASTContext::hasSameType().
|
static |
Determine whether the given type is or contains a dynamic class type (e.g., whether it has a vtable).
Definition at line 13659 of file SemaChecking.cpp.
References clang::RecordDecl::fields(), clang::Type::getAsCXXRecordDecl(), clang::Type::getBaseElementTypeUnsafe(), getContainedDynamicClass(), clang::CXXRecordDecl::getDefinition(), clang::ValueDecl::getType(), clang::CXXRecordDecl::isDynamicClass(), clang::Decl::isInvalidDecl(), and clang::T.
Referenced by getContainedDynamicClass().
|
static |
Compute the alignment and offset of the base class object given the derived-to-base cast expression and the alignment and offset of the derived class object.
Definition at line 18233 of file SemaChecking.cpp.
References clang::Type::getAsCXXRecordDecl(), clang::ASTContext::getASTRecordLayout(), clang::ASTRecordLayout::getBaseClassOffset(), clang::ASTRecordLayout::getNonVirtualAlignment(), clang::CastExpr::path_begin(), clang::CastExpr::path_end(), and clang::CharUnits::Zero().
Referenced by getBaseAlignmentAndOffsetFromLValue(), and getBaseAlignmentAndOffsetFromPtr().
|
static |
Definition at line 14997 of file SemaChecking.cpp.
References clang::C, GetExprRange(), and GetExprType().
|
static |
Pseudo-evaluate the given integer expression, estimating the range of values it might take.
MaxWidth | The width to which the value will be truncated. |
Approximate | If true , return a likely range for the result: in particular, assume that arithmetic on narrower types doesn't leave those types. If false , return a range including all possible result values. |
Definition at line 14749 of file SemaChecking.cpp.
References clang::C, clang::Expr::EvaluateAsRValue(), GetExprRange(), GetExprType(), clang::Expr::getSourceBitField(), clang::Expr::getType(), GetValueRange(), clang::Expr::IgnoreParens(), clang::Type::isUnsignedIntegerOrEnumerationType(), clang::Type::isVoidType(), log2, clang::T, and clang::Expr::EvalResult::Val.
Referenced by AnalyzeComparison(), CheckImplicitConversion(), CheckTautologicalComparison(), and GetExprRange().
Definition at line 14734 of file SemaChecking.cpp.
References clang::Type::getAs(), and clang::Expr::getType().
Referenced by GetExprRange().
|
static |
Definition at line 16078 of file SemaChecking.cpp.
Referenced by DiagnoseIntInBoolContext().
Definition at line 13162 of file SemaChecking.cpp.
Referenced by getBestAbsFunction().
|
static |
Retrieve the C type corresponding to type tag TypeExpr.
TypeExpr | Expression that specifies a type tag. |
MagicValues | Registered magic values. |
FoundWrongKind | Set to true if a type tag was found, but of a wrong kind. |
TypeInfo | Information about the corresponding C type. |
isConstantEvaluated | whether the evalaution should be performed in constant context. |
Definition at line 19856 of file SemaChecking.cpp.
References FindTypeTagExpr(), and clang::Decl::getAttr().
|
static |
getNeonEltType - Return the QualType corresponding to the elements of the vector type specified by the NeonTypeFlags.
This is used to check the pointer arguments for Neon load/store intrinsics.
Definition at line 3310 of file SemaChecking.cpp.
References clang::NeonTypeFlags::BFloat16, clang::ASTContext::BFloat16Ty, clang::ASTContext::DoubleTy, clang::NeonTypeFlags::Float16, clang::NeonTypeFlags::Float32, clang::NeonTypeFlags::Float64, clang::ASTContext::FloatTy, clang::NeonTypeFlags::getEltType(), clang::ASTContext::HalfTy, clang::NeonTypeFlags::Int16, clang::NeonTypeFlags::Int32, clang::NeonTypeFlags::Int64, clang::NeonTypeFlags::Int8, clang::ASTContext::IntTy, clang::NeonTypeFlags::isUnsigned(), clang::ASTContext::LongLongTy, clang::ASTContext::LongTy, clang::NeonTypeFlags::Poly128, clang::NeonTypeFlags::Poly16, clang::NeonTypeFlags::Poly64, clang::NeonTypeFlags::Poly8, clang::ASTContext::ShortTy, clang::ASTContext::SignedCharTy, clang::ASTContext::UnsignedCharTy, clang::ASTContext::UnsignedIntTy, clang::ASTContext::UnsignedLongLongTy, clang::ASTContext::UnsignedLongTy, and clang::ASTContext::UnsignedShortTy.
|
static |
Definition at line 19009 of file SemaChecking.cpp.
References clang::NSAPI::ClassId_NSMutableArray, clang::Sema::NSAPIObj, clang::NSAPI::NSMutableArr_addObject, clang::NSAPI::NSMutableArr_insertObjectAtIndex, clang::NSAPI::NSMutableArr_replaceObjectAtIndex, and clang::NSAPI::NSMutableArr_setObjectAtIndexedSubscript.
|
static |
|
static |
Definition at line 19074 of file SemaChecking.cpp.
References clang::NSAPI::ClassId_NSMutableOrderedSet, clang::NSAPI::ClassId_NSMutableSet, clang::Sema::NSAPIObj, clang::NSAPI::NSMutableSet_addObject, clang::NSAPI::NSOrderedSet_insertObjectAtIndex, clang::NSAPI::NSOrderedSet_replaceObjectAtIndexWithObject, clang::NSAPI::NSOrderedSet_setObjectAtIndex, and clang::NSAPI::NSOrderedSet_setObjectAtIndexedSubscript.
|
static |
Returns OpenCL access qual.
Definition at line 1729 of file SemaChecking.cpp.
References clang::Decl::getAttr().
Referenced by checkOpenCLPipeArg().
Definition at line 18452 of file SemaChecking.cpp.
References clang::Sema::Context, getBaseAlignmentAndOffsetFromPtr(), clang::Type::getPointeeType(), clang::Expr::getType(), clang::ASTContext::getTypeAlignInChars(), and P.
Referenced by clang::Sema::CheckCastAlign().
If E is a sizeof expression, returns its argument type.
Definition at line 13705 of file SemaChecking.cpp.
References getAsSizeOfExpr(), and SizeOf.
If E is a sizeof expression, returns its argument expression, otherwise returns NULL.
Definition at line 13697 of file SemaChecking.cpp.
References getAsSizeOfExpr(), and SizeOf.
|
static |
Definition at line 3569 of file SemaChecking.cpp.
References ArmNoState.
Definition at line 14199 of file SemaChecking.cpp.
References clang::FunctionDecl::getMemoryFunctionKind().
|
static |
Definition at line 14705 of file SemaChecking.cpp.
References clang::C, clang::APValue::getComplexIntImag(), clang::APValue::getComplexIntReal(), clang::APValue::getInt(), GetValueRange(), clang::APValue::getVectorElt(), clang::APValue::getVectorLength(), clang::APValue::isAddrLabelDiff(), clang::APValue::isComplexInt(), clang::APValue::isInt(), clang::APValue::isLValue(), clang::Type::isUnsignedIntegerOrEnumerationType(), and clang::APValue::isVector().
|
static |
Definition at line 14692 of file SemaChecking.cpp.
Referenced by GetExprRange(), and GetValueRange().
|
static |
Definition at line 12494 of file SemaChecking.cpp.
References clang::DiagnosticsEngine::isIgnored(), clang::analyze_format_string::ArgType::Match, clang::analyze_format_string::ArgType::NoMatch, and clang::analyze_format_string::ArgType::NoMatchSignedness.
|
static |
Definition at line 3555 of file SemaChecking.cpp.
References clang::FunctionType::ARM_None, clang::FunctionProtoType::getAArch64SMEAttributes(), clang::FunctionType::getArmZAState(), clang::Type::getAs(), clang::Decl::getAttr(), clang::ValueDecl::getType(), clang::Decl::hasAttr(), and clang::T.
|
static |
Definition at line 3562 of file SemaChecking.cpp.
References clang::FunctionType::ARM_None, clang::FunctionProtoType::getAArch64SMEAttributes(), clang::FunctionType::getArmZT0State(), clang::Type::getAs(), clang::Decl::getAttr(), clang::ValueDecl::getType(), clang::Decl::hasAttr(), and clang::T.
Definition at line 15196 of file SemaChecking.cpp.
References clang::Expr::getType(), and clang::Type::isEnumeralType().
Referenced by CheckTautologicalComparison().
|
static |
Definition at line 14087 of file SemaChecking.cpp.
References clang::BinaryOperator::getLHS(), clang::BinaryOperator::getRHS(), clang::Expr::IgnoreParenCasts(), and clang::BinaryOperator::isAdditiveOp().
|
static |
Check if the ArgLoc originated from a macro passed to the call at CallLoc.
This should return true for the first call to foo, but not for the second (regardless of whether foo is a macro or function).
Definition at line 13828 of file SemaChecking.cpp.
References clang::SourceLocation::isMacroID(), and SM.
Referenced by CheckMemaccessSize().
|
static |
Return true if ICE
is an implicit argument promotion of an arithmetic type.
Bit-field 'promotions' from a higher ranked type to a lower ranked type do not count.
Definition at line 12473 of file SemaChecking.cpp.
References clang::Sema::Context, clang::Type::getAs(), clang::CastExpr::getCastKind(), clang::ASTContext::getFloatingTypeOrder(), clang::ASTContext::getPromotedIntegerType(), clang::CastExpr::getSubExpr(), clang::Expr::getType(), and clang::ASTContext::isPromotableIntegerType().
Definition at line 1451 of file SemaChecking.cpp.
References clang::Expr::getType(), and clang::Type::isBlockPointerType().
Referenced by computeCopyInfoForBlockCapture(), inferARCWriteback(), OpenCLBuiltinEnqueueKernel(), OpenCLBuiltinKernelWorkGroupSize(), and OpenCLBuiltinNDRangeAndBlock().
|
static |
Definition at line 14109 of file SemaChecking.cpp.
References clang::ASTContext::getAsConstantArrayType(), and clang::Type::isVariableArrayType().
Definition at line 15044 of file SemaChecking.cpp.
References clang::Stmt::getBeginLoc(), clang::Lexer::getImmediateMacroName(), clang::Sema::getLangOpts(), clang::Sema::getSourceManager(), clang::Expr::IgnoreParenImpCasts(), and clang::SourceLocation::isMacroID().
Referenced by CheckTautologicalComparison().
Definition at line 15868 of file SemaChecking.cpp.
References clang::Sema::Context, clang::ASTContext::getCanonicalType(), clang::Expr::getType(), clang::CanQual< T >::getTypePtr(), clang::Expr::IgnoreParenImpCasts(), clang::BuiltinType::isFloatingPoint(), clang::Type::isSpecificBuiltinType(), and clang::Target.
Referenced by CheckImplicitArgumentConversions().
|
static |
Definition at line 16913 of file SemaChecking.cpp.
References clang::SourceLocation::isInvalid(), clang::SourceLocation::isMacroID(), and SM.
Referenced by clang::Sema::DiagnoseAlwaysNonNullPointer().
Definition at line 15065 of file SemaChecking.cpp.
References clang::Expr::getType(), clang::Expr::IgnoreParenImpCasts(), clang::Type::isIntegerType(), and clang::Type::isSignedIntegerType().
Referenced by CheckTautologicalComparison().
|
static |
Check if two enumeration types are layout-compatible.
Definition at line 19564 of file SemaChecking.cpp.
References clang::C, clang::EnumDecl::getIntegerType(), and clang::EnumDecl::isComplete().
|
static |
Check if two fields are layout-compatible.
Can be used on union members, which are exempt from alignment requirement of common initial sequence.
Definition at line 19575 of file SemaChecking.cpp.
References clang::C, clang::FieldDecl::getBitWidthValue(), clang::Decl::getMaxAlignment(), clang::FieldDecl::getParent(), clang::ValueDecl::getType(), clang::TypeDecl::getTypeForDecl(), clang::Decl::hasAttr(), clang::FieldDecl::isBitField(), isLayoutCompatible(), clang::Type::isStructureOrClassType(), and clang::Type::isUnionType().
|
static |
Check if two types are layout-compatible in C++11 sense.
Definition at line 19701 of file SemaChecking.cpp.
References clang::C, clang::QualType::getCanonicalType(), clang::Type::getTypeClass(), clang::QualType::getUnqualifiedType(), isLayoutCompatible(), clang::QualType::isNull(), and clang::Type::isStandardLayoutType().
Referenced by isLayoutCompatible(), clang::Sema::IsLayoutCompatible(), isLayoutCompatibleStruct(), and isLayoutCompatibleUnion().
|
static |
Definition at line 19689 of file SemaChecking.cpp.
References clang::C, isLayoutCompatibleStruct(), isLayoutCompatibleUnion(), and clang::TagDecl::isUnion().
|
static |
Check if two standard-layout structs are layout-compatible.
(C++11 [class.mem] p17)
Definition at line 19619 of file SemaChecking.cpp.
References clang::CXXRecordDecl::bases_begin(), clang::C, clang::RecordDecl::field_begin(), clang::RecordDecl::field_end(), clang::CXXRecordDecl::getNumBases(), and isLayoutCompatible().
Referenced by isLayoutCompatible().
|
static |
Check if two standard-layout unions are layout-compatible.
(C++11 [class.mem] p18)
Definition at line 19663 of file SemaChecking.cpp.
References clang::C, clang::RecordDecl::fields(), isLayoutCompatible(), and clang::Result.
Referenced by isLayoutCompatible().
Determine whether the given type has a non-null nullability annotation.
Definition at line 7715 of file SemaChecking.cpp.
References clang::NonNull, and clang::ast_matchers::type.
Referenced by CheckNonNullArguments().
Definition at line 15684 of file SemaChecking.cpp.
References clang::Sema::getLangOpts(), clang::Type::isSpecificBuiltinType(), and clang::Sema::NSAPIObj.
Referenced by CheckImplicitConversion(), and DiagnoseFloatingImpCast().
Definition at line 5219 of file SemaChecking.cpp.
Definition at line 19913 of file SemaChecking.cpp.
References clang::Type::getAs(), and clang::BuiltinType::getKind().
|
static |
Checks whether the given value, which currently has the given source semantics, has the same value when coerced through the target semantics.
The value might be a vector of floats (or a complex number).
Definition at line 15023 of file SemaChecking.cpp.
References clang::APValue::getComplexFloatImag(), clang::APValue::getComplexFloatReal(), clang::APValue::getFloat(), clang::APValue::getVectorElt(), clang::APValue::getVectorLength(), clang::APValue::isComplexFloat(), clang::APValue::isFloat(), IsSameFloatAfterCast(), and clang::APValue::isVector().
|
static |
Checks whether the given value, which currently has the given source semantics, has the same value when coerced through the target semantics.
Definition at line 15006 of file SemaChecking.cpp.
Referenced by CheckImplicitConversion(), and IsSameFloatAfterCast().
|
static |
Definition at line 16054 of file SemaChecking.cpp.
References clang::SourceManager::getCharacterData(), clang::Sema::getSourceManager(), clang::Expr::IgnoreParenImpCasts(), clang::Type::isCharType(), clang::SourceLocation::isValid(), and clang::T.
Referenced by CheckImplicitConversion().
Check for a keyword selector that starts with the word 'add' or 'set'.
Definition at line 18989 of file SemaChecking.cpp.
References clang::Selector::getNameForSlot(), clang::Selector::getNumArgs(), clang::isLowercase(), and clang::Selector::isUnarySelector().
Referenced by clang::Sema::checkRetainCycles().
|
static |
Definition at line 10292 of file SemaChecking.cpp.
|
static |
Definition at line 13452 of file SemaChecking.cpp.
References clang::NamedDecl::getIdentifier(), clang::Decl::isInStdNamespace(), and clang::IdentifierInfo::isStr().
Definition at line 4085 of file SemaChecking.cpp.
References clang::Type::getAs(), clang::Type::getAsPlaceholderType(), clang::Expr::getType(), clang::Type::getUnqualifiedDesugaredType(), and clang::Expr::IgnoreParens().
Definition at line 4041 of file SemaChecking.cpp.
References clang::Type::getAsPlaceholderType(), clang::Expr::getObjectKind(), clang::Expr::getType(), clang::Expr::IgnoreParens(), and clang::OK_BitField.
Definition at line 4054 of file SemaChecking.cpp.
References clang::Type::getAs(), clang::Type::getAsPlaceholderType(), clang::Expr::getType(), clang::Type::getUnqualifiedDesugaredType(), and clang::Expr::IgnoreParens().
|
static |
Definition at line 8241 of file SemaChecking.cpp.
Referenced by clang::Sema::BuildAtomicExpr().
Definition at line 7202 of file SemaChecking.cpp.
|
static |
Definition at line 11286 of file SemaChecking.cpp.
References clang::Expr::EvaluateAsRValue(), and clang::Result.
Referenced by checkFormatStringExpr().
OpenCL C v2.0, s6.13.17 - Enqueue kernel function contains four different overload formats specified in Table 6.13.17.1.
int enqueue_kernel(queue_t queue, kernel_enqueue_flags_t flags, const ndrange_t ndrange, void (^block)(void)) int enqueue_kernel(queue_t queue, kernel_enqueue_flags_t flags, const ndrange_t ndrange, uint num_events_in_wait_list, clk_event_t event_wait_list, clk_event_t *event_ret, void (^block)(void)) int enqueue_kernel(queue_t queue, kernel_enqueue_flags_t flags, const ndrange_t ndrange, void (^block)(local void, ...), uint size0, ...) int enqueue_kernel(queue_t queue, kernel_enqueue_flags_t flags, const ndrange_t ndrange, uint num_events_in_wait_list, clk_event_t event_wait_list, clk_event_t *event_ret, void (^block)(local void, ...), uint size0, ...)
Definition at line 1608 of file SemaChecking.cpp.
References clang::Type::castAs(), checkOpenCLBlockArgs(), checkOpenCLEnqueueVariadicArgs(), clang::Sema::Context, clang::SemaBase::Diag(), clang::CallExpr::getArg(), clang::QualType::getAsString(), clang::CallExpr::getBeginLoc(), clang::Stmt::getBeginLoc(), clang::QualType::getCanonicalType(), clang::CallExpr::getDirectCallee(), clang::CallExpr::getNumArgs(), clang::FunctionProtoType::getNumParams(), clang::Type::getPointeeOrArrayElementType(), clang::Type::getPointeeType(), clang::BlockPointerType::getPointeeType(), clang::ASTContext::getPointerType(), clang::Expr::getType(), clang::QualType::getUnqualifiedType(), isBlockPointer(), clang::Type::isClkEventT(), clang::Type::isIntegerType(), clang::Expr::isNullPointerConstant(), clang::Type::isPointerType(), clang::Type::isQueueT(), clang::Expr::NPC_ValueDependentIsNotNull, clang::ASTContext::OCLClkEventTy, and clang::ASTContext::OCLQueueTy.
OpenCL C v2.0, s6.13.17.6 - Check the argument to the get_kernel_work_group_size and get_kernel_preferred_work_group_size_multiple builtin functions.
Definition at line 1532 of file SemaChecking.cpp.
References checkArgCount(), checkOpenCLBlockArgs(), clang::SemaBase::Diag(), clang::CallExpr::getArg(), clang::Stmt::getBeginLoc(), clang::CallExpr::getDirectCallee(), and isBlockPointer().
Definition at line 1505 of file SemaChecking.cpp.
References checkArgCount(), checkOpenCLBlockArgs(), checkOpenCLSubgroupExt(), clang::SemaBase::Diag(), clang::CallExpr::getArg(), clang::QualType::getAsString(), clang::Stmt::getBeginLoc(), clang::CallExpr::getDirectCallee(), clang::Expr::getType(), clang::QualType::getUnqualifiedType(), and isBlockPointer().
Definition at line 1933 of file SemaChecking.cpp.
References clang::Call, checkArgCount(), clang::Sema::Context, clang::SemaBase::Diag(), clang::ASTContext::getPointerType(), clang::ASTContext::getQualifiedType(), clang::opencl_constant, clang::opencl_generic, clang::opencl_global, clang::opencl_local, and clang::opencl_private.
|
static |
Definition at line 2142 of file SemaChecking.cpp.
References clang::Call, checkArgCount(), checkPointerAuthEnabled(), checkPointerAuthKey(), checkPointerAuthValue(), and clang::ExprError().
|
static |
Definition at line 2101 of file SemaChecking.cpp.
References clang::Call, checkArgCount(), checkPointerAuthEnabled(), checkPointerAuthValue(), clang::Sema::Context, clang::ExprError(), and clang::ASTContext::getUIntPtrType().
|
static |
Definition at line 2114 of file SemaChecking.cpp.
References clang::Call, checkArgCount(), checkPointerAuthEnabled(), checkPointerAuthValue(), clang::Sema::Context, clang::ExprError(), and clang::ASTContext::getUIntPtrType().
|
static |
Definition at line 2127 of file SemaChecking.cpp.
References clang::Call, checkArgCount(), checkPointerAuthEnabled(), checkPointerAuthKey(), checkPointerAuthValue(), and clang::ExprError().
|
static |
Definition at line 2088 of file SemaChecking.cpp.
References clang::Call, checkArgCount(), checkPointerAuthEnabled(), checkPointerAuthKey(), checkPointerAuthValue(), and clang::ExprError().
|
static |
Definition at line 15858 of file SemaChecking.cpp.
References toString().
Referenced by CheckImplicitConversion().
|
static |
Definition at line 1092 of file SemaChecking.cpp.
References clang::ASTContext::getAsConstantArrayType(), and clang::T.
Check if two expressions refer to the same declaration.
Definition at line 14192 of file SemaChecking.cpp.
Definition at line 12377 of file SemaChecking.cpp.
References clang::Stmt::getStmtClass(), and clang::Expr::IgnoreImpCasts().
Definition at line 3274 of file SemaChecking.cpp.
References clang::NeonTypeFlags::BFloat16, clang::NeonTypeFlags::Float16, clang::NeonTypeFlags::Float32, clang::NeonTypeFlags::Float64, clang::NeonTypeFlags::Int16, clang::NeonTypeFlags::Int32, clang::NeonTypeFlags::Int64, clang::NeonTypeFlags::Int8, clang::NeonTypeFlags::Poly128, clang::NeonTypeFlags::Poly16, clang::NeonTypeFlags::Poly64, clang::NeonTypeFlags::Poly8, and true.
Definition at line 5562 of file SemaChecking.cpp.
References clang::Sema::Context, clang::Generic, clang::CallExpr::getArg(), clang::Type::getAs(), clang::Expr::getType(), clang::ASTContext::getVectorType(), and clang::Expr::setType().
Referenced by clang::Sema::CheckHLSLBuiltinFunctionCall().
|
static |
Definition at line 19349 of file SemaChecking.cpp.
References clang::SourceManager::getPresumedLineNumber(), clang::NullStmt::getSemiLoc(), clang::SourceManager::getSpellingLineNumber(), and clang::NullStmt::hasLeadingEmptyMacro().
Referenced by clang::Sema::DiagnoseEmptyLoopBody(), and clang::Sema::DiagnoseEmptyStmtBody().
|
static |
Definition at line 12414 of file SemaChecking.cpp.
References clang::Type::getAs(), clang::ASTContext::getNSIntegerType(), clang::ASTContext::getNSUIntegerType(), clang::ASTContext::IntTy, clang::QualType::isNull(), shouldNotPrintDirectly(), and clang::ASTContext::UnsignedIntTy.
Referenced by shouldNotPrintDirectly().
|
static |
Definition at line 10814 of file SemaChecking.cpp.
References sumOffsets().
Referenced by checkFormatStringExpr(), and sumOffsets().