Skip to content

Commit a5dc3f6

Browse files
[llvm] Use SmallString::operator std::string() (NFC)
1 parent 2b83cee commit a5dc3f6

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

llvm/lib/DebugInfo/Symbolize/Symbolize.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -434,14 +434,14 @@ bool LLVMSymbolizer::findDebugBinary(const std::string &OrigPath,
434434
// Try relative/path/to/original_binary/debuglink_name
435435
llvm::sys::path::append(DebugPath, DebuglinkName);
436436
if (checkFileCRC(DebugPath, CRCHash)) {
437-
Result = std::string(DebugPath.str());
437+
Result = std::string(DebugPath);
438438
return true;
439439
}
440440
// Try relative/path/to/original_binary/.debug/debuglink_name
441441
DebugPath = OrigDir;
442442
llvm::sys::path::append(DebugPath, ".debug", DebuglinkName);
443443
if (checkFileCRC(DebugPath, CRCHash)) {
444-
Result = std::string(DebugPath.str());
444+
Result = std::string(DebugPath);
445445
return true;
446446
}
447447
// Make the path absolute so that lookups will go to
@@ -463,7 +463,7 @@ bool LLVMSymbolizer::findDebugBinary(const std::string &OrigPath,
463463
llvm::sys::path::append(DebugPath, llvm::sys::path::relative_path(OrigDir),
464464
DebuglinkName);
465465
if (checkFileCRC(DebugPath, CRCHash)) {
466-
Result = std::string(DebugPath.str());
466+
Result = std::string(DebugPath);
467467
return true;
468468
}
469469
return false;

llvm/lib/Object/ArchiveWriter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -950,7 +950,7 @@ Expected<std::string> computeArchiveRelativePath(StringRef From, StringRef To) {
950950
for (auto ToE = sys::path::end(PathTo); ToI != ToE; ++ToI)
951951
sys::path::append(Relative, sys::path::Style::posix, *ToI);
952952

953-
return std::string(Relative.str());
953+
return std::string(Relative);
954954
}
955955

956956
static Error writeArchiveToStream(raw_ostream &Out,

llvm/lib/WindowsDriver/MSVCPaths.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ static bool getWindowsSDKDirViaCommandLine(
114114
else
115115
llvm::sys::path::append(
116116
SDKPath, getHighestNumericTupleInDirectory(VFS, SDKPath));
117-
Path = std::string(SDKPath.str());
117+
Path = std::string(SDKPath);
118118
} else {
119119
Path = WinSdkDir->str();
120120
}
@@ -491,7 +491,7 @@ bool findVCToolChainViaCommandLine(vfs::FileSystem &VFS,
491491
else
492492
ToolsVersion = getHighestNumericTupleInDirectory(VFS, ToolsPath);
493493
sys::path::append(ToolsPath, ToolsVersion);
494-
Path = std::string(ToolsPath.str());
494+
Path = std::string(ToolsPath);
495495
} else {
496496
Path = VCToolsDir->str();
497497
}

0 commit comments

Comments
 (0)