diff options
author | Taewook Oh <twoh@fb.com> | 2016-06-13 18:32:30 +0000 |
---|---|---|
committer | Taewook Oh <twoh@fb.com> | 2016-06-13 18:32:30 +0000 |
commit | cb07d65173a4271c08f80a159b02354fe6e8894b (patch) | |
tree | f82e045234832570f068a7519cddbe2ec1098a53 /clang/lib/Basic/VirtualFileSystem.cpp | |
parent | c1ffba5062c7fc8997a49f5656ff6ebc1d9de633 (diff) | |
download | bcm5719-llvm-cb07d65173a4271c08f80a159b02354fe6e8894b.tar.gz bcm5719-llvm-cb07d65173a4271c08f80a159b02354fe6e8894b.zip |
Revert r272562 for build bot failure (clang-x86-win2008-selfhost)
llvm-svn: 272572
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 8ace2b3dc83..2eb7a84521f 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<std::string> 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<std::string> RealFile::getName() { - return RealName.empty() ? S.getName().str() : 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 { |