diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2015-07-15 21:24:07 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2015-07-15 21:24:07 +0000 |
commit | f662e00a688305fa72fbbb7fb840eac173ed3c0f (patch) | |
tree | 7a82d9c1b48ec9e7dc7901344ddb3578692e652a /llvm/lib | |
parent | 00d4fe43c6322a367cc60430624ecda43d6e04c4 (diff) | |
download | bcm5719-llvm-f662e00a688305fa72fbbb7fb840eac173ed3c0f.tar.gz bcm5719-llvm-f662e00a688305fa72fbbb7fb840eac173ed3c0f.zip |
Simplify a few uses of remove_filename by using parent_path instead.
llvm-svn: 242334
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Object/Archive.cpp | 5 | ||||
-rw-r--r-- | llvm/lib/Support/Path.cpp | 3 |
2 files changed, 3 insertions, 5 deletions
diff --git a/llvm/lib/Object/Archive.cpp b/llvm/lib/Object/Archive.cpp index d4821196a6c..a1e5eb27689 100644 --- a/llvm/lib/Object/Archive.cpp +++ b/llvm/lib/Object/Archive.cpp @@ -122,9 +122,8 @@ ErrorOr<StringRef> Archive::Child::getBuffer() const { ErrorOr<StringRef> Name = getName(); if (std::error_code EC = Name.getError()) return EC; - SmallString<128> FullName = - Parent->getMemoryBufferRef().getBufferIdentifier(); - sys::path::remove_filename(FullName); + SmallString<128> FullName = sys::path::parent_path( + Parent->getMemoryBufferRef().getBufferIdentifier()); sys::path::append(FullName, *Name); ErrorOr<std::unique_ptr<MemoryBuffer>> Buf = MemoryBuffer::getFile(FullName); if (std::error_code EC = Buf.getError()) diff --git a/llvm/lib/Support/Path.cpp b/llvm/lib/Support/Path.cpp index cf467381db8..75fd292e5b1 100644 --- a/llvm/lib/Support/Path.cpp +++ b/llvm/lib/Support/Path.cpp @@ -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; |