aboutsummaryrefslogtreecommitdiff
path: root/lib/Support/PathV2.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Support/PathV2.cpp')
-rw-r--r--lib/Support/PathV2.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Support/PathV2.cpp b/lib/Support/PathV2.cpp
index 73896edecc..639b323a82 100644
--- a/lib/Support/PathV2.cpp
+++ b/lib/Support/PathV2.cpp
@@ -688,6 +688,16 @@ error_code create_directories(const Twine &path, bool &existed) {
return create_directory(p, existed);
}
+void directory_entry::replace_filename(const Twine &filename, file_status st,
+ file_status symlink_st) {
+ SmallString<128> path(Path.begin(), Path.end());
+ path::remove_filename(path);
+ path::append(path, filename);
+ Path = path.str();
+ Status = st;
+ SymlinkStatus = symlink_st;
+}
+
} // end namespace fs
} // end namespace sys
} // end namespace llvm