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
diff --git a/lib/Rewrite/FrontendActions.cpp b/lib/Rewrite/FrontendActions.cpp
index ec99ace..33e79ed 100644
--- a/lib/Rewrite/FrontendActions.cpp
+++ b/lib/Rewrite/FrontendActions.cpp
@@ -58,11 +58,10 @@
   }
 
   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