This is an archive of the discontinued LLVM Phabricator instance.

[flang] Don't prematurely resolve subprogram names
ClosedPublic

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

Details

Summary

Name resolution for subprograms checks whether the name is already
present in the enclosing scope as a generic interface, so that the
case of a generic with the same name as one of its specifics can be
handled. The particular means by which the enclosing scope is searched
for the name would resolve the name (bind a symbol to it) as a side
effect. This turns out to be the wrong thing to do when the subprogram
is going to have its symbol created in another scope to cope with its
BIND(C,NAME="name") name, and its Fortran name is already present in the
enclosing scope for a subprogram of the same name but without
BIND(C,NAME="name").

A very long explanation for a one-line fix, sorry. In short, change
the code to look up the name but not resolve it at that point.

Diff Detail

Event Timeline

klausler created this revision.May 21 2022, 10:15 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 21 2022, 10:15 PM
Herald added a subscriber: jdoerfert. · View Herald Transcript
klausler requested review of this revision.May 21 2022, 10:15 PM
vdonaldson accepted this revision.May 23 2022, 10:29 AM
This revision is now accepted and ready to land.May 23 2022, 10:29 AM
This revision was automatically updated to reflect the committed changes.