GCC Code Coverage Report


src/
Coverage:
low: ≥ 0%
medium: ≥ 75.0%
high: ≥ 90.0%
Lines:
9 / 9
100.0%
Branches:
2 / 2, 2 excl
100.0%
Functions:
2 / 2
100.0%

linker/bitcode-linker.spice
Line Branch Exec Source
1 // Copyright (c) 2021-2026 ChilliBits. All rights reserved.
2
3 // Std imports
4 import "std/bindings/llvm/llvm" as llvm;
5
6 // Own imports
7 import "@/compiler-pass";
8 import "@/source-file";
9 import "@/global/global-resource-manager";
10
11 /**
12 * Links the modules of all source files into the LTO module
13 */
14 public type BitcodeLinker struct {
15 compose public CompilerPass compilerPass
16 }
17
18 2 public p BitcodeLinker.ctor(GlobalResourceManager& resourceManager) {
19 2 this.compilerPass = CompilerPass(resourceManager);
20 2 }
21
22 2 public p BitcodeLinker.link() {
23 // Link all source file modules in. Use the creation order, because the order of the source file map depends on the hash
24 // function, and the link order shows in the LTO module
25
2/2
✓ Branch 0 taken 4 times.
✓ Branch 1 taken 2 times.
6 foreach SourceFile* sourceFile : this.resourceManager.sourceFilesInCreationOrder {
26 4 const bool failed = this.resourceManager.ltoModule.linkInModule(sourceFile.llvmModule);
27 4 assert !failed;
28 4 }
29 2 }
30