aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Support/VirtualFileSystemTest.cpp
diff options
context:
space:
mode:
authorAbhina Sree <Abhina.Sreeskantharajan@ibm.com>2024-09-19 14:30:10 -0400
committerGitHub <noreply@github.com>2024-09-19 14:30:10 -0400
commitedf3b277a5f2ebe144827ed47463c22743cac5f9 (patch)
tree99185acc509e869ab34528456e026b06f6594f6b /llvm/unittests/Support/VirtualFileSystemTest.cpp
parentf3f3883f4b9d15770a5ce49956ed4425c71ad69f (diff)
downloadllvm-edf3b277a5f2ebe144827ed47463c22743cac5f9.zip
llvm-edf3b277a5f2ebe144827ed47463c22743cac5f9.tar.gz
llvm-edf3b277a5f2ebe144827ed47463c22743cac5f9.tar.bz2
[SystemZ][z/OS] Propagate IsText parameter to open text files as text (#107906)
This patch adds an IsText parameter to the following functions openFileForRead, getBufferForFile, getBufferForFileImpl and determines whether a file is text by querying the file tag on z/OS. The default is set to OF_Text instead of OF_None, this change in value does not affect any other platforms other than z/OS.
Diffstat (limited to 'llvm/unittests/Support/VirtualFileSystemTest.cpp')
-rw-r--r--llvm/unittests/Support/VirtualFileSystemTest.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/unittests/Support/VirtualFileSystemTest.cpp b/llvm/unittests/Support/VirtualFileSystemTest.cpp
index eb590e4..219aaef 100644
--- a/llvm/unittests/Support/VirtualFileSystemTest.cpp
+++ b/llvm/unittests/Support/VirtualFileSystemTest.cpp
@@ -67,7 +67,7 @@ public:
return I->second;
}
ErrorOr<std::unique_ptr<vfs::File>>
- openFileForRead(const Twine &Path) override {
+ openFileForRead(const Twine &Path, bool IsText = true) override {
auto S = status(Path);
if (S)
return std::unique_ptr<vfs::File>(new DummyFile{*S});
@@ -3389,9 +3389,9 @@ TEST(RedirectingFileSystemTest, ExternalPaths) {
}
llvm::ErrorOr<std::unique_ptr<llvm::vfs::File>>
- openFileForRead(const Twine &Path) override {
+ openFileForRead(const Twine &Path, bool IsText = true) override {
SeenPaths.push_back(Path.str());
- return ProxyFileSystem::openFileForRead(Path);
+ return ProxyFileSystem::openFileForRead(Path, IsText);
}
std::error_code isLocal(const Twine &Path, bool &Result) override {