Skip to content

Commit 32ae9a2

Browse files
[llvm] Use SmallString::str (NFC) (#92712)
1 parent 6b0733e commit 32ae9a2

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

llvm/lib/Bitcode/Reader/BitcodeReader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2940,7 +2940,7 @@ Error BitcodeReader::parseValueSymbolTable(uint64_t Offset) {
29402940
if (!BB)
29412941
return error("Invalid bbentry record");
29422942

2943-
BB->setName(StringRef(ValueName.data(), ValueName.size()));
2943+
BB->setName(ValueName.str());
29442944
ValueName.clear();
29452945
break;
29462946
}

llvm/lib/CodeGen/ParallelCG.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,7 @@ void llvm::splitCodeGen(
7979
[TMFactory, FileType, ThreadOS](const SmallString<0> &BC) {
8080
LLVMContext Ctx;
8181
Expected<std::unique_ptr<Module>> MOrErr = parseBitcodeFile(
82-
MemoryBufferRef(StringRef(BC.data(), BC.size()),
83-
"<split-module>"),
84-
Ctx);
82+
MemoryBufferRef(BC.str(), "<split-module>"), Ctx);
8583
if (!MOrErr)
8684
report_fatal_error("Failed to read bitcode");
8785
std::unique_ptr<Module> MPartInCtx = std::move(MOrErr.get());

llvm/lib/LTO/LTOBackend.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -452,9 +452,8 @@ static void splitCodeGen(const Config &C, TargetMachine *TM,
452452
CodegenThreadPool.async(
453453
[&](const SmallString<0> &BC, unsigned ThreadId) {
454454
LTOLLVMContext Ctx(C);
455-
Expected<std::unique_ptr<Module>> MOrErr = parseBitcodeFile(
456-
MemoryBufferRef(StringRef(BC.data(), BC.size()), "ld-temp.o"),
457-
Ctx);
455+
Expected<std::unique_ptr<Module>> MOrErr =
456+
parseBitcodeFile(MemoryBufferRef(BC.str(), "ld-temp.o"), Ctx);
458457
if (!MOrErr)
459458
report_fatal_error("Failed to read bitcode");
460459
std::unique_ptr<Module> MPartInCtx = std::move(MOrErr.get());

0 commit comments

Comments
 (0)