aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/hir/tree/rust-hir-item.h
diff options
context:
space:
mode:
authorMarc Poulhiès <dkm@kataplop.net>2023-06-29 20:47:16 +0200
committerArthur Cohen <arthur.cohen@embecosm.com>2024-01-16 18:49:30 +0100
commit0ee496d5dc105b1925af0366d72c91c4e5712b3c (patch)
tree7309d9592b100545c246c1f3836619978666e157 /gcc/rust/hir/tree/rust-hir-item.h
parent0cecd8278901c32b0326f32105f63ed481bae0c9 (diff)
downloadgcc-0ee496d5dc105b1925af0366d72c91c4e5712b3c.zip
gcc-0ee496d5dc105b1925af0366d72c91c4e5712b3c.tar.gz
gcc-0ee496d5dc105b1925af0366d72c91c4e5712b3c.tar.bz2
gccrs: Add new getters
Some class members were not accessible from outside, which will be needed for the new HIR dump. gcc/rust/ChangeLog: * hir/tree/rust-hir-expr.h (AwaitExpr::get_awaited_expr): New. (AsyncBlockExpr::get_has_move, AsyncBlockExpr::get_block_expr): New. * hir/tree/rust-hir-item.h (Enum::get_where_clause): New. (Trait::get_where_clause, Trait::is_unsafe): New. (ExternalItem::get_visibility): New. Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
Diffstat (limited to 'gcc/rust/hir/tree/rust-hir-item.h')
-rw-r--r--gcc/rust/hir/tree/rust-hir-item.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/rust/hir/tree/rust-hir-item.h b/gcc/rust/hir/tree/rust-hir-item.h
index 13e933b..c719a7b 100644
--- a/gcc/rust/hir/tree/rust-hir-item.h
+++ b/gcc/rust/hir/tree/rust-hir-item.h
@@ -1965,6 +1965,7 @@ public:
}
std::vector<std::unique_ptr<EnumItem>> &get_variants () { return items; }
+ WhereClause &get_where_clause () { return where_clause; }
protected:
/* Use covariance to implement clone function as returning this object
@@ -2638,7 +2639,10 @@ public:
return trait_items;
}
+ WhereClause &get_where_clause () { return where_clause; }
+
Identifier get_name () const { return name; }
+ bool is_unsafe () const { return unsafety == Unsafety::Unsafe; }
// Mega-constructor
Trait (Analysis::NodeMapping mappings, Identifier name, Unsafety unsafety,
@@ -2894,6 +2898,7 @@ public:
virtual void accept_vis (HIRFullVisitor &vis) = 0;
virtual void accept_vis (HIRExternalItemVisitor &vis) = 0;
+ Visibility &get_visibility () { return visibility; }
Analysis::NodeMapping get_mappings () const { return mappings; }
Identifier get_item_name () const { return item_name; }