Index: llvm/trunk/include/llvm/ProfileData/CoverageMappingReader.h =================================================================== --- llvm/trunk/include/llvm/ProfileData/CoverageMappingReader.h +++ llvm/trunk/include/llvm/ProfileData/CoverageMappingReader.h @@ -33,6 +33,7 @@ /// \brief Coverage mapping information for a single function. struct CoverageMappingRecord { StringRef FunctionName; + uint64_t FunctionHash; ArrayRef Filenames; ArrayRef Expressions; ArrayRef MappingRegions; @@ -143,16 +144,17 @@ struct ProfileMappingRecord { CoverageMappingVersion Version; StringRef FunctionName; + uint64_t FunctionHash; StringRef CoverageMapping; size_t FilenamesBegin; size_t FilenamesSize; ProfileMappingRecord(CoverageMappingVersion Version, StringRef FunctionName, - StringRef CoverageMapping, size_t FilenamesBegin, - size_t FilenamesSize) + uint64_t FunctionHash, StringRef CoverageMapping, + size_t FilenamesBegin, size_t FilenamesSize) : Version(Version), FunctionName(FunctionName), - CoverageMapping(CoverageMapping), FilenamesBegin(FilenamesBegin), - FilenamesSize(FilenamesSize) {} + FunctionHash(FunctionHash), CoverageMapping(CoverageMapping), + FilenamesBegin(FilenamesBegin), FilenamesSize(FilenamesSize) {} }; private: Index: llvm/trunk/lib/ProfileData/CoverageMappingReader.cpp =================================================================== --- llvm/trunk/lib/ProfileData/CoverageMappingReader.cpp +++ llvm/trunk/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(); }