diff options
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r-- | clang/lib/Sema/SemaDeclAttr.cpp | 19 | ||||
-rw-r--r-- | clang/lib/Sema/SemaDeclCXX.cpp | 17 | ||||
-rw-r--r-- | clang/lib/Sema/SemaDeclObjC.cpp | 8 | ||||
-rw-r--r-- | clang/lib/Sema/SemaOverload.cpp | 25 | ||||
-rw-r--r-- | clang/lib/Sema/SemaType.cpp | 5 |
5 files changed, 4 insertions, 70 deletions
diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp index cffb860638d..b8432ebd53b 100644 --- a/clang/lib/Sema/SemaDeclAttr.cpp +++ b/clang/lib/Sema/SemaDeclAttr.cpp @@ -1531,22 +1531,6 @@ static void handleReturnsNonNullAttr(Sema &S, Decl *D, Attr.getAttributeSpellingListIndex())); } -static void handleNoEscapeAttr(Sema &S, Decl *D, const AttributeList &Attr) { - if (D->isInvalidDecl()) - return; - - // noescape only applies to pointer types. - QualType T = cast<ParmVarDecl>(D)->getType(); - if (!S.isValidPointerAttrType(T, /* RefOkay */ true)) { - S.Diag(Attr.getLoc(), diag::warn_attribute_pointers_only) - << Attr.getName() << Attr.getRange() << 0; - return; - } - - D->addAttr(::new (S.Context) NoEscapeAttr( - Attr.getRange(), S.Context, Attr.getAttributeSpellingListIndex())); -} - static void handleAssumeAlignedAttr(Sema &S, Decl *D, const AttributeList &Attr) { Expr *E = Attr.getArgAsExpr(0), @@ -6183,9 +6167,6 @@ static void ProcessDeclAttribute(Sema &S, Scope *scope, Decl *D, case AttributeList::AT_ReturnsNonNull: handleReturnsNonNullAttr(S, D, Attr); break; - case AttributeList::AT_NoEscape: - handleNoEscapeAttr(S, D, Attr); - break; case AttributeList::AT_AssumeAligned: handleAssumeAlignedAttr(S, D, Attr); break; diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp index 312e0e24828..529084a517b 100644 --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/lib/Sema/SemaDeclCXX.cpp @@ -14081,21 +14081,8 @@ void Sema::DiagnoseReturnInConstructorExceptionHandler(CXXTryStmt *TryBlock) { bool Sema::CheckOverridingFunctionAttributes(const CXXMethodDecl *New, const CXXMethodDecl *Old) { - const auto *NewFT = New->getType()->getAs<FunctionProtoType>(); - const auto *OldFT = Old->getType()->getAs<FunctionProtoType>(); - - if (OldFT->hasExtParameterInfos()) { - for (unsigned I = 0, E = OldFT->getNumParams(); I != E; ++I) - // A parameter of the overriding method should be annotated with noescape - // if the corresponding parameter of the overridden method is annotated. - if (OldFT->getExtParameterInfo(I).isNoEscape() && - !NewFT->getExtParameterInfo(I).isNoEscape()) { - Diag(New->getParamDecl(I)->getLocation(), - diag::warn_overriding_method_missing_noescape); - Diag(Old->getParamDecl(I)->getLocation(), - diag::note_overridden_marked_noescape); - } - } + const FunctionType *NewFT = New->getType()->getAs<FunctionType>(); + const FunctionType *OldFT = Old->getType()->getAs<FunctionType>(); CallingConv NewCC = NewFT->getCallConv(), OldCC = OldFT->getCallConv(); diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp index 6b33f7c64ce..5f9f608b75c 100644 --- a/clang/lib/Sema/SemaDeclObjC.cpp +++ b/clang/lib/Sema/SemaDeclObjC.cpp @@ -188,14 +188,6 @@ void Sema::CheckObjCMethodOverride(ObjCMethodDecl *NewMethod, Diag(newDecl->getLocation(), diag::warn_nsconsumed_attribute_mismatch); Diag(oldDecl->getLocation(), diag::note_previous_decl) << "parameter"; } - - // A parameter of the overriding method should be annotated with noescape - // if the corresponding parameter of the overridden method is annotated. - if (oldDecl->hasAttr<NoEscapeAttr>() && !newDecl->hasAttr<NoEscapeAttr>()) { - Diag(newDecl->getLocation(), - diag::warn_overriding_method_missing_noescape); - Diag(oldDecl->getLocation(), diag::note_overridden_marked_noescape); - } } } diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp index 8f28ec2fb8a..36f24fd9c46 100644 --- a/clang/lib/Sema/SemaOverload.cpp +++ b/clang/lib/Sema/SemaOverload.cpp @@ -1481,23 +1481,6 @@ bool Sema::IsFunctionConversion(QualType FromType, QualType ToType, .getTypePtr()); Changed = true; } - - // Convert FromFPT's ExtParameterInfo if necessary. The conversion is valid - // only if the ExtParameterInfo lists of the two function prototypes can be - // merged and the merged list is identical to ToFPT's ExtParameterInfo list. - SmallVector<FunctionProtoType::ExtParameterInfo, 4> NewParamInfos; - bool CanUseToFPT, CanUseFromFPT; - if (Context.mergeExtParameterInfo(ToFPT, FromFPT, CanUseToFPT, - CanUseFromFPT, NewParamInfos) && - CanUseToFPT && !CanUseFromFPT) { - FunctionProtoType::ExtProtoInfo ExtInfo = FromFPT->getExtProtoInfo(); - ExtInfo.ExtParameterInfos = - NewParamInfos.empty() ? nullptr : NewParamInfos.data(); - QualType QT = Context.getFunctionType(FromFPT->getReturnType(), - FromFPT->getParamTypes(), ExtInfo); - FromFn = QT->getAs<FunctionType>(); - Changed = true; - } } if (!Changed) @@ -2680,12 +2663,8 @@ bool Sema::IsBlockPointerConversion(QualType FromType, QualType ToType, // Argument types are too different. Abort. return false; } - - SmallVector<FunctionProtoType::ExtParameterInfo, 4> NewParamInfos; - bool CanUseToFPT, CanUseFromFPT; - if (!Context.mergeExtParameterInfo(ToFunctionType, FromFunctionType, - CanUseToFPT, CanUseFromFPT, - NewParamInfos)) + if (!Context.doFunctionTypesMatchOnExtParameterInfos(FromFunctionType, + ToFunctionType)) return false; ConvertedType = ToType; diff --git a/clang/lib/Sema/SemaType.cpp b/clang/lib/Sema/SemaType.cpp index f35eef2d4f7..c4d7bb1f36a 100644 --- a/clang/lib/Sema/SemaType.cpp +++ b/clang/lib/Sema/SemaType.cpp @@ -4479,11 +4479,6 @@ static TypeSourceInfo *GetFullTypeForDeclarator(TypeProcessingState &state, HasAnyInterestingExtParameterInfos = true; } - if (Param->hasAttr<NoEscapeAttr>()) { - ExtParameterInfos[i] = ExtParameterInfos[i].withIsNoEscape(true); - HasAnyInterestingExtParameterInfos = true; - } - ParamTys.push_back(ParamTy); } |