diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 5554773..46d15fb 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -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 diff --git a/Cargo.lock b/Cargo.lock index 16be1cf..6816deb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -913,7 +913,7 @@ dependencies = [ "either", "inkwell_internals", "libc", - "llvm-sys", + "llvm-sys 160.1.4", "once_cell", "thiserror", ] @@ -1036,6 +1036,20 @@ dependencies = [ "semver", ] +[[package]] +name = "llvm-sys" +version = "170.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eed90f72df5504c0af2e3a08ee7762a4a3e42ec2605811fc19f64879de40c50a" +dependencies = [ + "anyhow", + "cc", + "lazy_static", + "libc", + "regex-lite", + "semver", +] + [[package]] name = "lock_api" version = "0.4.11" @@ -1476,6 +1490,12 @@ dependencies = [ "regex-syntax 0.8.3", ] +[[package]] +name = "regex-lite" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30b661b2f27137bdbc16f00eda72866a92bb28af1753ffbd56744fb6e2e9cd8e" + [[package]] name = "regex-syntax" version = "0.6.29" @@ -1662,7 +1682,7 @@ dependencies = [ "inkwell", "lalrpop", "lalrpop-util", - "llvm-sys", + "llvm-sys 170.0.1", "log", "once_cell", "regex", diff --git a/lib/Cargo.toml b/lib/Cargo.toml index dd26921..32adfa3 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -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"] diff --git a/lib/src/analysis/type_analyze.rs b/lib/src/analysis/type_analyze.rs index 589dc5e..051849c 100644 --- a/lib/src/analysis/type_analyze.rs +++ b/lib/src/analysis/type_analyze.rs @@ -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()) }