You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
...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.
0 commit comments