This is an archive of the discontinued LLVM Phabricator instance.

[flang] Semantic analysis for FINAL subroutines
ClosedPublic

Authored by klausler on Sep 30 2020, 1:27 PM.

Details

Summary

Represent FINAL subroutines in the symbol table entries of
derived types. Enforce constraints. Update tests that have
inadvertent violations or modified messages. Added a test.

The specific procedure distinguishability checking code for generics
was used to enforce distinguishability of FINAL procedures.
(Also cleaned up some confusion and redundancy noticed in the
type compatibility infrastructure while digging into that area.)

Diff Detail

Event Timeline

klausler created this revision.Sep 30 2020, 1:27 PM
Herald added a project: Restricted Project. · View Herald Transcript
klausler requested review of this revision.Sep 30 2020, 1:27 PM
tskeith added inline comments.Sep 30 2020, 1:50 PM
flang/lib/Semantics/check-declarations.cpp
849

With clang 9 I get this error:

error: reference to local binding 'ref' declared in enclosing function 'Fortran::semantics::CheckHelper::CheckDerivedType'

And same for source.

klausler added inline comments.Sep 30 2020, 1:57 PM
flang/lib/Semantics/check-declarations.cpp
849

Thanks, I'll work around that and push an update shortly.

klausler updated this revision to Diff 295417.Sep 30 2020, 2:54 PM

Worked around clang error noticed by code reviewer, & added
a "const" suggested by the clang-tidy bot.

Herald added a reviewer: aartbik. · View Herald Transcript
Herald added projects: Restricted Project, Restricted Project, Restricted Project, Restricted Project, Restricted Project. · View Herald Transcript
Herald added a reviewer: Restricted Project. · View Herald Transcript
Herald added subscribers: libcxx-commits, lldb-commits, Restricted Project and 28 others. · View Herald Transcript
klausler updated this revision to Diff 295423.Sep 30 2020, 3:09 PM

Previous update to this review had inadvertent changes to other files because I neglected to rebase after updating master; now fixed. Sorry for the scare!

klausler removed reviewers: nicolasvasilache, aartbik, JDevlieghere, Restricted Project.Sep 30 2020, 3:11 PM
klausler removed projects: Restricted Project, Restricted Project, Restricted Project, Restricted Project, Restricted Project, Restricted Project.
klausler removed subscribers: mgorny, sbc100, fedor.sergeev and 29 others.
Herald added a project: Restricted Project. · View Herald TranscriptSep 30 2020, 3:11 PM
tskeith accepted this revision.Sep 30 2020, 3:35 PM
This revision is now accepted and ready to land.Sep 30 2020, 3:35 PM
This revision was automatically updated to reflect the committed changes.