You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2. Cloned this repository (follow the instructions in each chapter)
25
25
3. LLVM installed to run and test locally `cargo test --tests`
26
-
* Easiest option is LLVM v10.0 ([Debian/Ubuntu](https://apt.llvm.org/) or [macOS](https://formulae.brew.sh/formula/llvm))
27
-
* Otherwise, in `Cargo.toml` you'd need to change the `inkwell = { ..., features = ["your-llvm-version"] }` with LLVM version on your system (output of `llvm-config --version`)
26
+
* Easiest option is LLVM v14.0 ([Debian/Ubuntu](https://apt.llvm.org/) or [macOS](https://formulae.brew.sh/formula/llvm))
27
+
* Otherwise, in `Cargo.toml` you'd need to change the `inkwell = { ..., branch = "master", features = ["your-llvm-version"] }` with LLVM version on your system (output of `llvm-config --version`)
28
28
29
29
30
30
To build the book locally, navigate to the `book` subdirectory and follow the instructions in [mdbook](https://github.com/rust-lang/mdBook).
Copy file name to clipboardExpand all lines: book/src/01_calculator/basic_llvm.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,10 +3,10 @@
3
3
4
4
### Setup
5
5
6
-
The code is available in [`calculator/examples/llvm/src/main.rs`](https://github.com/ehsanmok/create-your-own-lang-with-rust/blob/master/calculator/examples/llvm/src/main.rs). Because my `llvm-config --version` shows `10.0.0` so I'm using `features = ["llvm10-0"]` in inkwell
6
+
The code is available in [`calculator/examples/llvm/src/main.rs`](https://github.com/ehsanmok/create-your-own-lang-with-rust/blob/master/calculator/examples/llvm/src/main.rs). Because my `llvm-config --version` shows `14.0.6` so I'm using `features = ["llvm14-0"]` in inkwell
Go to [`calculator/examples/llvm`](https://github.com/ehsanmok/create-your-own-lang-with-rust/blob/master/calculator/examples/llvm/) sub-crate and `cargo run`.
Copy file name to clipboardExpand all lines: book/src/01_calculator/jit_intro.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ JIT compilation is a combination of Ahead-Of-Time (AOT) compilation and interpre
6
6
7
7
[LLVM](https://en.wikipedia.org/wiki/LLVM) (which is *not* an acronym) is a mature compiler backend (code generator) infrastructure powering many languages such as [Clang](https://clang.llvm.org/), [Rust](https://www.rust-lang.org/), [Swift](https://swift.org/), etc. It has its own IR and Virtual Machine Bytecode abstracting away the underlying platform-specific differences.
8
8
9
-
We will use [inkwell](https://github.com/TheDan64/inkwell) which provides a safe Rust wrapper around LLVM. Remember to use the branch according to your installed `llvm-config --version`.
9
+
We will use [inkwell](https://github.com/TheDan64/inkwell) which provides a safe Rust wrapper around LLVM.
Copy file name to clipboardExpand all lines: book/src/intro.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,8 +16,8 @@ The accompanying codes and materials for this book are available in [GitHub](htt
16
16
```
17
17
18
18
* LLVM installed to run and test locally `cargo test --tests`
19
-
* Easiest option is LLVM v10.0 ([Debian/Ubuntu](https://apt.llvm.org/) or [macOS](https://formulae.brew.sh/formula/llvm))
20
-
* Otherwise, in `Cargo.toml` you'd need to change the `inkwell = { ..., branch = "your-llvm-version" }` with LLVM version on your system (output of `llvm-config --version`)
19
+
* Easiest option is LLVM v14.0 ([Debian/Ubuntu](https://apt.llvm.org/) or [macOS](https://formulae.brew.sh/formula/llvm))
20
+
* Otherwise, in `Cargo.toml` you'd need to change the `inkwell = { ..., branch = "master", features = ["your-llvm-version"] }` with LLVM version on your system (output of `llvm-config --version`)
Copy file name to clipboardExpand all lines: calculator/Cargo.toml
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ edition = "2018"
8
8
pest = "2.1"
9
9
pest_derive = "2.1"
10
10
anyhow = "1.0"
11
-
inkwell = { git = "https://github.com/TheDan64/inkwell", branch = "master", features = ["llvm10-0"] } # use correct feature according to your llvm version
11
+
inkwell = { git = "https://github.com/TheDan64/inkwell", branch = "master", features = ["llvm14-0"] } # use correct feature according to your llvm version
0 commit comments