This is an archive of the discontinued LLVM Phabricator instance.

[flang] Single entry point for GET_COMMAND_ARGUMENT
ClosedPublic

Authored by rovka on Jul 25 2022, 4:43 AM.

Details

Summary

This patch refactors the runtime support for GET_COMMAND_ARGUMENT to
have a single entry point instead of 2. It also updates lowering
accordingly.

This makes it easier to handle dynamically optional arguments. See also
https://reviews.llvm.org/D118777

Diff Detail

Event Timeline

rovka created this revision.Jul 25 2022, 4:43 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 25 2022, 4:43 AM
rovka requested review of this revision.Jul 25 2022, 4:43 AM
jeanPerier accepted this revision.Jul 26 2022, 5:29 AM

Thanks a lot for following up on this. Beware that there is a test failure introduced in Runtime/no-cpp-dep.c (I think you need to remove the references to the removed runtime APIs there).
Otherwise LGTM.

flang/lib/Lower/IntrinsicCall.cpp
772–773

STATUS is also optional, I think it also needs to have handleDynamicOptional so that the OPTIONAL POINTER/OPTIONAL ALLOCATABLE edge case are handled correctly (I think the current code might unconditionally dereference the descriptor in these case).

This revision is now accepted and ready to land.Jul 26 2022, 5:29 AM
rovka updated this revision to Diff 447958.Jul 27 2022, 2:09 AM

Thanks for reviewing! I updated the patch. I'm not sure why the no-cpp-dep test was marked as unsupported for me locally, nuking the whole build directory seems to have fixed it though. Sorry about the noise there.

rovka updated this revision to Diff 447976.Jul 27 2022, 3:09 AM
This revision was automatically updated to reflect the committed changes.