Make getTemporaryPath a static member of CIndexer and use it to replace tmpnam calls.
This fixes linker warnings on linux.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98439 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/CIndex/CIndexer.cpp b/tools/CIndex/CIndexer.cpp
index 0774ae2..3cc1af8 100644
--- a/tools/CIndex/CIndexer.cpp
+++ b/tools/CIndex/CIndexer.cpp
@@ -95,7 +95,7 @@
return P.str();
}
-static llvm::sys::Path GetTemporaryPath() {
+llvm::sys::Path CIndexer::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("remap");
+ P.appendComponent("CIndex");
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(GetTemporaryPath());
+ llvm::sys::Path SavedFile(CIndexer::getTemporaryPath());
if (SavedFile.empty())
return true;