This is an archive of the discontinued LLVM Phabricator instance.

[flang] Process subprogram BIND(C,NAME=...) locally
ClosedPublic

Authored by klausler on May 21 2022, 10:18 PM.

Details

Summary

The scalar-default-character-expression that defines the interoperable
name of a function or subroutine (or interface) must have its names
resolved within the context of the subprogram, despite its appearance
on a function-stmt or a subroutine-stmt. Failure to do so can lead
to bogus errors or to incorrect results.

The solution is to defer name resolution for function-stmt suffixes
(but not entry-stmt suffixes) and for subroutine-stmt language binding
specifications to EndSubprogram(). (Their resolution only need to be
deferred to the end of the specification part, but it's cleanest to
deal with it in EndSubprogram().)

Diff Detail

Event Timeline

klausler created this revision.May 21 2022, 10:18 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 21 2022, 10:18 PM
Herald added a subscriber: jdoerfert. · View Herald Transcript
klausler requested review of this revision.May 21 2022, 10:18 PM
klausler updated this revision to Diff 431273.May 22 2022, 4:47 PM

Tweak code to work in the absence of an earlier change on which this one used to depend.

vdonaldson accepted this revision.May 23 2022, 10:55 AM
This revision is now accepted and ready to land.May 23 2022, 10:55 AM
This revision was automatically updated to reflect the committed changes.