Clang Lands A Virtual File-System
LLVM's Clang compiler now has a virtual file-system implementation.
Why have a VFS inside a C/C++ code compiler? Ben Langmuir of Apple who worked on the initial Clang VFS explained, "[it allows] a build system to provide a file/directory layout to clang without having to construct it 'for real' on disk. For example, I am building a project containing two modules, and module A imports module B. It would be useful if we could bundle up the headers and module.map file for module B from wherever they may exist in the source directories and provide clang with a notion of the file layout of B _as it will be installed_."
Clang's FileManager code will now be migrated to this VFS code. The initial Clang virtual file-system landed with this Git commit on Tuesday. The VFS will be one of many features found in the next release, LLVM 3.5, which should be out around the middle of the year.
Why have a VFS inside a C/C++ code compiler? Ben Langmuir of Apple who worked on the initial Clang VFS explained, "[it allows] a build system to provide a file/directory layout to clang without having to construct it 'for real' on disk. For example, I am building a project containing two modules, and module A imports module B. It would be useful if we could bundle up the headers and module.map file for module B from wherever they may exist in the source directories and provide clang with a notion of the file layout of B _as it will be installed_."
Clang's FileManager code will now be migrated to this VFS code. The initial Clang virtual file-system landed with this Git commit on Tuesday. The VFS will be one of many features found in the next release, LLVM 3.5, which should be out around the middle of the year.
10 Comments