15 #ifndef LLVM_CLANG_BASIC_OBJCRUNTIME_H
16 #define LLVM_CLANG_BASIC_OBJCRUNTIME_H
19 #include "llvm/ADT/Triple.h"
20 #include "llvm/Support/ErrorHandling.h"
64 : TheKind(kind), Version(version) {}
79 case GCC:
return false;
82 case ObjFW:
return true;
83 case iOS:
return true;
85 llvm_unreachable(
"bad kind");
97 if (Arch == llvm::Triple::arm ||
98 Arch == llvm::Triple::x86 ||
99 Arch == llvm::Triple::x86_64)
105 return Arch != llvm::Triple::x86_64;
123 llvm_unreachable(
"bad kind");
138 case iOS:
return true;
139 case GCC:
return false;
141 case ObjFW:
return true;
143 llvm_unreachable(
"bad kind");
157 case GCC:
return false;
159 case ObjFW:
return true;
161 llvm_unreachable(
"bad kind");
204 case GCC:
return true;
206 case ObjFW:
return true;
208 llvm_unreachable(
"bad kind");
231 llvm_unreachable(
"bad kind");
248 case GCC:
return false;
250 case ObjFW:
return false;
252 llvm_unreachable(
"bad kind");
259 case iOS:
return true;
261 case GCC:
return true;
263 case ObjFW:
return true;
265 llvm_unreachable(
"bad kind");
272 case iOS:
return true;
274 case GCC:
return true;
276 case ObjFW:
return true;
278 llvm_unreachable(
"bad kind");
289 default:
return false;
307 return !(left == right);
311 raw_ostream &
operator<<(raw_ostream &out,
const ObjCRuntime &value);
bool allowsSizeofAlignof() const
Does this runtime allow sizeof or alignof on object types?
Represents a version number in the form major[.minor[.subminor[.build]]].
const DiagnosticBuilder & operator<<(const DiagnosticBuilder &DB, const Attr *At)
bool allowsWeak() const
Does this runtime allow the use of __weak?
bool allowsARC() const
Does this runtime allow ARC at all?
bool hasOptimizedSetter() const
Does this runtime supports optimized setter entrypoints?
bool hasNativeARC() const
Does this runtime natively provide the ARC entrypoints?
ObjCRuntime()
A bogus initialization of the runtime.
bool hasUnwindExceptions() const
Does this runtime use zero-cost exceptions?
bool hasTerminate() const
Does this runtime provide an objc_terminate function?
bool hasWeakClassImport() const
Does this runtime support weakly importing classes?
bool isNeXTFamily() const
Is this runtime basically of the NeXT family of runtimes?
bool tryParse(StringRef input)
Try to parse an Objective-C runtime specification from the given string.
bool hasNativeWeak() const
Does this runtime natively provide ARC-compliant 'weak' entrypoints?
ObjCRuntime(Kind kind, const VersionTuple &version)
'gnustep' is the modern non-fragile GNUstep runtime.
bool isNonFragile() const
Does this runtime follow the set of implied behaviors for a "non-fragile" ABI?
void set(Kind kind, VersionTuple version)
'objfw' is the Objective-C runtime included in ObjFW
bool isGNUFamily() const
Is this runtime basically of the GNU family of runtimes?
bool isLegacyDispatchDefaultForArch(llvm::Triple::ArchType Arch)
The default dispatch mechanism to use for the specified architecture.
const VersionTuple & getVersion() const
bool hasSubscripting() const
Does this runtime directly support the subscripting methods?
The basic abstraction for the target Objective-C runtime.
friend bool operator!=(const ObjCRuntime &left, const ObjCRuntime &right)
bool isSubscriptPointerArithmetic() const
Is subscripting pointer arithmetic?
friend bool operator==(const ObjCRuntime &left, const ObjCRuntime &right)
bool hasAtomicCopyHelper() const
unsigned kind
All of the diagnostics that can be emitted by the frontend.
Defines the clang::VersionTuple class, which represents a version in the form major[.minor[.subminor]].
std::string getAsString() const
Kind
The basic Objective-C runtimes that we know about.
bool allowsPointerArithmetic() const
Does this runtime allow pointer arithmetic on objects?