-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make self param and variadic param Param, introduce Param class and make function parameters param too. Self can now be represented as a standard parameter and is thus no longer required as a separate function attribute. Prevent self pointers and allow self in standard functions during parsing so they could be rejected at a later stage. gcc/rust/ChangeLog: * ast/rust-ast-collector.cc (TokenCollector::visit): * expand/rust-cfg-strip.cc: * expand/rust-expand-visitor.cc: * resolve/rust-ast-resolve-item.cc (ResolveItem::visit): * resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit): * ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): * ast/rust-ast.cc (Function::Function): (Function::operator=): (TraitMethodDecl::as_string): * ast/rust-item.h (class Function): (class TraitMethodDecl): * checks/errors/rust-ast-validation.cc (ASTValidation::visit): * expand/rust-cfg-strip.cc (CfgStrip::maybe_strip_self_param): (CfgStrip::maybe_strip_trait_method_decl): (CfgStrip::visit): * expand/rust-derive-clone.cc (DeriveClone::clone_fn): * expand/rust-expand-visitor.cc (ExpandVisitor::expand_self_param): (ExpandVisitor::expand_trait_method_decl): (ExpandVisitor::visit): * expand/rust-expand-visitor.h: * hir/rust-ast-lower-base.cc (ASTLoweringBase::lower_self): * hir/rust-ast-lower-base.h: * parse/rust-parse-impl.h (Parser::parse_function): (Parser::parse_trait_item): (Parser::parse_self_param): * parse/rust-parse.h: * resolve/rust-ast-resolve-item.cc (ResolveTraitItems::visit): (ResolveItem::visit): * resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit): * ast/rust-ast-collector.cc (TokenCollector::visit): * ast/rust-ast-collector.h: * ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): * ast/rust-ast-visitor.h: * ast/rust-ast.cc (Function::Function): (Function::operator=): (Function::as_string): (FunctionParam::accept_vis): (SelfParam::accept_vis): (VariadicParam::accept_vis): (VariadicParam::as_string): (TraitItemFunc::TraitItemFunc): (TraitItemFunc::operator=): (TraitFunctionDecl::as_string): (TraitItemMethod::TraitItemMethod): (TraitItemMethod::operator=): (TraitMethodDecl::as_string): * ast/rust-ast.h (struct Visibility): (class VisItem): * ast/rust-expr.h: * ast/rust-item.h (class Param): (class SelfParam): (class FunctionParam): (class VariadicParam): (struct Visibility): (class VisItem): (class Function): (class TraitFunctionDecl): (class TraitMethodDecl): * checks/errors/rust-ast-validation.cc (ASTValidation::visit): * checks/errors/rust-ast-validation.h: * checks/errors/rust-feature-gate.h: * expand/rust-cfg-strip.cc (CfgStrip::maybe_strip_function_params): (CfgStrip::visit): * expand/rust-cfg-strip.h: * expand/rust-derive.h: * expand/rust-expand-visitor.cc (ExpandVisitor::expand_function_params): (ExpandVisitor::visit): * expand/rust-expand-visitor.h: * hir/rust-ast-lower-base.cc (ASTLoweringBase::visit): * hir/rust-ast-lower-base.h: * hir/rust-ast-lower-implitem.h: * hir/rust-ast-lower-item.cc (ASTLoweringItem::visit): * metadata/rust-export-metadata.cc (ExportContext::emit_function): * parse/rust-parse-impl.h (Parser::parse_function): (Parser::parse_function_params): (Parser::parse_function_param): (Parser::parse_trait_item): (Parser::parse_method): * parse/rust-parse.h: * resolve/rust-ast-resolve-base.cc (ResolverBase::visit): * resolve/rust-ast-resolve-base.h: * resolve/rust-ast-resolve-item.cc (ResolveTraitItems::visit): (ResolveItem::visit): * resolve/rust-ast-resolve-stmt.h: * resolve/rust-default-resolver.cc (DefaultResolver::visit): * resolve/rust-default-resolver.h: * resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit): * resolve/rust-early-name-resolver.h: * util/rust-attributes.cc (AttributeChecker::visit): * util/rust-attributes.h: * parse/rust-parse-impl.h (Parser::parse_self_param): Error out with self pointers and prevent the lexer from eating regular function parameters. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
- Loading branch information
Showing
34 changed files
with
1,089 additions
and
739 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.