diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 50548bef..4c3601e4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -95,8 +95,6 @@ jobs: code-coverage: name: Collect code coverage runs-on: ubuntu-latest - # Temporarily disabled due to clang miscompilation? - if: false steps: - uses: actions/checkout@v2 - name: Install Rust @@ -109,7 +107,10 @@ jobs: - name: Install LLVM run: | - sudo apt-get install -y llvm + wget https://apt.llvm.org/llvm.sh + chmod +x llvm.sh + sudo ./llvm.sh 18 + sudo apt-get install -y llvm-18 llvm-18-dev clang-tools-18 - name: Install Tree-sitter (with runtime) run: | @@ -125,7 +126,7 @@ jobs: - name: Build dist-check with coverage timeout-minutes: 10 - run: make coverage -j8 + run: CC=clang-18 LLVM_SUFFIX=-18 make coverage -j8 - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v3 diff --git a/Makefile b/Makefile index 5602e814..650a0ff3 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ else ifdef FAST_DEBUG CFLAGS += -g0 ALUMINA_FLAGS += --debug else ifdef COVERAGE - CC = clang + CC ?= clang BUILD_DIR = $(BUILD_ROOT)/coverage CARGO_FLAGS += --profile coverage CARGO_TARGET_DIR = target/coverage @@ -326,18 +326,18 @@ coverage: COVERAGE=1 CACHE_AST=1 $(MAKE) all-tests-with-coverage all-tests-with-coverage: test test-docs test-libraries test-diag examples - llvm-profdata merge \ + llvm-profdata$(LLVM_SUFFIX) merge \ -sparse \ $(BUILD_DIR)/profiles/* \ -o $(BUILD_DIR)/profiles/merged.profdata - llvm-cov export \ + llvm-cov$(LLVM_SUFFIX) export \ -Xdemangler=rustfilt \ -format=lcov \ -instr-profile=$(BUILD_DIR)/profiles/merged.profdata $(ALUMINA_BOOT) \ $(BOOTSTRAP_SOURCES) > $(BUILD_DIR)/coverage.txt - llvm-cov show \ + llvm-cov$(LLVM_SUFFIX) show \ -Xdemangler=rustfilt \ -format=html \ -instr-profile=$(BUILD_DIR)/profiles/merged.profdata $(ALUMINA_BOOT) \ diff --git a/src/alumina-boot-macros/src/lib.rs b/src/alumina-boot-macros/src/lib.rs index 90b222ea..0306d04b 100644 --- a/src/alumina-boot-macros/src/lib.rs +++ b/src/alumina-boot-macros/src/lib.rs @@ -96,8 +96,8 @@ pub fn ast_serializable(input: TokenStream) -> TokenStream { } }); - let deserialize_fields = variant.fields.iter().enumerate() - .map(|(_i, f)| { + let deserialize_fields = variant.fields.iter() + .map(|f| { let ty = &f.ty; quote! { <#ty as #module_path::AstSerializable<#lifetime>>::deserialize(deserializer)? @@ -167,8 +167,8 @@ pub fn ast_serializable(input: TokenStream) -> TokenStream { } }); - let deserialize_fields = r#struct.fields.iter().enumerate() - .map(|(_i, f)| { + let deserialize_fields = r#struct.fields.iter() + .map(|f| { let ty = &f.ty; if let Some(field) = &f.ident { quote! { diff --git a/src/alumina-boot/src/ast/serialization.rs b/src/alumina-boot/src/ast/serialization.rs index 5b892f3b..a4559c7f 100644 --- a/src/alumina-boot/src/ast/serialization.rs +++ b/src/alumina-boot/src/ast/serialization.rs @@ -467,6 +467,7 @@ impl<'ast> DeserializeContext<'ast> { } pub struct AstDeserializer<'ast, R: std::io::Read> { + #[allow(dead_code)] pub global_ctx: GlobalCtx, pub ast: &'ast AstCtx<'ast>, context: DeserializeContext<'ast>, diff --git a/src/alumina-boot/src/ir/mod.rs b/src/alumina-boot/src/ir/mod.rs index ef205f98..c1318300 100644 --- a/src/alumina-boot/src/ir/mod.rs +++ b/src/alumina-boot/src/ir/mod.rs @@ -279,6 +279,7 @@ pub struct StructLike<'ir> { pub attributes: &'ir [Attribute<'ir>], pub fields: &'ir [Field<'ir>], pub is_union: bool, + #[allow(dead_code)] pub span: Option, } @@ -321,6 +322,7 @@ pub struct Closure<'ir> { pub struct Protocol<'ir> { pub name: Option<&'ir str>, pub methods: &'ir [ProtocolFunction<'ir>], + #[allow(dead_code)] pub span: Option, } @@ -348,6 +350,7 @@ pub struct Enum<'ir> { pub name: Option<&'ir str>, pub underlying_type: TyP<'ir>, pub members: &'ir [EnumMember<'ir>], + #[allow(dead_code)] pub span: Option, }