[flang-commits] [PATCH] D96878: [flang] Ensure that intrinsic procedures are PURE &/or ELEMENTAL

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Wed Feb 17 10:14:13 PST 2021


klausler created this revision.
klausler added a reviewer: PeteSteinfeld.
klausler added a project: Flang.
Herald added a subscriber: jdoerfert.
klausler requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D96878

Files:
  flang/lib/Semantics/resolve-names.cpp
  flang/test/Semantics/call11.f90
  flang/test/Semantics/doconcurrent01.f90
  flang/test/Semantics/omp-symbol08.f90
  flang/test/Semantics/procinterface01.f90
  flang/test/Semantics/symbol13.f90
  flang/test/Semantics/symbol14.f90
  flang/test/Semantics/symbol15.f90
  flang/test/Semantics/symbol17.f90
  flang/test/Semantics/symbol18.f90
  flang/test/Semantics/symbol19.f90

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D96878.324348.patch
Type: text/x-patch
Size: 11902 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20210217/a5ffd7c5/attachment-0001.bin>


More information about the flang-commits mailing list