[Coverage] Take filenames into account when loading function records.
authorMax Moroz <mmoroz@chromium.org>
Tue, 8 May 2018 19:26:51 +0000 (19:26 +0000)
committerMax Moroz <mmoroz@chromium.org>
Tue, 8 May 2018 19:26:51 +0000 (19:26 +0000)
commit0c5b6020153341f7ec27e178b348f117c957eca8
tree4dcbdc7f0d87d5618a6d6223dd5aec59ed8aafb6
parent65a7eb71f9a605b66b4f705a2a305d2e22e07903
[Coverage] Take filenames into account when loading function records.

Summary:
Don't skip functions with the same name but from different files.

That change makes it possible to generate code coverage reports from
different binaries compiled from different sources even if there are functions
with non-unique names. Without that change, code coverage for such functions is
missing except of the first function processed.

Reviewers: vsk, morehouse

Reviewed By: vsk

Subscribers: llvm-commits, kcc

Differential Revision: https://reviews.llvm.org/D46478

llvm-svn: 331801
llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h
llvm/lib/ProfileData/Coverage/CoverageMapping.cpp
llvm/test/tools/llvm-cov/multiple-objects.test
llvm/unittests/ProfileData/CoverageMappingTest.cpp