Support/PathV2: Clarify and correct documentation.
authorMichael J. Spencer <bigcheesegs@gmail.com>
Tue, 7 Dec 2010 01:23:08 +0000 (01:23 +0000)
committerMichael J. Spencer <bigcheesegs@gmail.com>
Tue, 7 Dec 2010 01:23:08 +0000 (01:23 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121091 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/PathV2.h
lib/Support/Unix/PathV2.inc

index e2b87510452a878a74cd4716e240f6411dfe6cd1..79760d1db500582af571b857846abf340490868f 100644 (file)
@@ -123,17 +123,18 @@ inline reverse_iterator rend(const StringRef &path) {
 /// empty \a path will result in the current directory.
 ///
 /// /absolute/path   => /absolute/path
-/// relative/../path => <current-directory>/path
+/// relative/../path => <current-directory>/relative/../path
 ///
 /// @param path A path that is modified to be an absolute path.
 /// @returns errc::success if \a path has been made absolute, otherwise a
 ///          platform specific error_code.
 error_code make_absolute(SmallVectorImpl<char> &path);
 
-/// @brief Remove the last component from \a path if it exists.
+/// @brief Remove the last component from \a path unless it is the root dir.
 ///
 /// directory/filename.cpp => directory/
 /// directory/             => directory
+/// /                      => /
 ///
 /// @param path A path that is modified to not have a file component.
 /// @returns errc::success if \a path's file name has been removed (or there was
@@ -144,7 +145,7 @@ error_code remove_filename(SmallVectorImpl<char> &path);
 ///
 /// ./filename.cpp => ./filename.extension
 /// ./filename     => ./filename.extension
-/// ./             => ? TODO: decide what semantics this has.
+/// ./             => ./.extension
 ///
 /// @param path A path that has its extension replaced with \a extension.
 /// @param extension The extension to be added. It may be empty. It may also
index f7ca64daf7e9bf578a60d785d702f8408773f5b6..4ca482dfce1d50d1ae25e0160583e7d2ffccdf4c 100644 (file)
 using namespace llvm;
 
 namespace {
+  /// This class automatically closes the given file descriptor when it goes out
+  /// of scope. You can take back explicit ownership of the file descriptor by
+  /// calling take(). The destructor does not verify that close was successful.
+  /// Therefore, never allow this class to call close on a file descriptor that
+  /// has been read from or written to.
   struct AutoFD {
     int FileDescriptor;