17 Commits

Author SHA1 Message Date
Peter Klausler
38207a52a7
[flang] Test SYNC IMAGES, increase checking (#132279)
Add a test for the SYNC IMAGES statement, and add a check for invalid
image numbers.
2025-03-26 12:08:48 -07:00
Peter Klausler
3f04fb42aa
[flang] Complete semantic checks for FORM TEAM (#131022)
Add remaining checking for the FORM TEAM statement, complete and enable
a test.
2025-03-19 11:59:59 -07:00
Peter Klausler
1dc397deed
[flang] Enforce control flow restrictions on CHANGE TEAM (#131013)
Like DO CONCURRENT and CRITICAL constructs, control flow into and out of
a CHANGE TEAM construct is disallowed.
2025-03-19 11:59:39 -07:00
Peter Klausler
8c535669a3
[flang] Semantic checking of LOCK statement (#129806)
Add checks for the LOCK statement, and complete and enable their tests.
2025-03-10 13:17:31 -07:00
Peter Klausler
2625510ef8
[flang] Refine EVENT_TYPE/LOCK_TYPE usage checks (#123244)
The event variable in an EVENT POST/WAIT statement can be a coarray
reference, and need not be an entire coarray.

Variables and potential subobject components with EVENT_TYPE/LOCK_TYPE
must be coarrays, unless they are potential subobjects nested within
coarrays or pointers.
2025-01-27 08:45:11 -08:00
Alexander Shaposhnikov
77d8cfb3c5
[Flang] Switch to common::visit more call sites (#90018)
Switch to common::visit more call sites.

Test plan: ninja check-all
2024-06-17 12:59:04 -07:00
Katherine Rasmussen
a2d7af757b
[flang] Add notify-type and notify-wait-stmt (#76594)
Add `notify-type` to `iso_fortran_env` module. Add `notify-wait-stmt` to
the parser and add checks for constraints on the statement, `C1177` and
`C1178`, from the Fortran 2023 standard. Add three semantics tests for
`notify-wait-stmt`.
2024-01-02 10:40:47 -08:00
Peter Klausler
7871deb821
[flang] Add optional portability warning for upcoming Fortran 202X/3 breaking change
The soon-to-be-published next revision of the ISO Fortran language standard
contains a couple of breaking changes to previous specifications that may cause
existing programs to silently change their behavior.

For the change that introduces automatic reallocation of deferred length
allocatable character scalar variables when they appear as the targets
of internal WRITE statements, as IOMSG=/ERRMSG= variables, as outputs
of INQUIRE specifiers, or as INTENT(OUT) arguments to intrinsic
procedures, this patch adds an optional portability warning.

Differential Revision: https://reviews.llvm.org/D154242
2023-07-03 09:07:00 -07:00
Katherine Rasmussen
2d5ef39184 [flang] Apply the check for the constraint C1172 to more stmts
Apply the check for the constraint `C1172` to `unlock-stmt`,
`change-team-stmt`, `end-team-stmt`, and `critical-stmt`, which
all have `sync-stat-lists` and so `C1172` applies to them. Add
a test to check the `sync-stat-lists` for these 4 statements.

Reviewed By: PeteSteinfeld

Differential Revision: https://reviews.llvm.org/D150745
2023-05-17 19:38:44 -07:00
Katherine Rasmussen
e03200164b [flang] Add check for constraints on event-stmts
In the CoarrayChecker, add checks for the constraints C1177 and
C1178 for event-wait-stmt. Add event-post-stmt to the check
for the constraints for sync-stat-list. Add a check for the
constraint C1176 on event-variable.

Reviewed By: PeteSteinfeld

Differential Revision: https://reviews.llvm.org/D137204
2023-05-16 12:09:48 -07:00
Katherine Rasmussen
4d84ed5283 Revert "[flang] Add check for constraints on event-stmts"
This reverts commit 9725c740fbe7841a7aed57ca35f83d28aac1814c.
2023-05-16 10:46:27 -07:00
Katherine Rasmussen
9725c740fb [flang] Add check for constraints on event-stmts
In the CoarrayChecker, add checks for the constraints C1177 and
C1178 for event-wait-stmt. Add event-post-stmt to the check
for the constraints for sync-stat-list. Add a check for the
constraint C1176 on event-variable.

Reviewed By: PeteSteinfeld

Differential Revision: https://reviews.llvm.org/D137204
2023-05-15 18:48:01 -07:00
Katherine Rasmussen
f770b1e954 [flang] Add check for constraints on synchronization-stmts
In the CoarrayChecker, add checks for the constraints C1172 and
C1173, which constrain sync-stat-list. Add these checks to
sync-all-stmt, sync-images-stmt, sync-memory-stmt, and
sync-team-stmt. Also add a check for the constraint C1174 in
sync-images-stmt. Update semantics tests for these stmts.

Reviewed By: klausler

Differential Revision: https://reviews.llvm.org/D136104
2022-10-25 10:30:28 -07:00
Peter Klausler
7e225423d3 [flang] Finer control over error recovery with GetExpr()
Prior to this patch, the semantics utility GetExpr() will crash
unconditionally if it encounters a typed expression in the parse
tree that has not been set by expression semantics.  This is the
right behavior when called from lowering, by which time it is known
that the program had no fatal user errors, since it signifies a
fatal internal error.  However, prior to lowering, in the statement
semantics checking code, a more nuanced test should be used before
crashing -- specifically, we should not crash in the face of a
missing typed expression when in error recovery mode.

Getting this right requires GetExpr() and its helper class to have
access to the semantics context, so that it can check AnyFatalErrors()
before crashing.  So this patch touches nearly all of its call sites.

Differential Revision: https://reviews.llvm.org/D123873
2022-04-15 14:25:41 -07:00
Pete Steinfeld
15fa287b64 [flang] Support for image selectors
Summary:
This change implements support for image selectors and image selector
specifications as described in section 9.6.

In check-coarray[.h,cpp] I changed the `Leave()` function for
`parser::ImageSelectorSpec` to take a `parser::ImageSelector`, which
contains a list of image selector specifications.  This allows us to
detect when the same specification is used more than once.  I also added
code to analyze the expressions for the image selector specifications to
expression.cpp and a test for all of the conditions to check at
compile-time.

Note that we do not check at compile-time to see if the value of the
cosubscripts are within the specified cobounds.  We also do not check anything
related to selecting a valid team.  We also do not check that the denotation of
the `stat-variable` is not dependent on the evaluation of an entity in the
same statement.

Reviewers: klausler, tskeith, DavidTruby

Subscribers: llvm-commits

Tags: #llvm, #flang

Differential Revision: https://reviews.llvm.org/D83336
2020-07-08 07:31:54 -07:00
Tim Keith
1f8790050b [flang] Reformat with latest clang-format and .clang-format
Original-commit: flang-compiler/f18@9fe84f45d7
Reviewed-on: https://github.com/flang-compiler/f18/pull/1094
2020-03-28 21:00:16 -07:00
CarolineConcatto
64ab3302d5 [flang] [LLVMify F18] Compiler module folders should have capitalised names (flang-compiler/f18#980)
This patch renames the modules in f18 to use a capital letter in the
module name

Signed-off-by: Caroline Concatto <caroline.concatto@arm.com>

Original-commit: flang-compiler/f18@d2eb7a1c44
Reviewed-on: https://github.com/flang-compiler/f18/pull/980
2020-02-25 07:11:52 -08:00