This is an archive of the discontinued LLVM Phabricator instance.

[flang] Return arrays in Transfer runtime with SIZE argument
ClosedPublic

Authored by jeanPerier on Dec 2 2021, 4:23 AM.

Details

Summary

In TRANSFER runtime the result was an array only if the MOLD was an array.
This is not in line with TRANSFER definition in 16.9.193 that rules that it
must also be an array if MOLD is scalar and SIZE if provided.

Diff Detail

Event Timeline

jeanPerier created this revision.Dec 2 2021, 4:23 AM
jeanPerier requested review of this revision.Dec 2 2021, 4:23 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 2 2021, 4:23 AM
klausler accepted this revision.Dec 2 2021, 9:15 AM
klausler added inline comments.
flang/runtime/misc-intrinsic.cpp
16–17

The "extern "C"" can be after the (now) static first function.

24–25

I know this is safe, but future code readers might be misled by the (apparently) unprotected reference to the value of resultExtent here. Can you change the if() predicate to "if (resultExtent)"?

This revision is now accepted and ready to land.Dec 2 2021, 9:15 AM

Move static function outisde of extern "C" and use "if (resultExtent)".

jeanPerier marked 2 inline comments as done.Dec 2 2021, 10:31 AM
jeanPerier added inline comments.
flang/runtime/misc-intrinsic.cpp
24–25

Fair point, I changed it.

This revision was automatically updated to reflect the committed changes.
jeanPerier marked an inline comment as done.