aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/resolve/rust-name-resolver.h
diff options
context:
space:
mode:
authorPhilip Herron <philip.herron@embecosm.com>2022-07-04 16:56:46 +0100
committerPhilip Herron <philip.herron@embecosm.com>2022-07-08 12:46:30 +0100
commitfb27d1452b31d5485b1fce692f14279472cf0baf (patch)
tree362332a85d7d4e27ed53f91a2f8293817fafc856 /gcc/rust/resolve/rust-name-resolver.h
parent31887c00fbdc7d607cf79b1042cb84d2c6db17e2 (diff)
downloadgcc-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.h2
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; }