Support/PathV1: Deprecate getLast.
authorMichael J. Spencer <bigcheesegs@gmail.com>
Sat, 18 Dec 2010 00:19:10 +0000 (00:19 +0000)
committerMichael J. Spencer <bigcheesegs@gmail.com>
Sat, 18 Dec 2010 00:19:10 +0000 (00:19 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122116 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/PathV1.h
lib/Support/CommandLine.cpp

index 260deeb4a872de9ba7f1b324b7175365128acc2d..818b32964eea173b1229fa29071850990540de08 100644 (file)
@@ -263,7 +263,9 @@ namespace sys {
       /// 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
index 373a1a2c52a61c0bc001fdd8cacbca69aa4d7fed..6f5d9dd4281055fd01ff12f7849351184f45d02f 100644 (file)
@@ -505,7 +505,7 @@ void cl::ParseCommandLineOptions(int argc, char **argv,
   }
 
   // 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';