[lld] Use SmallString::operator std::string (NFC)

GitOrigin-RevId: 21730eb49b7c53abd47eff898c913b48e2f1dfc9
diff --git a/COFF/Driver.cpp b/COFF/Driver.cpp
index cfcf738..e0afb6b 100644
--- a/COFF/Driver.cpp
+++ b/COFF/Driver.cpp
@@ -855,7 +855,7 @@
   for (StringRef path : filePaths)
     os << quote(relativeToRoot(path)) << "\n";
 
-  return std::string(data.str());
+  return std::string(data);
 }
 
 static unsigned parseDebugTypes(const opt::InputArgList &args) {
@@ -910,7 +910,7 @@
     return std::string(ctx.config.implib);
   SmallString<128> out = StringRef(ctx.config.outputFile);
   sys::path::replace_extension(out, ".lib");
-  return std::string(out.str());
+  return std::string(out);
 }
 
 // The import name is calculated as follows:
@@ -934,7 +934,7 @@
                                    (ctx.config.dll || asLib) ? ".dll" : ".exe");
   }
 
-  return std::string(out.str());
+  return std::string(out);
 }
 
 void LinkerDriver::createImportLibrary(bool asLib) {
diff --git a/COFF/DriverUtils.cpp b/COFF/DriverUtils.cpp
index 4678767..fc8eb32 100644
--- a/COFF/DriverUtils.cpp
+++ b/COFF/DriverUtils.cpp
@@ -350,7 +350,7 @@
     SmallString<128> s;
     if (auto ec = sys::fs::createTemporaryFile("lld-" + prefix, extn, s))
       fatal("cannot create a temporary file: " + ec.message());
-    path = std::string(s.str());
+    path = std::string(s);
 
     if (!contents.empty()) {
       std::error_code ec;
diff --git a/COFF/InputFiles.cpp b/COFF/InputFiles.cpp
index 22cc0e3..1ed90d7 100644
--- a/COFF/InputFiles.cpp
+++ b/COFF/InputFiles.cpp
@@ -828,7 +828,7 @@
   // on Windows, so we can assume type server paths are Windows style.
   sys::path::append(path,
                     sys::path::filename(tSPath, sys::path::Style::windows));
-  return std::string(path.str());
+  return std::string(path);
 }
 
 // The casing of the PDB path stamped in the OBJ can differ from the actual path
diff --git a/ELF/DriverUtils.cpp b/ELF/DriverUtils.cpp
index 0a27422..de8ffab 100644
--- a/ELF/DriverUtils.cpp
+++ b/ELF/DriverUtils.cpp
@@ -204,7 +204,7 @@
       os << toString(*arg) << "\n";
     }
   }
-  return std::string(data.str());
+  return std::string(data);
 }
 
 // Find a file by concatenating given paths. If a resulting path
diff --git a/MachO/DriverUtils.cpp b/MachO/DriverUtils.cpp
index 1749945..d6f18ec 100644
--- a/MachO/DriverUtils.cpp
+++ b/MachO/DriverUtils.cpp
@@ -180,7 +180,7 @@
       os << toString(*arg) << "\n";
     }
   }
-  return std::string(data.str());
+  return std::string(data);
 }
 
 static void searchedDylib(const Twine &path, bool found) {
diff --git a/wasm/Driver.cpp b/wasm/Driver.cpp
index edf1979..88a3db7 100644
--- a/wasm/Driver.cpp
+++ b/wasm/Driver.cpp
@@ -1019,7 +1019,7 @@
       os << toString(*arg) << "\n";
     }
   }
-  return std::string(data.str());
+  return std::string(data);
 }
 
 // The --wrap option is a feature to rename symbols so that you can write
diff --git a/wasm/WriterUtils.cpp b/wasm/WriterUtils.cpp
index cc8ed0b..418192f 100644
--- a/wasm/WriterUtils.cpp
+++ b/wasm/WriterUtils.cpp
@@ -51,7 +51,7 @@
     s += "void";
   else
     s += toString(sig.Returns[0]);
-  return std::string(s.str());
+  return std::string(s);
 }
 
 std::string toString(const WasmGlobalType &type) {