[PATCH] D18758: [Coverage] Support for making test data for more than one function.

David Li via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 14 14:47:50 PDT 2016


davidxl accepted this revision.
davidxl added a comment.
This revision is now accepted and ready to land.

lgtm.


================
Comment at: llvm/trunk/unittests/ProfileData/CoverageMappingTest.cpp:87
@@ +86,3 @@
+  // to the index of that file within this function.
+  SmallDenseMap<unsigned, unsigned> ReverseVirtualFileMapping;
+  std::string Name;
----------------
davidxl wrote:
> Is this mapping strictly needed? Can global file index be used without creating function level file index?
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.

================
Comment at: llvm/trunk/unittests/ProfileData/CoverageMappingTest.cpp:119
@@ -104,1 +118,3 @@
 
+  unsigned getFileIndexForFunction(StringRef Name) {
+    unsigned GlobalIndex = getGlobalFileIndex(Name);
----------------
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
// for the file and maps the global index to the local index that is returned (ReverseVirtualFileMapping).
// The ReverseVirtualFileMapping is used to create the virtual file mapping (from local fileId to global Index)
// in the head of the per-function coverage mapping data.


http://reviews.llvm.org/D18758





More information about the llvm-commits mailing list