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
This commit is contained in:
Alex Lorenz
2014-08-21 19:23:25 +00:00
parent 40bfd6db57
commit 936b99c942
2 changed files with 10 additions and 6 deletions

View File

@@ -308,6 +308,7 @@ template <typename IntPtrT> struct CoverageMappingFunctionRecord {
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 @@ std::error_code readCoverageMappingData(
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 @@ ObjectFileCoverageMappingReader::readNextRecord(CoverageMappingRecord &Record) {
FunctionsFilenames, Expressions, MappingRegions);
if (auto Err = Reader.read(Record))
return Err;
Record.FunctionHash = R.FunctionHash;
++CurrentRecord;
return success();
}