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/CIndexCodeCompletion.cpp b/tools/CIndex/CIndexCodeCompletion.cpp
index 3b7674e..cd37872 100644
--- a/tools/CIndex/CIndexCodeCompletion.cpp
+++ b/tools/CIndex/CIndexCodeCompletion.cpp
@@ -299,15 +299,11 @@
argv.push_back(NULL);
// Generate a temporary name for the code-completion results file.
- char tmpFile[L_tmpnam];
- char *tmpFileName = tmpnam(tmpFile);
- llvm::sys::Path ResultsFile(tmpFileName);
+ llvm::sys::Path ResultsFile(CIndexer::getTemporaryPath());
TemporaryFiles.push_back(ResultsFile);
// Generate a temporary name for the diagnostics file.
- char tmpFileResults[L_tmpnam];
- char *tmpResultsFileName = tmpnam(tmpFileResults);
- llvm::sys::Path DiagnosticsFile(tmpResultsFileName);
+ llvm::sys::Path DiagnosticsFile(CIndexer::getTemporaryPath());
TemporaryFiles.push_back(DiagnosticsFile);
// Invoke 'clang'.