[Flang][OpenMP][Sema] Support propagation of REQUIRES information across program...
commitedc2fb0733a6cf384e041b69bbcbac18b7ff17c7
authorSergio Afonso <safonsof@amd.com>
Mon, 11 Sep 2023 12:39:22 +0000 (11 13:39 +0100)
committerSergio Afonso <safonsof@amd.com>
Mon, 11 Sep 2023 14:01:57 +0000 (11 15:01 +0100)
tree02f794a4f65971611faf5b0a549fe499ac6b0af7
parent26ca2f47c1373f20215994e844a30d1f6173268d
[Flang][OpenMP][Sema] Support propagation of REQUIRES information across program units

Re-land commit 3787fd942f3927345320cc97a479f13e44355805

This patch adds support for storing OpenMP REQUIRES information in the
semantics symbols for programs/subprograms and modules/submodules, and
populates them during directive resolution. A pass is added to name resolution
that makes sure this information is also propagated across top-level programs,
functions and subprograms.

Storing REQUIRES information inside of semantics symbols will also allow
supporting the propagation of this information across Fortran modules. This
will come as a separate patch.

The `bool DirectiveAttributeVisitor::Pre(const parser::SpecificationPart &x)`
method is removed since it resulted in specification parts being visited twice.

This is patch 3/5 of a series splitting D149337 to simplify review.

Differential Revision: https://reviews.llvm.org/D157983
flang/examples/FeatureList/FeatureList.cpp
flang/include/flang/Common/Fortran.h
flang/include/flang/Parser/dump-parse-tree.h
flang/include/flang/Parser/parse-tree.h
flang/include/flang/Semantics/symbol.h
flang/lib/Parser/openmp-parsers.cpp
flang/lib/Parser/unparse.cpp
flang/lib/Semantics/resolve-directives.cpp
flang/lib/Semantics/resolve-directives.h
flang/lib/Semantics/resolve-names.cpp
flang/test/Semantics/OpenMP/requires09.f90 [new file with mode: 0644]