CModule

A compiled C translation unit. Owns the MIR context; hands out typed native function pointers via get. Non-copyable; frees all code on destruction.

Destructor

A destructor is present on this object, but not explicitly documented in the source.

Postblit

A postblit is present on this object, but not explicitly documented in the source.

Members

Functions

context
MIR_context_t context()

The underlying MIR context, for dropping down to the raw API.

functions
string[] functions()

Names of every function defined in the module.

get
auto get(string name)

Generate (lazily, then cache) the named C function and return it as a typed function pointer. Fn is the function-pointer type to retrieve, e.g. int function(int, int); its linkage and attributes are normalized, so the returned pointer is always extern(C) ... nothrow @nogc. A zero-parameter function is just get!(int function()).

has
bool has(string name)

True if a function with this name was compiled into the module.