Simplify a few uses of remove_filename by using parent_path instead.
[oota-llvm.git] / lib / Support / Path.cpp
index cf467381db8c47315f58aeb82e74a681fafccc29..75fd292e5b161dde3fb5fd6f18a44d866edbca07 100644 (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;