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
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);