forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP attempt to add coverage
0
of dead blocks
...by saving dead counters/expressions. Unfortunately, I'm still getting the same result, when trying to get coverage from Fuchsia apps (at least those using fuchsia_async, but that may not be the specific cause): When running `llvm-cov` to get the coverage report, I get the well known and still useless message: ``` Failed to load coverage: Malformed instrumentation profile data ``` I can change CoverageMappingReader.cpp to avoid failing and I will see some coverage results (maybe most of the coverage results) but there is missing coverage as well. I don't know why the function name is not found. The "hack" is, change this: ```c++ if (Error Err = CFR->template getFuncName<Endian>(ProfileNames, FuncName)) return Err; if (FuncName.empty()) return make_error<InstrProfError>(instrprof_error::malformed); ++CovMapNumUsedRecords; ``` to this: ```c++ if (Error Err = CFR->template getFuncName<Endian>(ProfileNames, FuncName)) return Err; if (FuncName.empty()) FuncName = "MissingFuncNameForCoverage"; ++CovMapNumUsedRecords; ``` I did learn that the original implementation (replacing counters and expressions with Zero/unreachable counters), so this PR addresses that issue. I hoped that it would fix the problem, but it didn't. Specifically regarding the LLVM coverage adjustment (improvement?) made in this version, compared to the reverted PR (rust-lang#84797): LLVM requires all counters with code regions be added to the coverage map. The original dead block fix replaced the counters and expressions with a Zero (unreachable) code region. This commit saves the original counter or expression, without adding a statement to increment the counter for the eliminated dead block.
- Loading branch information
Showing
5 changed files
with
65 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters