hanchenye-llvm-project/llvm/unittests/ProfileData
Vedant Kumar dde19c5a73 [Coverage] Add an API to retrive all instantiations of a function (NFC)
The CoverageMapping::getInstantiations() API retrieved all function
records corresponding to functions with more than one instantiation (e.g
template functions with multiple specializations). However, there was no
simple way to determine *which* function a given record was an
instantiation of. This was an oversight, since it's useful to aggregate
coverage information over all instantiations of a function.

llvm-cov works around this by building a mapping of source locations to
instantiation sets, but this duplicates logic that libCoverage already
has (see FunctionInstantiationSetCollector).

This change adds a new API, CoverageMapping::getInstantiationGroups(),
which returns a list of InstantiationGroups. A group contains records
for each instantiation of some particular function, and also provides
utilities to get the total execution count within the group, the source
location of the common definition, etc.

This lets removes some hacky logic in llvm-cov by reusing
FunctionInstantiationSetCollector and makes the CoverageMapping API
friendlier for other clients.

llvm-svn: 309904
2017-08-02 23:35:25 +00:00
..
CMakeLists.txt ProfData: Fix some unchecked Errors in unit tests 2017-07-07 21:02:59 +00:00
CoverageMappingTest.cpp [Coverage] Add an API to retrive all instantiations of a function (NFC) 2017-08-02 23:35:25 +00:00
InstrProfTest.cpp InstrProf: Fix unit test which accidentally used a duplicate name 2017-07-10 21:44:43 +00:00
SampleProfTest.cpp Re-sort #include lines for unittests. This uses a slightly modified 2017-06-06 11:06:56 +00:00