diff options
author | Manman Ren <manman.ren@gmail.com> | 2016-02-22 04:47:24 +0000 |
---|---|---|
committer | Manman Ren <manman.ren@gmail.com> | 2016-02-22 04:47:24 +0000 |
commit | d8039df5231cb23fe332e70ecb6f064179ec0352 (patch) | |
tree | d0399039d694dde88d0c9c3c61480797f145091f /clang/lib/Sema/SemaDeclAttr.cpp | |
parent | e59c8af7059f2ba1d65ea421a8ba4a739ed80372 (diff) | |
download | bcm5719-llvm-d8039df5231cb23fe332e70ecb6f064179ec0352.tar.gz bcm5719-llvm-d8039df5231cb23fe332e70ecb6f064179ec0352.zip |
Addressing review comments for r261163.
Use "strict" instead of "nopartial". Also make strictly not-introduced
share the same diagnostics as Obsolete and Unavailable.
rdar://23791325
llvm-svn: 261512
Diffstat (limited to 'clang/lib/Sema/SemaDeclAttr.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDeclAttr.cpp | 40 |
1 files changed, 10 insertions, 30 deletions
diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp index d2db4b92849..3f6af3d765b 100644 --- a/clang/lib/Sema/SemaDeclAttr.cpp +++ b/clang/lib/Sema/SemaDeclAttr.cpp @@ -1918,7 +1918,7 @@ AvailabilityAttr *Sema::mergeAvailabilityAttr(NamedDecl *D, SourceRange Range, VersionTuple Obsoleted, bool IsUnavailable, StringRef Message, - bool IsNopartial, + bool IsStrict, AvailabilityMergeKind AMK, unsigned AttrSpellingListIndex) { VersionTuple MergedIntroduced = Introduced; @@ -2065,7 +2065,7 @@ AvailabilityAttr *Sema::mergeAvailabilityAttr(NamedDecl *D, SourceRange Range, return ::new (Context) AvailabilityAttr(Range, Context, Platform, Introduced, Deprecated, Obsoleted, IsUnavailable, Message, - IsNopartial, AttrSpellingListIndex); + IsStrict, AttrSpellingListIndex); } return nullptr; } @@ -2092,7 +2092,7 @@ static void handleAvailabilityAttr(Sema &S, Decl *D, AvailabilityChange Deprecated = Attr.getAvailabilityDeprecated(); AvailabilityChange Obsoleted = Attr.getAvailabilityObsoleted(); bool IsUnavailable = Attr.getUnavailableLoc().isValid(); - bool IsNopartial = Attr.getNopartialLoc().isValid(); + bool IsStrict = Attr.getStrictLoc().isValid(); StringRef Str; if (const StringLiteral *SE = dyn_cast_or_null<StringLiteral>(Attr.getMessageExpr())) @@ -2103,7 +2103,7 @@ static void handleAvailabilityAttr(Sema &S, Decl *D, Deprecated.Version, Obsoleted.Version, IsUnavailable, Str, - IsNopartial, + IsStrict, Sema::AMK_None, Index); if (NewAttr) @@ -2148,7 +2148,7 @@ static void handleAvailabilityAttr(Sema &S, Decl *D, NewDeprecated, NewObsoleted, IsUnavailable, Str, - IsNopartial, + IsStrict, Sema::AMK_None, Index); if (NewAttr) @@ -2171,7 +2171,7 @@ static void handleAvailabilityAttr(Sema &S, Decl *D, Deprecated.Version, Obsoleted.Version, IsUnavailable, Str, - IsNopartial, + IsStrict, Sema::AMK_None, Index); if (NewAttr) @@ -5964,14 +5964,6 @@ static void DoEmitAvailabilityWarning(Sema &S, Sema::AvailabilityDiagnostic K, property_note_select = /* partial */ 2; available_here_select_kind = /* partial */ 3; break; - - case Sema::AD_NotYetIntroduced: - diag = diag::err_notyetintroduced; - diag_message = diag::err_notyetintroduced_message; - diag_fwdclass_message = diag::warn_notyetintroduced_fwdclass_message; - property_note_select = /* deprecated */ 3; - available_here_select_kind = /* notyetintroduced */ 4; - break; } if (!Message.empty()) { @@ -5998,22 +5990,10 @@ static void DoEmitAvailabilityWarning(Sema &S, Sema::AvailabilityDiagnostic K, static void handleDelayedAvailabilityCheck(Sema &S, DelayedDiagnostic &DD, Decl *Ctx) { assert(DD.Kind == DelayedDiagnostic::Deprecation || - DD.Kind == DelayedDiagnostic::Unavailable || - DD.Kind == DelayedDiagnostic::NotYetIntroduced); - Sema::AvailabilityDiagnostic AD; - switch (DD.Kind) { - case DelayedDiagnostic::Deprecation: - AD = Sema::AD_Deprecation; - break; - case DelayedDiagnostic::Unavailable: - AD = Sema::AD_Unavailable; - break; - case DelayedDiagnostic::NotYetIntroduced: - AD = Sema::AD_NotYetIntroduced; - break; - default: - llvm_unreachable("Expecting: deprecated, unavailable, not-yet-introduced"); - } + DD.Kind == DelayedDiagnostic::Unavailable); + Sema::AvailabilityDiagnostic AD = DD.Kind == DelayedDiagnostic::Deprecation + ? Sema::AD_Deprecation + : Sema::AD_Unavailable; DD.Triggered = true; DoEmitAvailabilityWarning( S, AD, Ctx, DD.getDeprecationDecl(), DD.getDeprecationMessage(), DD.Loc, |