Revert 98439. There is a bad race condition in sys::Path::makeUnique on win32.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98452 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/CIndex/CIndexer.cpp b/tools/CIndex/CIndexer.cpp
index 3cc1af8..0774ae2 100644
--- a/tools/CIndex/CIndexer.cpp
+++ b/tools/CIndex/CIndexer.cpp
@@ -95,7 +95,7 @@
   return P.str();
 }
 
-llvm::sys::Path CIndexer::getTemporaryPath() {
+static llvm::sys::Path GetTemporaryPath() {
   // FIXME: This is lame; sys::Path should provide this function (in particular,
   // it should know how to find the temporary files dir).
   std::string Error;
@@ -107,7 +107,7 @@
   if (!TmpDir)
     TmpDir = "/tmp";
   llvm::sys::Path P(TmpDir);
-  P.appendComponent("CIndex");
+  P.appendComponent("remap");
   if (P.makeUnique(false, &Error))
     return llvm::sys::Path("");
 
@@ -123,7 +123,7 @@
                        std::vector<llvm::sys::Path> &TemporaryFiles) {
   for (unsigned i = 0; i != num_unsaved_files; ++i) {
     // Write the contents of this unsaved file into the temporary file.
-    llvm::sys::Path SavedFile(CIndexer::getTemporaryPath());
+    llvm::sys::Path SavedFile(GetTemporaryPath());
     if (SavedFile.empty())
       return true;