diff options
author | Abhina Sreeskantharajan <Abhina.Sreeskantharajan@ibm.com> | 2024-09-20 08:18:16 -0400 |
---|---|---|
committer | Abhina Sreeskantharajan <Abhina.Sreeskantharajan@ibm.com> | 2024-09-20 08:18:16 -0400 |
commit | efdb3ae23247850d3886e3708400f0d991ed59e1 (patch) | |
tree | e336b83aad0f1032b0fd092b07a2dc601fcc5a11 /llvm/lib/Support/VirtualFileSystem.cpp | |
parent | d6f91200fe95dbf30a091af3ba039a817e7ddf14 (diff) | |
download | llvm-efdb3ae23247850d3886e3708400f0d991ed59e1.zip llvm-efdb3ae23247850d3886e3708400f0d991ed59e1.tar.gz llvm-efdb3ae23247850d3886e3708400f0d991ed59e1.tar.bz2 |
Revert "[SystemZ][z/OS] Propagate IsText parameter to open text files as text (#107906)"
This reverts commit edf3b277a5f2ebe144827ed47463c22743cac5f9.
Diffstat (limited to 'llvm/lib/Support/VirtualFileSystem.cpp')
-rw-r--r-- | llvm/lib/Support/VirtualFileSystem.cpp | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/llvm/lib/Support/VirtualFileSystem.cpp b/llvm/lib/Support/VirtualFileSystem.cpp index ceca65b..928c0b5 100644 --- a/llvm/lib/Support/VirtualFileSystem.cpp +++ b/llvm/lib/Support/VirtualFileSystem.cpp @@ -117,9 +117,8 @@ FileSystem::~FileSystem() = default; ErrorOr<std::unique_ptr<MemoryBuffer>> FileSystem::getBufferForFile(const llvm::Twine &Name, int64_t FileSize, - bool RequiresNullTerminator, bool IsVolatile, - bool IsText) { - auto F = openFileForRead(Name, IsText); + bool RequiresNullTerminator, bool IsVolatile) { + auto F = openFileForRead(Name); if (!F) return F.getError(); @@ -279,8 +278,7 @@ public: } ErrorOr<Status> status(const Twine &Path) override; - ErrorOr<std::unique_ptr<File>> openFileForRead(const Twine &Path, - bool IsText = true) override; + ErrorOr<std::unique_ptr<File>> openFileForRead(const Twine &Path) override; directory_iterator dir_begin(const Twine &Dir, std::error_code &EC) override; llvm::ErrorOr<std::string> getCurrentWorkingDirectory() const override; @@ -325,11 +323,10 @@ ErrorOr<Status> RealFileSystem::status(const Twine &Path) { } ErrorOr<std::unique_ptr<File>> -RealFileSystem::openFileForRead(const Twine &Name, bool IsText) { +RealFileSystem::openFileForRead(const Twine &Name) { SmallString<256> RealName, Storage; Expected<file_t> FDOrErr = sys::fs::openNativeFileForRead( - adjustPath(Name, Storage), IsText ? sys::fs::OF_Text : sys::fs::OF_None, - &RealName); + adjustPath(Name, Storage), sys::fs::OF_None, &RealName); if (!FDOrErr) return errorToErrorCode(FDOrErr.takeError()); return std::unique_ptr<File>( @@ -461,10 +458,10 @@ bool OverlayFileSystem::exists(const Twine &Path) { } ErrorOr<std::unique_ptr<File>> -OverlayFileSystem::openFileForRead(const llvm::Twine &Path, bool IsText) { +OverlayFileSystem::openFileForRead(const llvm::Twine &Path) { // FIXME: handle symlinks that cross file systems for (iterator I = overlays_begin(), E = overlays_end(); I != E; ++I) { - auto Result = (*I)->openFileForRead(Path, IsText); + auto Result = (*I)->openFileForRead(Path); if (Result || Result.getError() != llvm::errc::no_such_file_or_directory) return Result; } @@ -1076,7 +1073,7 @@ llvm::ErrorOr<Status> InMemoryFileSystem::status(const Twine &Path) { } llvm::ErrorOr<std::unique_ptr<File>> -InMemoryFileSystem::openFileForRead(const Twine &Path, bool IsText) { +InMemoryFileSystem::openFileForRead(const Twine &Path) { auto Node = lookupNode(Path,/*FollowFinalSymlink=*/true); if (!Node) return Node.getError(); @@ -2540,7 +2537,7 @@ File::getWithPath(ErrorOr<std::unique_ptr<File>> Result, const Twine &P) { } ErrorOr<std::unique_ptr<File>> -RedirectingFileSystem::openFileForRead(const Twine &OriginalPath, bool IsText) { +RedirectingFileSystem::openFileForRead(const Twine &OriginalPath) { SmallString<256> Path; OriginalPath.toVector(Path); |