Page MenuHomePhabricator

[flang] [openmp] Add Fortran specific semantic checks for OpenMP Allocate directive.

Authored by I_Perry on May 7 2021, 3:59 AM.



This patch adds Fortran specific semantic checks for the OpenMP allocate

Due to an issue in the parser (described in
the checks: "List items specified in an allocate directive that is
associated with an allocate statement must be variables that are allocated
by the allocate statement" and "Multiple directives can only be associated
with an allocate statement if list items are specified on each allocate directive"
cannot be implemented yet.

I have used code written as part of
as a basis for the implementations of these checks.

Diff Detail

Event Timeline

I_Perry created this revision.May 7 2021, 3:59 AM
I_Perry requested review of this revision.May 7 2021, 3:59 AM
Herald added a project: Restricted Project. · View Herald Transcript
kiranchandramohan requested changes to this revision.May 13 2021, 7:49 AM

A few comments.


Nit: Use braced initialization.


Can you make the type parameter inquiry check the first check and the other one the second and remove (!IsDataRefTypeParamInquiry(dataRef)) from the current first check?


Nit: Is this clang-formatted?


The line 15 omp allocate should come before line 11. The line 12 allocate is an executable statement, which makes the line 15 openmp allocate directive an executable allocate.


Can you add a test which has allocate directive having an array's kind?

This revision now requires changes to proceed.May 13 2021, 7:49 AM
I_Perry updated this revision to Diff 346144.Tue, May 18, 5:07 AM

Addressed comments.

I_Perry added inline comments.Tue, May 18, 5:36 AM

I've just edited then formatted this code with clang-format and this is the result. Could there possibly be a clang-format version issue if this shouldn't be the case?

This revision is now accepted and ready to land.Mon, May 24, 9:39 AM
I_Perry marked 5 inline comments as done.Tue, May 25, 5:13 AM
This revision was landed with ongoing or failed builds.Thu, May 27, 7:51 AM
This revision was automatically updated to reflect the committed changes.