[cfe-dev] RFC: A virtual file system for clang

Rafael Espíndola rafael.espindola at gmail.com
Wed Feb 12 14:26:43 PST 2014


>> Please also use the opportunity to modernize the API when possible (using ErrorOr for example).
>
> I think keeping the interface as close to llvm::sys::fs as possible is really helpful for staging this in.  It makes it easier to see the correspondence between the real file system and the virtual one, and it makes updating clients easier.  If the intention is to modernize llvm::sys::fs as well, then I feel that’s orthogonal to what I want to accomplish.  Is the existing interface actually a pain point? It seems pretty easy to use to me.

Well, it means more code to change when we do fix llvm:sys::fs :-(

The main issue with returning error_code is that it is really easy to
ignore the error (like with plain posix functions). With ErrorOr we
get an assert if someone tries to use a result in an error condition.

Cheers,
Rafael




More information about the cfe-dev mailing list