diff options
author | Kushal Pal <kushalpal109@gmail.com> | 2024-01-26 13:21:37 +0530 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2024-02-07 12:40:24 +0100 |
commit | 1e114b62e6e4941e9d6ed69c005e5901b6b5f21b (patch) | |
tree | a98f374b0d1df3c237c276dc996a5b119db3d4e4 /gcc/rust/ast/rust-ast-collector.cc | |
parent | 6e9dad6a7943a37aba5b1a0609bb9e46741dd1c8 (diff) | |
download | gcc-1e114b62e6e4941e9d6ed69c005e5901b6b5f21b.zip gcc-1e114b62e6e4941e9d6ed69c005e5901b6b5f21b.tar.gz gcc-1e114b62e6e4941e9d6ed69c005e5901b6b5f21b.tar.bz2 |
gccrs: Remove obsolete classes and functions.
Trait functions now use AST::Function class, so classes
AST::TraitItemFunc, AST::TraitItemMethod, AST::TraitFunctionDecl,
AST::TraitMethodDecl and their related functions can be removed.
gcc/rust/ChangeLog:
* ast/rust-ast-collector.cc (TokenCollector::visit):
Remove obsolete classes and functions.
* ast/rust-ast-collector.h:
Likewise.
* ast/rust-ast-full-decls.h (class TraitFunctionDecl):
Likewise.
(class TraitItemFunc):
Likewise.
(class TraitMethodDecl):
Likewise.
(class TraitItemMethod):
Likewise.
* ast/rust-ast-visitor.cc (DefaultASTVisitor::visit):
Likewise.
* ast/rust-ast-visitor.h:
Likewise.
* ast/rust-ast.cc (TraitItemFunc::TraitItemFunc):
Likewise.
(TraitItemFunc::operator=):
Likewise.
(TraitItemFunc::as_string):
Likewise.
(TraitFunctionDecl::as_string):
Likewise.
(TraitItemMethod::TraitItemMethod):
Likewise.
(TraitItemMethod::operator=):
Likewise.
(TraitItemMethod::as_string):
Likewise.
(TraitMethodDecl::as_string):
Likewise.
(TraitItemFunc::accept_vis):
Likewise.
(TraitItemMethod::accept_vis):
Likewise.
* ast/rust-item.h (class TraitFunctionDecl):
Likewise.
(class TraitItemFunc):
Likewise.
(class TraitMethodDecl):
Likewise.
(class TraitItemMethod):
Likewise.
* checks/errors/rust-ast-validation.cc (ASTValidation::visit):
Likewise.
* checks/errors/rust-ast-validation.h:
Likewise.
* checks/errors/rust-feature-gate.h:
Likewise.
* expand/rust-cfg-strip.cc (CfgStrip::maybe_strip_trait_function_decl):
Likewise.
(CfgStrip::maybe_strip_trait_method_decl):
Likewise.
(CfgStrip::visit):
Likewise.
* expand/rust-cfg-strip.h:
Likewise.
* expand/rust-derive.h:
Likewise.
* expand/rust-expand-visitor.cc (ExpandVisitor::expand_trait_function_decl):
Likewise.
(ExpandVisitor::expand_trait_method_decl):
Likewise.
(ExpandVisitor::visit):
Likewise.
* expand/rust-expand-visitor.h:
Likewise.
* hir/rust-ast-lower-base.cc (ASTLoweringBase::visit):
Likewise.
* hir/rust-ast-lower-base.h:
Likewise.
* hir/rust-ast-lower-implitem.cc (ASTLowerTraitItem::visit):
Likewise.
* hir/rust-ast-lower-implitem.h:
Likewise.
* resolve/rust-ast-resolve-base.cc (ResolverBase::visit):
Likewise.
* resolve/rust-ast-resolve-base.h:
Likewise.
* resolve/rust-ast-resolve-implitem.h (visit):
Likewise.
* resolve/rust-ast-resolve-item.cc (ResolveTraitItems::visit):
Likewise.
* resolve/rust-ast-resolve-item.h:
Likewise.
* resolve/rust-default-resolver.cc (DefaultResolver::visit):
Likewise.
* resolve/rust-default-resolver.h:
Likewise.
* resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit):
Likewise.
* resolve/rust-toplevel-name-resolver-2.0.h:
Likewise.
* util/rust-attributes.cc (AttributeChecker::visit):
Likewise.
* util/rust-attributes.h:
Likewise.
Signed-off-by: Kushal Pal <kushalpal109@gmail.com>
Diffstat (limited to 'gcc/rust/ast/rust-ast-collector.cc')
-rw-r--r-- | gcc/rust/ast/rust-ast-collector.cc | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/gcc/rust/ast/rust-ast-collector.cc b/gcc/rust/ast/rust-ast-collector.cc index d5a98f1..fb0e6f9 100644 --- a/gcc/rust/ast/rust-ast-collector.cc +++ b/gcc/rust/ast/rust-ast-collector.cc @@ -1949,23 +1949,6 @@ TokenCollector::visit_function_common (std::unique_ptr<Type> &return_type, } void -TokenCollector::visit (TraitItemFunc &item) -{ - auto func = item.get_trait_function_decl (); - auto id = func.get_identifier ().as_string (); - - push (Rust::Token::make (FN_KW, item.get_locus ())); - push (Rust::Token::make_identifier (UNDEF_LOCATION, std::move (id))); - push (Rust::Token::make (LEFT_PAREN, UNDEF_LOCATION)); - - visit_items_joined_by_separator (func.get_function_params ()); - - push (Rust::Token::make (RIGHT_PAREN, UNDEF_LOCATION)); - - visit_function_common (func.get_return_type (), item.get_definition ()); -} - -void TokenCollector::visit (SelfParam ¶m) { if (param.get_has_ref ()) @@ -1988,23 +1971,6 @@ TokenCollector::visit (SelfParam ¶m) } void -TokenCollector::visit (TraitItemMethod &item) -{ - auto method = item.get_trait_method_decl (); - auto id = method.get_identifier ().as_string (); - - push (Rust::Token::make (FN_KW, item.get_locus ())); - push (Rust::Token::make_identifier (UNDEF_LOCATION, std::move (id))); - push (Rust::Token::make (LEFT_PAREN, UNDEF_LOCATION)); - - visit_items_joined_by_separator (method.get_function_params (), COMMA); - - push (Rust::Token::make (RIGHT_PAREN, UNDEF_LOCATION)); - - visit_function_common (method.get_return_type (), item.get_definition ()); -} - -void TokenCollector::visit (TraitItemConst &item) { auto id = item.get_identifier ().as_string (); |