Skip to content

Commit 35f4a25

Browse files
committed
Add documentation
1 parent 3f6a3b5 commit 35f4a25

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

Readme.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,14 @@ or
7171
$ $cg_clif_dir/build/bin/cg_clif -Cllvm-args=mode=jit -Cprefer-dynamic my_crate.rs
7272
```
7373

74+
There is also an experimental lazy jit mode. In this mode functions are only compiled once they are
75+
first called. It currently does not work with multi-threaded programs. When a not yet compiled
76+
function is called from another thread than the main thread, you will get an ICE.
77+
78+
```bash
79+
$ $cg_clif_dir/build/cargo.sh lazy-jit
80+
```
81+
7482
### Shell
7583

7684
These are a few functions that allow you to easily run rust code from the shell using cg_clif as jit.

scripts/cargo.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ shift || true
1111

1212
if [[ "$cmd" = "jit" ]]; then
1313
cargo "+${TOOLCHAIN}" rustc "$@" -- -Cllvm-args=mode=jit -Cprefer-dynamic
14+
elif [[ "$cmd" = "lazy-jit" ]]; then
15+
cargo "+${TOOLCHAIN}" rustc "$@" -- -Cllvm-args=mode=jit-lazy -Cprefer-dynamic
1416
else
1517
cargo "+${TOOLCHAIN}" "$cmd" "$@"
1618
fi

0 commit comments

Comments
 (0)