MIR project bindings for Rust
This is the low-level binding that only exposes raw C types and functions, and handles compilation and linking of C code.
See mir-rs crate for high-level ergonomic APIs.
Source
The source code of mir C library is bundled in this package. Since upstream lacks some API/features that are necessary for Rust integration, we use a forked version of mir.
The fork can be seen at this repo, and the current revision is based on upstream version v1.0.0.
⚠️ The API/ABI is NOT compatible with upstream mir library.
Features
⚠️ Warning: Currently, due to lack of support of bindgen,
extern functions may still be generated even with corresponding feature disabled.
Be careful to avoid using them when disabling features, or you may encounter link errors.
-
default: Impliesio,scan,interp,gen. -
io: De/serialization of MIR memory representation into/from bytes. If disabled, C macroMIR_NO_IOis set for compilation.Guarded APIs:
MIR_write{,_module}{,_with_func}MIR_read{,_with_func}
-
scan: Parsing of MIR textual representation. If disabled, C macroMIR_NO_SCANis set for compilation.Guarded API:
MIR_scan_string
-
interp: Enables MIR interpreter. If disabled, C macroMIR_NO_INTERPis set for compilation.Guarded APIs:
MIR_interp*
-
gen: MIR native code generator. If disabled,mir-gen.cwill not be compiled.Guarded APIs:
MIR_gen*MIR_set_*_gen_interface
-
gen-debug: Debug logging in MIR native code generator. It impliesgen. If disabled, C macroMIR_NO_GEN_DEBUGis set for compilation.Guarded APIs:
MIR_gen_set_debug_{file,level}
-
assert: Debug assertions. If disabled, C macroNDEBUGis set for compilation. It is implicitly enabled whendebug_assertionsis on (eg. in dev profile).