[cfe-commits] r143839 - /cfe/trunk/lib/Driver/ToolChains.cpp

Chandler Carruth chandlerc at gmail.com
Sat Nov 5 15:23:11 PDT 2011


Author: chandlerc
Date: Sat Nov  5 17:23:11 2011
New Revision: 143839

URL: http://llvm.org/viewvc/llvm-project?rev=143839&view=rev
Log:
Remove a no-longer needed helper function. Thanks for implementing this
Michael!

Modified:
    cfe/trunk/lib/Driver/ToolChains.cpp

Modified: cfe/trunk/lib/Driver/ToolChains.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=143839&r1=143838&r2=143839&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains.cpp Sat Nov  5 17:23:11 2011
@@ -1519,14 +1519,6 @@
   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
@@ -1622,11 +1614,11 @@
   // 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);
@@ -1729,7 +1721,7 @@
         continue;
       if (CandidateVersion <= BestVersion)
         continue;
-      if (!PathExists(LI->path() + "/crtbegin.o"))
+      if (!llvm::sys::fs::exists(LI->path() + "/crtbegin.o"))
         continue;
 
       BestVersion = CandidateVersion;
@@ -1746,7 +1738,7 @@
 
 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.





More information about the cfe-commits mailing list