Skip to content

Commit 06b971a

Browse files
committed
Upgrade to llvm 14
1 parent 3dbc9ae commit 06b971a

File tree

8 files changed

+11
-11
lines changed

8 files changed

+11
-11
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
run: |
4040
wget https://apt.llvm.org/llvm.sh
4141
chmod +x llvm.sh
42-
sudo ./llvm.sh 10
42+
sudo ./llvm.sh 14
4343
4444
- name: Clippy lint
4545
run: |

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ Make sure you have
2323
1. [Rust toolchain installed](https://www.rust-lang.org/tools/install)
2424
2. Cloned this repository (follow the instructions in each chapter)
2525
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`)
2828

2929

3030
To build the book locally, navigate to the `book` subdirectory and follow the instructions in [mdbook](https://github.com/rust-lang/mdBook).

book/src/01_calculator/basic_llvm.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33

44
### Setup
55

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
77

88
```text
9-
inkwell = { git = "https://github.com/TheDan64/inkwell", branch = "master", features = ["llvm10-0"] }
9+
inkwell = { git = "https://github.com/TheDan64/inkwell", branch = "master", features = ["llvm14-0"] }
1010
```
1111

1212
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`.

book/src/01_calculator/jit_intro.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ JIT compilation is a combination of Ahead-Of-Time (AOT) compilation and interpre
66

77
[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.
88

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.
1010

1111
### Alternatives
1212

book/src/intro.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ The accompanying codes and materials for this book are available in [GitHub](htt
1616
```
1717
1818
* 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`)
2121
2222
## Motivations and Goals
2323

calculator/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ edition = "2018"
88
pest = "2.1"
99
pest_derive = "2.1"
1010
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
1212
rustyline = "6.2"
1313
cfg-if = "0.1"
1414

calculator/examples/llvm/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ authors = ["ehsanmok <[email protected]>"]
55
edition = "2018"
66

77
[dependencies]
8-
inkwell = { git = "https://github.com/TheDan64/inkwell", branch = "llvm10-0" }
8+
inkwell = { git = "https://github.com/TheDan64/inkwell", branch = "master", features = ["llvm14-0"] }

calculator/src/compiler/vm/bytecode.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::compiler::vm::{make_op, OpCode};
22
use crate::{Compile, Node, Operator};
33

4-
#[derive(Debug, Clone, PartialEq)]
4+
#[derive(Debug, Clone, PartialEq, Eq)]
55
// ANCHOR: bytecode
66
pub struct Bytecode {
77
pub instructions: Vec<u8>,

0 commit comments

Comments
 (0)