diff options
-rw-r--r-- | include/llvm/Support/PathV1.h | 5 | ||||
-rw-r--r-- | lib/Support/Path.cpp | 19 | ||||
-rw-r--r-- | lib/Support/Unix/Path.inc | 15 | ||||
-rw-r--r-- | lib/Support/Windows/Path.inc | 30 |
4 files changed, 0 insertions, 69 deletions
diff --git a/include/llvm/Support/PathV1.h b/include/llvm/Support/PathV1.h index 9fe01da..44c29ec 100644 --- a/include/llvm/Support/PathV1.h +++ b/include/llvm/Support/PathV1.h @@ -111,11 +111,6 @@ namespace sys { /// directory. static Path GetTemporaryDirectory(std::string* ErrMsg = 0); - /// Construct a vector of sys::Path that contains the "standard" system - /// library paths suitable for linking into programs. - /// @brief Construct a path to the system library directory - static void GetSystemLibraryPaths(std::vector<sys::Path>& Paths); - /// Construct a path to the current user's home directory. The /// implementation must use an operating system specific mechanism for /// determining the user's home directory. For example, the environment diff --git a/lib/Support/Path.cpp b/lib/Support/Path.cpp index 5c2b1f7..09d2ead 100644 --- a/lib/Support/Path.cpp +++ b/lib/Support/Path.cpp @@ -95,25 +95,6 @@ bool Path::hasMagicNumber(StringRef Magic) const { return false; } -static void getPathList(const char*path, std::vector<Path>& Paths) { - const char* at = path; - const char* delim = strchr(at, PathSeparator); - Path tmpPath; - while (delim != 0) { - std::string tmp(at, size_t(delim-at)); - if (tmpPath.set(tmp)) - if (tmpPath.canRead()) - Paths.push_back(tmpPath); - at = delim + 1; - delim = strchr(at, PathSeparator); - } - - if (*at != 0) - if (tmpPath.set(std::string(at))) - if (tmpPath.canRead()) - Paths.push_back(tmpPath); -} - static StringRef getDirnameCharSep(StringRef path, const char *Sep) { assert(Sep[0] != '\0' && Sep[1] == '\0' && "Sep must be a 1-character string literal."); diff --git a/lib/Support/Unix/Path.inc b/lib/Support/Unix/Path.inc index 3ca4a0d..b942674 100644 --- a/lib/Support/Unix/Path.inc +++ b/lib/Support/Unix/Path.inc @@ -207,21 +207,6 @@ Path::GetTemporaryDirectory(std::string *ErrMsg) { #endif } -void -Path::GetSystemLibraryPaths(std::vector<sys::Path>& Paths) { -#ifdef LTDL_SHLIBPATH_VAR - char* env_var = getenv(LTDL_SHLIBPATH_VAR); - if (env_var != 0) { - getPathList(env_var,Paths); - } -#endif - // FIXME: Should this look at LD_LIBRARY_PATH too? - Paths.push_back(sys::Path("/usr/local/lib/")); - Paths.push_back(sys::Path("/usr/X11R6/lib/")); - Paths.push_back(sys::Path("/usr/lib/")); - Paths.push_back(sys::Path("/lib/")); -} - Path Path::GetUserHomeDirectory() { const char* home = getenv("HOME"); diff --git a/lib/Support/Windows/Path.inc b/lib/Support/Windows/Path.inc index c29b28a..f076cd4 100644 --- a/lib/Support/Windows/Path.inc +++ b/lib/Support/Windows/Path.inc @@ -241,36 +241,6 @@ Path::GetRootDirectory() { return Path("file:///"); } -void -Path::GetSystemLibraryPaths(std::vector<sys::Path>& Paths) { - char buff[MAX_PATH]; - // Generic form of C:\Windows\System32 - HRESULT res = SHGetFolderPathA(NULL, - CSIDL_FLAG_CREATE | CSIDL_SYSTEM, - NULL, - SHGFP_TYPE_CURRENT, - buff); - if (res != S_OK) { - assert(0 && "Failed to get system directory"); - return; - } - Paths.push_back(sys::Path(buff)); - - // Reset buff. - buff[0] = 0; - // Generic form of C:\Windows - res = SHGetFolderPathA(NULL, - CSIDL_FLAG_CREATE | CSIDL_WINDOWS, - NULL, - SHGFP_TYPE_CURRENT, - buff); - if (res != S_OK) { - assert(0 && "Failed to get windows directory"); - return; - } - Paths.push_back(sys::Path(buff)); -} - Path Path::GetUserHomeDirectory() { char buff[MAX_PATH]; |