[CoverageMapping] Remove dots from paths inside the profile
authorPetr Hosek <phosek@google.com>
Tue, 22 Mar 2022 01:30:35 +0000 (18:30 -0700)
committerPetr Hosek <phosek@google.com>
Wed, 29 Jun 2022 03:53:01 +0000 (20:53 -0700)
commit0204fd25b0ca9a7bc7db11df238d8ec9f195e67c
tree19f2e7aecc89e19543dc1a5a2282cbc0da87123f
parent779d2470a45393b981eff706662922f320859681
[CoverageMapping] Remove dots from paths inside the profile

We already remove dots from collected paths and path mappings. This
makes it difficult to match paths inside the profile which contain
dots. For example, we would never match /path/to/../file.c because
the collected path is always be normalized to /path/file.c. This
change enables dot removal for paths inside the profile to address
the issue.

Differential Revision: https://reviews.llvm.org/D123164
llvm/lib/ProfileData/Coverage/CoverageMappingReader.cpp
llvm/test/tools/llvm-cov/Inputs/relative_dir/header.h [new file with mode: 0644]
llvm/test/tools/llvm-cov/Inputs/relative_dir/main.c [new file with mode: 0644]
llvm/test/tools/llvm-cov/Inputs/relative_dir/main.covmapping [new file with mode: 0644]
llvm/test/tools/llvm-cov/Inputs/relative_dir/main.proftext [new file with mode: 0644]
llvm/test/tools/llvm-cov/coverage-prefix-map.test
llvm/test/tools/llvm-cov/relative-dir.test [new file with mode: 0644]
llvm/unittests/ProfileData/CoverageMappingTest.cpp