Most restrictions in 2.7.1 Loop construct, nesting checks are still on TODO list.
seenClauses (EnumSet) is dropped. A multimap clauseInfo is added to save the encountering clause and its parser tree node pointer (parser::OmpClause) and to do the checks after walking through all the clauses.
Original-commit: flang-compiler/f18@f797357682
Reviewed-on: https://github.com/flang-compiler/f18/pull/536
The constraint says that a variable-name in a locality-spec shall be the name
of a variable in the innermost executable construct or scoping unit that
includes the DO CONCURRENT statement. This check was already being made in
resolve-names.cc for LOCAL and LOCAL_INIT locality specs but not for the
SHARED locality spec. Also, there was some code in check-do.cc that was
intended to be used to enforce this constraint at some time in the future.
I added code to resolve-names.cc to extend the checking to the SHARED locality
spec and removed the unused code from check-do.cc. I also extended the
existing tests in resolve35.f90 to exercise the new code.
Original-commit: flang-compiler/f18@b421923d94
Reviewed-on: https://github.com/flang-compiler/f18/pull/533
Tree-same-pre-rewrite: false
There are no Clause 12 constraints to check for PRINT, but PRINT does share
FMT specifier processing with READ and WRITE. To avoid interactions between
these I/O statements, reset IoChecker values for PRINT.
Original-commit: flang-compiler/f18@6a54766718
Reviewed-on: https://github.com/flang-compiler/f18/pull/528
Change the CMakeFile.txt in tools/f18 to build the predefined modules with the just-built compiler. The mod files are created in the new "include" subdirectory of the binary target directory. The mod files are installed to ${CMAKE_INSTALL_PREFIX}/include.
The f18 driver is already installed in ${CMAKE_INSTALL_PREFIX}/bin. This change change the location of the f18 binary build to a sibling directory of "include" called "bin" instead of at the top level of the binary destination directory. This change is in anticipation of changing the driver to find the include directory using a path relative to the location of f18.
Update the test scripts to find f18 in the bin subdirectory.
Remove the simple predefined module tests from test/semantics because they are compiled as part of the build and don't need to be recompiled as part of a test.
Original-commit: flang-compiler/f18@7811ccecdc
Reviewed-on: https://github.com/flang-compiler/f18/pull/526
This patch is to show the framework to do OpenMP structure related check and you may find missing/incomplete implementation, which will be added in the future.
1. Each encountering construct has its own context and the context info will be filled while walking the directive/clause nodes. In the `Leave`, the current OpenMP context will be popped out.
2. When entering the construct, necessary nesting check will be performed. Use std::vector to implement the context stack because certain nesting restrictions may need to trace back more than one level.
3. PARALLEL construct is used as an example for clause validity check.
4. `EnumSet` is used to represent the directive/clause sets and to show the error msg. All the error msgs are quoted from the specification.
5. Necessary `CharBlock` is added for error msgs.
Original-commit: flang-compiler/f18@620441c03e
Reviewed-on: https://github.com/flang-compiler/f18/pull/493
* Clause 13 (Input/output editing) syntax and semantic checking
Diagnose:
- all clause syntax errors (independent of normal parsing)
- all clause constraints
- use of non-standard extensions under -Mstandard
- obvious program requirement violations
The code:
- is invoked for both format statement and I/O statement constant formats
- should be useable by the runtime I/O library for runtime formats
- is able to recover from errors
- is able to diagnose multiple errors in a single format
- has accurate markers for errors
- can process (fixed character size) Hollerith strings
- generates reasonable error messages for known error scenarios
- should not require C++ run-time library support
The code is templatized for use with fixed size character kind={1,2,4} input,
but only the kind=1 variant is actually exercised.
* Review update.
* Review update.
* Review update.
* Improve error processing of unterminated formats.
Original-commit: flang-compiler/f18@c04b7518df
Reviewed-on: https://github.com/flang-compiler/f18/pull/498
The passed-object dummy argument cannot be checked until the
interfaces of contained subprograms are known. To accomplish this,
add `FinishSpecificationPart` pass to run after all specification
parts have been analyzed but before any of the execution parts.
This visits all derived types defined in each scope and performs
the checks on each procedure component and procedure binding.
Add a flag to `ParamValue` to distinguish kind from len parameters.
Fix some tests that had errors we now detect.
Original-commit: flang-compiler/f18@4789643c5b
Reviewed-on: https://github.com/flang-compiler/f18/pull/521