diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2021-12-25 22:30:44 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2021-12-25 22:30:44 +0000 |
commit | 77fc4c146f0870ffb09c1afb823ccbe742c5e6ff (patch) | |
tree | 5c0eb39553003b9c75a901af6bc4ddabd6f2f28c /llvm/lib/Support/Path.cpp | |
parent | f65dcba83ce5035ab88a85fe17628b447eb56e1b (diff) |
Diffstat (limited to 'llvm/lib/Support/Path.cpp')
-rw-r--r-- | llvm/lib/Support/Path.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Support/Path.cpp b/llvm/lib/Support/Path.cpp index 3957547dfaaa..7c99d088911c 100644 --- a/llvm/lib/Support/Path.cpp +++ b/llvm/lib/Support/Path.cpp @@ -474,7 +474,7 @@ StringRef parent_path(StringRef path, Style style) { void remove_filename(SmallVectorImpl<char> &path, Style style) { size_t end_pos = parent_path_end(StringRef(path.begin(), path.size()), style); if (end_pos != StringRef::npos) - path.set_size(end_pos); + path.truncate(end_pos); } void replace_extension(SmallVectorImpl<char> &path, const Twine &extension, @@ -486,7 +486,7 @@ void replace_extension(SmallVectorImpl<char> &path, const Twine &extension, // Erase existing extension. size_t pos = p.find_last_of('.'); if (pos != StringRef::npos && pos >= filename_pos(p, style)) - path.set_size(pos); + path.truncate(pos); // Append '.' if needed. if (ext.size() > 0 && ext[0] != '.') |