[PATCH] Some infrastructure work for virtual file system (now on phab)

Ben Langmuir blangmuir at apple.com
Thu Feb 13 14:44:46 PST 2014


    - Use ErrorOr in places where it makes sense to prevent using an invalid object
    - Dodge the question of how to write the predicate functions by removing them all from AbstractFileSystem, since only the ones in Status are being called for now
    - De-virtualize getBufferForFile(Path) by using getBufferForOpenFile(FD).  This is what MemoryBuffer was doing internally anway.
    - To support the previous point, I added a close(FD) method. Right now this requires an ugly #include to get ::close, but I will move this into llvm::sys::fs. For now it is still a net improvement, since the FileManager now doesn't call raw ::close.
    - Rename functions in Status to follow naming conventions

Hi doug.gregor, klimek, gribozavr,

http://llvm-reviews.chandlerc.com/D2745

CHANGE SINCE LAST DIFF
  http://llvm-reviews.chandlerc.com/D2745?vs=7006&id=7095#toc

Files:
  include/clang/Basic/FileManager.h
  include/clang/Basic/FileSystemStatCache.h
  include/clang/Basic/VirtualFileSystem.h
  include/clang/Frontend/CompilerInstance.h
  lib/Basic/CMakeLists.txt
  lib/Basic/FileManager.cpp
  lib/Basic/FileSystemStatCache.cpp
  lib/Basic/VirtualFileSystem.cpp
  lib/Frontend/ASTUnit.cpp
  lib/Frontend/CacheTokens.cpp
  lib/Frontend/ChainedIncludesSource.cpp
  lib/Frontend/CompilerInstance.cpp
  lib/Frontend/FrontendAction.cpp
  lib/Lex/PTHLexer.cpp
  unittests/Basic/FileManagerTest.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D2745.3.patch
Type: text/x-patch
Size: 36031 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140213/32b203f0/attachment.bin>


More information about the cfe-commits mailing list