diff options
Diffstat (limited to 'gcc/rust/ast/rust-ast.h')
-rw-r--r-- | gcc/rust/ast/rust-ast.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/gcc/rust/ast/rust-ast.h b/gcc/rust/ast/rust-ast.h index 392c36a..b61c8c3 100644 --- a/gcc/rust/ast/rust-ast.h +++ b/gcc/rust/ast/rust-ast.h @@ -1139,11 +1139,14 @@ private: Location locus; + NodeId node_id; + public: // Constructor Lifetime (LifetimeType type, std::string name = std::string (), Location locus = Location ()) - : lifetime_type (type), lifetime_name (std::move (name)), locus (locus) + : lifetime_type (type), lifetime_name (std::move (name)), locus (locus), + node_id (Analysis::Mappings::get ()->get_next_node_id ()) {} // Creates an "error" lifetime. @@ -1159,6 +1162,14 @@ public: void accept_vis (ASTVisitor &vis) override; + LifetimeType get_lifetime_type () { return lifetime_type; } + + Location get_locus () { return locus; } + + std::string get_lifetime_name () const { return lifetime_name; } + + NodeId get_node_id () const { return node_id; } + protected: /* Use covariance to implement clone function as returning this object rather * than base */ |