diff options
author | Philip Herron <philip.herron@embecosm.com> | 2021-07-26 17:34:02 +0100 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2021-07-26 17:38:51 +0100 |
commit | 5f238bc0fdc083a692a72a39ab1d5890dbb6f338 (patch) | |
tree | 4d46ebe04691b12dcbc4ffcdbe1939bdf42a85fe /gcc/rust/ast/rust-ast.h | |
parent | 5b3909dd7487ddd41ffacf45150a4fff550e2fab (diff) | |
download | gcc-5f238bc0fdc083a692a72a39ab1d5890dbb6f338.zip gcc-5f238bc0fdc083a692a72a39ab1d5890dbb6f338.tar.gz gcc-5f238bc0fdc083a692a72a39ab1d5890dbb6f338.tar.bz2 |
Add name-resolution and HIR lowering for extern blocks
This is the initial patch to do the ground work to support extern blocks.
Type resolution and Generic output still needs to be done to actually
support extern blocks.
Addresses #421
Diffstat (limited to 'gcc/rust/ast/rust-ast.h')
-rw-r--r-- | gcc/rust/ast/rust-ast.h | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/gcc/rust/ast/rust-ast.h b/gcc/rust/ast/rust-ast.h index 3e3e185b..067e2f5b 100644 --- a/gcc/rust/ast/rust-ast.h +++ b/gcc/rust/ast/rust-ast.h @@ -1364,6 +1364,8 @@ public: class ExternalItem { public: + ExternalItem () : node_id (Analysis::Mappings::get ()->get_next_node_id ()) {} + virtual ~ExternalItem () {} // Unique pointer custom clone function @@ -1379,9 +1381,13 @@ public: virtual void mark_for_strip () = 0; virtual bool is_marked_for_strip () const = 0; + NodeId get_node_id () const { return node_id; } + protected: // Clone function implementation as pure virtual method virtual ExternalItem *clone_external_item_impl () const = 0; + + NodeId node_id; }; /* Data structure to store the data used in macro invocations and macro @@ -1513,36 +1519,36 @@ protected: return new MacroInvocationSemi (*this); } - /* Use covariance to implement clone function as returning this object rather - * than base */ + /* Use covariance to implement clone function as returning this object + * rather than base */ MacroInvocationSemi *clone_item_impl () const final override { return clone_macro_invocation_semi_impl (); } - /* Use covariance to implement clone function as returning this object rather - * than base */ + /* Use covariance to implement clone function as returning this object + * rather than base */ MacroInvocationSemi *clone_inherent_impl_item_impl () const final override { return clone_macro_invocation_semi_impl (); } - /* Use covariance to implement clone function as returning this object rather - * than base */ + /* Use covariance to implement clone function as returning this object + * rather than base */ MacroInvocationSemi *clone_trait_impl_item_impl () const final override { return clone_macro_invocation_semi_impl (); } - /* Use covariance to implement clone function as returning this object rather - * than base */ + /* Use covariance to implement clone function as returning this object + * rather than base */ MacroInvocationSemi *clone_trait_item_impl () const final override { return clone_macro_invocation_semi_impl (); } - /* Use covariance to implement clone function as returning this object rather - * than base */ + /* Use covariance to implement clone function as returning this object + * rather than base */ MacroInvocationSemi *clone_external_item_impl () const final override { return clone_macro_invocation_semi_impl (); |