diff options
author | dim <dim@FreeBSD.org> | 2014-11-24 18:11:16 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2014-11-24 18:11:16 +0000 |
commit | 6148c19c738a92f344008aa3f88f4e008bada0ee (patch) | |
tree | d4426858455f04d0d8c25a2f9eb9ea5582ffe1b6 /contrib/llvm/tools/clang/lib/Sema/DelayedDiagnostic.cpp | |
parent | 2c8643c6396b0a3db33430cf9380e70bbb9efce0 (diff) | |
parent | 173a4f43a911175643bda81ee675e8d9269056ea (diff) | |
download | FreeBSD-src-6148c19c738a92f344008aa3f88f4e008bada0ee.zip FreeBSD-src-6148c19c738a92f344008aa3f88f4e008bada0ee.tar.gz |
Merge clang 3.5.0 release from ^/vendor/clang/dist, resolve conflicts,
and preserve our customizations, where necessary.
Diffstat (limited to 'contrib/llvm/tools/clang/lib/Sema/DelayedDiagnostic.cpp')
-rw-r--r-- | contrib/llvm/tools/clang/lib/Sema/DelayedDiagnostic.cpp | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/contrib/llvm/tools/clang/lib/Sema/DelayedDiagnostic.cpp b/contrib/llvm/tools/clang/lib/Sema/DelayedDiagnostic.cpp index 3100432..664a6b1 100644 --- a/contrib/llvm/tools/clang/lib/Sema/DelayedDiagnostic.cpp +++ b/contrib/llvm/tools/clang/lib/Sema/DelayedDiagnostic.cpp @@ -19,19 +19,29 @@ using namespace clang; using namespace sema; -DelayedDiagnostic DelayedDiagnostic::makeDeprecation(SourceLocation Loc, +DelayedDiagnostic +DelayedDiagnostic::makeAvailability(Sema::AvailabilityDiagnostic AD, + SourceLocation Loc, const NamedDecl *D, const ObjCInterfaceDecl *UnknownObjCClass, const ObjCPropertyDecl *ObjCProperty, - StringRef Msg) { + StringRef Msg, + bool ObjCPropertyAccess) { DelayedDiagnostic DD; - DD.Kind = Deprecation; + switch (AD) { + case Sema::AD_Deprecation: + DD.Kind = Deprecation; + break; + case Sema::AD_Unavailable: + DD.Kind = Unavailable; + break; + } DD.Triggered = false; DD.Loc = Loc; DD.DeprecationData.Decl = D; DD.DeprecationData.UnknownObjCClass = UnknownObjCClass; DD.DeprecationData.ObjCProperty = ObjCProperty; - char *MessageData = 0; + char *MessageData = nullptr; if (Msg.size()) { MessageData = new char [Msg.size()]; memcpy(MessageData, Msg.data(), Msg.size()); @@ -39,16 +49,18 @@ DelayedDiagnostic DelayedDiagnostic::makeDeprecation(SourceLocation Loc, DD.DeprecationData.Message = MessageData; DD.DeprecationData.MessageLen = Msg.size(); + DD.DeprecationData.ObjCPropertyAccess = ObjCPropertyAccess; return DD; } void DelayedDiagnostic::Destroy() { - switch (Kind) { + switch (static_cast<DDKind>(Kind)) { case Access: getAccessData().~AccessedEntity(); break; - case Deprecation: + case Deprecation: + case Unavailable: delete [] DeprecationData.Message; break; |