This is an archive of the discontinued LLVM Phabricator instance.

[flang] Fix READ/WRITE with POS= on stream units, with refactoring
ClosedPublic

Authored by klausler on Jun 22 2022, 3:34 PM.

Details

Summary

First, ExternalFileUnit::SetPosition was being used both as a utility
within the class' member functions as well as an API from I/O statement
processing. Make it private, and add APIs for SetStreamPos and SetDirectRec.

Second, ensure that SetStreamPos for POS= positioning in a stream
doesn't leave the current record number and endfile record number
in an arbitrary state. In stream I/O they are used only to manage
end-of-file detection, and shouldn't produce false positive results
from IsAtEnd() after repositioning.

Diff Detail

Event Timeline

klausler created this revision.Jun 22 2022, 3:34 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 22 2022, 3:34 PM
Herald added a subscriber: jdoerfert. · View Herald Transcript
klausler requested review of this revision.Jun 22 2022, 3:34 PM
vdonaldson accepted this revision.Jun 22 2022, 4:24 PM
This revision is now accepted and ready to land.Jun 22 2022, 4:24 PM