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");
210 llvm_unreachable(
"bad kind");
247 llvm_unreachable(
"bad kind");
292 case GCC:
return true;
294 case ObjFW:
return true;
296 llvm_unreachable(
"bad kind");
320 llvm_unreachable(
"bad kind");
338 case GCC:
return false;
340 case ObjFW:
return false;
342 llvm_unreachable(
"bad kind");
349 case iOS:
return true;
352 case GCC:
return true;
354 case ObjFW:
return true;
356 llvm_unreachable(
"bad kind");
363 case iOS:
return true;
366 case GCC:
return true;
368 case ObjFW:
return true;
370 llvm_unreachable(
"bad kind");
382 default:
return false;
431 return !(left == right);
439 #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 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)
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?