[flang][runtime] Support B/O/Z editing of CHARACTER
authorPeter Klausler <pklausler@nvidia.com>
Wed, 27 Apr 2022 19:45:07 +0000 (12:45 -0700)
committerPeter Klausler <pklausler@nvidia.com>
Thu, 28 Apr 2022 19:44:31 +0000 (12:44 -0700)
commit53f775bbc0b8fbca941b5f7ad324b18884eddd7e
treedbaefb499dcd330124a5253ff416b933d3389059
parent75881d8b023ef8576afbba510c07eb8b899f2ec7
[flang][runtime] Support B/O/Z editing of CHARACTER

This is a common extension, though semantics differ across
compilers.  I've chosen to interpret the CHARACTER data
as if it were an arbitrary-precision integer value and
format or read it as such.  This matches Intel's compilers
and nvfortran.  (GNU Fortran can't handle lengths > 1 and XLF
seems to get the enddianness wrong.)

This patch generalizes the previous implementations of
B/O/Z input and output so that they'll work for arbitrary data
in memory, and then uses them for all B/O/Z input/output,
including (now) CHARACTER.

Differential Revision: https://reviews.llvm.org/D124547
flang/runtime/edit-input.cpp
flang/runtime/edit-output.cpp