llvm-project/llvm/lib/ProfileData/Coverage
Petr Hosek 5fbd1a333a [Coverage] Store compilation dir separately in coverage mapping
We currently always store absolute filenames in coverage mapping.  This
is problematic for several reasons. It poses a problem for distributed
compilation as source location might vary across machines.  We are also
duplicating the path prefix potentially wasting space.

This change modifies how we store filenames in coverage mapping. Rather
than absolute paths, it stores the compilation directory and file paths
as given to the compiler, either relative or absolute. Later when
reading the coverage mapping information, we recombine relative paths
with the working directory. This approach is similar to handling
ofDW_AT_comp_dir in DWARF.

Finally, we also provide a new option, -fprofile-compilation-dir akin
to -fdebug-compilation-dir which can be used to manually override the
compilation directory which is useful in distributed compilation cases.

Differential Revision: https://reviews.llvm.org/D95753
2021-02-18 14:34:39 -08:00
..
CMakeLists.txt llvmbuildectomy - replace llvm-build by plain cmake 2020-11-13 10:35:24 +01:00
CoverageMapping.cpp [llvm] Use llvm::append_range (NFC) 2021-01-06 18:27:33 -08:00
CoverageMappingReader.cpp [Coverage] Store compilation dir separately in coverage mapping 2021-02-18 14:34:39 -08:00
CoverageMappingWriter.cpp [Coverage] Store compilation dir separately in coverage mapping 2021-02-18 14:34:39 -08:00