[PATCH] D94602: [flang] Fix accessibility of USEd name in .mod file

Tim Keith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 13 12:53:14 PST 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rG18278ff1aac4: [flang] Fix accessibility of USEd name in .mod file (authored by tskeith).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D94602/new/

https://reviews.llvm.org/D94602

Files:
  flang/lib/Semantics/mod-file.cpp
  flang/test/Semantics/modfile03.f90


Index: flang/test/Semantics/modfile03.f90
===================================================================
--- flang/test/Semantics/modfile03.f90
+++ flang/test/Semantics/modfile03.f90
@@ -158,3 +158,21 @@
 !  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
Index: flang/lib/Semantics/mod-file.cpp
===================================================================
--- flang/lib/Semantics/mod-file.cpp
+++ flang/lib/Semantics/mod-file.cpp
@@ -427,6 +427,7 @@
     PutGenericName(uses_ << "=>", use);
   }
   uses_ << '\n';
+  PutUseExtraAttr(Attr::PRIVATE, symbol, use);
   PutUseExtraAttr(Attr::VOLATILE, symbol, use);
   PutUseExtraAttr(Attr::ASYNCHRONOUS, symbol, use);
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D94602.316495.patch
Type: text/x-patch
Size: 852 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210113/fb494d4d/attachment.bin>


More information about the llvm-commits mailing list