diff options
author | Taewook Oh <twoh@fb.com> | 2016-06-04 03:14:43 +0000 |
---|---|---|
committer | Taewook Oh <twoh@fb.com> | 2016-06-04 03:14:43 +0000 |
commit | 1c1101bb331c5b242bdf31a57bcb9dfd80e30e9b (patch) | |
tree | f5344e2d75ce88e48d0b5aef4ef5ed54b04f77f2 /clang/lib/Basic/VirtualFileSystem.cpp | |
parent | 0c30f89ccad259978f89950ba9fe4151f952ace6 (diff) | |
download | bcm5719-llvm-1c1101bb331c5b242bdf31a57bcb9dfd80e30e9b.tar.gz bcm5719-llvm-1c1101bb331c5b242bdf31a57bcb9dfd80e30e9b.zip |
Revert commit r271708
llvm-svn: 271761
Diffstat (limited to 'clang/lib/Basic/VirtualFileSystem.cpp')
-rw-r--r-- | clang/lib/Basic/VirtualFileSystem.cpp | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/clang/lib/Basic/VirtualFileSystem.cpp b/clang/lib/Basic/VirtualFileSystem.cpp index 120d7e0d9e0..d64c4e3d8c0 100644 --- a/clang/lib/Basic/VirtualFileSystem.cpp +++ b/clang/lib/Basic/VirtualFileSystem.cpp @@ -140,19 +140,16 @@ namespace { class RealFile : public File { int FD; Status S; - std::string RealName; friend class RealFileSystem; - RealFile(int FD, StringRef NewName, StringRef NewRealPathName) + RealFile(int FD, StringRef NewName) : FD(FD), S(NewName, {}, {}, {}, {}, {}, - llvm::sys::fs::file_type::status_error, {}), - RealName(NewRealPathName.str()) { + llvm::sys::fs::file_type::status_error, {}) { assert(FD >= 0 && "Invalid or inactive file descriptor"); } public: ~RealFile() override; ErrorOr<Status> status() override; - ErrorOr<StringRef> getName() override; ErrorOr<std::unique_ptr<MemoryBuffer>> getBuffer(const Twine &Name, int64_t FileSize, bool RequiresNullTerminator, @@ -173,10 +170,6 @@ ErrorOr<Status> RealFile::status() { return S; } -ErrorOr<StringRef> RealFile::getName() { - return RealName.empty() ? S.getName() : StringRef(RealName); -} - ErrorOr<std::unique_ptr<MemoryBuffer>> RealFile::getBuffer(const Twine &Name, int64_t FileSize, bool RequiresNullTerminator, bool IsVolatile) { @@ -214,10 +207,9 @@ ErrorOr<Status> RealFileSystem::status(const Twine &Path) { ErrorOr<std::unique_ptr<File>> RealFileSystem::openFileForRead(const Twine &Name) { int FD; - SmallString<256> RealName; - if (std::error_code EC = sys::fs::openFileForRead(Name, FD, &RealName)) + if (std::error_code EC = sys::fs::openFileForRead(Name, FD)) return EC; - return std::unique_ptr<File>(new RealFile(FD, Name.str(), RealName.str())); + return std::unique_ptr<File>(new RealFile(FD, Name.str())); } llvm::ErrorOr<std::string> RealFileSystem::getCurrentWorkingDirectory() const { |