forked from OSchip/llvm-project
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:
parent
6e724762b1
commit
8e72a07efe
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue