diff options
author | dim <dim@FreeBSD.org> | 2012-12-02 13:20:44 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2012-12-02 13:20:44 +0000 |
commit | 056abd2059c65a3e908193aeae16fad98017437c (patch) | |
tree | 2732d02d7d51218d6eed98ac7fcfc5b8794896b5 /include/clang/Basic/ObjCRuntime.h | |
parent | cc73504950eb7b5dff2dded9bedd67bc36d64641 (diff) | |
download | FreeBSD-src-056abd2059c65a3e908193aeae16fad98017437c.zip FreeBSD-src-056abd2059c65a3e908193aeae16fad98017437c.tar.gz |
Vendor import of clang release_32 branch r168974 (effectively, 3.2 RC2):
http://llvm.org/svn/llvm-project/cfe/branches/release_32@168974
Diffstat (limited to 'include/clang/Basic/ObjCRuntime.h')
-rw-r--r-- | include/clang/Basic/ObjCRuntime.h | 45 |
1 files changed, 39 insertions, 6 deletions
diff --git a/include/clang/Basic/ObjCRuntime.h b/include/clang/Basic/ObjCRuntime.h index b24fe7c..d543b76 100644 --- a/include/clang/Basic/ObjCRuntime.h +++ b/include/clang/Basic/ObjCRuntime.h @@ -126,12 +126,25 @@ public: return !isGNUFamily(); } + /// \brief Does this runtime allow ARC at all? + bool allowsARC() const { + switch (getKind()) { + case FragileMacOSX: return false; + case MacOSX: return true; + case iOS: return true; + case GCC: return false; + case GNUstep: return true; + case ObjFW: return true; + } + llvm_unreachable("bad kind"); + } + /// \brief Does this runtime natively provide the ARC entrypoints? /// /// ARC cannot be directly supported on a platform that does not provide /// these entrypoints, although it may be supportable via a stub /// library. - bool hasARC() const { + bool hasNativeARC() const { switch (getKind()) { case FragileMacOSX: return false; case MacOSX: return getVersion() >= VersionTuple(10, 7); @@ -139,16 +152,35 @@ public: case GCC: return false; case GNUstep: return getVersion() >= VersionTuple(1, 6); - case ObjFW: return false; // XXX: this will change soon + case ObjFW: return true; } llvm_unreachable("bad kind"); } + /// \brief Does this runtime supports optimized setter entrypoints? + bool hasOptimizedSetter() const { + switch (getKind()) { + case MacOSX: + return getVersion() >= VersionTuple(10, 8); + case iOS: + return (getVersion() >= VersionTuple(6)); + + default: + return false; + } + } + + /// Does this runtime allow the use of __weak? + bool allowsWeak() const { + return hasNativeWeak(); + } + /// \brief Does this runtime natively provide ARC-compliant 'weak' /// entrypoints? - bool hasWeak() const { - // Right now, this is always equivalent to the ARC decision. - return hasARC(); + bool hasNativeWeak() const { + // Right now, this is always equivalent to whether the runtime + // natively supports ARC decision. + return hasNativeARC(); } /// \brief Does this runtime directly support the subscripting methods? @@ -158,7 +190,7 @@ public: switch (getKind()) { case FragileMacOSX: return false; case MacOSX: return getVersion() >= VersionTuple(10, 8); - case iOS: return false; + case iOS: return getVersion() >= VersionTuple(6); // This is really a lie, because some implementations and versions // of the runtime do not support ARC. Probably -fgnu-runtime @@ -226,6 +258,7 @@ public: } llvm_unreachable("bad kind"); } + /// \brief Does this runtime use zero-cost exceptions? bool hasUnwindExceptions() const { switch (getKind()) { |