Lines Matching refs:FDecl
2147 Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl, unsigned BuiltinID, in CheckBuiltinFunctionCall() argument
2569 Context.getExceptionObjectType(FDecl->getParamDecl(0)->getType()), in CheckBuiltinFunctionCall()
2587 QualType Param = FDecl->getParamDecl(0)->getType(); in CheckBuiltinFunctionCall()
2588 QualType Result = FDecl->getReturnType(); in CheckBuiltinFunctionCall()
2597 << FDecl; in CheckBuiltinFunctionCall()
7235 const NamedDecl *FDecl, in DiagnoseCStringFormatDirectiveInCFAPI() argument
7240 ObjCStringFormatFamily SFFamily = FDecl->getObjCFStringFormattingFamily(); in DiagnoseCStringFormatDirectiveInCFAPI()
7246 for (const auto *I : FDecl->specific_attrs<FormatAttr>()) { in DiagnoseCStringFormatDirectiveInCFAPI()
7268 S.Diag(FDecl->getLocation(), diag::note_entity_declared_at) in DiagnoseCStringFormatDirectiveInCFAPI()
7269 << FDecl->getDeclName(); in DiagnoseCStringFormatDirectiveInCFAPI()
7282 const NamedDecl *FDecl, in CheckNonNullArguments() argument
7286 assert((FDecl || Proto) && "Need a function declaration or prototype"); in CheckNonNullArguments()
7293 if (FDecl) { in CheckNonNullArguments()
7295 for (const auto *NonNull : FDecl->specific_attrs<NonNullAttr>()) { in CheckNonNullArguments()
7315 if (FDecl && (isa<FunctionDecl>(FDecl) || isa<ObjCMethodDecl>(FDecl))) { in CheckNonNullArguments()
7319 if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(FDecl)) in CheckNonNullArguments()
7322 parms = cast<ObjCMethodDecl>(FDecl)->parameters(); in CheckNonNullArguments()
7339 if (const ValueDecl *VD = dyn_cast<ValueDecl>(FDecl)) { in CheckNonNullArguments()
7415 void Sema::CheckArgAlignment(SourceLocation Loc, NamedDecl *FDecl, in CheckArgAlignment() argument
7447 << ParamName << (FDecl != nullptr) << FDecl; in CheckArgAlignment()
7453 void Sema::checkCall(NamedDecl *FDecl, const FunctionProtoType *Proto, in checkCall() argument
7463 if (FDecl) { in checkCall()
7464 for (const auto *I : FDecl->specific_attrs<FormatAttr>()) { in checkCall()
7475 auto *FD = dyn_cast_or_null<FunctionDecl>(FDecl); in checkCall()
7479 : FDecl && isa<FunctionDecl>(FDecl) in checkCall()
7480 ? cast<FunctionDecl>(FDecl)->getNumParams() in checkCall()
7481 : FDecl && isa<ObjCMethodDecl>(FDecl) in checkCall()
7482 ? cast<ObjCMethodDecl>(FDecl)->param_size() in checkCall()
7494 if (FDecl || Proto) { in checkCall()
7495 CheckNonNullArguments(*this, FDecl, Proto, Args, Loc); in checkCall()
7498 if (FDecl) { in checkCall()
7499 for (const auto *I : FDecl->specific_attrs<ArgumentWithTypeTagAttr>()) in checkCall()
7506 if (!Proto && FDecl) { in checkCall()
7507 const auto *FT = FDecl->getFunctionType(); in checkCall()
7509 Proto = cast<FunctionProtoType>(FDecl->getFunctionType()); in checkCall()
7521 if (Context.getTargetInfo().getTriple().isOSAIX() && FDecl && Arg && in checkCall()
7522 FDecl->hasLinkage() && in checkCall()
7523 FDecl->getFormalLinkage() != Linkage::Internal && in checkCall()
7529 CheckArgAlignment(Arg->getExprLoc(), FDecl, std::to_string(ArgIdx + 1), in checkCall()
7588 if (FDecl && FDecl->hasAttr<AllocAlignAttr>()) { in checkCall()
7589 auto *AA = FDecl->getAttr<AllocAlignAttr>(); in checkCall()
7612 void Sema::CheckConstructorCall(FunctionDecl *FDecl, QualType ThisType, in CheckConstructorCall() argument
7619 auto *Ctor = cast<CXXConstructorDecl>(FDecl); in CheckConstructorCall()
7621 Loc, FDecl, "'this'", Context.getPointerType(ThisType), in CheckConstructorCall()
7624 checkCall(FDecl, Proto, /*ThisArg=*/nullptr, Args, /*IsMemberFunction=*/true, in CheckConstructorCall()
7630 bool Sema::CheckFunctionCall(FunctionDecl *FDecl, CallExpr *TheCall, in CheckFunctionCall() argument
7633 isa<CXXMethodDecl>(FDecl); in CheckFunctionCall()
7636 VariadicCallType CallType = getVariadicCallType(FDecl, Proto, in CheckFunctionCall()
7642 if (IsMemberOperatorCall && !FDecl->hasCXXExplicitFunctionObjectParameter()) { in CheckFunctionCall()
7649 } else if (IsMemberFunction && !FDecl->isStatic() && in CheckFunctionCall()
7650 !FDecl->hasCXXExplicitFunctionObjectParameter()) in CheckFunctionCall()
7664 cast<CXXMethodDecl>(FDecl)->getFunctionObjectParameterType()); in CheckFunctionCall()
7666 CheckArgAlignment(TheCall->getRParenLoc(), FDecl, "'this'", ThisType, in CheckFunctionCall()
7670 checkCall(FDecl, Proto, ImplicitThis, llvm::ArrayRef(Args, NumArgs), in CheckFunctionCall()
7674 IdentifierInfo *FnInfo = FDecl->getIdentifier(); in CheckFunctionCall()
7681 if (FDecl->getBuiltinID() == 0) in CheckFunctionCall()
7682 CheckTCBEnforcement(TheCall->getExprLoc(), FDecl); in CheckFunctionCall()
7684 CheckAbsoluteValueFunction(TheCall, FDecl); in CheckFunctionCall()
7685 CheckMaxUnsignedZero(TheCall, FDecl); in CheckFunctionCall()
7686 CheckInfNaNFunction(TheCall, FDecl); in CheckFunctionCall()
7689 DiagnoseCStringFormatDirectiveInCFAPI(*this, FDecl, Args, NumArgs); in CheckFunctionCall()
7691 unsigned CMId = FDecl->getMemoryFunctionKind(); in CheckFunctionCall()
8443 FunctionDecl *FDecl = cast<FunctionDecl>(DRE->getDecl()); in SemaBuiltinAtomicOverloaded() local
8555 unsigned BuiltinID = FDecl->getBuiltinID(); in SemaBuiltinAtomicOverloaded()
8744 NewBuiltinDecl = FDecl; in SemaBuiltinAtomicOverloaded()
8820 FunctionDecl *FDecl = cast<FunctionDecl>(DRE->getDecl()); in SemaBuiltinNontemporalOverloaded() local
8821 unsigned BuiltinID = FDecl->getBuiltinID(); in SemaBuiltinNontemporalOverloaded()
9732 FunctionDecl *FDecl = cast<FunctionDecl>(DRE->getDecl()); in SemaBuiltinConstantArg() local
9739 << FDecl->getDeclName() << Arg->getSourceRange(); in SemaBuiltinConstantArg()
12834 static unsigned getAbsoluteValueFunctionKind(const FunctionDecl *FDecl) { in getAbsoluteValueFunctionKind() argument
12835 const IdentifierInfo *FnInfo = FDecl->getIdentifier(); in getAbsoluteValueFunctionKind()
12839 switch (FDecl->getBuiltinID()) { in getAbsoluteValueFunctionKind()
12860 return FDecl->getBuiltinID(); in getAbsoluteValueFunctionKind()
12889 const FunctionDecl *FDecl = nullptr; in emitReplacement() local
12891 FDecl = dyn_cast<FunctionDecl>(UsingD->getTargetDecl()); in emitReplacement()
12893 FDecl = dyn_cast<FunctionDecl>(I); in emitReplacement()
12895 if (!FDecl) in emitReplacement()
12899 if (FDecl->getNumParams() != 1) in emitReplacement()
12903 QualType ParamType = FDecl->getParamDecl(0)->getType(); in emitReplacement()
12950 static bool IsStdFunction(const FunctionDecl *FDecl, in IsStdFunction() argument
12952 if (!FDecl) in IsStdFunction()
12954 if (!FDecl->getIdentifier() || !FDecl->getIdentifier()->isStr(Str)) in IsStdFunction()
12956 if (!FDecl->isInStdNamespace()) in IsStdFunction()
12963 const FunctionDecl *FDecl) { in CheckInfNaNFunction() argument
12965 if ((IsStdFunction(FDecl, "isnan") || IsStdFunction(FDecl, "isunordered") || in CheckInfNaNFunction()
12970 else if ((IsStdFunction(FDecl, "isinf") || in CheckInfNaNFunction()
12971 (IsStdFunction(FDecl, "isfinite") || in CheckInfNaNFunction()
12972 (FDecl->getIdentifier() && FDecl->getName() == "infinity"))) && in CheckInfNaNFunction()
12980 const FunctionDecl *FDecl) { in CheckAbsoluteValueFunction() argument
12984 unsigned AbsKind = getAbsoluteValueFunctionKind(FDecl); in CheckAbsoluteValueFunction()
12985 bool IsStdAbs = IsStdFunction(FDecl, "abs"); in CheckAbsoluteValueFunction()
13033 << FDecl << ArgType << ParamType; in CheckAbsoluteValueFunction()
13052 << FDecl << ParamValueKind << ArgValueKind; in CheckAbsoluteValueFunction()
13060 const FunctionDecl *FDecl) { in CheckMaxUnsignedZero() argument
13061 if (!Call || !FDecl) return; in CheckMaxUnsignedZero()
13069 if (!IsStdFunction(FDecl, "max")) return; in CheckMaxUnsignedZero()
13070 const auto * ArgList = FDecl->getTemplateSpecializationArgs(); in CheckMaxUnsignedZero()