diff options
Diffstat (limited to 'include/clang/Basic/ObjCRuntime.h')
-rw-r--r-- | include/clang/Basic/ObjCRuntime.h | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/include/clang/Basic/ObjCRuntime.h b/include/clang/Basic/ObjCRuntime.h index 8dc259c7ab66..d5f4f50fe36f 100644 --- a/include/clang/Basic/ObjCRuntime.h +++ b/include/clang/Basic/ObjCRuntime.h @@ -1,4 +1,4 @@ -//===--- ObjCRuntime.h - Objective-C Runtime Configuration ------*- C++ -*-===// +//===- ObjCRuntime.h - Objective-C Runtime Configuration --------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -6,25 +6,28 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -/// +// /// \file -/// \brief Defines types useful for describing an Objective-C runtime. -/// +/// Defines types useful for describing an Objective-C runtime. +// //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_BASIC_OBJCRUNTIME_H #define LLVM_CLANG_BASIC_OBJCRUNTIME_H -#include "clang/Basic/VersionTuple.h" +#include "clang/Basic/LLVM.h" +#include "llvm/ADT/StringRef.h" #include "llvm/ADT/Triple.h" #include "llvm/Support/ErrorHandling.h" +#include "llvm/Support/VersionTuple.h" +#include <string> namespace clang { -/// \brief The basic abstraction for the target Objective-C runtime. +/// The basic abstraction for the target Objective-C runtime. class ObjCRuntime { public: - /// \brief The basic Objective-C runtimes that we know about. + /// The basic Objective-C runtimes that we know about. enum Kind { /// 'macosx' is the Apple-provided NeXT-derived runtime on Mac OS /// X platforms that use the non-fragile ABI; the version is a @@ -57,15 +60,14 @@ public: }; private: - Kind TheKind; + Kind TheKind = MacOSX; VersionTuple Version; public: /// A bogus initialization of the runtime. - ObjCRuntime() : TheKind(MacOSX) {} - + ObjCRuntime() = default; ObjCRuntime(Kind kind, const VersionTuple &version) - : TheKind(kind), Version(version) {} + : TheKind(kind), Version(version) {} void set(Kind kind, VersionTuple version) { TheKind = kind; @@ -75,7 +77,7 @@ public: Kind getKind() const { return TheKind; } const VersionTuple &getVersion() const { return Version; } - /// \brief Does this runtime follow the set of implied behaviors for a + /// Does this runtime follow the set of implied behaviors for a /// "non-fragile" ABI? bool isNonFragile() const { switch (getKind()) { @@ -113,7 +115,7 @@ public: return true; } - /// \brief Is this runtime basically of the GNU family of runtimes? + /// Is this runtime basically of the GNU family of runtimes? bool isGNUFamily() const { switch (getKind()) { case FragileMacOSX: @@ -129,14 +131,14 @@ public: llvm_unreachable("bad kind"); } - /// \brief Is this runtime basically of the NeXT family of runtimes? + /// Is this runtime basically of the NeXT family of runtimes? bool isNeXTFamily() const { // For now, this is just the inverse of isGNUFamily(), but that's // not inherently true. return !isGNUFamily(); } - /// \brief Does this runtime allow ARC at all? + /// Does this runtime allow ARC at all? bool allowsARC() const { switch (getKind()) { case FragileMacOSX: @@ -152,7 +154,7 @@ public: llvm_unreachable("bad kind"); } - /// \brief Does this runtime natively provide the ARC entrypoints? + /// 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 @@ -171,7 +173,7 @@ public: llvm_unreachable("bad kind"); } - /// \brief Does this runtime supports optimized setter entrypoints? + /// Does this runtime supports optimized setter entrypoints? bool hasOptimizedSetter() const { switch (getKind()) { case MacOSX: @@ -182,9 +184,8 @@ public: return true; case GNUstep: return getVersion() >= VersionTuple(1, 7); - default: - return false; + return false; } } @@ -193,7 +194,7 @@ public: return hasNativeWeak(); } - /// \brief Does this runtime natively provide ARC-compliant 'weak' + /// Does this runtime natively provide ARC-compliant 'weak' /// entrypoints? bool hasNativeWeak() const { // Right now, this is always equivalent to whether the runtime @@ -201,14 +202,14 @@ public: return hasNativeARC(); } - /// \brief Does this runtime directly support the subscripting methods? + /// Does this runtime directly support the subscripting methods? /// /// This is really a property of the library, not the runtime. bool hasSubscripting() const { switch (getKind()) { case FragileMacOSX: return false; - case MacOSX: return getVersion() >= VersionTuple(10, 8); - case iOS: return getVersion() >= VersionTuple(6); + case MacOSX: return getVersion() >= VersionTuple(10, 11); + case iOS: return getVersion() >= VersionTuple(9); case WatchOS: return true; // This is really a lie, because some implementations and versions @@ -221,12 +222,12 @@ public: llvm_unreachable("bad kind"); } - /// \brief Does this runtime allow sizeof or alignof on object types? + /// Does this runtime allow sizeof or alignof on object types? bool allowsSizeofAlignof() const { return isFragile(); } - /// \brief Does this runtime allow pointer arithmetic on objects? + /// Does this runtime allow pointer arithmetic on objects? /// /// This covers +, -, ++, --, and (if isSubscriptPointerArithmetic() /// yields true) []. @@ -245,12 +246,12 @@ public: llvm_unreachable("bad kind"); } - /// \brief Is subscripting pointer arithmetic? + /// Is subscripting pointer arithmetic? bool isSubscriptPointerArithmetic() const { return allowsPointerArithmetic(); } - /// \brief Does this runtime provide an objc_terminate function? + /// Does this runtime provide an objc_terminate function? /// /// This is used in handlers for exceptions during the unwind process; /// without it, abort() must be used in pure ObjC files. @@ -267,7 +268,7 @@ public: llvm_unreachable("bad kind"); } - /// \brief Does this runtime support weakly importing classes? + /// Does this runtime support weakly importing classes? bool hasWeakClassImport() const { switch (getKind()) { case MacOSX: return true; @@ -281,7 +282,7 @@ public: llvm_unreachable("bad kind"); } - /// \brief Does this runtime use zero-cost exceptions? + /// Does this runtime use zero-cost exceptions? bool hasUnwindExceptions() const { switch (getKind()) { case MacOSX: return true; @@ -320,7 +321,6 @@ public: return getVersion() >= VersionTuple(2); case GNUstep: return false; - default: return false; } @@ -340,7 +340,7 @@ public: } } - /// \brief Try to parse an Objective-C runtime specification from the given + /// Try to parse an Objective-C runtime specification from the given /// string. /// /// \return true on error. @@ -360,6 +360,6 @@ public: raw_ostream &operator<<(raw_ostream &out, const ObjCRuntime &value); -} // end namespace clang +} // namespace clang -#endif +#endif // LLVM_CLANG_BASIC_OBJCRUNTIME_H |