-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Function instead of TraitItemFunc or TraitItemMethod
gcc/rust/ChangeLog: * ast/rust-item.h (RUST_AST_ITEM_H): Make get_definition() public. * backend/rust-compile-implitem.cc (CompileTraitItem::visit): Use Function instead of TraitItemFunc. * backend/rust-compile-implitem.h: Add visitor for HIR::Function. * backend/rust-mangle-v0.cc (v0_path): Rename get_item_kind() to get trait_item_kind(). * checks/errors/rust-ast-validation.cc (ASTValidation::visit): TRAIT is valid context for function as it will be used instead of TraitItemFunc. * hir/rust-ast-lower-implitem.h: Lower Function as a trait item. * hir/tree/rust-hir-item.h (class Function): Make Function inherit from TraitItem and add necessary functions, also add necessary parameters for constructors. * hir/tree/rust-hir-visitor.h: Add vistor for Function in HIRTraitItemVisitor. * hir/tree/rust-hir.cc (Function::accept_vis): Add accept_vis for Function. * hir/tree/rust-hir.h: Rename get_item_kind() to get trait_item_kind(). * parse/rust-parse-impl.h (Parser::parse_trait_item): Return AST::Function instead of AST::TraitItemFunc or AST::TriatItemMethod. * typecheck/rust-hir-dot-operator.cc (MethodResolver::select): Rename get_item_kind() to get trait_item_kind(). * typecheck/rust-hir-trait-reference.cc (TraitItemReference::get_tyty): Use HIR::Function instead of HIR::TraitItemFunc. * typecheck/rust-hir-trait-reference.h: Add functions for Function instead of TraitItemFunc. * typecheck/rust-hir-trait-resolve.cc (ResolveTraitItemToRef::visit): Add visit to Function. (TraitItemReference::on_resolved): Use HIR::Function instead of HIR::TraitItemFunc. (TraitItemReference::resolve_item): Add resolve_item() for Function. * typecheck/rust-hir-trait-resolve.h: Add visitor for Function. * typecheck/rust-hir-type-check.cc (TraitItemReference::get_type_from_fn): Add overload for Function. * typecheck/rust-tyty.cc (ClosureType::setup_fn_once_output): Rename get_item_kind() to get trait_item_kind(). Signed-off-by: Kushal Pal <[email protected]>
- Loading branch information
Showing
18 changed files
with
382 additions
and
149 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
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.