diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-06-26 05:01:35 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-06-26 05:01:35 +0000 |
commit | 50188c1f42c122640ab9ccac2134acf371c26b2c (patch) | |
tree | 05539e5a83063a0eeda3c9211dfb8153cc750f0c /lib/Support/Windows | |
parent | 2c63b27e9f36dddc2660639026b19e606ad52cd0 (diff) | |
download | llvm-50188c1f42c122640ab9ccac2134acf371c26b2c.tar.gz llvm-50188c1f42c122640ab9ccac2134acf371c26b2c.tar.bz2 llvm-50188c1f42c122640ab9ccac2134acf371c26b2c.tar.xz |
Port GetMainExecutable over to PathV2.
I will remove the V1 version as soon as I change clang in the next commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184914 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/Windows')
-rw-r--r-- | lib/Support/Windows/PathV2.inc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Support/Windows/PathV2.inc b/lib/Support/Windows/PathV2.inc index 0c12bb440e..6987e5fc9d 100644 --- a/lib/Support/Windows/PathV2.inc +++ b/lib/Support/Windows/PathV2.inc @@ -128,6 +128,13 @@ namespace llvm { namespace sys { namespace fs { +std::string getMainExecutable(const char *argv0, void *MainExecAddr) { + char pathname[MAX_PATH]; + DWORD ret = ::GetModuleFileNameA(NULL, pathname, MAX_PATH); + return ret != MAX_PATH ? pathname : ""; +} + + TimeValue file_status::getLastModificationTime() const { ULARGE_INTEGER UI; UI.LowPart = LastWriteTimeLow; |