diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2011-11-07 10:30:25 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2011-11-07 10:30:25 +0000 |
commit | 8d9c0888e282db66cc8d68383d07f6b1911a91da (patch) | |
tree | 748450ac096e23166cea74e222fca67e79bd79a0 | |
parent | bec38f0dc6ca14b57d2e891e6c11553f990152e3 (diff) | |
download | llvm-8d9c0888e282db66cc8d68383d07f6b1911a91da.zip llvm-8d9c0888e282db66cc8d68383d07f6b1911a91da.tar.gz llvm-8d9c0888e282db66cc8d68383d07f6b1911a91da.tar.bz2 |
Merging r143839:
------------------------------------------------------------------------
r143839 | chandlerc | 2011-11-05 15:23:11 -0700 (Sat, 05 Nov 2011) | 2 lines
Remove a no-longer needed helper function. Thanks for implementing this
Michael!
------------------------------------------------------------------------
llvm-svn: 143941
-rw-r--r-- | clang/lib/Driver/ToolChains.cpp | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/clang/lib/Driver/ToolChains.cpp b/clang/lib/Driver/ToolChains.cpp index aaedab6..a89e031 100644 --- a/clang/lib/Driver/ToolChains.cpp +++ b/clang/lib/Driver/ToolChains.cpp @@ -1521,14 +1521,6 @@ static LinuxDistro DetectLinuxDistro(llvm::Triple::ArchType Arch) { return UnknownDistro; } -/// \brief Trivial helper function to simplify code checking path existence. -static bool PathExists(StringRef Path) { - bool Exists; - if (!llvm::sys::fs::exists(Path, Exists)) - return Exists; - return false; -} - /// \brief Struct to store and manipulate GCC versions. /// /// We rely on assumptions about the form and structure of GCC version @@ -1624,11 +1616,11 @@ Linux::GCCInstallationDetector::GCCInstallationDetector(const Driver &D) // installation available. GCC installs are ranked by version number. GCCVersion BestVersion = {0, 0, 0}; for (unsigned i = 0, ie = Prefixes.size(); i < ie; ++i) { - if (!PathExists(Prefixes[i])) + if (!llvm::sys::fs::exists(Prefixes[i])) continue; for (unsigned j = 0, je = CandidateLibDirs.size(); j < je; ++j) { const std::string LibDir = Prefixes[i] + CandidateLibDirs[j].str(); - if (!PathExists(LibDir)) + if (!llvm::sys::fs::exists(LibDir)) continue; for (unsigned k = 0, ke = CandidateTriples.size(); k < ke; ++k) ScanLibDirForGCCTriple(LibDir, CandidateTriples[k], BestVersion); @@ -1731,7 +1723,7 @@ void Linux::GCCInstallationDetector::ScanLibDirForGCCTriple( continue; if (CandidateVersion <= BestVersion) continue; - if (!PathExists(LI->path() + "/crtbegin.o")) + if (!llvm::sys::fs::exists(LI->path() + "/crtbegin.o")) continue; BestVersion = CandidateVersion; @@ -1748,7 +1740,7 @@ void Linux::GCCInstallationDetector::ScanLibDirForGCCTriple( static void addPathIfExists(const std::string &Path, ToolChain::path_list &Paths) { - if (PathExists(Path)) Paths.push_back(Path); + if (llvm::sys::fs::exists(Path)) Paths.push_back(Path); } /// \brief Get our best guess at the multiarch triple for a target. |