aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend
diff options
context:
space:
mode:
authorPhilip Herron <philip.herron@embecosm.com>2022-08-23 16:19:04 +0100
committerArthur Cohen <arthur.cohen@embecosm.com>2022-12-13 14:00:04 +0100
commit85a8fe00f805e7889b4e67a98ae1d435c042166b (patch)
treed034c272bdd63d7c63132e816e63f284c0076b82 /gcc/rust/backend
parent1841081a8a306c1a220694a5ddb3a927cb4b2db3 (diff)
downloadgcc-85a8fe00f805e7889b4e67a98ae1d435c042166b.zip
gcc-85a8fe00f805e7889b4e67a98ae1d435c042166b.tar.gz
gcc-85a8fe00f805e7889b4e67a98ae1d435c042166b.tar.bz2
gccrs: Add name resolution pass to the Rust front-end
The name resolution is split into two phases, one toplevel pass which scans the whole "Crate" which iterates all items and nested items in modules to generate a context class full of CanonicalPath items. It also generates a hierarchy of parent->child and child->parent relationships using the AST NodeId for PathResolution in the second phase. The second phase drills into each item like functions and creates a stack of canonical paths for variables etc so that we can store information in a side table of usage variable 'a' resolves to NodeId '123' which refers to the NodeId of the "let a;" statement. gcc/rust/ * resolve/rust-ast-resolve-base.cc: New. * resolve/rust-ast-resolve-base.h: New. * resolve/rust-ast-resolve-expr.cc: New. * resolve/rust-ast-resolve-expr.h: New. * resolve/rust-ast-resolve-implitem.h: New. * resolve/rust-ast-resolve-item.cc: New. * resolve/rust-ast-resolve-item.h: New. * resolve/rust-ast-resolve-path.cc: New. * resolve/rust-ast-resolve-path.h: New. * resolve/rust-ast-resolve-pattern.cc: New. * resolve/rust-ast-resolve-pattern.h: New. * resolve/rust-ast-resolve-stmt.cc: New. * resolve/rust-ast-resolve-stmt.h: New. * resolve/rust-ast-resolve-struct-expr-field.cc: New. * resolve/rust-ast-resolve-struct-expr-field.h: New. * resolve/rust-ast-resolve-toplevel.h: New. * resolve/rust-ast-resolve-type.cc: New. * resolve/rust-ast-resolve-type.h: New. * resolve/rust-ast-resolve.cc: New. * resolve/rust-ast-resolve.h: New. * resolve/rust-ast-verify-assignee.h: New. * resolve/rust-name-resolver.cc: New. * resolve/rust-name-resolver.h: New.
Diffstat (limited to 'gcc/rust/backend')
0 files changed, 0 insertions, 0 deletions