Skip to content

Commit 0d0a31c

Browse files
committed
Use features in LLVM wrapper instead of branch
1 parent 86abfb4 commit 0d0a31c

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Make sure you have
2424
2. Cloned this repository (follow the instructions in each chapter)
2525
3. LLVM installed to run and test locally `cargo test --tests`
2626
* 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 = { ..., branch = "your-llvm-version" }` with LLVM version on your system (output of `llvm-config --version`)
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`)
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

+2-2
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 `branch = "llvm=10-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 `10.0.0` so I'm using `features = ["llvm10-0"]` in inkwell
77

88
```text
9-
inkwell = { git = "https://github.com/TheDan64/inkwell", branch = "llvm10-0" }
9+
inkwell = { git = "https://github.com/TheDan64/inkwell", branch = "master", features = ["llvm10-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`.

calculator/Cargo.toml

+1-1
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 = "llvm10-0" } # use branch according to your llvm version
11+
inkwell = { git = "https://github.com/TheDan64/inkwell", branch = "master", features = ["llvm10-0"] } # use correct feature according to your llvm version
1212
rustyline = "6.2"
1313
cfg-if = "0.1"
1414

calculator/src/compiler/jit.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use inkwell::{
22
builder::Builder, context::Context, execution_engine::JitFunction, types::IntType,
3-
values::IntValue, OptimizationLevel,
3+
values::IntValue, values::AnyValue, OptimizationLevel,
44
};
55

66
use crate::{Compile, Node, Operator, Result};

0 commit comments

Comments
 (0)