Support/Path: Deprecate PathV1::isDirectory and replace all uses with PathV2::is_dire...
[oota-llvm.git] / lib / Support / Unix / Path.inc
index b39e465a5359c1de90b55e5f704c56bf8baf7ca8..bdd13a64b01594e4c9d3de037b5cb3fc6b45ef46 100644 (file)
@@ -823,7 +823,8 @@ Path::makeUnique(bool reuse_current, std::string* ErrMsg) {
   Buf.resize(path.size()+8);
   char *FNBuffer = &Buf[0];
     path.copy(FNBuffer,path.size());
-  if (isDirectory())
+  bool isdir;
+  if (!fs::is_directory(path, isdir) && isdir)
     strcpy(FNBuffer+path.size(), "/XXXXXX");
   else
     strcpy(FNBuffer+path.size(), "-XXXXXX");