Lines Matching defs:FDecl

2107 Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl, unsigned BuiltinID,
2551 Context.getExceptionObjectType(FDecl->getParamDecl(0)->getType()),
2569 QualType Param = FDecl->getParamDecl(0)->getType();
2570 QualType Result = FDecl->getReturnType();
2579 << FDecl;
3099 const NamedDecl *FDecl,
3103 assert((FDecl || Proto) && "Need a function declaration or prototype");
3110 if (FDecl) {
3112 for (const auto *NonNull : FDecl->specific_attrs<NonNullAttr>()) {
3132 if (FDecl && (isa<FunctionDecl>(FDecl) || isa<ObjCMethodDecl>(FDecl))) {
3136 if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(FDecl))
3139 parms = cast<ObjCMethodDecl>(FDecl)->parameters();
3156 if (const ValueDecl *VD = dyn_cast<ValueDecl>(FDecl)) {
3194 void Sema::CheckArgAlignment(SourceLocation Loc, NamedDecl *FDecl,
3226 << ParamName << (FDecl != nullptr) << FDecl;
3276 void Sema::checkCall(NamedDecl *FDecl, const FunctionProtoType *Proto,
3286 if (FDecl) {
3287 for (const auto *I : FDecl->specific_attrs<FormatAttr>()) {
3298 auto *FD = dyn_cast_or_null<FunctionDecl>(FDecl);
3302 : isa_and_nonnull<FunctionDecl>(FDecl)
3303 ? cast<FunctionDecl>(FDecl)->getNumParams()
3304 : isa_and_nonnull<ObjCMethodDecl>(FDecl)
3305 ? cast<ObjCMethodDecl>(FDecl)->param_size()
3318 if (FDecl || Proto) {
3319 CheckNonNullArguments(*this, FDecl, Proto, Args, Loc);
3322 if (FDecl) {
3323 for (const auto *I : FDecl->specific_attrs<ArgumentWithTypeTagAttr>())
3330 if (!Proto && FDecl) {
3331 const auto *FT = FDecl->getFunctionType();
3333 Proto = cast<FunctionProtoType>(FDecl->getFunctionType());
3347 if (Context.getTargetInfo().getTriple().isOSAIX() && FDecl && Arg &&
3348 FDecl->hasLinkage() &&
3349 FDecl->getFormalLinkage() != Linkage::Internal &&
3357 CheckArgAlignment(Arg->getExprLoc(), FDecl, std::to_string(ArgIdx + 1),
3440 if (FDecl && FDecl->hasAttr<AllocAlignAttr>()) {
3441 auto *AA = FDecl->getAttr<AllocAlignAttr>();
3468 void Sema::CheckConstructorCall(FunctionDecl *FDecl, QualType ThisType,
3475 auto *Ctor = cast<CXXConstructorDecl>(FDecl);
3477 Loc, FDecl, "'this'", Context.getPointerType(ThisType),
3480 checkCall(FDecl, Proto, /*ThisArg=*/nullptr, Args, /*IsMemberFunction=*/true,
3484 bool Sema::CheckFunctionCall(FunctionDecl *FDecl, CallExpr *TheCall,
3487 isa<CXXMethodDecl>(FDecl);
3490 VariadicCallType CallType = getVariadicCallType(FDecl, Proto,
3496 if (IsMemberOperatorCall && !FDecl->hasCXXExplicitFunctionObjectParameter()) {
3503 } else if (IsMemberFunction && !FDecl->isStatic() &&
3504 !FDecl->hasCXXExplicitFunctionObjectParameter())
3518 cast<CXXMethodDecl>(FDecl)->getFunctionObjectParameterType());
3520 CheckArgAlignment(TheCall->getRParenLoc(), FDecl, "'this'", ThisType,
3524 checkCall(FDecl, Proto, ImplicitThis, llvm::ArrayRef(Args, NumArgs),
3528 IdentifierInfo *FnInfo = FDecl->getIdentifier();
3535 if (FDecl->getBuiltinID() == 0)
3536 CheckTCBEnforcement(TheCall->getExprLoc(), FDecl);
3538 CheckAbsoluteValueFunction(TheCall, FDecl);
3539 CheckMaxUnsignedZero(TheCall, FDecl);
3540 CheckInfNaNFunction(TheCall, FDecl);
3543 ObjC().DiagnoseCStringFormatDirectiveInCFAPI(FDecl, Args, NumArgs);
3545 unsigned CMId = FDecl->getMemoryFunctionKind();
3600 VariadicCallType CallType = getVariadicCallType(/*FDecl=*/nullptr, Proto,
3602 checkCall(/*FDecl=*/nullptr, Proto, /*ThisArg=*/nullptr,
4289 FunctionDecl *FDecl = cast<FunctionDecl>(DRE->getDecl());
4401 unsigned BuiltinID = FDecl->getBuiltinID();
4590 NewBuiltinDecl = FDecl;
4660 FunctionDecl *FDecl = cast<FunctionDecl>(DRE->getDecl());
4661 unsigned BuiltinID = FDecl->getBuiltinID();
5481 FunctionDecl *FDecl = cast<FunctionDecl>(DRE->getDecl());
5488 << FDecl->getDeclName() << Arg->getSourceRange();
8345 static unsigned getAbsoluteValueFunctionKind(const FunctionDecl *FDecl) {
8346 const IdentifierInfo *FnInfo = FDecl->getIdentifier();
8350 switch (FDecl->getBuiltinID()) {
8371 return FDecl->getBuiltinID();
8400 const FunctionDecl *FDecl = nullptr;
8402 FDecl = dyn_cast<FunctionDecl>(UsingD->getTargetDecl());
8404 FDecl = dyn_cast<FunctionDecl>(I);
8406 if (!FDecl)
8410 if (FDecl->getNumParams() != 1)
8414 QualType ParamType = FDecl->getParamDecl(0)->getType();
8461 static bool IsStdFunction(const FunctionDecl *FDecl,
8463 if (!FDecl)
8465 if (!FDecl->getIdentifier() || !FDecl->getIdentifier()->isStr(Str))
8467 if (!FDecl->isInStdNamespace())
8492 static bool IsInfinityFunction(const FunctionDecl *FDecl) {
8493 if (FDecl->getName() != "infinity")
8496 if (const CXXMethodDecl *MDecl = dyn_cast<CXXMethodDecl>(FDecl)) {
8510 const FunctionDecl *FDecl) {
8511 if (!FDecl->getIdentifier())
8516 (IsStdFunction(FDecl, "isnan") || IsStdFunction(FDecl, "isunordered") ||
8517 IsInfOrNanFunction(FDecl->getName(), MathCheck::NaN))) {
8524 (IsStdFunction(FDecl, "isinf") || IsStdFunction(FDecl, "isfinite") ||
8525 IsInfinityFunction(FDecl) ||
8526 IsInfOrNanFunction(FDecl->getName(), MathCheck::Inf))) {
8533 const FunctionDecl *FDecl) {
8537 unsigned AbsKind = getAbsoluteValueFunctionKind(FDecl);
8538 bool IsStdAbs = IsStdFunction(FDecl, "abs");
8586 << FDecl << ArgType << ParamType;
8605 << FDecl << ParamValueKind << ArgValueKind;
8613 const FunctionDecl *FDecl) {
8614 if (!Call || !FDecl) return;
8622 if (!IsStdFunction(FDecl, "max")) return;
8623 const auto * ArgList = FDecl->getTemplateSpecializationArgs();