167 releases (63 breaking)

Uses new Rust 2024

new 0.130.1 Apr 9, 2026
0.130.0 Mar 20, 2026
0.129.2 Apr 9, 2026
0.129.1 Feb 25, 2026
0.66.0 Jul 16, 2020

#626 in Encoding

Apache-2.0 WITH LLVM-exception

4.5MB
101K SLoC

This crate performs serialization of the Cranelift IR.

This crate is structured as an optional ability to serialize and deserialize cranelift IR into JSON format.

Status

Cranelift IR can be serialized into JSON.

Deserialize is a work in progress, as it currently deserializes into the serializable data structure that can be utilized by serde instead of the actual Cranelift IR data structure.

Building and Using Cranelift Serde

clif-json usage:

clif-json serialize [-p] <file>
clif-json deserialize <file>

Where the -p flag outputs Cranelift IR as pretty JSON.

For example to build and use clif-json:

cd cranelift-serde
cargo build
clif-json serialize -p test.clif

Dependencies

~8MB
~153K SLoC