This is an archive of the discontinued LLVM Phabricator instance.

[flang] Ensure that intrinsic procedures are PURE &/or ELEMENTAL
ClosedPublic

Authored by klausler on Feb 17 2021, 10:14 AM.

Details

Summary

The intrinsic procedure table properly classify the various
intrinsics, but the PURE and ELEMENTAL attributes that these
classifications imply don't always make it to the utility
predicates that test symbols for them, leading to spurious
error messages in some contexts. So set those attribute flags
as appropriate in name resolution, using a new function to
isolate the tests.

An alternate solution, in which the predicates would query
the intrinsic procedure table for these attributes on demand,
was something I also tried, so that this information could
come directly from an authoritative source; but it would have
required references to the intrinsic table to be passed along
on too many seemingly unrelated APIs and ended up looking messy.

Several symbol table tests needed to have their expected outputs
augmented with the PURE and ELEMENTAL flags. Some bogus messages
that were flagged as such in test/Semantics/doconcurrent01.f90 were
removed, since they are now correctly not emitted.

Diff Detail

Event Timeline

klausler created this revision.Feb 17 2021, 10:14 AM
klausler requested review of this revision.Feb 17 2021, 10:14 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 17 2021, 10:14 AM
PeteSteinfeld accepted this revision.Feb 17 2021, 10:39 AM

All builds, tests, and looks good.

This revision is now accepted and ready to land.Feb 17 2021, 10:39 AM