class GCStrategy

Declaration

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

Description

GCStrategy describes a garbage collector algorithm's code generation requirements, and provides overridable hooks for those needs which cannot be abstractly described. GCStrategy objects must be looked up through the Function. The objects themselves are owned by the Context and must be immutable.

Declared at: llvm/include/llvm/CodeGen/GCStrategy.h:66

Member Variables

protected bool UseStatepoints = false
protected bool NeededSafePoints = false
if set, calls are inferred to be safepoints
protected bool UsesMetadata = false
If set, backend must emit metadata tables.

Method Overview

Methods

GCStrategy()

Declared at: llvm/include/llvm/CodeGen/GCStrategy.h:81

const std::string& getName() const

Description

Return the name of the GC strategy. This is the value of the collector name string specified on functions which use this strategy.

Declared at: llvm/include/llvm/CodeGen/GCStrategy.h:86

virtual Optional<bool> isGCManagedPointer(
    const llvm::Type* Ty) const

Description

If the type specified can be reliably distinguished, returns true for pointers to GC managed locations and false for pointers to non-GC managed locations. Note a GCStrategy can always return 'None' (i.e. an empty optional indicating it can't reliably distinguish.

Declared at: llvm/include/llvm/CodeGen/GCStrategy.h:99

Parameters

const llvm::Type* Ty

bool needsSafePoints() const

Description

True if safe points need to be inferred on call sites

Declared at: llvm/include/llvm/CodeGen/GCStrategy.h:111

bool useStatepoints() const

Description

Returns true if this strategy is expecting the use of gc.statepoints, and false otherwise.

Declared at: llvm/include/llvm/CodeGen/GCStrategy.h:90

bool usesMetadata() const

Description

If set, appropriate metadata tables must be emitted by the back-end (assembler, JIT, or otherwise). For statepoint, this method is currently unsupported. The stackmap information can be found in the StackMap section as described in the documentation.

Declared at: llvm/include/llvm/CodeGen/GCStrategy.h:117

virtual ~GCStrategy()

Declared at: llvm/include/llvm/CodeGen/GCStrategy.h:82