This is an archive of the discontinued LLVM Phabricator instance.

[flang][openmp] Allocators construct semantic checks
ClosedPublic

Authored by elmcdonough on May 12 2023, 12:28 AM.

Details

Summary

This patch applies the semantic checks for executable allocation directives to the new allocators construct. It also introduces a new check that ensures all items in the list appear in the corresponding Fortran allocate statement.

Diff Detail

Event Timeline

elmcdonough created this revision.May 12 2023, 12:28 AM
Herald added a project: Restricted Project. · View Herald Transcript
elmcdonough requested review of this revision.May 12 2023, 12:28 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 12 2023, 12:28 AM

Looks OK. Please add tests for all error messages that are added or updated.

flang/lib/Semantics/check-omp-structure.cpp
290

Please add a test for ALLOCATORS with this error message.

flang/lib/Semantics/resolve-directives.cpp
1586

Please add a test for this.

1766–1770

Please add a test for ALLOCATORS with this error message.

2035

Please add a test that exercises this path (Commonblocks?).

2055

Is this currently only called for the allocate in allocators?

elmcdonough marked 4 inline comments as done.

Added more tests and adjusted Allocate OMP clause to modify isPredefinedAllocator.

flang/lib/Semantics/resolve-directives.cpp
2035

Removed this because I can't think of a scenario where a common block name would appear in an allocation list.

2055

For now, but I was planning on adding it to D150483 to cover the List items specified in an allocate directive that is associated with an allocate statement must be variables that are allocated by the allocate statement semantic requirement.

kiranchandramohan accepted this revision.Aug 1 2023, 8:38 AM

LG.

flang/lib/Semantics/check-omp-structure.cpp
1120–1150

The RequiresPositiveParameter requires a test.

This revision is now accepted and ready to land.Aug 1 2023, 8:38 AM

Add test for RequiresPositiveParameter check.

This revision was landed with ongoing or failed builds.Aug 2 2023, 10:59 AM
This revision was automatically updated to reflect the committed changes.