14 #ifndef LLVM_CLANG_BASIC_OBJCRUNTIME_H 15 #define LLVM_CLANG_BASIC_OBJCRUNTIME_H 18 #include "llvm/ADT/StringRef.h" 19 #include "llvm/ADT/Triple.h" 20 #include "llvm/Support/ErrorHandling.h" 21 #include "llvm/Support/VersionTuple.h" 69 : TheKind(kind), Version(version) {}
77 const VersionTuple &
getVersion()
const {
return Version; }
84 case GCC:
return false;
87 case ObjFW:
return true;
88 case iOS:
return true;
91 llvm_unreachable(
"bad kind");
103 if (Arch == llvm::Triple::arm ||
104 Arch == llvm::Triple::x86 ||
105 Arch == llvm::Triple::x86_64)
111 return Arch != llvm::Triple::x86_64;
130 llvm_unreachable(
"bad kind");
147 case iOS:
return true;
149 case GCC:
return false;
151 case ObjFW:
return true;
153 llvm_unreachable(
"bad kind");
168 case GCC:
return false;
170 case ObjFW:
return true;
172 llvm_unreachable(
"bad kind");
209 llvm_unreachable(
"bad kind");
246 llvm_unreachable(
"bad kind");
255 return getVersion() >= VersionTuple(10, 14, 4);
307 case GCC:
return true;
309 case ObjFW:
return true;
311 llvm_unreachable(
"bad kind");
335 llvm_unreachable(
"bad kind");
353 case GCC:
return false;
355 case ObjFW:
return false;
357 llvm_unreachable(
"bad kind");
364 case iOS:
return true;
367 case GCC:
return true;
369 case ObjFW:
return true;
371 llvm_unreachable(
"bad kind");
378 case iOS:
return true;
381 case GCC:
return true;
383 case ObjFW:
return true;
385 llvm_unreachable(
"bad kind");
397 default:
return false;
446 llvm_unreachable(
"bad kind");
454 case iOS:
return true;
456 case GCC:
return false;
458 case ObjFW:
return false;
460 llvm_unreachable(
"bad kind");
477 return !(left == right);
485 #endif // LLVM_CLANG_BASIC_OBJCRUNTIME_H bool shouldUseRuntimeFunctionsForAlloc() const
Does this runtime provide entrypoints that are likely to be faster than an ordinary message send of t...
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 allowsDirectDispatch() const
Does this runtime supports direct dispatch.
bool allowsClassStubs() const
Returns true if this Objective-C runtime supports Objective-C class stubs.
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?
bool shouldUseRuntimeFunctionForCombinedAllocInit() const
Does this runtime provide the objc_alloc_init entrypoint? This can apply the same optimization as obj...
'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)
bool shouldUseARCFunctionsForRetainRelease() const
Does this runtime provide ARC entrypoints that are likely to be faster than an ordinary message send ...
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?