aboutsummaryrefslogtreecommitdiff
path: root/flang/lib/Semantics/pointer-assignment.h
AgeCommit message (Collapse)AuthorFilesLines
2025-05-12[flang] Require contiguous actual pointer for contiguous dummy pointer (#139298)Peter Klausler1-1/+1
When the actual argument associated with an explicitly CONTIGUOUS pointer dummy argument is itself a pointer, it must also be contiguous. (A non-pointer actual argument can associate with a CONTIGUOUS pointer dummy argument if it's INTENT(IN), and in that case it's still just a warning if we can't prove at compilation time that the actual is contiguous.) Fixes https://github.com/llvm/llvm-project/issues/138899.
2023-09-13[flang] Don't check dummy vs. actual result rank for assumed-rank poi… ↵Peter Klausler1-2/+3
(#66237) …nters When associating a function result pointer as an actual argument with a dummy pointer that is assumed-rank, don't emit a bogus error.
2023-08-29[flang] Check procedure pointer initializations; clean up ELEMENTALPeter Klausler1-3/+4
Implements compatibility checking for initializers in procedure pointer declarations. This work exposed some inconsistency in how ELEMENTAL interfaces were handled and checked, from both unrestricted intrinsic functions and others, and some refinements needed for function result compatbility checking; these have also been ironed out. Some new warnings are now emitted, and this affected a dozen or so tests. Differential Revision: https://reviews.llvm.org/D159026
2023-05-16[flang] Finer control over warningsPeter Klausler1-11/+8
Establish a set of optional usage warnings, and enable some only in "-pedantic" mode that, in our subjective experience with application codes, seem to issue frequently without indicating usage that really needs to be corrected. By default, with this patch the compiler should appear to be somewhat less persnickety but not less informative. Differential Revision: https://reviews.llvm.org/D150710
2022-10-31[flang] Fix pointer definition semantic checking via refactoringPeter Klausler1-7/+8
The infrastructure in semantics that is used to check that the left-hand sides of normal assignment statements are really definable variables was not being used to check whether the LHSs of pointer assignments are modifiable, and so most cases of unmodifiable pointers are left undiagnosed. Rework the semantics checking for pointer assignments, NULLIFY statements, pointer dummy arguments, &c. so that cases of unmodifiable pointers are properly caught. This has been done by extracting all the various definability checking code that has been implemented for different contexts in Fortran into one new facility. The new consolidated definability checking code returns messages meant to be attached as "because: " explanations to context-dependent errors like "left-hand side of assignment is not definable". These new error message texts and their attached explanations affect many existing tests, which have been updated. The testing infrastructure was extended by another patch to properly compare warnings and explanatory messages, which had been ignored until recently. Differential Revision: https://reviews.llvm.org/D136979
2020-06-19[flang] DATA stmt processing (part 3/4): Remaining prep workpeter klausler1-3/+10
Rolls up small changes across the frontend to prepare for the large forthcoming patch (part 4/4) that completes DATA statement processing via conversion to initializers. Reviewed By: PeteSteinfeld Differential Revision: https://reviews.llvm.org/D82137
2020-03-28[flang] Reformat with latest clang-format and .clang-formatTim Keith1-2/+2
Original-commit: flang-compiler/f18@9fe84f45d7fd685051004678d6b5775dcc4c6f8f Reviewed-on: https://github.com/flang-compiler/f18/pull/1094
2020-02-25[flang] [LLVMify F18] Compiler module folders should have capitalised names ↵CarolineConcatto1-0/+39
(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@d2eb7a1c443d1539ef12b6f027074a0eb15b1ea0 Reviewed-on: https://github.com/flang-compiler/f18/pull/980