Beaver.Deferred (beaver v0.4.8)

Copy Markdown

Functions to work with IR entities not eagerly created. Usually it is an attribute/type doesn't get created until there is a MLIR context from block/op state.

Summary

Types

attribute()

@type attribute() :: contextual(Beaver.MLIR.Attribute.t())

context_arg()

@type context_arg() :: Beaver.MLIR.Context.t()

contextual(t)

@type contextual(t) :: t | (context_arg() -> t)

deferred(t)

@type deferred(t) :: contextual(t)

operation()

@type operation() :: contextual(Beaver.MLIR.Operation.t())

opts()

@type opts() :: [{:ctx, context_arg()}]

type()

@type type() :: contextual(Beaver.MLIR.Type.t())

Functions

create(f, ctx)

fetch_context(opts)

@spec fetch_context(opts :: opts()) :: Beaver.MLIR.Context.t() | nil

fetch_insertion_point(opts)

@spec fetch_insertion_point(opts :: opts()) ::
  Beaver.MLIR.Block.t()
  | Beaver.MLIR.PatternRewriter.t()
  | Beaver.MLIR.RewriterBase.t()
  | Macro.t()
  | nil

from_opts(opts, f)

@spec from_opts(opts(), (context_arg() -> t)) :: contextual(t) when t: var