summaryrefslogtreecommitdiffstats
path: root/lib/Rewrite/Frontend/FrontendActions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Rewrite/Frontend/FrontendActions.cpp')
-rw-r--r--lib/Rewrite/Frontend/FrontendActions.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/Rewrite/Frontend/FrontendActions.cpp b/lib/Rewrite/Frontend/FrontendActions.cpp
index 9935aeb..e9ec388 100644
--- a/lib/Rewrite/Frontend/FrontendActions.cpp
+++ b/lib/Rewrite/Frontend/FrontendActions.cpp
@@ -76,12 +76,10 @@ class FixItRewriteToTemp : public FixItOptions {
public:
std::string RewriteFilename(const std::string &Filename, int &fd) {
SmallString<128> Path;
- Path = llvm::sys::path::filename(Filename);
- Path += "-%%%%%%%%";
- Path += llvm::sys::path::extension(Filename);
- SmallString<128> NewPath;
- llvm::sys::fs::unique_file(Path.str(), fd, NewPath);
- return NewPath.str();
+ llvm::sys::fs::createTemporaryFile(llvm::sys::path::filename(Filename),
+ llvm::sys::path::extension(Filename), fd,
+ Path);
+ return Path.str();
}
};
} // end anonymous namespace
OpenPOWER on IntegriCloud