Revert r309984, "Use "foo-12345.o" instead of "foo.o-12345" as temporary file name."

It generates MODULE-XXXXXXXXXXXX-%%%%%%%%.pcm, then GlobalModuleIndex.cpp is confused with the suffix ".pcm"

llvm-svn: 310030
This commit is contained in:
NAKAMURA Takumi 2017-08-04 06:35:32 +00:00
parent 6e724762b1
commit 8e72a07efe
1 changed files with 2 additions and 6 deletions

View File

@ -759,13 +759,9 @@ std::unique_ptr<llvm::raw_pwrite_stream> CompilerInstance::createOutputFile(
if (UseTemporary) {
// Create a temporary file.
// Insert -%%%%%%%% before the extension (if any), so that tools doing
// things based on the file extension do the right thing.
StringRef OutputExtension = llvm::sys::path::extension(OutFile);
SmallString<128> TempPath =
StringRef(OutFile).drop_back(OutputExtension.size());
SmallString<128> TempPath;
TempPath = OutFile;
TempPath += "-%%%%%%%%";
TempPath += OutputExtension;
int fd;
std::error_code EC =
llvm::sys::fs::createUniqueFile(TempPath, fd, TempPath);