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
5 #include <driver/Driver.h>
6 #include <exception/CompilerError.h>
7
8 namespace spice::compiler {
9
10 59079 void IRGenerator::enableFunctionInstrumentation(llvm::Function *function) const {
11
5/6
✓ Branch 2 → 3 taken 58170 times.
✓ Branch 2 → 4 taken 813 times.
✓ Branch 2 → 5 taken 92 times.
✓ Branch 2 → 7 taken 2 times.
✓ Branch 2 → 9 taken 2 times.
✗ Branch 2 → 11 not taken.
59079 switch (cliOptions.instrumentation.sanitizer) {
12 − case Sanitizer::NONE: // GCOV_EXCL_LINE
13 − break; // GCOV_EXCL_LINE
14 813 case Sanitizer::ADDRESS:
15 813 function->addFnAttr(llvm::Attribute::SanitizeAddress);
16 813 break;
17 92 case Sanitizer::THREAD:
18 92 function->addFnAttr(llvm::Attribute::SanitizeThread);
19 92 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 59079 }
30
31 } // namespace spice::compiler
32