[llvm-commits] [llvm] r121091 - in /llvm/trunk: include/llvm/Support/PathV2.h lib/Support/Unix/PathV2.inc
Michael J. Spencer
bigcheesegs at gmail.com
Mon Dec 6 17:23:08 PST 2010
Author: mspencer
Date: Mon Dec 6 19:23:08 2010
New Revision: 121091
URL: http://llvm.org/viewvc/llvm-project?rev=121091&view=rev
Log:
Support/PathV2: Clarify and correct documentation.
Modified:
llvm/trunk/include/llvm/Support/PathV2.h
llvm/trunk/lib/Support/Unix/PathV2.inc
Modified: llvm/trunk/include/llvm/Support/PathV2.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/PathV2.h?rev=121091&r1=121090&r2=121091&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/PathV2.h (original)
+++ llvm/trunk/include/llvm/Support/PathV2.h Mon Dec 6 19:23:08 2010
@@ -123,17 +123,18 @@
/// 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 @@
///
/// ./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
Modified: llvm/trunk/lib/Support/Unix/PathV2.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Unix/PathV2.inc?rev=121091&r1=121090&r2=121091&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Unix/PathV2.inc (original)
+++ llvm/trunk/lib/Support/Unix/PathV2.inc Mon Dec 6 19:23:08 2010
@@ -30,6 +30,11 @@
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;
More information about the llvm-commits
mailing list