summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CompilerInstance.cpp
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2017-08-04 06:35:32 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2017-08-04 06:35:32 +0000
commit8e72a07efecb55e023b1ba3a3d754d3eb14540be (patch)
tree73ec71a7a926235ee4e3520b0fd0ea1f0097e2e4 /clang/lib/Frontend/CompilerInstance.cpp
parent6e724762b14307893ac237047c370fbc080a3635 (diff)
downloadbcm5719-llvm-8e72a07efecb55e023b1ba3a3d754d3eb14540be.tar.gz
bcm5719-llvm-8e72a07efecb55e023b1ba3a3d754d3eb14540be.zip
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
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInstance.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp
index d0c1a974aff..bb6a665cb45 100644
--- a/clang/lib/Frontend/CompilerInstance.cpp
+++ b/clang/lib/Frontend/CompilerInstance.cpp
@@ -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);
OpenPOWER on IntegriCloud