From: NAKAMURA Takumi Date: Fri, 4 Aug 2017 06:35:32 +0000 (+0000) Subject: Revert r309984, "Use "foo-12345.o" instead of "foo.o-12345" as temporary file name." X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=08ca17598d42af79e4e233dd7dbb7e067f3a4496;p=clang 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" git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@310030 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Frontend/CompilerInstance.cpp b/lib/Frontend/CompilerInstance.cpp index d0c1a974af..bb6a665cb4 100644 --- a/lib/Frontend/CompilerInstance.cpp +++ b/lib/Frontend/CompilerInstance.cpp @@ -759,13 +759,9 @@ std::unique_ptr 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);