Support/PathV1: Deprecate getLast.

llvm-svn: 122116
diff --git a/llvm/include/llvm/Support/PathV1.h b/llvm/include/llvm/Support/PathV1.h
index 260deeb..818b329 100644
--- a/llvm/include/llvm/Support/PathV1.h
+++ b/llvm/include/llvm/Support/PathV1.h
@@ -263,7 +263,9 @@
       /// path name is returned (i.e. same as toString).
       /// @returns StringRef containing the last component of the path name.
       /// @brief Returns the last component of the path name.
-      StringRef getLast() const;
+      LLVM_ATTRIBUTE_DEPRECATED(
+        StringRef getLast() const,
+        LLVMV_PATH_DEPRECATED_MSG);
 
       /// This function strips off the path and suffix of the file or directory
       /// name and returns just the basename. For example /a/foo.bar would cause
diff --git a/llvm/lib/Support/CommandLine.cpp b/llvm/lib/Support/CommandLine.cpp
index 373a1a2..6f5d9dd 100644
--- a/llvm/lib/Support/CommandLine.cpp
+++ b/llvm/lib/Support/CommandLine.cpp
@@ -505,7 +505,7 @@
   }
 
   // Copy the program name into ProgName, making sure not to overflow it.
-  std::string ProgName = sys::Path(argv[0]).getLast();
+  std::string ProgName = sys::path::filename(argv[0]);
   size_t Len = std::min(ProgName.size(), size_t(79));
   memcpy(ProgramName, ProgName.data(), Len);
   ProgramName[Len] = '\0';