| Line | Branch | Exec | Source | 
|---|---|---|---|
| 1 | // Copyright (c) 2021-2025 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 | 9994 | void IRGenerator::enableFunctionInstrumentation(llvm::Function *function) const { | |
| 11 | 
        1/5✓ Branch 2 → 3 taken 9994 times. 
            ✗ Branch 2 → 4 not taken. 
            ✗ Branch 2 → 5 not taken. 
            ✗ Branch 2 → 7 not taken. 
            ✗ Branch 2 → 9 not taken. 
           | 
      9994 | switch (cliOptions.instrumentation.sanitizer) { | 
| 12 | − | case Sanitizer::NONE: // GCOV_EXCL_LINE | |
| 13 | − | break; // GCOV_EXCL_LINE | |
| 14 | ✗ | case Sanitizer::ADDRESS: | |
| 15 | ✗ | function->addFnAttr(llvm::Attribute::SanitizeAddress); | |
| 16 | ✗ | break; | |
| 17 | ✗ | case Sanitizer::THREAD: | |
| 18 | ✗ | function->addFnAttr(llvm::Attribute::SanitizeThread); | |
| 19 | ✗ | break; | |
| 20 | ✗ | case Sanitizer::MEMORY: | |
| 21 | ✗ | function->addFnAttr(llvm::Attribute::SanitizeMemory); | |
| 22 | ✗ | break; | |
| 23 | − | default: // GCOV_EXCL_LINE | |
| 24 | − | throw CompilerError(UNHANDLED_BRANCH, "Unhandled sanitizer type"); // GCOV_EXCL_LINE | |
| 25 | } | ||
| 26 | 9994 | } | |
| 27 | |||
| 28 | } // namespace spice::compiler | ||
| 29 |