Path::GetTemporaryDirectory(): Add an assertion if TempDirectory is alive, to check when someone would remove the tempdir.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157529 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
NAKAMURA Takumi 2012-05-27 13:02:04 +00:00
parent cf1d69df7e
commit 542c063f96

View File

@ -188,8 +188,10 @@ static Path *TempDirectory;
Path
Path::GetTemporaryDirectory(std::string* ErrMsg) {
if (TempDirectory)
if (TempDirectory) {
assert(TempDirectory->exists() && "Who has removed TempDirectory?");
return *TempDirectory;
}
char pathname[MAX_PATH];
if (!GetTempPath(MAX_PATH, pathname)) {