Clang's source location information reporting is always improving, but
llvm-cov and LLVM's profiling data reporters are "all-or-nothing": if
just a single region of code coverage data is invalid or malformed, the
entire coverage data file is scrapped, and llvm-cov reports "Failed to
load coverage: Malformed coverage data".
The C++ developers I support rely heavily on coverage data from their
unit tests, and this all-or-nothing approach to reporting has caused that
data to be unreliable. I fixed a recent incident of "Failed to load
coverage" by patching D65428 into an older internal release of Clang
that we use, to fix location information for a single function that had
caused thousands of other functions to not be reported. More recently,
I've discovered that Clang generates invalid coverage data for C++20
coroutines, and this prevents coverage data from being reported for the
entire unit.
Before I can send up a fix for C++20 coroutines, I thought I'd provide a
stop-gap solution: allow developers to invoke
llvm-cov -ignore-malformed-coverage-mapping-regions, which will simply
drop mapping regions with invalid source location information. Using
this option would have allowed the developers I support to get coverage
data for most of their source code, even when Clang could not generate
valid information for specific regions (such as prior to D65428, or prior
to whatever I send up for coroutines).