This is an archive of the discontinued LLVM Phabricator instance.

[flang] Better messages for function vs. array errors
ClosedPublic

Authored by klausler on Jan 18 2022, 9:41 AM.

Details

Summary

When a scalar-valued function with no distinct RESULT
is being called recursively in its own executable part,
emit a better message about the error. Clean up the
code that resolves function vs. array ambiguities in
expression semantics.

Diff Detail

Event Timeline

klausler created this revision.Jan 18 2022, 9:41 AM
klausler requested review of this revision.Jan 18 2022, 9:41 AM
PeteSteinfeld accepted this revision.Jan 18 2022, 10:46 AM

Aside from that one nit, all builds, tests, and looks good.

flang/lib/Semantics/expression.cpp
2815

This is the only use of "hasArgs". You could just put the code that defines it here.

This revision is now accepted and ready to land.Jan 18 2022, 10:46 AM
klausler updated this revision to Diff 400946.Jan 18 2022, 12:20 PM

Update to address review comment.

klausler marked an inline comment as done.Jan 18 2022, 12:21 PM

Please take another look at the updated patch at your convenience and confirm that your comment has been addressed to your satisfaction; thanks!

PeteSteinfeld accepted this revision.Jan 18 2022, 2:09 PM

Looks great! Thanks for the update.

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJan 18 2022, 3:42 PM