diff options
author | Michael J. Spencer <bigcheesegs@gmail.com> | 2010-12-18 04:13:32 +0000 |
---|---|---|
committer | Michael J. Spencer <bigcheesegs@gmail.com> | 2010-12-18 04:13:32 +0000 |
commit | d5b08bee799d4f77f1a25fa5977ca77b983ab031 (patch) | |
tree | 426542f5871a92a87a6c0723bf9a46cb46b02f8d /lib/Rewrite/FrontendActions.cpp | |
parent | 2b364a43f50efd3d82177c29a79e66895ab335ad (diff) |
Replace all uses of PathV1::get{Basename,Dirname,Suffix} with their PathV2 equivalents.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122140 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Rewrite/FrontendActions.cpp')
-rw-r--r-- | lib/Rewrite/FrontendActions.cpp | 9 |
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 |