[flang-commits] [PATCH] D89473: [flang] Document and use intrinsic subroutine argument intents
Jean Perier via Phabricator via flang-commits
flang-commits at lists.llvm.org
Thu Oct 15 07:59:36 PDT 2020
jeanPerier created this revision.
jeanPerier added reviewers: klausler, PeteSteinfeld.
jeanPerier added a project: Flang.
Herald added subscribers: llvm-commits, jdoerfert.
Herald added a project: LLVM.
jeanPerier requested review of this revision.
Check INTENT(OUT)/INTENT(INOUT) constraints for actual argument
of intrinsic procedure calls.
- Adding a common::Intent field to the IntrinsicDummyArgument
in the intrinsic table.
- Propagating it to the DummyDataObject intent field so that it can
later be used in CheckExplicitDataArg semantic checks.
- Add related tests.
- Fix regression (C846 false error), C846 INTENT(OUT) rule does not apply to intrinsic call. Propagate the information that we are in an intrinsic call up to CheckExplicitDataArg (that is doing this check).
Note 1: The added intent field is useless for all intrinsic
functions since none of them have intent out/inout arguments (I think,
but did not thoroughly checked). Since the table is not that small, the
change leads in a ~10ko increase in intrinsics.cpp.o (RL mode, gcc 8.3).
Since we are talking a bout a 0.03% space increase and that I am not sure how true
it is that all intrinsic functions will always have intent in arguments,
I ruled that this was OK.
Note 2: For the C846 fix, I considered adding an "Intrinsic" attribute
to characteristics::Procedure Attr, it worked but then seemed like a
bad idea to me since we would think that we are in an intrinsic call
when calling bar in the program below since characteristic built from
an intrinsic name can be used for user procedure.
subroutine foo(bar)
procedure(acos) bar
y = bar(x)
end subroutine
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D89473
Files:
flang/include/flang/Evaluate/characteristics.h
flang/lib/Evaluate/characteristics.cpp
flang/lib/Evaluate/intrinsics.cpp
flang/lib/Semantics/check-call.cpp
flang/lib/Semantics/check-call.h
flang/lib/Semantics/expression.cpp
flang/test/Semantics/call03.f90
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89473.298386.patch
Type: text/x-patch
Size: 18448 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20201015/c3dc9174/attachment-0001.bin>
More information about the flang-commits
mailing list