a1a55f007c
These are recognized along with other attributes and saved in `passName_` and `bindName_`. The functions `SetPassNameOn()` and `SetBindNameOn()` set them in a symbol if they are present. They are also written to `.mod` files. Add `MakePlaceholder()` to make symbols for names that otherwise wouldn't have one. This allows us to assign a symbol to every name and report errors for those that don't have one. Make use of this for PASS names, which don't have explicit symbols. Change `ObjectEntityDetails` and `ProcEntityDetails` to be sub-classes of `EntityDetails`. They each contain a superset of the information in `EntityDetails` so this reduces some duplication. Original-commit: flang-compiler/f18@404c920840 Reviewed-on: https://github.com/flang-compiler/f18/pull/256 Tree-same-pre-rewrite: false
48 lines
1.1 KiB
Fortran
48 lines
1.1 KiB
Fortran
! Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
|
|
!
|
|
! Licensed under the Apache License, Version 2.0 (the "License");
|
|
! you may not use this file except in compliance with the License.
|
|
! You may obtain a copy of the License at
|
|
!
|
|
! http://www.apache.org/licenses/LICENSE-2.0
|
|
!
|
|
! Unless required by applicable law or agreed to in writing, software
|
|
! distributed under the License is distributed on an "AS IS" BASIS,
|
|
! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
! See the License for the specific language governing permissions and
|
|
! limitations under the License.
|
|
|
|
module m
|
|
type :: t
|
|
procedure(a), pointer, pass :: c
|
|
procedure(a), pointer, pass(x) :: d
|
|
contains
|
|
procedure, pass(y) :: a, b
|
|
end type
|
|
contains
|
|
subroutine a(x, y)
|
|
class(t) :: x, y
|
|
end
|
|
subroutine b(y)
|
|
class(t) :: y
|
|
end
|
|
end module
|
|
|
|
!Expect: m.mod
|
|
!module m
|
|
! type::t
|
|
! procedure(a),pass,pointer::c
|
|
! procedure(a),pass(x),pointer::d
|
|
! contains
|
|
! procedure,pass(y)::a
|
|
! procedure,pass(y)::b
|
|
! end type
|
|
!contains
|
|
! subroutine a(x,y)
|
|
! class(t)::x
|
|
! class(t)::y
|
|
! end
|
|
! subroutine b(y)
|
|
! class(t)::y
|
|
! end
|
|
!end
|