[lld] 3e24242 - [lld] Replace SmallStr.str().str() with std::string conversion operator.
Jonas Devlieghere via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 29 21:30:51 PST 2020
Author: Jonas Devlieghere
Date: 2020-01-29T21:30:21-08:00
New Revision: 3e24242a7dc99ef04676cc7e227bd3652e80c975
URL: https://github.com/llvm/llvm-project/commit/3e24242a7dc99ef04676cc7e227bd3652e80c975
DIFF: https://github.com/llvm/llvm-project/commit/3e24242a7dc99ef04676cc7e227bd3652e80c975.diff
LOG: [lld] Replace SmallStr.str().str() with std::string conversion operator.
Use the std::string conversion operator introduced in
d7049213d0fcda691c9e79f9b41e357198d99738.
Added:
Modified:
lld/COFF/Driver.cpp
lld/ELF/DriverUtils.cpp
lld/MinGW/Driver.cpp
lld/wasm/Driver.cpp
Removed:
################################################################################
diff --git a/lld/COFF/Driver.cpp b/lld/COFF/Driver.cpp
index f1619070643a..a85dfda2dea1 100644
--- a/lld/COFF/Driver.cpp
+++ b/lld/COFF/Driver.cpp
@@ -1095,7 +1095,7 @@ Optional<std::string> getReproduceFile(const opt::InputArgList &args) {
if (auto *arg = args.getLastArg(OPT_linkrepro)) {
SmallString<64> path = StringRef(arg->getValue());
sys::path::append(path, "repro.tar");
- return path.str().str();
+ return std::string(path);
}
return None;
diff --git a/lld/ELF/DriverUtils.cpp b/lld/ELF/DriverUtils.cpp
index 6b90c06c03ed..03336b384500 100644
--- a/lld/ELF/DriverUtils.cpp
+++ b/lld/ELF/DriverUtils.cpp
@@ -212,7 +212,7 @@ static Optional<std::string> findFile(StringRef path1, const Twine &path2) {
path::append(s, path1, path2);
if (fs::exists(s))
- return s.str().str();
+ return std::string(s);
return None;
}
diff --git a/lld/MinGW/Driver.cpp b/lld/MinGW/Driver.cpp
index 1a256b44efb8..7597fb40cca4 100644
--- a/lld/MinGW/Driver.cpp
+++ b/lld/MinGW/Driver.cpp
@@ -114,7 +114,7 @@ static Optional<std::string> findFile(StringRef path1, const Twine &path2) {
SmallString<128> s;
sys::path::append(s, path1, path2);
if (sys::fs::exists(s))
- return s.str().str();
+ return std::string(s);
return None;
}
diff --git a/lld/wasm/Driver.cpp b/lld/wasm/Driver.cpp
index 946201874a69..1a1d4782797c 100644
--- a/lld/wasm/Driver.cpp
+++ b/lld/wasm/Driver.cpp
@@ -154,7 +154,7 @@ static Optional<std::string> findFile(StringRef path1, const Twine &path2) {
SmallString<128> s;
path::append(s, path1, path2);
if (fs::exists(s))
- return s.str().str();
+ return std::string(s);
return None;
}
More information about the llvm-commits
mailing list