summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CompilerInstance.cpp
diff options
context:
space:
mode:
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