diff options
author | Ted Kremenek <kremenek@apple.com> | 2012-02-10 02:45:47 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2012-02-10 02:45:47 +0000 |
commit | d6cf912e1e33167452f328d15b98a790c58c03c0 (patch) | |
tree | 3fd3a053b9530dc87549b944b427fe39e8a8255e /lib/Sema/SemaExpr.cpp | |
parent | 572ae0a32ece4bd7ea24e3d8f9bfe3e11aa26414 (diff) |
Revert r145999. This turned out to be a bad idea. Unfortunately, 'id' is used so profusely
in many APIs and large codebases that this made the deprecated warning trigger happy to
the point of not being useful.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150223 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index de70ad4cba..ae5dc55825 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -65,8 +65,7 @@ bool Sema::CanUseDecl(NamedDecl *D) { return true; } -AvailabilityResult -Sema::DiagnoseAvailabilityOfDecl( +static AvailabilityResult DiagnoseAvailabilityOfDecl(Sema &S, NamedDecl *D, SourceLocation Loc, const ObjCInterfaceDecl *UnknownObjCClass) { // See if this declaration is unavailable or deprecated. @@ -85,22 +84,22 @@ Sema::DiagnoseAvailabilityOfDecl( break; case AR_Deprecated: - EmitDeprecationWarning(D, Message, Loc, UnknownObjCClass); + S.EmitDeprecationWarning(D, Message, Loc, UnknownObjCClass); break; case AR_Unavailable: - if (getCurContextAvailability() != AR_Unavailable) { + if (S.getCurContextAvailability() != AR_Unavailable) { if (Message.empty()) { if (!UnknownObjCClass) - Diag(Loc, diag::err_unavailable) << D->getDeclName(); + S.Diag(Loc, diag::err_unavailable) << D->getDeclName(); else - Diag(Loc, diag::warn_unavailable_fwdclass_message) + S.Diag(Loc, diag::warn_unavailable_fwdclass_message) << D->getDeclName(); } else - Diag(Loc, diag::err_unavailable_message) + S.Diag(Loc, diag::err_unavailable_message) << D->getDeclName() << Message; - Diag(D->getLocation(), diag::note_unavailable_here) + S.Diag(D->getLocation(), diag::note_unavailable_here) << isa<FunctionDecl>(D) << false; } break; @@ -155,7 +154,7 @@ bool Sema::DiagnoseUseOfDecl(NamedDecl *D, SourceLocation Loc, return true; } } - DiagnoseAvailabilityOfDecl(D, Loc, UnknownObjCClass); + DiagnoseAvailabilityOfDecl(*this, D, Loc, UnknownObjCClass); // Warn if this is used but marked unused. if (D->hasAttr<UnusedAttr>()) |