diff options
author | Philip Herron <philip.herron@embecosm.com> | 2022-07-04 16:56:46 +0100 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2022-07-08 12:46:30 +0100 |
commit | fb27d1452b31d5485b1fce692f14279472cf0baf (patch) | |
tree | 362332a85d7d4e27ed53f91a2f8293817fafc856 /gcc/rust/resolve/rust-name-resolver.h | |
parent | 31887c00fbdc7d607cf79b1042cb84d2c6db17e2 (diff) | |
download | gcc-fb27d1452b31d5485b1fce692f14279472cf0baf.zip gcc-fb27d1452b31d5485b1fce692f14279472cf0baf.tar.gz gcc-fb27d1452b31d5485b1fce692f14279472cf0baf.tar.bz2 |
Refactor mappings class and HIR lowering to be consistent
In order to support loading extern crates and use statements we needed to
clarify the usage of NodeId and HirId within gccrs. Each of these id's were
nested behind the CrateNum but the type resolution, linting and code-gen
passes do not support that level of nesting.
In order to get metadata exports and imports working lets focus on gccrs
supporting compilation of a single crate at a time. This means the crate
prefix only matters for imports and limits the complexity here. Down the
line there might be a way to leverage DefId's for all Path resolution
which could solve this problem but significant refactoring would be
required here to do this properly and its not nessecary for a basic working
rust compiler.
Diffstat (limited to 'gcc/rust/resolve/rust-name-resolver.h')
-rw-r--r-- | gcc/rust/resolve/rust-name-resolver.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/rust/resolve/rust-name-resolver.h b/gcc/rust/resolve/rust-name-resolver.h index e9f7c62..014628a 100644 --- a/gcc/rust/resolve/rust-name-resolver.h +++ b/gcc/rust/resolve/rust-name-resolver.h @@ -45,6 +45,8 @@ public: void append_reference_for_def (NodeId def, NodeId ref); bool have_references_for_node (NodeId def) const; bool decl_was_declared_here (NodeId def) const; + void debug () const; + std::string debug_str () const; CrateNum get_crate_num () const { return crate_num; } NodeId get_node_id () const { return node_id; } |