GCC Code Coverage Report


Directory: ../
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 100.0% 15 / 4 / 19
Functions: 100.0% 1 / 0 / 1
Branches: 83.3% 5 / 4 / 10

src/irgenerator/GenInstrumentation.cpp
Line Branch Exec Source
1 // Copyright (c) 2021-2026 ChilliBits. All rights reserved.
2
3 #include "IRGenerator.h"
4 #include "exception/CompilerError.h"
5
6 #include <driver/Driver.h>
7
8 namespace spice::compiler {
9
10 11550 void IRGenerator::enableFunctionInstrumentation(llvm::Function *function) const {
11
5/6
✓ Branch 2 → 3 taken 11502 times.
✓ Branch 2 → 4 taken 20 times.
✓ Branch 2 → 5 taken 24 times.
✓ Branch 2 → 7 taken 2 times.
✓ Branch 2 → 9 taken 2 times.
✗ Branch 2 → 11 not taken.
11550 switch (cliOptions.instrumentation.sanitizer) {
12 case Sanitizer::NONE: // GCOV_EXCL_LINE
13 break; // GCOV_EXCL_LINE
14 20 case Sanitizer::ADDRESS:
15 20 function->addFnAttr(llvm::Attribute::SanitizeAddress);
16 20 break;
17 24 case Sanitizer::THREAD:
18 24 function->addFnAttr(llvm::Attribute::SanitizeThread);
19 24 break;
20 2 case Sanitizer::MEMORY:
21 2 function->addFnAttr(llvm::Attribute::SanitizeMemory);
22 2 break;
23 2 case Sanitizer::TYPE:
24 2 function->addFnAttr(llvm::Attribute::SanitizeType);
25 2 break;
26 default: // GCOV_EXCL_LINE
27 throw CompilerError(UNHANDLED_BRANCH, "Unhandled sanitizer type"); // GCOV_EXCL_LINE
28 }
29 11550 }
30
31 } // namespace spice::compiler
32