Context

public class Context

A Context represents execution states for the core LLVM IR system.

  • Retrieves the global context instance.

    Declaration

    Swift

    public static let global: Context
  • Creates a Context object using LLVMContextCreate

    Declaration

    Swift

    public init()
  • Creates a Context object from an LLVMContextRef object.

    Declaration

    Swift

    public init(llvm: LLVMContextRef, ownsContext: Bool = false)
  • Returns whether the given context is set to discard all value names.

    If true, only the names of GlobalValue objects will be available in the IR. This can be used to save memory and runtime, especially in release mode.

    Declaration

    Swift

    public var discardValueNames: Bool { get set }
  • Deinitialize this value and dispose of its resources.

    Declaration

    Swift

    deinit
  • Searches for and retrieves a metadata kind with the given name in this context. If none is found, one with that name is created and its unique identifier is returned.

    Declaration

    Swift

    public func metadataKind(named name: String, in context: Context = .global) -> UInt32