Coverage Mapping: add function's hash to coverage function records.
The profile data format was recently updated and the new indexing api
requires the code coverage tool to know the function's hash as well
as the function's name to get the execution counts for a function.
Differential Revision: http://reviews.llvm.org/D4994
llvm-svn: 216207
diff --git a/llvm/lib/ProfileData/CoverageMappingReader.cpp b/llvm/lib/ProfileData/CoverageMappingReader.cpp
index 965e085..f10ae05 100644
--- a/llvm/lib/ProfileData/CoverageMappingReader.cpp
+++ b/llvm/lib/ProfileData/CoverageMappingReader.cpp
@@ -308,6 +308,7 @@
IntPtrT FunctionNamePtr;
uint32_t FunctionNameSize;
uint32_t CoverageMappingSize;
+ uint64_t FunctionHash;
};
/// \brief The coverage mapping data for a single translation unit.
@@ -422,8 +423,8 @@
FunctionName))
return Err;
Records.push_back(ObjectFileCoverageMappingReader::ProfileMappingRecord(
- Version, FunctionName, Mapping, FilenamesBegin,
- Filenames.size() - FilenamesBegin));
+ Version, FunctionName, MappingRecord.FunctionHash, Mapping,
+ FilenamesBegin, Filenames.size() - FilenamesBegin));
}
}
@@ -485,6 +486,7 @@
FunctionsFilenames, Expressions, MappingRegions);
if (auto Err = Reader.read(Record))
return Err;
+ Record.FunctionHash = R.FunctionHash;
++CurrentRecord;
return success();
}