[PATCH] D51921: [VFS] vfs::directory_iterator yields path and file type instead of full Status

Benjamin Kramer via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 12 11:00:08 PDT 2018


bkramer added inline comments.


================
Comment at: include/clang/Basic/VirtualFileSystem.h:135
+  // For compatibility with old Status-based API. Prefer using Path directly.
+  StringRef getName() const { return Path; }
+};
----------------
sammccall wrote:
> Backwards-compatibility notes:
> 
>  - Almost all users of `directory_iterator` require no source changes (with this change)
>  - Implementations of VFS require changes if they support directory iteration and do not merely wrap other VFSes. Anecdotally, most do not require changes. 
> 
> So this weird API seems worth having to make out-of-tree breakages less painful.
> Happy to update the internal uses though if that seems worthwhile.
Can we mirror llvm::sys::fs::directory_entry's interface? I want the APIs to be as close as possible. Upgrading users is not a big deal.


Repository:
  rC Clang

https://reviews.llvm.org/D51921





More information about the cfe-commits mailing list