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

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 11 03:43:26 PDT 2018


sammccall 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; }
+};
----------------
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.


Repository:
  rC Clang

https://reviews.llvm.org/D51921





More information about the cfe-commits mailing list