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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228075 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Justin Bogner
2015-02-03 23:59:33 +00:00
parent f041861302
commit bf67bfe6bb
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();
}