[clang] [llvm] [SystemZ][z/OS] Add new openFileForReadBinary function, and pass IsText parameter to getBufferForFile (PR #111723)

Sean Perry via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 9 10:43:20 PDT 2024


================
@@ -117,8 +117,12 @@ FileSystem::~FileSystem() = default;
 
 ErrorOr<std::unique_ptr<MemoryBuffer>>
 FileSystem::getBufferForFile(const llvm::Twine &Name, int64_t FileSize,
-                             bool RequiresNullTerminator, bool IsVolatile) {
-  auto F = openFileForRead(Name);
+                             bool RequiresNullTerminator, bool IsVolatile,
+                             bool IsText) {
+  auto openFileFunctionPointer = &FileSystem::openFileForRead;
+  if (!IsText)
+    openFileFunctionPointer = &FileSystem::openFileForReadBinary;
----------------
perry-ca wrote:

```suggestion
  auto F = IsText ?openFileForRead(Name) : openFileForReadBinary(Name);
```

https://github.com/llvm/llvm-project/pull/111723


More information about the cfe-commits mailing list