summaryrefslogtreecommitdiffstats
path: root/llvm/lib/System/Unix/Path.inc
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2007-12-18 22:07:33 +0000
committerTed Kremenek <kremenek@apple.com>2007-12-18 22:07:33 +0000
commit14020706d80572504c107fcf6a8d1aaad4d0f2ff (patch)
tree63bdecc3cd60d3501e61a8525a3841d6d5400920 /llvm/lib/System/Unix/Path.inc
parentf70d24d2ae9e4b4e32e82b0ccb97d3b3d6ba9cbe (diff)
downloadbcm5719-llvm-14020706d80572504c107fcf6a8d1aaad4d0f2ff.tar.gz
bcm5719-llvm-14020706d80572504c107fcf6a8d1aaad4d0f2ff.zip
Added "GetCurrentDirectory()" to sys::Path.
llvm-svn: 45182
Diffstat (limited to 'llvm/lib/System/Unix/Path.inc')
-rw-r--r--llvm/lib/System/Unix/Path.inc10
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/System/Unix/Path.inc b/llvm/lib/System/Unix/Path.inc
index 9e90dda04e0..025357258dc 100644
--- a/llvm/lib/System/Unix/Path.inc
+++ b/llvm/lib/System/Unix/Path.inc
@@ -250,6 +250,16 @@ Path::GetUserHomeDirectory() {
return GetRootDirectory();
}
+Path
+Path::GetCurrentDirectory() {
+ char pathname[MAXPATHLEN];
+ if (!getcwd(pathname,MAXPATHLEN)) {
+ assert (false && "Could not query current working directory.");
+ return Path("");
+ }
+
+ return Path(pathname);
+}
std::string
Path::getBasename() const {
OpenPOWER on IntegriCloud