Thrown by jit when c2mir rejects the C source. The message carries the diagnostics c2mir produced.
Thrown by CModule.get when the requested D signature is incompatible with the compiled C function's prototype.
Thrown by CModule.get when no function of that name exists.
Compile one translation unit of C source to MIR and return an owning CModule. C syntax/semantic errors surface here as CompileException.
mirjit.cjit — an idiomatic D layer over the c2mir C11->MIR frontend.
Compile a translation unit of C source once with jit, then pull out typed, native function pointers with CModule.get:
get takes the function-pointer type you want to retrieve, e.g. int function(int, int) or a named alias. Whatever linkage and attributes it carries are normalized to extern(C) ... nothrow @nogc. Only C-compatible scalar and pointer types are accepted; anything else is a compile-time error.
CModule owns the MIR context and all generated code: the returned function pointers are valid only while the CModule is alive (same contract as a dlopen handle). It is non-copyable and frees everything in its destructor.
This module is only compiled when the MirjitC2mir version is set, which the with-c2mir dub configuration does (it also links the c2mir frontend).