[llvm] a5dc3f6 - [llvm] Use SmallString::operator std::string() (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 11 23:32:57 PST 2024
Author: Kazu Hirata
Date: 2024-01-11T23:32:44-08:00
New Revision: a5dc3f68a86d1fb533cdba880514507f1348bc3d
URL: https://github.com/llvm/llvm-project/commit/a5dc3f68a86d1fb533cdba880514507f1348bc3d
DIFF: https://github.com/llvm/llvm-project/commit/a5dc3f68a86d1fb533cdba880514507f1348bc3d.diff
LOG: [llvm] Use SmallString::operator std::string() (NFC)
Added:
Modified:
llvm/lib/DebugInfo/Symbolize/Symbolize.cpp
llvm/lib/Object/ArchiveWriter.cpp
llvm/lib/WindowsDriver/MSVCPaths.cpp
Removed:
################################################################################
diff --git a/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp b/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp
index 43e5c9e9329e00..37806be448ae16 100644
--- a/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp
+++ b/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp
@@ -434,14 +434,14 @@ bool LLVMSymbolizer::findDebugBinary(const std::string &OrigPath,
// Try relative/path/to/original_binary/debuglink_name
llvm::sys::path::append(DebugPath, DebuglinkName);
if (checkFileCRC(DebugPath, CRCHash)) {
- Result = std::string(DebugPath.str());
+ Result = std::string(DebugPath);
return true;
}
// Try relative/path/to/original_binary/.debug/debuglink_name
DebugPath = OrigDir;
llvm::sys::path::append(DebugPath, ".debug", DebuglinkName);
if (checkFileCRC(DebugPath, CRCHash)) {
- Result = std::string(DebugPath.str());
+ Result = std::string(DebugPath);
return true;
}
// Make the path absolute so that lookups will go to
@@ -463,7 +463,7 @@ bool LLVMSymbolizer::findDebugBinary(const std::string &OrigPath,
llvm::sys::path::append(DebugPath, llvm::sys::path::relative_path(OrigDir),
DebuglinkName);
if (checkFileCRC(DebugPath, CRCHash)) {
- Result = std::string(DebugPath.str());
+ Result = std::string(DebugPath);
return true;
}
return false;
diff --git a/llvm/lib/Object/ArchiveWriter.cpp b/llvm/lib/Object/ArchiveWriter.cpp
index 2f70c9edd13ed8..155926a8c5949d 100644
--- a/llvm/lib/Object/ArchiveWriter.cpp
+++ b/llvm/lib/Object/ArchiveWriter.cpp
@@ -950,7 +950,7 @@ Expected<std::string> computeArchiveRelativePath(StringRef From, StringRef To) {
for (auto ToE = sys::path::end(PathTo); ToI != ToE; ++ToI)
sys::path::append(Relative, sys::path::Style::posix, *ToI);
- return std::string(Relative.str());
+ return std::string(Relative);
}
static Error writeArchiveToStream(raw_ostream &Out,
diff --git a/llvm/lib/WindowsDriver/MSVCPaths.cpp b/llvm/lib/WindowsDriver/MSVCPaths.cpp
index 1c070bf1bf7d7d..b69ee11c1931b0 100644
--- a/llvm/lib/WindowsDriver/MSVCPaths.cpp
+++ b/llvm/lib/WindowsDriver/MSVCPaths.cpp
@@ -114,7 +114,7 @@ static bool getWindowsSDKDirViaCommandLine(
else
llvm::sys::path::append(
SDKPath, getHighestNumericTupleInDirectory(VFS, SDKPath));
- Path = std::string(SDKPath.str());
+ Path = std::string(SDKPath);
} else {
Path = WinSdkDir->str();
}
@@ -491,7 +491,7 @@ bool findVCToolChainViaCommandLine(vfs::FileSystem &VFS,
else
ToolsVersion = getHighestNumericTupleInDirectory(VFS, ToolsPath);
sys::path::append(ToolsPath, ToolsVersion);
- Path = std::string(ToolsPath.str());
+ Path = std::string(ToolsPath);
} else {
Path = VCToolsDir->str();
}
More information about the llvm-commits
mailing list