[flang-commits] [PATCH] D125057: [flang][runtime] BACKSPACE after non-advancing I/O
Peter Klausler via Phabricator via flang-commits
flang-commits at lists.llvm.org
Mon May 9 13:07:55 PDT 2022
This revision was automatically updated to reflect the committed changes.
Closed by commit rG72831a592edf: [flang][runtime] BACKSPACE after non-advancing I/O (authored by klausler).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D125057/new/
https://reviews.llvm.org/D125057
Files:
flang/runtime/io-stmt.cpp
flang/runtime/unit.cpp
Index: flang/runtime/unit.cpp
===================================================================
--- flang/runtime/unit.cpp
+++ flang/runtime/unit.cpp
@@ -569,6 +569,9 @@
if (IsAfterEndfile()) {
// BACKSPACE after explicit ENDFILE
currentRecordNumber = *endfileRecordNumber;
+ } else if (leftTabLimit) {
+ // BACKSPACE after non-advancing I/O
+ leftTabLimit.reset();
} else {
DoImpliedEndfile(handler);
if (frameOffsetInFile_ + recordOffsetInFrame_ > 0) {
Index: flang/runtime/io-stmt.cpp
===================================================================
--- flang/runtime/io-stmt.cpp
+++ flang/runtime/io-stmt.cpp
@@ -315,6 +315,9 @@
}
if constexpr (DIR == Direction::Input) {
BeginReadingRecord(); // in case there were no I/O items
+ if (mutableModes().nonAdvancing) {
+ unit().leftTabLimit = unit().furthestPositionInRecord;
+ }
if (!mutableModes().nonAdvancing || GetIoStat() == IostatEor) {
FinishReadingRecord();
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D125057.428183.patch
Type: text/x-patch
Size: 1015 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20220509/53ac1c32/attachment.bin>
More information about the flang-commits
mailing list