clang API Documentation
The basic abstraction for the target Objective-C runtime. More...
#include <ObjCRuntime.h>
Public Types | |
| enum | Kind { MacOSX, FragileMacOSX, iOS, GCC, GNUstep, ObjFW } |
| The basic Objective-C runtimes that we know about. More... | |
Public Member Functions | |
| ObjCRuntime () | |
| A bogus initialization of the runtime. | |
| ObjCRuntime (Kind kind, const VersionTuple &version) | |
| void | set (Kind kind, VersionTuple version) |
| Kind | getKind () const |
| const VersionTuple & | getVersion () const |
| bool | isNonFragile () const |
| Does this runtime follow the set of implied behaviors for a "non-fragile" ABI? | |
| bool | isFragile () const |
| bool | isLegacyDispatchDefaultForArch (llvm::Triple::ArchType Arch) |
| The default dispatch mechanism to use for the specified architecture. | |
| bool | isGNUFamily () const |
| Is this runtime basically of the GNU family of runtimes? | |
| bool | isNeXTFamily () const |
| Is this runtime basically of the NeXT family of runtimes? | |
| bool | allowsARC () const |
| Does this runtime allow ARC at all? | |
| bool | hasNativeARC () const |
| Does this runtime natively provide the ARC entrypoints? | |
| bool | hasOptimizedSetter () const |
| Does this runtime supports optimized setter entrypoints? | |
| bool | allowsWeak () const |
| Does this runtime allow the use of __weak? | |
| bool | hasNativeWeak () const |
| Does this runtime natively provide ARC-compliant 'weak' entrypoints? | |
| bool | hasSubscripting () const |
| Does this runtime directly support the subscripting methods? | |
| bool | allowsSizeofAlignof () const |
| Does this runtime allow sizeof or alignof on object types? | |
| bool | allowsPointerArithmetic () const |
| Does this runtime allow pointer arithmetic on objects? | |
| bool | isSubscriptPointerArithmetic () const |
| Is subscripting pointer arithmetic? | |
| bool | hasTerminate () const |
| Does this runtime provide an objc_terminate function? | |
| bool | hasWeakClassImport () const |
| Does this runtime support weakly importing classes? | |
| bool | hasUnwindExceptions () const |
| Does this runtime use zero-cost exceptions? | |
| bool | hasAtomicCopyHelper () const |
| bool | tryParse (StringRef input) |
| Try to parse an Objective-C runtime specification from the given string. | |
| std::string | getAsString () const |
Friends | |
| bool | operator== (const ObjCRuntime &left, const ObjCRuntime &right) |
| bool | operator!= (const ObjCRuntime &left, const ObjCRuntime &right) |
The basic abstraction for the target Objective-C runtime.
Definition at line 25 of file ObjCRuntime.h.
The basic Objective-C runtimes that we know about.
Definition at line 28 of file ObjCRuntime.h.
| clang::ObjCRuntime::ObjCRuntime | ( | ) | [inline] |
A bogus initialization of the runtime.
Definition at line 61 of file ObjCRuntime.h.
| clang::ObjCRuntime::ObjCRuntime | ( | Kind | kind, |
| const VersionTuple & | version | ||
| ) | [inline] |
Definition at line 63 of file ObjCRuntime.h.
| bool clang::ObjCRuntime::allowsARC | ( | ) | const [inline] |
Does this runtime allow ARC at all?
Definition at line 134 of file ObjCRuntime.h.
References FragileMacOSX, GCC, getKind(), GNUstep, iOS, MacOSX, and ObjFW.
Referenced by ParseLangArgs().
| bool clang::ObjCRuntime::allowsPointerArithmetic | ( | ) | const [inline] |
Does this runtime allow pointer arithmetic on objects?
This covers +, -, ++, --, and (if isSubscriptPointerArithmetic() yields true) [].
Definition at line 220 of file ObjCRuntime.h.
References FragileMacOSX, GCC, getKind(), GNUstep, iOS, MacOSX, and ObjFW.
Referenced by checkArithmeticOnObjCPointer(), and isSubscriptPointerArithmetic().
| bool clang::ObjCRuntime::allowsSizeofAlignof | ( | ) | const [inline] |
Does this runtime allow sizeof or alignof on object types?
Definition at line 212 of file ObjCRuntime.h.
References isFragile().
Referenced by CheckObjCTraitOperandConstraints().
| bool clang::ObjCRuntime::allowsWeak | ( | ) | const [inline] |
Does this runtime allow the use of __weak?
Definition at line 180 of file ObjCRuntime.h.
References hasNativeWeak().
Referenced by ParseLangArgs().
| std::string ObjCRuntime::getAsString | ( | ) | const |
Definition at line 19 of file ObjCRuntime.cpp.
| Kind clang::ObjCRuntime::getKind | ( | ) | const [inline] |
Definition at line 71 of file ObjCRuntime.h.
Referenced by allowsARC(), allowsPointerArithmetic(), clang::driver::tools::Clang::ConstructJob(), clang::CodeGen::CreateGNUObjCRuntime(), getObjCPersonality(), getObjCXXPersonality(), hasAtomicCopyHelper(), hasNativeARC(), hasOptimizedSetter(), hasSubscripting(), hasTerminate(), hasUnwindExceptions(), hasWeakClassImport(), InitializePredefinedMacros(), isGNUFamily(), isLegacyDispatchDefaultForArch(), isNonFragile(), clang::operator<<(), and ParseLangArgs().
| const VersionTuple& clang::ObjCRuntime::getVersion | ( | ) | const [inline] |
Definition at line 72 of file ObjCRuntime.h.
Referenced by getObjCPersonality(), hasAtomicCopyHelper(), hasNativeARC(), hasOptimizedSetter(), hasSubscripting(), hasTerminate(), InitializePredefinedMacros(), isLegacyDispatchDefaultForArch(), and clang::operator<<().
| bool clang::ObjCRuntime::hasAtomicCopyHelper | ( | ) | const [inline] |
Definition at line 281 of file ObjCRuntime.h.
References FragileMacOSX, getKind(), getVersion(), GNUstep, iOS, and MacOSX.
Referenced by clang::CodeGen::CodeGenFunction::GenerateObjCAtomicGetterCopyHelperFunction(), and clang::CodeGen::CodeGenFunction::GenerateObjCAtomicSetterCopyHelperFunction().
| bool clang::ObjCRuntime::hasNativeARC | ( | ) | const [inline] |
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 library.
Definition at line 151 of file ObjCRuntime.h.
References FragileMacOSX, GCC, getKind(), getVersion(), GNUstep, iOS, MacOSX, and ObjFW.
Referenced by clang::driver::toolchains::DarwinClang::AddLinkARCArgs(), createARCRuntimeFunction(), clang::CodeGen::CodeGenFunction::EmitObjCAutoreleasePoolStmt(), and hasNativeWeak().
| bool clang::ObjCRuntime::hasNativeWeak | ( | ) | const [inline] |
Does this runtime natively provide ARC-compliant 'weak' entrypoints?
Definition at line 186 of file ObjCRuntime.h.
References hasNativeARC().
Referenced by allowsWeak().
| bool clang::ObjCRuntime::hasOptimizedSetter | ( | ) | const [inline] |
Does this runtime supports optimized setter entrypoints?
Definition at line 165 of file ObjCRuntime.h.
References getKind(), getVersion(), GNUstep, iOS, and MacOSX.
Referenced by UseOptimizedSetter().
| bool clang::ObjCRuntime::hasSubscripting | ( | ) | const [inline] |
Does this runtime directly support the subscripting methods?
This is really a property of the library, not the runtime.
Definition at line 195 of file ObjCRuntime.h.
References FragileMacOSX, GCC, getKind(), getVersion(), GNUstep, iOS, MacOSX, and ObjFW.
Referenced by clang::driver::toolchains::DarwinClang::AddLinkARCArgs().
| bool clang::ObjCRuntime::hasTerminate | ( | ) | const [inline] |
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.
Definition at line 243 of file ObjCRuntime.h.
References FragileMacOSX, GCC, getKind(), getVersion(), GNUstep, iOS, MacOSX, and ObjFW.
Referenced by getTerminateFn().
| bool clang::ObjCRuntime::hasUnwindExceptions | ( | ) | const [inline] |
Does this runtime use zero-cost exceptions?
Definition at line 269 of file ObjCRuntime.h.
References FragileMacOSX, GCC, getKind(), GNUstep, iOS, MacOSX, and ObjFW.
Referenced by hasUnwindExceptions().
| bool clang::ObjCRuntime::hasWeakClassImport | ( | ) | const [inline] |
Does this runtime support weakly importing classes?
Definition at line 256 of file ObjCRuntime.h.
References FragileMacOSX, GCC, getKind(), GNUstep, iOS, MacOSX, and ObjFW.
Referenced by clang::Decl::canBeWeakImported(), and HasFeature().
| bool clang::ObjCRuntime::isFragile | ( | ) | const [inline] |
The inverse of isNonFragile(): does this runtime follow the set of implied behaviors for a "fragile" ABI?
Definition at line 90 of file ObjCRuntime.h.
References isNonFragile().
Referenced by clang::Sema::ActOnPropertyImplDecl(), allowsSizeofAlignof(), clang::Sema::BuildExceptionDeclaration(), and clang::Sema::DefaultSynthesizeProperties().
| bool clang::ObjCRuntime::isGNUFamily | ( | ) | const [inline] |
Is this runtime basically of the GNU family of runtimes?
Definition at line 112 of file ObjCRuntime.h.
References FragileMacOSX, GCC, getKind(), GNUstep, iOS, MacOSX, and ObjFW.
Referenced by EncodeBitField(), clang::CodeGen::CodeGenModule::GetAddrOfRTTIDescriptor(), and isNeXTFamily().
| bool clang::ObjCRuntime::isLegacyDispatchDefaultForArch | ( | llvm::Triple::ArchType | Arch | ) | [inline] |
The default dispatch mechanism to use for the specified architecture.
Definition at line 93 of file ObjCRuntime.h.
References getKind(), getVersion(), GNUstep, isNonFragile(), and MacOSX.
Referenced by clang::driver::tools::Clang::ConstructJob().
| bool clang::ObjCRuntime::isNeXTFamily | ( | ) | const [inline] |
Is this runtime basically of the NeXT family of runtimes?
Definition at line 127 of file ObjCRuntime.h.
References isGNUFamily().
Referenced by CheckProtocolMethodDefs(), clang::driver::tools::Clang::ConstructJob(), and InitializePredefinedMacros().
| bool clang::ObjCRuntime::isNonFragile | ( | ) | const [inline] |
Does this runtime follow the set of implied behaviors for a "non-fragile" ABI?
Definition at line 76 of file ObjCRuntime.h.
References FragileMacOSX, GCC, getKind(), GNUstep, iOS, MacOSX, and ObjFW.
Referenced by clang::Sema::ActOnAtEnd(), clang::Sema::ActOnDefs(), clang::Sema::ActOnPropertyImplDecl(), clang::Sema::CheckImplementationIvars(), clang::driver::tools::Clang::ConstructJob(), DiagnoseUnimplementedAccessor(), clang::CodeGen::CodeGenModule::GetAddrOfConstantString(), HasFeature(), clang::Sema::ImplMethodsVsClassMethods(), InitializePredefinedMacros(), isFragile(), isLegacyDispatchDefaultForArch(), and shouldUseExceptionTablesForObjCExceptions().
| bool clang::ObjCRuntime::isSubscriptPointerArithmetic | ( | ) | const [inline] |
Is subscripting pointer arithmetic?
Definition at line 235 of file ObjCRuntime.h.
References allowsPointerArithmetic().
| void clang::ObjCRuntime::set | ( | Kind | kind, |
| VersionTuple | version | ||
| ) | [inline] |
Definition at line 66 of file ObjCRuntime.h.
| bool ObjCRuntime::tryParse | ( | StringRef | input | ) |
Try to parse an Objective-C runtime specification from the given string.
Definition at line 43 of file ObjCRuntime.cpp.
References FragileMacOSX, GCC, GNUstep, iOS, MacOSX, ObjFW, and clang::VersionTuple::tryParse().
Referenced by ParseLangArgs().
| bool operator!= | ( | const ObjCRuntime & | left, |
| const ObjCRuntime & | right | ||
| ) | [friend] |
Definition at line 306 of file ObjCRuntime.h.
| bool operator== | ( | const ObjCRuntime & | left, |
| const ObjCRuntime & | right | ||
| ) | [friend] |
Definition at line 301 of file ObjCRuntime.h.