[flang] Fix accessibility of USEd name in .mod file
If a module specifies default private accessibility, names that have been use-associated are private by default. This was not reflected in .mod files. Differential Revision: https://reviews.llvm.org/D94602
This commit is contained in:
parent
01c3135850
commit
18278ff1aa
|
@ -427,6 +427,7 @@ void ModFileWriter::PutUse(const Symbol &symbol) {
|
|||
PutGenericName(uses_ << "=>", use);
|
||||
}
|
||||
uses_ << '\n';
|
||||
PutUseExtraAttr(Attr::PRIVATE, symbol, use);
|
||||
PutUseExtraAttr(Attr::VOLATILE, symbol, use);
|
||||
PutUseExtraAttr(Attr::ASYNCHRONOUS, symbol, use);
|
||||
}
|
||||
|
|
|
@ -158,3 +158,21 @@ end
|
|||
! end
|
||||
! end interface
|
||||
!end
|
||||
|
||||
module m7a
|
||||
real :: x
|
||||
end
|
||||
!Expect: m7a.mod
|
||||
!module m7a
|
||||
! real(4)::x
|
||||
!end
|
||||
|
||||
module m7b
|
||||
use m7a
|
||||
private
|
||||
end
|
||||
!Expect: m7b.mod
|
||||
!module m7b
|
||||
! use m7a,only:x
|
||||
! private::x
|
||||
!end
|
||||
|
|
Loading…
Reference in a new issue