================
@@ -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
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits