mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-19 18:24:00 +00:00
InstrProf: Simplify RawCoverageMappingReader's API slightly
This is still kind of a weird API, but dropping the (partial) update of the passed in CoverageMappingRecord makes it a little easier to understand and use. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227900 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -221,7 +221,7 @@ std::error_code RawCoverageMappingReader::readMappingRegionsSubArray(
|
||||
return success();
|
||||
}
|
||||
|
||||
std::error_code RawCoverageMappingReader::read(CoverageMappingRecord &Record) {
|
||||
std::error_code RawCoverageMappingReader::read() {
|
||||
|
||||
// Read the virtual file mapping.
|
||||
llvm::SmallVector<unsigned, 8> VirtualFileMapping;
|
||||
@ -287,10 +287,6 @@ std::error_code RawCoverageMappingReader::read(CoverageMappingRecord &Record) {
|
||||
}
|
||||
}
|
||||
|
||||
Record.FunctionName = FunctionName;
|
||||
Record.Filenames = Filenames;
|
||||
Record.Expressions = Expressions;
|
||||
Record.MappingRegions = MappingRegions;
|
||||
return success();
|
||||
}
|
||||
|
||||
@ -542,12 +538,18 @@ ObjectFileCoverageMappingReader::readNextRecord(CoverageMappingRecord &Record) {
|
||||
MappingRegions.clear();
|
||||
auto &R = MappingRecords[CurrentRecord];
|
||||
RawCoverageMappingReader Reader(
|
||||
R.FunctionName, R.CoverageMapping,
|
||||
R.CoverageMapping,
|
||||
makeArrayRef(Filenames).slice(R.FilenamesBegin, R.FilenamesSize),
|
||||
FunctionsFilenames, Expressions, MappingRegions);
|
||||
if (auto Err = Reader.read(Record))
|
||||
if (auto Err = Reader.read())
|
||||
return Err;
|
||||
|
||||
Record.FunctionName = R.FunctionName;
|
||||
Record.FunctionHash = R.FunctionHash;
|
||||
Record.Filenames = FunctionsFilenames;
|
||||
Record.Expressions = Expressions;
|
||||
Record.MappingRegions = MappingRegions;
|
||||
|
||||
++CurrentRecord;
|
||||
return success();
|
||||
}
|
||||
|
Reference in New Issue
Block a user