diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2015-10-07 15:48:01 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2015-10-07 15:48:01 +0000 |
commit | d45b205ed1a1f83529929de88feb0e63e5a27649 (patch) | |
tree | d355dfffae731b55c86792bf0f103efaf6bb9f6b /clang/lib/Basic/VirtualFileSystem.cpp | |
parent | fd3a3b3f291cb93d6779a0c0670a43d97579ab99 (diff) | |
download | bcm5719-llvm-d45b205ed1a1f83529929de88feb0e63e5a27649.tar.gz bcm5719-llvm-d45b205ed1a1f83529929de88feb0e63e5a27649.zip |
[VFS] Port driver tool chains to VFS.
There are still some loose ends here but it's sufficient so we can detect
GCC headers that are inside of a VFS.
llvm-svn: 249556
Diffstat (limited to 'clang/lib/Basic/VirtualFileSystem.cpp')
-rw-r--r-- | clang/lib/Basic/VirtualFileSystem.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Basic/VirtualFileSystem.cpp b/clang/lib/Basic/VirtualFileSystem.cpp index 227c5737aa4..04383dbb878 100644 --- a/clang/lib/Basic/VirtualFileSystem.cpp +++ b/clang/lib/Basic/VirtualFileSystem.cpp @@ -105,6 +105,11 @@ std::error_code FileSystem::makeAbsolute(SmallVectorImpl<char> &Path) const { return llvm::sys::fs::make_absolute(WorkingDir.get(), Path); } +bool FileSystem::exists(const Twine &Path) { + auto Status = status(Path); + return Status && Status->exists(); +} + //===-----------------------------------------------------------------------===/ // RealFileSystem implementation //===-----------------------------------------------------------------------===/ |