[Support] Use GetTempDir to get the temporary dir path on Windows.
authorPawel Bylica <chfast@gmail.com>
Fri, 6 Nov 2015 23:21:49 +0000 (23:21 +0000)
committerPawel Bylica <chfast@gmail.com>
Fri, 6 Nov 2015 23:21:49 +0000 (23:21 +0000)
commitdae382206cce8018e43e0743d908abfb9108532c
tree5fd98a2d2ef687284eb085d722202269b48e7062
parent8843b7105c41353de8945d0c02fe735a8a57c232
[Support] Use GetTempDir to get the temporary dir path on Windows.

Summary:
In general GetTempDir follows the same logic as the replaced code: checks env variables TMP, TEMP, USERPROFILE in order. However, it also perform other checks like making separators native (\), making the path absolute, etc.

This change fixes FileSystemTest.CreateDir unittest that had been failing when run from Unix-like shell on Windows (Unix-like path separator (/) used in env variables).

Reviewers: chapuni, rafael, aaron.ballman

Subscribers: rafael, llvm-commits

Differential Revision: http://reviews.llvm.org/D14231

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252366 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Support/Windows/Path.inc
unittests/Support/Path.cpp