summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2011-11-07 10:38:50 +0000
committerChandler Carruth <chandlerc@gmail.com>2011-11-07 10:38:50 +0000
commit64cd7c9dc27be6bf6dfe41eb079054d4802abd3b (patch)
tree8162d8e9fe3fc8d6b75eb919b0d5aea1bb98f331
parente4936afae1efebb2ea0145f130c757c1b11ad88a (diff)
Merging r143869:
------------------------------------------------------------------------ r143869 | chandlerc | 2011-11-06 01:21:54 -0800 (Sun, 06 Nov 2011) | 2 lines 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/branches/release_30@143947 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Driver/ToolChains.cpp9
-rw-r--r--lib/Driver/ToolChains.h6
2 files changed, 7 insertions, 8 deletions
diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp
index d07abab9cf..7ddb98e590 100644
--- a/lib/Driver/ToolChains.cpp
+++ b/lib/Driver/ToolChains.cpp
@@ -1782,9 +1782,8 @@ void Linux::GCCInstallationDetector::ScanLibDirForGCCTriple(
}
}
-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.
@@ -1831,8 +1830,8 @@ Linux::Linux(const HostInfo &Host, const llvm::Triple &Triple)
// 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");
diff --git a/lib/Driver/ToolChains.h b/lib/Driver/ToolChains.h
index 0ae0e53496..57b14cc8dd 100644
--- a/lib/Driver/ToolChains.h
+++ b/lib/Driver/ToolChains.h
@@ -396,13 +396,13 @@ class LLVM_LIBRARY_VISIBILITY Linux : public Generic_ELF {
bool isValid() const { return IsValid; }
/// \brief Get the GCC triple for the detected install.
- const std::string &getTriple() const { return GccTriple; }
+ StringRef getTriple() const { return GccTriple; }
/// \brief Get the detected GCC installation path.
- const std::string &getInstallPath() const { return GccInstallPath; }
+ StringRef getInstallPath() const { return GccInstallPath; }
/// \brief Get the detected GCC parent lib path.
- const std::string &getParentLibPath() const { return GccParentLibPath; }
+ StringRef getParentLibPath() const { return GccParentLibPath; }
private:
static void CollectLibDirsAndTriples(llvm::Triple::ArchType HostArch,