[llvm-commits] [llvm] r120538 - in /llvm/trunk: include/llvm/Support/Path.h lib/Support/Path.cpp
Dan Gohman
gohman at apple.com
Tue Nov 30 18:46:42 PST 2010
Author: djg
Date: Tue Nov 30 20:46:41 2010
New Revision: 120538
URL: http://llvm.org/viewvc/llvm-project?rev=120538&view=rev
Log:
Delete Path::appendSuffix's return value; it wasn't used anywhere, which
is fine since isn't really necessary to check isValid there anyway.
Modified:
llvm/trunk/include/llvm/Support/Path.h
llvm/trunk/lib/Support/Path.cpp
Modified: llvm/trunk/include/llvm/Support/Path.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Path.h?rev=120538&r1=120537&r2=120538&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/Path.h (original)
+++ llvm/trunk/include/llvm/Support/Path.h Tue Nov 30 20:46:41 2010
@@ -455,14 +455,9 @@
bool appendComponent(StringRef component);
/// A period and the \p suffix are appended to the end of the pathname.
- /// The precondition for this function is that the Path reference a file
- /// name (i.e. isFile() returns true). If the Path is not a file, no
- /// action is taken and the function returns false. If the path would
- /// become invalid for the host operating system, false is returned. When
- /// the \p suffix is empty, no action is performed.
- /// @returns false if the suffix could not be added, true if it was.
+ /// When the \p suffix is empty, no action is performed.
/// @brief Adds a period and the \p suffix to the end of the pathname.
- bool appendSuffix(StringRef suffix);
+ void appendSuffix(StringRef suffix);
/// The suffix of the filename is erased. The suffix begins with and
/// includes the last . character in the filename after the last directory
Modified: llvm/trunk/lib/Support/Path.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Path.cpp?rev=120538&r1=120537&r2=120538&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Path.cpp (original)
+++ llvm/trunk/lib/Support/Path.cpp Tue Nov 30 20:46:41 2010
@@ -195,19 +195,12 @@
return &(LTDL_SHLIB_EXT[1]);
}
-bool
+void
Path::appendSuffix(StringRef suffix) {
if (!suffix.empty()) {
- std::string save(path);
path.append(".");
path.append(suffix);
- if (!isValid()) {
- path = save;
- return false;
- }
}
-
- return true;
}
bool
More information about the llvm-commits
mailing list