diff options
Diffstat (limited to 'include/clang/Sema/DelayedDiagnostic.h')
-rw-r--r-- | include/clang/Sema/DelayedDiagnostic.h | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/include/clang/Sema/DelayedDiagnostic.h b/include/clang/Sema/DelayedDiagnostic.h index 4f4a87fe11f2d..85551f8db0369 100644 --- a/include/clang/Sema/DelayedDiagnostic.h +++ b/include/clang/Sema/DelayedDiagnostic.h @@ -113,7 +113,7 @@ private: /// the complete parsing of the current declaration. class DelayedDiagnostic { public: - enum DDKind { Deprecation, Access, ForbiddenType }; + enum DDKind { Deprecation, Unavailable, Access, ForbiddenType }; unsigned char Kind; // actually a DDKind bool Triggered; @@ -122,11 +122,14 @@ public: void Destroy(); - static DelayedDiagnostic makeDeprecation(SourceLocation Loc, - const NamedDecl *D, - const ObjCInterfaceDecl *UnknownObjCClass, - const ObjCPropertyDecl *ObjCProperty, - StringRef Msg); + static DelayedDiagnostic makeAvailability(Sema::AvailabilityDiagnostic AD, + SourceLocation Loc, + const NamedDecl *D, + const ObjCInterfaceDecl *UnknownObjCClass, + const ObjCPropertyDecl *ObjCProperty, + StringRef Msg, + bool ObjCPropertyAccess); + static DelayedDiagnostic makeAccess(SourceLocation Loc, const AccessedEntity &Entity) { @@ -162,12 +165,14 @@ public: } const NamedDecl *getDeprecationDecl() const { - assert(Kind == Deprecation && "Not a deprecation diagnostic."); + assert((Kind == Deprecation || Kind == Unavailable) && + "Not a deprecation diagnostic."); return DeprecationData.Decl; } StringRef getDeprecationMessage() const { - assert(Kind == Deprecation && "Not a deprecation diagnostic."); + assert((Kind == Deprecation || Kind == Unavailable) && + "Not a deprecation diagnostic."); return StringRef(DeprecationData.Message, DeprecationData.MessageLen); } @@ -198,6 +203,10 @@ public: const ObjCPropertyDecl *getObjCProperty() const { return DeprecationData.ObjCProperty; } + + bool getObjCPropertyAccess() const { + return DeprecationData.ObjCPropertyAccess; + } private: @@ -207,6 +216,7 @@ private: const ObjCPropertyDecl *ObjCProperty; const char *Message; size_t MessageLen; + bool ObjCPropertyAccess; }; struct FTD { @@ -244,7 +254,7 @@ public: /// Does this pool, or any of its ancestors, contain any diagnostics? bool empty() const { - return (Diagnostics.empty() && (Parent == NULL || Parent->empty())); + return (Diagnostics.empty() && (!Parent || Parent->empty())); } /// Add a diagnostic to this pool. @@ -257,7 +267,7 @@ public: if (pool.Diagnostics.empty()) return; if (Diagnostics.empty()) { - Diagnostics = llvm_move(pool.Diagnostics); + Diagnostics = std::move(pool.Diagnostics); } else { Diagnostics.append(pool.pool_begin(), pool.pool_end()); } |