From e7b6a9ee16ae495a858a694d53b8c74548f5bbdd Mon Sep 17 00:00:00 2001 From: Arthur Cohen Date: Tue, 26 Jul 2022 10:48:31 +0200 Subject: hir: Add ExternalItem::ExternKind enumeration --- gcc/rust/hir/tree/rust-hir-item.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'gcc') diff --git a/gcc/rust/hir/tree/rust-hir-item.h b/gcc/rust/hir/tree/rust-hir-item.h index 6156b2d..394b04f 100644 --- a/gcc/rust/hir/tree/rust-hir-item.h +++ b/gcc/rust/hir/tree/rust-hir-item.h @@ -2834,10 +2834,18 @@ class ExternalItem : public Node Location locus; public: + enum class ExternKind + { + Static, + Function, + }; + virtual ~ExternalItem () {} BaseKind get_hir_kind () override final { return EXTERNAL; } + virtual ExternKind get_extern_kind () = 0; + // Returns whether item has outer attributes. bool has_outer_attrs () const { return !outer_attrs.empty (); } @@ -2944,6 +2952,8 @@ public: std::unique_ptr &get_item_type () { return item_type; } + ExternKind get_extern_kind () override { return ExternKind::Static; } + protected: /* Use covariance to implement clone function as returning this object * rather than base */ @@ -3095,6 +3105,8 @@ public: bool is_variadic () const { return has_variadics; } + ExternKind get_extern_kind () override { return ExternKind::Function; } + protected: /* Use covariance to implement clone function as returning this object * rather than base */ -- cgit v1.1