aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Cohen <arthur.cohen@embecosm.com>2022-04-25 16:45:44 +0200
committerArthur Cohen <arthur.cohen@embecosm.com>2022-04-25 16:56:31 +0200
commitd0c75495dda7943078771d792a6e380315c7d604 (patch)
treeecfbdf8733709a2a28f4f6af78ba05a7339c95d5
parent5536d363074d07d84acb8111f6b1ae2cb1f6d0c3 (diff)
downloadgcc-d0c75495dda7943078771d792a6e380315c7d604.zip
gcc-d0c75495dda7943078771d792a6e380315c7d604.tar.gz
gcc-d0c75495dda7943078771d792a6e380315c7d604.tar.bz2
ast: Visibility: Add `has_path` method
-rw-r--r--gcc/rust/ast/rust-item.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/rust/ast/rust-item.h b/gcc/rust/ast/rust-item.h
index 1b925c3..5907516 100644
--- a/gcc/rust/ast/rust-item.h
+++ b/gcc/rust/ast/rust-item.h
@@ -640,6 +640,9 @@ public:
return vis_type == PUB_IN_PATH && in_path.is_empty ();
}
+ // Returns whether a visibility has a path
+ bool has_path () const { return !(is_error ()) && vis_type == PUB_IN_PATH; }
+
// Returns whether visibility is public or not.
bool is_public () const { return vis_type != PRIV && !is_error (); }