It is required for creating more complex unit tests.
Details
Diff Detail
Event Timeline
Could you explain the difference between global file indices and an index in a function?
llvm/trunk/unittests/ProfileData/CoverageMappingTest.cpp | ||
---|---|---|
86 | Please add a comment explaining the what the map contains. Also, would an llvm::SmallDenseMap work here? |
This is intended to be closer to the serialization format of coverage mapping. All functions share the same array of file names, but each function has its own set of files and maps its local indices to global ones. See RawCoverageMappingReader::read().
llvm/trunk/unittests/ProfileData/CoverageMappingTest.cpp | ||
---|---|---|
56 | Is this field needed? It can be a local variable. | |
174 | Split this function into two methods:
loadCoverageMapping calls 1) followed by call to CoverageMapping::load Calls to readProfCount can also be folded into 2). Function 1) can be called in many other places as well. |
- Rebased on the top commit.
- Made Expressions local.
- Added a comment for ReverseVirtualFileMapping and changed its type to llvm::SmallDenseMap.
- Extracted writeAndReadCoverageRegions from loadCoverageMapping.
- Added a call to readProfCount into loadCoverageMapping.
lgtm.
llvm/trunk/unittests/ProfileData/CoverageMappingTest.cpp | ||
---|---|---|
88 | It is needed. The virtual FileId for each function record is the index to the array of region sub-arrays in the coverage mapping. Perhaps you can add more comments to clarify. | |
118 | Add a comment to this method. Something in the line of .. Returns the file index of file 'Name' for the current function. It also computes the global file index |
Is this field needed? It can be a local variable.