aboutsummaryrefslogtreecommitdiff
path: root/flang-rt/lib/runtime/edit-input.cpp
AgeCommit message (Collapse)AuthorFilesLines
4 days[flang] Support fixed-width input field truncation for LOGICAL (#151203)Peter Klausler1-20/+14
As a common extension, we support the truncation of fixed-width fields for non-list-directed input editing when a separator character (',' or ';' depending on DECIMAL='POINT' or 'COMMA' resp.) appears in the field. This isn't working for L input editing; fix. (The bug reports a failure with DC mode, but it doesn't work with a comma either.) Fixes https://github.com/llvm/llvm-project/issues/151178.
9 days[flang][runtime] Handle ';' in fixed-width input field (#150512)Peter Klausler1-3/+3
Formatted input of real values can handle a ',' field separator when one appears in an fixed-width input field, but can't cope with a semicolon under DECIMAL='COMMA'. Fix. Fixes https://github.com/llvm/llvm-project/issues/150047.
9 days[flang][runtime] Refine state associated with child I/O (#150461)Peter Klausler1-9/+6
Child I/O state needs to carry a pointer to the original non-type-bound defined I/O subroutine table, so that nested defined I/O can call those defined I/O subroutines. It also needs to maintain a mutableModes instance for the whole invocation of defined I/O, instead of having a mutableModes local to list-directed child I/O, so that a top-level data transfer statement with (say) DECIMAL='COMMA' propagates that setting down to nested child I/O data transfers. Fixes https://github.com/llvm/llvm-project/issues/149885.
9 days[flang][runtime] Fix formatted input of NAN(...) (#149606)Peter Klausler1-14/+30
Formatted real input is allowed to have parenthesized information after "NAN". We don't interpret the contents, but we should at least scan the information correctly. Fixes https://github.com/llvm/llvm-project/issues/149533 and https://github.com/llvm/llvm-project/issues/150035.
2025-07-18[flang][runtime] Handle spaces before ')' in alternative list-directe… ↵Peter Klausler1-31/+10
(#149384) …d complex input List-directed reads of complex values that can't go through the usual fast path (as in this bug's test case, which uses DECIMAL='COMMA') didn't skip spaces before the closing right parenthesis correctly. Fixes https://github.com/llvm/llvm-project/issues/149164.
2025-05-15[flang-rt] Fix warningsKazu Hirata1-4/+4
This patch fixes: flang-rt/include/flang-rt/runtime/emit-encoded.h:67:27: error: implicit conversion from 'const char16_t' to 'char32_t' may change the meaning of the represented code unit [-Werror,-Wcharacter-conversion] flang-rt/lib/runtime/edit-input.cpp:1114:18: error: implicit conversion from 'char32_t' to 'char16_t' may lose precision and change the meaning of the represented code unit [-Werror,-Wcharacter-conversion] flang-rt/lib/runtime/edit-input.cpp:1133:18: error: implicit conversion from 'char32_t' to 'char16_t' may lose precision and change the meaning of the represented code unit [-Werror,-Wcharacter-conversion] flang-rt/lib/runtime/edit-input.cpp:1033:14: error: implicit conversion from 'char32_t' to 'char16_t' may lose precision and change the meaning of the represented code unit [-Werror,-Wcharacter-conversion] flang-rt/lib/runtime/edit-input.cpp:986:14: error: implicit conversion from 'char32_t' to 'char16_t' may lose precision and change the meaning of the represented code unit [-Werror,-Wcharacter-conversion]
2025-04-18[flang][runtime] Better handling for integer input into null address (#135987)Peter Klausler1-8/+11
The original descriptor-only path for I/O checks for null data addresses and crashes with a readable message, but there's no such check on the new fast path for formatted integer input, and so a READ into (say) a deallocated allocatable will crash with a segfault. Put a null data address check on the new fast path.
2025-04-11[flang][runtime] Fix recently broken big-endian formatted integer input ↵Peter Klausler1-2/+2
(#135417) My recent change to speed up formatted integer input has a bug on big-endian targets that has shown up on ppc64 AIX build bots. Fix.
2025-04-10[flang][runtime] Formatted input optimizations (#134715)Peter Klausler1-13/+26
Make some minor tweaks (inlining, caching) to the formatting input path to improve integer input in a SPEC code. (None of the I/O library has been tuned yet for performance, and there are some easy optimizations for common cases.) Input integer values are now calculated with native C/C++ 128-bit integers. A benchmark that only reads about 5M lines of three integer values each speeds up from over 8 seconds to under 3 in my environment with these changeds. If this works out, the code here can be used to optimize the formatted input paths for real and character data, too. Fixes https://github.com/llvm/llvm-project/issues/134026.
2025-02-16[Flang][NFC] Move runtime library files to flang-rt (#110298)Michael Kruse1-0/+1179
Mostly mechanical changes in preparation of extracting the Flang-RT "subproject" in #110217. This PR intends to only move pre-existing files to the new folder structure, with no behavioral change. Common files (headers, testing, cmake) shared by Flang-RT and Flang remain in `flang/`. Some cosmetic changes and files paths were necessary: * Relative paths to the new path for the source files and `add_subdirectory`. * Add the new location's include directory to `include_directories` * The unittest/Evaluate directory has unitests for flang-rt and Flang. A new `CMakeLists.txt` was introduced for the flang-rt tests. * Change the `#include` paths relative to the include directive * clang-format on the `#include` directives * Since the paths are part if the copyright header and include guards, a script was used to canonicalize those * `test/Runtime` and runtime tests in `test/Driver` are moved, but the lit.cfg.py mechanism to execute the will only be added in #110217.