[llvm-commits] [llvm] r122116 - in /llvm/trunk: include/llvm/Support/PathV1.h lib/Support/CommandLine.cpp
Michael J. Spencer
bigcheesegs at gmail.com
Fri Dec 17 16:19:10 PST 2010
Author: mspencer
Date: Fri Dec 17 18:19:10 2010
New Revision: 122116
URL: http://llvm.org/viewvc/llvm-project?rev=122116&view=rev
Log:
Support/PathV1: Deprecate getLast.
Modified:
llvm/trunk/include/llvm/Support/PathV1.h
llvm/trunk/lib/Support/CommandLine.cpp
Modified: llvm/trunk/include/llvm/Support/PathV1.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/PathV1.h?rev=122116&r1=122115&r2=122116&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/PathV1.h (original)
+++ llvm/trunk/include/llvm/Support/PathV1.h Fri Dec 17 18:19:10 2010
@@ -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
Modified: llvm/trunk/lib/Support/CommandLine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/CommandLine.cpp?rev=122116&r1=122115&r2=122116&view=diff
==============================================================================
--- llvm/trunk/lib/Support/CommandLine.cpp (original)
+++ llvm/trunk/lib/Support/CommandLine.cpp Fri Dec 17 18:19:10 2010
@@ -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';
More information about the llvm-commits
mailing list