[PATCH] D49724: [VFS] Cleanups to VFS interfaces.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 24 04:34:06 PDT 2018


sammccall created this revision.
sammccall added a reviewer: klimek.
Herald added a subscriber: cfe-commits.

- add comments clarifying semantics
- Status::copyWithNewName(Status, Name) --> instance method
- Status::copyWithNewName(fs::file_status, Name) --> constructor (it's not a copy)
- File::getName() -> getRealPath(), reflecting its actual behavior/function and stop returning status().getName() in the base class (callers can do this fallback if they want to, it complicates the contracts).

This is mostly NFC, but the behavior of File::getName() affects FileManager's
FileEntry::tryGetRealPathName(), which now fails in more cases:

- non-real file cases
- real-file cases where the underlying vfs::File was opened in a way that doesn't call realpath().

(In these cases we don't know a distinct real name, so in principle it seems OK)


Repository:
  rC Clang

https://reviews.llvm.org/D49724

Files:
  include/clang/Basic/VirtualFileSystem.h
  lib/Basic/FileManager.cpp
  lib/Basic/VirtualFileSystem.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49724.157003.patch
Type: text/x-patch
Size: 6762 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180724/c257deef/attachment-0001.bin>


More information about the cfe-commits mailing list