aboutsummaryrefslogtreecommitdiff
path: root/lib/Rewrite/FrontendActions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Rewrite/FrontendActions.cpp')
-rw-r--r--lib/Rewrite/FrontendActions.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/Rewrite/FrontendActions.cpp b/lib/Rewrite/FrontendActions.cpp
index ec99ace18a..33e79edaf9 100644
--- a/lib/Rewrite/FrontendActions.cpp
+++ b/lib/Rewrite/FrontendActions.cpp
@@ -58,11 +58,10 @@ public:
}
std::string RewriteFilename(const std::string &Filename) {
- llvm::sys::Path Path(Filename);
- std::string Suffix = Path.getSuffix();
- Path.eraseSuffix();
- Path.appendSuffix(NewSuffix + "." + Suffix);
- return Path.c_str();
+ llvm::SmallString<128> Path(Filename);
+ llvm::sys::path::replace_extension(Path,
+ NewSuffix + llvm::sys::path::extension(Path));
+ return Path.str();
}
};
} // end anonymous namespace