diff --git a/include/llvm/Support/Path.h b/include/llvm/Support/Path.h index 93a116f45c9..879f0137361 100644 --- a/include/llvm/Support/Path.h +++ b/include/llvm/Support/Path.h @@ -455,14 +455,9 @@ namespace sys { 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 diff --git a/lib/Support/Path.cpp b/lib/Support/Path.cpp index 394e013b8b2..c3353fd0e2b 100644 --- a/lib/Support/Path.cpp +++ b/lib/Support/Path.cpp @@ -195,19 +195,12 @@ StringRef Path::GetDLLSuffix() { 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