Switch some of these interfaces from std::string to StringRef and Twine.
This will facilitate further use and recombinations of them.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143869 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp
index df01fc9..0a8aa7a 100644
--- a/lib/Driver/ToolChains.cpp
+++ b/lib/Driver/ToolChains.cpp
@@ -1780,9 +1780,8 @@
}
}
-static void addPathIfExists(const std::string &Path,
- ToolChain::path_list &Paths) {
- if (llvm::sys::fs::exists(Path)) Paths.push_back(Path);
+static void addPathIfExists(Twine Path, ToolChain::path_list &Paths) {
+ if (llvm::sys::fs::exists(Path)) Paths.push_back(Path.str());
}
/// \brief Get our best guess at the multiarch triple for a target.
@@ -1823,8 +1822,8 @@
// OpenSuse stores the linker with the compiler, add that to the search
// path.
ToolChain::path_list &PPaths = getProgramPaths();
- PPaths.push_back(GCCInstallation.getParentLibPath() + "/../" +
- GCCInstallation.getTriple() + "/bin");
+ PPaths.push_back(Twine(GCCInstallation.getParentLibPath() + "/../" +
+ GCCInstallation.getTriple() + "/bin").str());
Linker = GetProgramPath("ld");