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())
}
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;
if (!getCacheFilename(ModuleID, CacheName))
return;
if (!CacheDir.empty()) { // Create user-defined cache dir.
- SmallString<128> dir(CacheName);
- sys::path::remove_filename(dir);
+ SmallString<128> dir(sys::path::parent_path(CacheName));
sys::fs::create_directories(Twine(dir));
}
std::error_code EC;