InstrProf: Make CounterMappingRegions less confusing to construct

Creating empty and expansion regions is awkward with the current API.
Expose static methods to make this simpler.

llvm-svn: 228075
This commit is contained in:
Justin Bogner
2015-02-03 23:59:33 +00:00
parent 879d18bf4e
commit 26b3142d34
2 changed files with 32 additions and 10 deletions

View File

@@ -210,10 +210,9 @@ std::error_code RawCoverageMappingReader::readMappingRegionsSubArray(
dbgs() << "\n";
});
MappingRegions.push_back(
CounterMappingRegion(C, InferredFileID, LineStart, ColumnStart,
LineStart + NumLines, ColumnEnd, Kind));
MappingRegions.back().ExpandedFileID = ExpandedFileID;
MappingRegions.push_back(CounterMappingRegion(
C, InferredFileID, ExpandedFileID, LineStart, ColumnStart,
LineStart + NumLines, ColumnEnd, Kind));
}
return success();
}