-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[flang] Always incorporate parent types' special generic bindings
The runtime type information table generator was broken when dealing with an extension derived type that didn't include a special generic procedure binding for ASSIGNMENT(=) or user-defined I/O, but one of whose ancestor types did. Ensure that the runtime derived type info tables have complete subtables for all of these special bindings, and respect any overrides that may have been defined. Motivating example: type parent contains procedure :: dtWrite => dtWrite1 generic :: write(formatted) => dtWrite end type type, extends(parent) :: extended contains procedure :: dtWrite => dtWrite2 end type The runtime derived type information table for "extended" must include a special generic procedure entry for "write(formatted)" that points to "dtWrite2" even though "extend" has no generic procedure for "write(formatted)". Differential Revision: https://reviews.llvm.org/D144148
- Loading branch information
Showing
4 changed files
with
83 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
!RUN: bbc --dump-symbols %s | FileCheck %s | ||
!RUN: %flang_fc1 -fdebug-dump-symbols %s | FileCheck %s | ||
|
||
module m1 | ||
type base | ||
contains | ||
procedure :: wf => wf1 | ||
generic :: write(formatted) => wf | ||
end type | ||
type, extends(base) :: extended | ||
contains | ||
procedure :: wf => wf2 | ||
end type | ||
contains | ||
subroutine wf1(x,u,iot,v,iostat,iomsg) | ||
class(base), intent(in) :: x | ||
integer, intent(in) :: u | ||
character(len=*), intent(in) :: iot | ||
integer, intent(in) :: v(:) | ||
integer, intent(out) :: iostat | ||
character(len=*), intent(inout) :: iomsg | ||
end subroutine | ||
subroutine wf2(x,u,iot,v,iostat,iomsg) | ||
class(extended), intent(in) :: x | ||
integer, intent(in) :: u | ||
character(len=*), intent(in) :: iot | ||
integer, intent(in) :: v(:) | ||
integer, intent(out) :: iostat | ||
character(len=*), intent(inout) :: iomsg | ||
end subroutine | ||
end module | ||
!CHECK: .s.base, SAVE, TARGET (CompilerCreated, ReadOnly): ObjectEntity type: TYPE(specialbinding) shape: 0_8:0_8 init:[specialbinding::specialbinding(which=5_1,isargdescriptorset=1_1,proc=wf1)] | ||
!CHECK: .s.extended, SAVE, TARGET (CompilerCreated, ReadOnly): ObjectEntity type: TYPE(specialbinding) shape: 0_8:0_8 init:[specialbinding::specialbinding(which=5_1,isargdescriptorset=1_1,proc=wf2)] |