Skip to content

Commit

Permalink
build: update LLVM to 17
Browse files Browse the repository at this point in the history
  • Loading branch information
sbwtw committed Apr 13, 2024
1 parent 7077509 commit 6c26676
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 7 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ jobs:

- uses: KyleMayes/install-llvm-action@v1
with:
version: "16.0"
directory: ${{ runner.temp }}/llvm-16
version: "17.0"
directory: ${{ runner.temp }}/llvm-17

- uses: actions/checkout@v3
- name: Build
run: cargo build --verbose
env:
LLVM_SYS_160_PREFIX: ${{ runner.temp }}/llvm-16
LLVM_SYS_170_PREFIX: ${{ runner.temp }}/llvm-17
- name: Run tests
run: cargo test --verbose
env:
LLVM_SYS_160_PREFIX: ${{ runner.temp }}/llvm-16
LLVM_SYS_170_PREFIX: ${{ runner.temp }}/llvm-17
24 changes: 22 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ inkwell = { version = "*", optional = true, features = ["llvm16-0-no-llvm-linkin
[build-dependencies]
cbindgen = "*"
lalrpop = { version = "*", optional = true }
llvm-sys = { version = "160", optional = true, features = ["prefer-dynamic"] }
llvm-sys = { version = "170", optional = true, features = ["prefer-dynamic"] }

[features]
default = ["use_lalrpop", "llvm_backend"]
Expand Down
4 changes: 4 additions & 0 deletions lib/src/analysis/type_analyze.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,22 @@ impl TypeAnalyzer {
.unwrap_or(&self.local_scope)
}

#[inline]
fn top(&self) -> &TypeAnalyzerAttribute {
self.attribute_stack.last().unwrap()
}

#[inline]
fn top_mut(&mut self) -> &mut TypeAnalyzerAttribute {
self.attribute_stack.last_mut().unwrap()
}

#[inline]
fn push(&mut self, attr: TypeAnalyzerAttribute) {
self.attribute_stack.push(attr)
}

#[inline]
fn push_default(&mut self) {
self.push(TypeAnalyzerAttribute::default())
}
Expand Down

0 comments on commit 6c26676

Please sign in to comment.