aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/ast/rust-ast.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/rust/ast/rust-ast.h')
-rw-r--r--gcc/rust/ast/rust-ast.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/rust/ast/rust-ast.h b/gcc/rust/ast/rust-ast.h
index 72f2609..05779e7 100644
--- a/gcc/rust/ast/rust-ast.h
+++ b/gcc/rust/ast/rust-ast.h
@@ -542,6 +542,13 @@ protected:
class AttrInput
{
public:
+ enum AttrInputType
+ {
+ LITERAL,
+ META_ITEM,
+ TOKEN_TREE,
+ };
+
virtual ~AttrInput () {}
// Unique pointer custom clone function
@@ -564,6 +571,8 @@ public:
// Returns whether attr input has been parsed to meta item syntax.
virtual bool is_meta_item () const = 0;
+ virtual AttrInputType get_attr_input_type () const = 0;
+
protected:
// pure virtual clone implementation
virtual AttrInput *clone_attr_input_impl () const = 0;
@@ -650,6 +659,11 @@ public:
bool check_cfg_predicate (const Session &session) const override;
+ AttrInputType get_attr_input_type () const final override
+ {
+ return AttrInput::AttrInputType::META_ITEM;
+ }
+
// Clones this object.
std::unique_ptr<AttrInputMetaItemContainer>
clone_attr_input_meta_item_container () const
@@ -767,6 +781,11 @@ public:
}
bool is_meta_item () const override { return false; }
+
+ AttrInputType get_attr_input_type () const final override
+ {
+ return AttrInput::AttrInputType::TOKEN_TREE;
+ }
};
/* Forward decl - definition moved to rust-expr.h as it requires LiteralExpr to