diff options
author | Arthur Cohen <arthur.cohen@embecosm.com> | 2022-04-07 11:47:56 +0200 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2022-04-12 14:26:23 +0200 |
commit | dfb5f548cee6874be343d3a337e9779ac30a5eb5 (patch) | |
tree | db6298060c6d60ced8a16a3c102d9a9485f42455 | |
parent | e01a8140613da2a7aeab99362c38a0e7b2e1e9e6 (diff) | |
download | gcc-dfb5f548cee6874be343d3a337e9779ac30a5eb5.zip gcc-dfb5f548cee6874be343d3a337e9779ac30a5eb5.tar.gz gcc-dfb5f548cee6874be343d3a337e9779ac30a5eb5.tar.bz2 |
hir: Visibility: Add is_public() method
-rw-r--r-- | gcc/rust/hir/tree/rust-hir-item.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/rust/hir/tree/rust-hir-item.h b/gcc/rust/hir/tree/rust-hir-item.h index 2e35aea..70d5138 100644 --- a/gcc/rust/hir/tree/rust-hir-item.h +++ b/gcc/rust/hir/tree/rust-hir-item.h @@ -576,6 +576,9 @@ public: // Returns whether visibility is in an error state. bool is_error () const { return vis_type == ERROR; } + // Does the current visibility refer to a simple `pub <item>` entirely public + bool is_public () const { return vis_type == PUBLIC; } + // Creates an error visibility. static Visibility create_error () { |