public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/rust/master] privacy: reachability: wip: Update all base reach levels
@ 2022-06-08 12:31 Thomas Schwinge
  0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2022-06-08 12:31 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:71f2cd57c6fed5d01c56858800bc17cb68a9ac38

commit 71f2cd57c6fed5d01c56858800bc17cb68a9ac38
Author: Arthur Cohen <arthur.cohen@embecosm.com>
Date:   Thu Apr 14 09:59:18 2022 +0200

    privacy: reachability: wip: Update all base reach levels

Diff:
---
 gcc/rust/privacy/rust-reachability.cc | 23 +++++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)

diff --git a/gcc/rust/privacy/rust-reachability.cc b/gcc/rust/privacy/rust-reachability.cc
index c5bfce1e298..826a465566d 100644
--- a/gcc/rust/privacy/rust-reachability.cc
+++ b/gcc/rust/privacy/rust-reachability.cc
@@ -69,6 +69,9 @@ ReachabilityVisitor::visit_generic_predicates (
 void
 ReachabilityVisitor::visit (HIR::Module &mod)
 {
+  auto reach = get_reachability_level (mod.get_visibility ());
+  reach = ctx.update_reachability (mod.get_mappings (), reach);
+
   for (auto &item : mod.get_items ())
     {
       // FIXME: Is that what we want to do? Yes? Only visit the items with
@@ -83,11 +86,17 @@ ReachabilityVisitor::visit (HIR::Module &mod)
 
 void
 ReachabilityVisitor::visit (HIR::ExternCrate &crate)
-{}
+{
+  auto reach = get_reachability_level (crate.get_visibility ());
+  reach = ctx.update_reachability (crate.get_mappings (), reach);
+}
 
 void
 ReachabilityVisitor::visit (HIR::UseDeclaration &use_decl)
-{}
+{
+  auto reach = get_reachability_level (use_decl.get_visibility ());
+  reach = ctx.update_reachability (use_decl.get_mappings (), reach);
+}
 
 void
 ReachabilityVisitor::visit (HIR::Function &func)
@@ -155,11 +164,17 @@ ReachabilityVisitor::visit (HIR::Union &union_item)
 
 void
 ReachabilityVisitor::visit (HIR::ConstantItem &const_item)
-{}
+{
+  auto reach = get_reachability_level (const_item.get_visibility ());
+  reach = ctx.update_reachability (const_item.get_mappings (), reach);
+}
 
 void
 ReachabilityVisitor::visit (HIR::StaticItem &static_item)
-{}
+{
+  auto reach = get_reachability_level (static_item.get_visibility ());
+  reach = ctx.update_reachability (static_item.get_mappings (), reach);
+}
 
 void
 ReachabilityVisitor::visit (HIR::Trait &trait)


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-06-08 12:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-08 12:31 [gcc/devel/rust/master] privacy: reachability: wip: Update all base reach levels Thomas Schwinge

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).