[flang-commits] [flang] 6527749 - [flang][runtime] Allow record advancement in child I/O via '/' control edit descriptor
Peter Klausler via flang-commits
flang-commits at lists.llvm.org
Thu Feb 16 16:41:27 PST 2023
Author: Peter Klausler
Date: 2023-02-16T16:41:15-08:00
New Revision: 65277494f04da7c4fd5903138d057c0faac7ba9a
URL: https://github.com/llvm/llvm-project/commit/65277494f04da7c4fd5903138d057c0faac7ba9a
DIFF: https://github.com/llvm/llvm-project/commit/65277494f04da7c4fd5903138d057c0faac7ba9a.diff
LOG: [flang][runtime] Allow record advancement in child I/O via '/' control edit descriptor
My earlier misreading of the Fortran standards had convinced me that child I/O
-- meaning the use of user-defined subroutines via generic interfaces to implement
data transfer statements -- was not allowed to advance the current record in the
ultimate unit of the original (non-child parent) data transfer statement.
This turns out to be wrong, so forward AdvanceRecord() from ChildFormattedIoStatement<>
to its parent I/O statement rather than implementing it as a no-op.
Differential Revision: https://reviews.llvm.org/D144205
Added:
Modified:
flang/runtime/io-stmt.cpp
Removed:
################################################################################
diff --git a/flang/runtime/io-stmt.cpp b/flang/runtime/io-stmt.cpp
index c7e349a46768f..8e75ca5f68824 100644
--- a/flang/runtime/io-stmt.cpp
+++ b/flang/runtime/io-stmt.cpp
@@ -879,8 +879,8 @@ int ChildFormattedIoStatementState<DIR, CHAR>::EndIoStatement() {
}
template <Direction DIR, typename CHAR>
-bool ChildFormattedIoStatementState<DIR, CHAR>::AdvanceRecord(int) {
- return false; // no can do in a child I/O
+bool ChildFormattedIoStatementState<DIR, CHAR>::AdvanceRecord(int n) {
+ return this->child().parent().AdvanceRecord(n);
}
template <Direction DIR>
More information about the flang-commits
mailing list