15 #ifndef LLVM_CLANG_BASIC_OBJCRUNTIME_H 16 #define LLVM_CLANG_BASIC_OBJCRUNTIME_H 19 #include "llvm/ADT/StringRef.h" 20 #include "llvm/ADT/Triple.h" 21 #include "llvm/Support/ErrorHandling.h" 22 #include "llvm/Support/VersionTuple.h" 70 : TheKind(kind), Version(version) {}
78 const VersionTuple &
getVersion()
const {
return Version; }
85 case GCC:
return false;
88 case ObjFW:
return true;
89 case iOS:
return true;
92 llvm_unreachable(
"bad kind");
104 if (Arch == llvm::Triple::arm ||
105 Arch == llvm::Triple::x86 ||
106 Arch == llvm::Triple::x86_64)
112 return Arch != llvm::Triple::x86_64;
131 llvm_unreachable(
"bad kind");
148 case iOS:
return true;
150 case GCC:
return false;
152 case ObjFW:
return true;
154 llvm_unreachable(
"bad kind");
169 case GCC:
return false;
171 case ObjFW:
return true;
173 llvm_unreachable(
"bad kind");
218 case GCC:
return true;
220 case ObjFW:
return true;
222 llvm_unreachable(
"bad kind");
246 llvm_unreachable(
"bad kind");
264 case GCC:
return false;
266 case ObjFW:
return false;
268 llvm_unreachable(
"bad kind");
275 case iOS:
return true;
278 case GCC:
return true;
280 case ObjFW:
return true;
282 llvm_unreachable(
"bad kind");
289 case iOS:
return true;
292 case GCC:
return true;
294 case ObjFW:
return true;
296 llvm_unreachable(
"bad kind");
308 default:
return false;
357 return !(left == right);
365 #endif // LLVM_CLANG_BASIC_OBJCRUNTIME_H const DiagnosticBuilder & operator<<(const DiagnosticBuilder &DB, const Attr *At)
bool allowsPointerArithmetic() const
Does this runtime allow pointer arithmetic on objects?
'gcc' is the Objective-C runtime shipped with GCC, implementing a fragile Objective-C ABI ...
bool hasWeakClassImport() const
Does this runtime support weakly importing classes?
'macosx-fragile' is the Apple-provided NeXT-derived runtime on Mac OS X platforms that use the fragil...
bool hasOptimizedSetter() const
Does this runtime supports optimized setter entrypoints?
bool isNonFragile() const
Does this runtime follow the set of implied behaviors for a "non-fragile" ABI?
bool isNeXTFamily() const
Is this runtime basically of the NeXT family of runtimes?
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
'watchos' is a variant of iOS for Apple's watchOS.
bool isFragile() const
The inverse of isNonFragile(): does this runtime follow the set of implied behaviors for a "fragile" ...
bool isSubscriptPointerArithmetic() const
Is subscripting pointer arithmetic?
bool isGNUFamily() const
Is this runtime basically of the GNU family of runtimes?
bool hasAtomicCopyHelper() const
'macosx' is the Apple-provided NeXT-derived runtime on Mac OS X platforms that use the non-fragile AB...
std::string getAsString() const
bool allowsSizeofAlignof() const
Does this runtime allow sizeof or alignof on object types?
bool tryParse(StringRef input)
Try to parse an Objective-C runtime specification from the given string.
bool hasTerminate() const
Does this runtime provide an objc_terminate function?
ObjCRuntime()=default
A bogus initialization of the runtime.
ObjCRuntime(Kind kind, const VersionTuple &version)
'gnustep' is the modern non-fragile GNUstep runtime.
bool hasEmptyCollections() const
Are the empty collection symbols available?
bool hasNativeWeak() const
Does this runtime natively provide ARC-compliant 'weak' entrypoints?
'objfw' is the Objective-C runtime included in ObjFW
bool hasUnwindExceptions() const
Does this runtime use zero-cost exceptions?
bool isLegacyDispatchDefaultForArch(llvm::Triple::ArchType Arch)
The default dispatch mechanism to use for the specified architecture.
const VersionTuple & getVersion() const
bool allowsARC() const
Does this runtime allow ARC at all?
Dataflow Directional Tag Classes.
The basic abstraction for the target Objective-C runtime.
friend bool operator!=(const ObjCRuntime &left, const ObjCRuntime &right)
'ios' is the Apple-provided NeXT-derived runtime on iOS or the iOS simulator; it is always non-fragil...
friend bool operator==(const ObjCRuntime &left, const ObjCRuntime &right)
unsigned kind
All of the diagnostics that can be emitted by the frontend.
bool hasARCUnsafeClaimAutoreleasedReturnValue() const
Is objc_unsafeClaimAutoreleasedReturnValue available?
bool hasNativeARC() const
Does this runtime natively provide the ARC entrypoints?
bool hasSubscripting() const
Does this runtime directly support the subscripting methods?
Kind
The basic Objective-C runtimes that we know about.
bool allowsWeak() const
Does this runtime allow the use of __weak?