llvm-wrapper: pass std::string instead of StringRef
LLVM change 5fbd1a333aa1a0b70903d036b98ea56c51ae5224 modified this function to want std::string instead of StringRef, which is easily done.
This commit is contained in:
parent
0ed1c33ad9
commit
dcdb9ad3d2
1 changed files with 7 additions and 0 deletions
|
@ -23,10 +23,17 @@ extern "C" void LLVMRustCoverageWriteFilenamesSectionToBuffer(
|
||||||
const char* const Filenames[],
|
const char* const Filenames[],
|
||||||
size_t FilenamesLen,
|
size_t FilenamesLen,
|
||||||
RustStringRef BufferOut) {
|
RustStringRef BufferOut) {
|
||||||
|
#if LLVM_VERSION_GE(12,0)
|
||||||
|
SmallVector<std::string,32> FilenameRefs;
|
||||||
|
for (size_t i = 0; i < FilenamesLen; i++) {
|
||||||
|
FilenameRefs.push_back(std::string(Filenames[i]));
|
||||||
|
}
|
||||||
|
#else
|
||||||
SmallVector<StringRef,32> FilenameRefs;
|
SmallVector<StringRef,32> FilenameRefs;
|
||||||
for (size_t i = 0; i < FilenamesLen; i++) {
|
for (size_t i = 0; i < FilenamesLen; i++) {
|
||||||
FilenameRefs.push_back(StringRef(Filenames[i]));
|
FilenameRefs.push_back(StringRef(Filenames[i]));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
auto FilenamesWriter = coverage::CoverageFilenamesSectionWriter(
|
auto FilenamesWriter = coverage::CoverageFilenamesSectionWriter(
|
||||||
makeArrayRef(FilenameRefs));
|
makeArrayRef(FilenameRefs));
|
||||||
RawRustStringOstream OS(BufferOut);
|
RawRustStringOstream OS(BufferOut);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue