1 unstable release
new 0.2.0 | Mar 7, 2025 |
---|---|
0.1.0+mir.0.1.1 |
|
#940 in Programming languages
24 downloads per month
Used in mir-rs
1.5MB
34K
SLoC
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_IO
is 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_SCAN
is set for compilation.Guarded API:
MIR_scan_string
-
interp
: Enables MIR interpreter. If disabled, C macroMIR_NO_INTERP
is set for compilation.Guarded APIs:
MIR_interp*
-
gen
: MIR native code generator. If disabled,mir-gen.c
will 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_DEBUG
is set for compilation.Guarded APIs:
MIR_gen_set_debug_{file,level}
-
assert
: Debug assertions. If disabled, C macroNDEBUG
is set for compilation. It is implicitly enabled whendebug_assertions
is on (eg. in dev profile).