This is an archive of the discontinued LLVM Phabricator instance.

[flang] Implicitly convert result of statement function
ClosedPublic

Authored by tskeith on Jul 23 2020, 11:17 AM.

Details

Summary

The result of a statement function may require an implicit conversion
to match its result type. Add that to the expression that represents
the statement function body in SubprogramDetails.

Extract the analysis of that expression into a separate function.

Dump the statement function expression as part of the dump of
SubprogramDetails.

Diff Detail

Event Timeline

tskeith created this revision.Jul 23 2020, 11:17 AM
Herald added a project: Restricted Project. · View Herald Transcript
klausler accepted this revision.Jul 23 2020, 11:51 AM
klausler added inline comments.
flang/lib/Semantics/resolve-names.cpp
6119

Singular/plural conflict here in comment ("the symbol" vs. "have").

6134

ConvertToType() should do the right thing (nothing) if the types already match, so maybe you can simplify that if predicate.

This revision is now accepted and ready to land.Jul 23 2020, 11:51 AM
PeteSteinfeld accepted this revision.Jul 23 2020, 12:24 PM

Is there a test for this?

tskeith updated this revision to Diff 280297.Jul 23 2020, 5:11 PM

Address review comments.

tskeith marked 2 inline comments as done.Jul 23 2020, 5:13 PM

Is there a test for this?

We don't currently have a way to test the expression that implements a statement function. Once they are lowered the generated code can be verified.

This revision was automatically updated to reflect the committed changes.