mirjit.core

mirjit.core — bindings to mir.h (the MIR core API).

static inline helpers from the header (MIR_init / MIR_init2) are reimplemented as D functions at the bottom; everything else is a 1:1 extern(C) declaration.

Public Imports

mirjit.types
public import mirjit.types;
Undocumented in source.

Members

Functions

MIR_init
MIR_context_t MIR_init()

Create a context with default allocators.

MIR_init2
MIR_context_t MIR_init2(MIR_alloc_t alloc, MIR_code_alloc_t code_alloc)

Create a context with custom allocators, checking the API version.

mirFindFunc
MIR_item_t mirFindFunc(MIR_context_t ctx, const(char)* name)

Find a function item by name across all loaded modules in ctx. Use this instead of MIR_get_global_item (declared in mir.h but not implemented).

mirModules
auto mirModules(MIR_context_t ctx)

Iterate the modules currently in ctx (e.g. those created by c2mir_compile). Newest modules are at the tail.