diff options
author | Taewook Oh <twoh@fb.com> | 2016-06-13 20:40:21 +0000 |
---|---|---|
committer | Taewook Oh <twoh@fb.com> | 2016-06-13 20:40:21 +0000 |
commit | 50eca98dda9eb9dba0aa3e30830c13650de44a42 (patch) | |
tree | 22622a420ad47dbbb03acb38ac8ed619c4d70cd4 /include/clang/Basic/VirtualFileSystem.h | |
parent | 6f040c194957e95dbdbb03e9fc3481361476281b (diff) | |
download | clang-50eca98dda9eb9dba0aa3e30830c13650de44a42.tar.gz |
Use the name of the file on disk to issue a new diagnostic about non-portable #include and #import paths.
Differential Revision: http://reviews.llvm.org/D19843
Corresponding LLVM change: http://reviews.llvm.org/D19842
Re-commit of r272562 after addressing clang-x86-win2008-selfhost failure.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@272584 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/VirtualFileSystem.h')
-rw-r--r-- | include/clang/Basic/VirtualFileSystem.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/clang/Basic/VirtualFileSystem.h b/include/clang/Basic/VirtualFileSystem.h index bc09e67878..6ac0812dbb 100644 --- a/include/clang/Basic/VirtualFileSystem.h +++ b/include/clang/Basic/VirtualFileSystem.h @@ -91,6 +91,13 @@ public: virtual ~File(); /// \brief Get the status of the file. virtual llvm::ErrorOr<Status> status() = 0; + /// \brief Get the name of the file + virtual llvm::ErrorOr<std::string> getName() { + if (auto Status = status()) + return Status->getName().str(); + else + return Status.getError(); + } /// \brief Get the contents of the file as a \p MemoryBuffer. virtual llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> getBuffer(const Twine &Name, int64_t FileSize = -1, |