OpenMP/Fortran: Support underscore variant of directive names
Fortran OpenMP directive names with underscores are now supported in `assume` clauses and as modifiers in `if` clauses.
This patch enhances the Fortran front-end to support underscore variants of multi-word OpenMP directive names, aligning with recent OpenMP specification updates. These underscored directive names, such as declare_mapper and target_data, are now recognized within the absent and contains clauses of assume statements. Additionally, directive name modifiers like target_... can now be correctly handled within the if clause. A new test case verifies this functionality.
In Details
Adds underscore variants for OpenMP directive names (e.g., declare_mapper, target_data) to gfc_omp_directives and handles target_... as modifiers in the if clause, fulfilling OpenMP 5.x features for Fortran. Supports these in assume statement's absent and contains clauses.
- OpenMP
- A standardized API for shared-memory parallel programming. It uses directives and clauses to specify parallelism, data sharing, and offload behavior.
- Fortran
- A high-level programming language commonly used for numerical and scientific computation. GCC's
gfortrancompiler supports OpenMP directives within Fortran code. - directive name
- The specific keyword identifying an OpenMP construct (e.g.,
parallel,for,target). - assume statement
- A Fortran statement that allows programmers to provide information to the compiler that it can use for optimization or to check for consistency. In this context, it's used for compiler directives related to OpenMP.
- if clause
- An OpenMP clause that specifies a conditional execution for a directive. The condition is evaluated at runtime.