diff options
author | Arthur Cohen <arthur.cohen@embecosm.com> | 2024-06-24 18:25:15 +0200 |
---|---|---|
committer | CohenArthur <arthur.cohen@embecosm.com> | 2024-08-19 12:39:49 +0000 |
commit | d44051dea3036534b672684d22c7adf4f0684f9f (patch) | |
tree | 2520c760209dbb22478ab89e7d07fdfa391feeb6 /gcc/rust/util/rust-attributes.cc | |
parent | 530b6121cf5db17eb2da34aa60e911c23e66918d (diff) | |
download | gcc-d44051dea3036534b672684d22c7adf4f0684f9f.zip gcc-d44051dea3036534b672684d22c7adf4f0684f9f.tar.gz gcc-d44051dea3036534b672684d22c7adf4f0684f9f.tar.bz2 |
ast: Introduce class hierarchy for lang item paths
Create a base Path class which is derived into two children classes for
regular paths and lang item paths. This allows it to hold either the
segments of a fully formed path, or the node ID of a lang-item path.
This is required in order to create these special paths
which do not have segments, and do not necessarily have a canonical
form - they only depend on where the item was defined.
gcc/rust/ChangeLog:
* ast/rust-ast-full-decls.h (class PathPattern): Rename PathPattern to...
(class Path): ...Path
* ast/rust-ast-collector.cc (TokenCollector::visit): Add required methods
for LangItemPath and RegularPath.
* ast/rust-ast-collector.h: Likewise.
* ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Likewise.
* ast/rust-ast-visitor.h: Likewise.
* ast/rust-path.cc (PathPattern::as_string): Likewise.
(RegularPath::as_string): Likewise.
(LangItemPath::as_string): Likewise.
(PathPattern::convert_to_simple_path): Likewise.
(RegularPath::convert_to_simple_path): Likewise.
(RegularPath::accept_vis): Likewise.
(LangItemPath::accept_vis): Likewise.
(PathInExpression::as_string): Likewise.
(QualifiedPathInExpression::as_string): Likewise.
* ast/rust-path.h (class PathPattern): Likewise.
(class Path): Likewise.
(class RegularPath): Likewise.
(class LangItemPath): Likewise.
(class PathInExpression): Likewise.
(class QualifiedPathInExpression): Likewise.
* ast/rust-pattern.h (class PathPattern): Likewise.
(class Path): Likewise.
* expand/rust-derive.h: Likewise.
* hir/rust-ast-lower-base.cc (ASTLoweringBase::visit): Likewise.
* hir/rust-ast-lower-base.h: Likewise.
* resolve/rust-ast-resolve-base.cc (ResolverBase::visit): Likewise.
* resolve/rust-ast-resolve-base.h: Likewise.
Diffstat (limited to 'gcc/rust/util/rust-attributes.cc')
0 files changed, 0 insertions, 0 deletions