class ObjCRuntime

Declaration

class ObjCRuntime { /* full declaration omitted */ };

Description

The basic abstraction for the target Objective-C runtime.

Declared at: clang/include/clang/Basic/ObjCRuntime.h:28

Member Variables

private clang::ObjCRuntime::Kind TheKind = MacOSX
private llvm::VersionTuple Version

Method Overview

Methods

ObjCRuntime(clang::ObjCRuntime::Kind kind,
            const llvm::VersionTuple& version)

Declared at: clang/include/clang/Basic/ObjCRuntime.h:69

Parameters

clang::ObjCRuntime::Kind kind
const llvm::VersionTuple& version

ObjCRuntime()

Description

A bogus initialization of the runtime.

Declared at: clang/include/clang/Basic/ObjCRuntime.h:68

bool allowsARC() const

Description

Does this runtime allow ARC at all?

Declared at: clang/include/clang/Basic/ObjCRuntime.h:142

bool allowsClassStubs() const

Description

Returns true if this Objective-C runtime supports Objective-C class stubs.

Declared at: clang/include/clang/Basic/ObjCRuntime.h:435

bool allowsDirectDispatch() const

Description

Does this runtime supports direct dispatch

Declared at: clang/include/clang/Basic/ObjCRuntime.h:451

bool allowsPointerArithmetic() const

Description

Does this runtime allow pointer arithmetic on objects? This covers +, -, ++, --, and (if isSubscriptPointerArithmetic() yields true) [].

Declared at: clang/include/clang/Basic/ObjCRuntime.h:324

bool allowsSizeofAlignof() const

Description

Does this runtime allow sizeof or alignof on object types?

Declared at: clang/include/clang/Basic/ObjCRuntime.h:316

bool allowsWeak() const

Description

Does this runtime allow the use of __weak?

Declared at: clang/include/clang/Basic/ObjCRuntime.h:283

std::string getAsString() const

Declared at: clang/include/clang/Basic/ObjCRuntime.h:470

clang::ObjCRuntime::Kind getKind() const

Declared at: clang/include/clang/Basic/ObjCRuntime.h:77

const llvm::VersionTuple& getVersion() const

Declared at: clang/include/clang/Basic/ObjCRuntime.h:78

bool hasARCUnsafeClaimAutoreleasedReturnValue()
    const

Description

Is objc_unsafeClaimAutoreleasedReturnValue available?

Declared at: clang/include/clang/Basic/ObjCRuntime.h:403

bool hasAtomicCopyHelper() const

Declared at: clang/include/clang/Basic/ObjCRuntime.h:389

bool hasEmptyCollections() const

Description

Are the empty collection symbols available?

Declared at: clang/include/clang/Basic/ObjCRuntime.h:420

bool hasNativeARC() const

Description

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.

Declared at: clang/include/clang/Basic/ObjCRuntime.h:162

bool hasNativeWeak() const

Description

Does this runtime natively provide ARC-compliant 'weak' entrypoints?

Declared at: clang/include/clang/Basic/ObjCRuntime.h:289

bool hasOptimizedSetter() const

Description

Does this runtime supports optimized setter entrypoints?

Declared at: clang/include/clang/Basic/ObjCRuntime.h:267

bool hasSubscripting() const

Description

Does this runtime directly support the subscripting methods? This is really a property of the library, not the runtime.

Declared at: clang/include/clang/Basic/ObjCRuntime.h:298

bool hasTerminate() const

Description

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.

Declared at: clang/include/clang/Basic/ObjCRuntime.h:348

bool hasUnwindExceptions() const

Description

Does this runtime use zero-cost exceptions?

Declared at: clang/include/clang/Basic/ObjCRuntime.h:376

bool hasWeakClassImport() const

Description

Does this runtime support weakly importing classes?

Declared at: clang/include/clang/Basic/ObjCRuntime.h:362

bool isFragile() const

Description

The inverse of isNonFragile(): does this runtime follow the set of implied behaviors for a "fragile" ABI?

Declared at: clang/include/clang/Basic/ObjCRuntime.h:97

bool isGNUFamily() const

Description

Is this runtime basically of the GNU family of runtimes?

Declared at: clang/include/clang/Basic/ObjCRuntime.h:119

bool isLegacyDispatchDefaultForArch(
    llvm::Triple::ArchType Arch)

Description

The default dispatch mechanism to use for the specified architecture

Declared at: clang/include/clang/Basic/ObjCRuntime.h:100

Parameters

llvm::Triple::ArchType Arch

bool isNeXTFamily() const

Description

Is this runtime basically of the NeXT family of runtimes?

Declared at: clang/include/clang/Basic/ObjCRuntime.h:135

bool isNonFragile() const

Description

Does this runtime follow the set of implied behaviors for a "non-fragile" ABI?

Declared at: clang/include/clang/Basic/ObjCRuntime.h:82

bool isSubscriptPointerArithmetic() const

Description

Is subscripting pointer arithmetic?

Declared at: clang/include/clang/Basic/ObjCRuntime.h:340

void set(clang::ObjCRuntime::Kind kind,
         llvm::VersionTuple version)

Declared at: clang/include/clang/Basic/ObjCRuntime.h:72

Parameters

clang::ObjCRuntime::Kind kind
llvm::VersionTuple version

bool shouldUseARCFunctionsForRetainRelease() const

Description

Does this runtime provide ARC entrypoints that are likely to be faster than an ordinary message send of the appropriate selector? The ARC entrypoints are guaranteed to be equivalent to just sending the corresponding message. If the entrypoint is implemented naively as just a message send, using it is a trade-off: it sacrifices a few cycles of overhead to save a small amount of code. However, it's possible for runtimes to detect and special-case classes that use "standard" retain/release behavior; if that's dynamically a large proportion of all retained objects, using the entrypoint will also be faster than using a message send. When this method returns true, Clang will turn non-super message sends of certain selectors into calls to the correspond entrypoint: retain => objc_retain release => objc_release autorelease => objc_autorelease

Declared at: clang/include/clang/Basic/ObjCRuntime.h:193

bool shouldUseRuntimeFunctionForCombinedAllocInit()
    const

Description

Does this runtime provide the objc_alloc_init entrypoint? This can apply the same optimization as objc_alloc, but also sends an -init message, reducing code size on the caller.

Declared at: clang/include/clang/Basic/ObjCRuntime.h:253

bool shouldUseRuntimeFunctionsForAlloc() const

Description

Does this runtime provide entrypoints that are likely to be faster than an ordinary message send of the "alloc" selector? The "alloc" entrypoint is guaranteed to be equivalent to just sending the corresponding message. If the entrypoint is implemented naively as just a message send, using it is a trade-off: it sacrifices a few cycles of overhead to save a small amount of code. However, it's possible for runtimes to detect and special-case classes that use "standard" alloc behavior; if that's dynamically a large proportion of all objects, using the entrypoint will also be faster than using a message send. When this method returns true, Clang will turn non-super message sends of certain selectors into calls to the corresponding entrypoint: alloc => objc_alloc allocWithZone:nil => objc_allocWithZone

Declared at: clang/include/clang/Basic/ObjCRuntime.h:229

bool tryParse(llvm::StringRef input)

Description

Try to parse an Objective-C runtime specification from the given string.

Declared at: clang/include/clang/Basic/ObjCRuntime.h:468

Parameters

llvm::StringRef input

Returns

true on error.