public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/rust/master] hir: Add ExternalItem::ExternKind enumeration
@ 2022-07-28 7:53 Thomas Schwinge
0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2022-07-28 7:53 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:e7b6a9ee16ae495a858a694d53b8c74548f5bbdd
commit e7b6a9ee16ae495a858a694d53b8c74548f5bbdd
Author: Arthur Cohen <arthur.cohen@embecosm.com>
Date: Tue Jul 26 10:48:31 2022 +0200
hir: Add ExternalItem::ExternKind enumeration
Diff:
---
gcc/rust/hir/tree/rust-hir-item.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/gcc/rust/hir/tree/rust-hir-item.h b/gcc/rust/hir/tree/rust-hir-item.h
index 6156b2dacb3..394b04f6c7f 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<Type> &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 */
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-07-28 7:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-28 7:53 [gcc/devel/rust/master] hir: Add ExternalItem::ExternKind enumeration Thomas Schwinge
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).