rustc_llvm: replace llvm::makeArrayRef with ArrayRef constructors.
LLVM upstream has deprecated llvm::makeArrayRef and will remove it.
This commit is contained in:
parent
b22c152958
commit
4f0c88f8bd
2 changed files with 13 additions and 12 deletions
|
@ -28,8 +28,8 @@ extern "C" void LLVMRustCoverageWriteFilenamesSectionToBuffer(
|
|||
for (size_t i = 0; i < FilenamesLen; i++) {
|
||||
FilenameRefs.push_back(std::string(Filenames[i]));
|
||||
}
|
||||
auto FilenamesWriter = coverage::CoverageFilenamesSectionWriter(
|
||||
makeArrayRef(FilenameRefs));
|
||||
auto FilenamesWriter =
|
||||
coverage::CoverageFilenamesSectionWriter(ArrayRef<std::string>(FilenameRefs));
|
||||
RawRustStringOstream OS(BufferOut);
|
||||
FilenamesWriter.write(OS);
|
||||
}
|
||||
|
@ -45,15 +45,16 @@ extern "C" void LLVMRustCoverageWriteMappingToBuffer(
|
|||
// Convert from FFI representation to LLVM representation.
|
||||
SmallVector<coverage::CounterMappingRegion, 0> MappingRegions;
|
||||
MappingRegions.reserve(NumMappingRegions);
|
||||
for (const auto &Region : makeArrayRef(RustMappingRegions, NumMappingRegions)) {
|
||||
for (const auto &Region : ArrayRef<LLVMRustCounterMappingRegion>(
|
||||
RustMappingRegions, NumMappingRegions)) {
|
||||
MappingRegions.emplace_back(
|
||||
Region.Count, Region.FalseCount, Region.FileID, Region.ExpandedFileID,
|
||||
Region.LineStart, Region.ColumnStart, Region.LineEnd, Region.ColumnEnd,
|
||||
Region.Kind);
|
||||
}
|
||||
auto CoverageMappingWriter = coverage::CoverageMappingWriter(
|
||||
makeArrayRef(VirtualFileMappingIDs, NumVirtualFileMappingIDs),
|
||||
makeArrayRef(Expressions, NumExpressions),
|
||||
ArrayRef<unsigned>(VirtualFileMappingIDs, NumVirtualFileMappingIDs),
|
||||
ArrayRef<coverage::CounterExpression>(Expressions, NumExpressions),
|
||||
MappingRegions);
|
||||
RawRustStringOstream OS(BufferOut);
|
||||
CoverageMappingWriter.write(OS);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue