The previous code had handling for cases when too many file descriptors may be opened; this is not necessary with MemoryBuffer as the file descriptors are closed after the mapping occurs. MemoryBuffer also internally handles the case where a file is small and therefore an mmap is bad for performance; such files are simply copied to memory after being opened. Many places elsewhere in the code assume that the buffer is not empty, and the old file opening code handles this by replacing an empty file with a buffer containing a single newline. That behavior is now kept in the new MemoryBuffer based code. Original-commit: flang-compiler/f18@d34df84351 Reviewed-on: https://github.com/flang-compiler/f18/pull/1032
5 lines
121 B
Fortran
5 lines
121 B
Fortran
! RUN: %f18 -fparse-only %s
|
|
! RUN: rm -rf %t && mkdir %t
|
|
! RUN: touch %t/empty.f90
|
|
! RUN: %f18 -fparse-only %t/empty.f90
|