aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/ast/rust-ast.h
diff options
context:
space:
mode:
authorSimplyTheOther <simplytheother@gmail.com>2021-02-11 12:15:39 +0800
committerSimplyTheOther <simplytheother@gmail.com>2021-02-11 12:15:39 +0800
commit7d4ed9d38c7a636408a262f70aa69d2a34e2169d (patch)
tree915c10b77703d0ef8d074775ddea95eb0f728cab /gcc/rust/ast/rust-ast.h
parentcfd1d805ff5921480d9badd7d215e1b1deb33aca (diff)
parent0c7d0135663b6f0d94e0ffd931366ba2b32f8b2c (diff)
downloadgcc-7d4ed9d38c7a636408a262f70aa69d2a34e2169d.zip
gcc-7d4ed9d38c7a636408a262f70aa69d2a34e2169d.tar.gz
gcc-7d4ed9d38c7a636408a262f70aa69d2a34e2169d.tar.bz2
Merge branch 'master' of https://github.com/redbrain/gccrs
Diffstat (limited to 'gcc/rust/ast/rust-ast.h')
-rw-r--r--gcc/rust/ast/rust-ast.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/gcc/rust/ast/rust-ast.h b/gcc/rust/ast/rust-ast.h
index 14816e2..b34525e 100644
--- a/gcc/rust/ast/rust-ast.h
+++ b/gcc/rust/ast/rust-ast.h
@@ -1152,11 +1152,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.
@@ -1172,6 +1175,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 */