aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Cohen <arthur.cohen@embecosm.com>2022-07-26 10:48:31 +0200
committerArthur Cohen <arthur.cohen@embecosm.com>2022-07-27 15:30:09 +0200
commite7b6a9ee16ae495a858a694d53b8c74548f5bbdd (patch)
tree71aa85ced3d817460e99786638e4303ed76d6c4b
parent53aee096bd22a43165839f908581753ab987e9d9 (diff)
downloadgcc-e7b6a9ee16ae495a858a694d53b8c74548f5bbdd.zip
gcc-e7b6a9ee16ae495a858a694d53b8c74548f5bbdd.tar.gz
gcc-e7b6a9ee16ae495a858a694d53b8c74548f5bbdd.tar.bz2
hir: Add ExternalItem::ExternKind enumeration
-rw-r--r--gcc/rust/hir/tree/rust-hir-item.h12
1 files changed, 12 insertions, 0 deletions
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<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 */