Simplify a few uses of remove_filename by using parent_path instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242334 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2015-07-15 21:24:07 +00:00
parent f9893938de
commit a0458b67ae
3 changed files with 4 additions and 7 deletions

View File

@ -889,8 +889,7 @@ std::error_code is_other(const Twine &Path, bool &Result) {
}
void directory_entry::replace_filename(const Twine &filename, file_status st) {
SmallString<128> path(Path.begin(), Path.end());
path::remove_filename(path);
SmallString<128> path = path::parent_path(Path);
path::append(path, filename);
Path = path.str();
Status = st;