aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend/rust-compile-base.cc
diff options
context:
space:
mode:
authorArthur Cohen <arthur.cohen@embecosm.com>2022-04-11 14:15:10 +0200
committerArthur Cohen <arthur.cohen@embecosm.com>2022-04-11 17:18:02 +0200
commit2a264a36932288c2a1fe848b03eab977267761dd (patch)
tree140ae5f9ff0e73a0cc03fe41144c249ba85402d7 /gcc/rust/backend/rust-compile-base.cc
parent68458036c81d141a3899ac4e6ec6ddf0fdfde174 (diff)
downloadgcc-2a264a36932288c2a1fe848b03eab977267761dd.zip
gcc-2a264a36932288c2a1fe848b03eab977267761dd.tar.gz
gcc-2a264a36932288c2a1fe848b03eab977267761dd.tar.bz2
hir: Cleanup Visibility struct
The HIR::Visibility struct was extremely similar to the AST::Visibility one. However, we do not need to keep as much information at the HIR level: Syntactic sugar such as pub(crate) can be kept as the desugared form, which is pub(in crate). Likewise, pub(self) can be desugared to pub(in self) which amounts to having a private item.
Diffstat (limited to 'gcc/rust/backend/rust-compile-base.cc')
-rw-r--r--gcc/rust/backend/rust-compile-base.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/gcc/rust/backend/rust-compile-base.cc b/gcc/rust/backend/rust-compile-base.cc
index a705da7..602fc56 100644
--- a/gcc/rust/backend/rust-compile-base.cc
+++ b/gcc/rust/backend/rust-compile-base.cc
@@ -37,8 +37,7 @@ HIRCompileBase::setup_attributes_on_fndecl (
{
// if its the main fn or pub visibility mark its as DECL_PUBLIC
// please see https://github.com/Rust-GCC/gccrs/pull/137
- bool is_pub
- = visibility.get_vis_type () != HIR::Visibility::PublicVisType::NONE;
+ bool is_pub = visibility.get_vis_type () == HIR::Visibility::VisType::PUBLIC;
if (is_main_entry_point || is_pub)
{
TREE_PUBLIC (fndecl) = 1;