diff options
author | Sam McCall <sam.mccall@gmail.com> | 2018-07-24 16:00:55 +0000 |
---|---|---|
committer | Sam McCall <sam.mccall@gmail.com> | 2018-07-24 16:00:55 +0000 |
commit | 33b78c5d24ecafeff93d9345e7dc21c9005985d6 (patch) | |
tree | 8c4b1967bbba7d092d09073a25413e97839b5521 /clang/lib/Basic/FileManager.cpp | |
parent | f8f2a788f06ea811503dbf035b0de182e2700b04 (diff) | |
download | bcm5719-llvm-33b78c5d24ecafeff93d9345e7dc21c9005985d6.tar.gz bcm5719-llvm-33b78c5d24ecafeff93d9345e7dc21c9005985d6.zip |
[VFS] Cleanups to VFS interfaces.
Summary:
- add comments clarifying semantics
- Status::copyWithNewName(Status, Name) --> instance method
- Status::copyWithNewName(fs::file_status, Name) --> constructor (it's not a copy)
- File::getName() -> getRealPath(), reflecting its actual behavior/function
and stop returning status().getName() in the base class (callers can do this
fallback if they want to, it complicates the contracts).
This is mostly NFC, but the behavior of File::getName() affects FileManager's
FileEntry::tryGetRealPathName(), which now fails in more cases:
- non-real file cases
- real-file cases where the underlying vfs::File was opened in a way that
doesn't call realpath().
(In these cases we don't know a distinct real name, so in principle it seems OK)
Reviewers: klimek
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D49724
llvm-svn: 337834
Diffstat (limited to 'clang/lib/Basic/FileManager.cpp')
-rw-r--r-- | clang/lib/Basic/FileManager.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Basic/FileManager.cpp b/clang/lib/Basic/FileManager.cpp index 7e2d01c4981..13a3d8f95ce 100644 --- a/clang/lib/Basic/FileManager.cpp +++ b/clang/lib/Basic/FileManager.cpp @@ -316,7 +316,7 @@ const FileEntry *FileManager::getFile(StringRef Filename, bool openFile, UFE.File = std::move(F); UFE.IsValid = true; if (UFE.File) - if (auto RealPathName = UFE.File->getName()) + if (auto RealPathName = UFE.File->getRealPath()) UFE.RealPathName = *RealPathName; return &UFE; } |