diff options
| author | Chris Lattner <sabre@nondot.org> | 2008-02-27 06:17:10 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2008-02-27 06:17:10 +0000 |
| commit | 6fca938971fcf80fbdd278fb8fbaf4b0e8476090 (patch) | |
| tree | 8f9ec58210e9e517261c9550b6ac1866175ec4ce /llvm/lib/System/Path.cpp | |
| parent | c025841dd4f5b8569c891b1eb27717572a2ddd6b (diff) | |
| download | bcm5719-llvm-6fca938971fcf80fbdd278fb8fbaf4b0e8476090.tar.gz bcm5719-llvm-6fca938971fcf80fbdd278fb8fbaf4b0e8476090.zip | |
Add path separator support, patch by Sam Bishop.
llvm-svn: 47662
Diffstat (limited to 'llvm/lib/System/Path.cpp')
| -rw-r--r-- | llvm/lib/System/Path.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/llvm/lib/System/Path.cpp b/llvm/lib/System/Path.cpp index 11035cfee7a..8a1de75e478 100644 --- a/llvm/lib/System/Path.cpp +++ b/llvm/lib/System/Path.cpp @@ -177,6 +177,25 @@ Path::getSuffix() const { return path.substr(path.rfind('.') + 1); } +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); +} + // Include the truly platform-specific parts of this class. #if defined(LLVM_ON_UNIX) #include "Unix/Path.inc" |

