- Feb 21, 2023
-
-
Jakub Dupak authored
+ Return FunctionQualifiers as ref to work in ast dump gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Add missing visitor. * ast/rust-ast-dump.h: Add missing getter declaration. * ast/rust-ast-full-test.cc (BareFunctionType::as_string): Fix bare function string representation. * ast/rust-type.h (class BareFunctionType): Declare said getter. Signed-off-by:
Jakub Dupak <dev@jakubdupak.com>
-
Jakub Dupak authored
gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Add missing visitor. Signed-off-by:
Jakub Dupak <dev@jakubdupak.com>
-
Jakub Dupak authored
gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Add missing tuple type visitor. Signed-off-by:
Jakub Dupak <dev@jakubdupak.com>
-
Jakub Dupak authored
gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Add missing never type visitor. Signed-off-by:
Jakub Dupak <dev@jakubdupak.com>
-
Jakub Dupak authored
gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Add missing RawPointer visitor. Signed-off-by:
Jakub Dupak <dev@jakubdupak.com>
-
Jakub Dupak authored
gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Add missing array visitor Signed-off-by:
Jakub Dupak <dev@jakubdupak.com>
-
Jakub Dupak authored
gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Add missing slice visitor. Signed-off-by:
Jakub Dupak <dev@jakubdupak.com>
-
Jakub Dupak authored
This is currently needed for lifetimes to use the existing infrastructure. gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Add missing visitors. * ast/rust-ast-dump.h: Likewise. * ast/rust-ast.h: Add `get_lifetime_bounds` method. * ast/rust-item.h: Add missing getter for lifetimes. * ast/rust-type.h: Likewise. Signed-off-by:
Jakub Dupak <dev@jakubdupak.com>
-
Jakub Dupak authored
This is currently needed for lifetimes to use the existing infrastructure. gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Add new reference visitor wrapper. * ast/rust-ast-dump.h: Declare it. * ast/rust-item.h: Add mutable visibility getters. Signed-off-by:
Jakub Dupak <dev@jakubdupak.com>
-
Arthur Cohen authored
gcc/rust/ChangeLog: * typecheck/rust-tyty-call.cc (TypeCheckCallExpr::visit): Fix extra call to `delete`.
-
Dave authored
gcc/rust/ChangeLog: * ast/rust-item.h: Add location member. * hir/rust-ast-lower.cc (translate_visibility): Pass location argument. * hir/tree/rust-hir-item.h: Fix constructor to accept Location argument.
-
Raiki Tamura authored
gcc/rust/ChangeLog: * util/rust-lang-item.h: Add handling for `phantom_data` lang item. gcc/testsuite/ChangeLog: * rust/compile/torture/phantom_data.rs: New test.
-
Jakub Dupak authored
gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Add handling for unit structures. Signed-off-by:
Jakub Dupak <dev@jakubdupak.com>
-
Jakub Dupak authored
gcc/rust/ChangeLog: * ast/rust-ast-dump.h: Fix documentation. Signed-off-by:
Jakub Dupak <dev@jakubdupak.com>
-
Jakub Dupak authored
gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::go): Use new API. (Dump::format_function_param): Refactor. (Dump::visit_items_joined_by_separator): New function. (Dump::emit_attrib): Refactor. (Dump::visit_as_line): New function. (Dump::visit_items_as_lines): Likewise. (Dump::visit_items_as_block): Likewise. (Dump::visit): Use new API. (Dump::emit_visibility): Likewise. (Dump::emit_indented_string): Likewise. (Dump::emit_generic_params): Likewise. (Dump::format_tuple_field): Likewise. (Dump::format_struct_field): Likewise. (Dump::format_function_common): Likewise. (Dump::visit_function_common): Likewise. * ast/rust-ast-dump.h: Declare new functions and add documentation. Signed-off-by:
Jakub Dupak <dev@jakubdupak.com>
-
Jakub Dupak authored
gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Add new visit function for overloading. * ast/rust-ast-dump.h: Add documentation for layer. Signed-off-by:
Jakub Dupak <dev@jakubdupak.com>
-
Arthur Cohen authored
gcc/rust/ChangeLog: * backend/rust-builtins.cc (BuiltinsContext::setup_atomic_fns): Declare atomic load intrinsics. * backend/rust-compile-intrinsic.cc (atomic_load_handler_inner): New handler. (atomic_load_handler): Likewise. (unchecked_op_handler): Remove `static` function qualifier. (build_atomic_builtin_name): Handle load intrinsics. (atomic_store_handler_inner): New handler. gcc/testsuite/ChangeLog: * rust/compile/torture/intrinsics-3.rs: * rust/execute/torture/atomic_load.rs: New test.
-
Arthur Cohen authored
gcc/rust/ChangeLog: * backend/rust-compile-intrinsic.cc (check_for_basic_integer_type): New function. (build_atomic_builtin_name): Use HIR Type instead of `tree`. (atomic_store_handler_inner): Cleanup error handling. (unchecked_op_inner): Likewise. gcc/testsuite/ChangeLog: * rust/compile/torture/intrinsics-5.rs: Fix error message.
-
Arthur Cohen authored
gcc/rust/ChangeLog: * backend/rust-compile-intrinsic.cc (wrapping_op_handler): Refactor to return an `std::function`. (wrapping_op_handler_inner): Rename. (wrapping_add_handler): Remove function. (wrapping_sub_handler): Likewise. (wrapping_mul_handler): Likewise.
-
Arthur Cohen authored
gcc/rust/ChangeLog: * backend/rust-compile-intrinsic.cc (is_basic_integer_type): New function. (unchecked_op_inner): New handler. (unchecked_op_handler): New handler. gcc/testsuite/ChangeLog: * rust/compile/torture/intrinsics-6.rs: New test. * rust/compile/torture/intrinsics-7.rs: New test.
-
Arthur Cohen authored
gcc/rust/ChangeLog: * backend/rust-builtins.cc (BuiltinsContext::setup_atomic_fns): New function. (BuiltinsContext::setup): Call `setup_atomic_fns`. * backend/rust-builtins.h: Declare `setup_atomic_fns`. * backend/rust-compile-intrinsic.cc (atomic_store_handler_inner): New function. (atomic_store_handler): New handler. (make_unsigned_long_tree): Add helper around making unsigned long trees. (prefetch_data_handler): Use `make_unsigned_long_tree`. (build_atomic_builtin_name): New function. gcc/testsuite/ChangeLog: * rust/compile/torture/intrinsics-4.rs: New test. * rust/compile/torture/intrinsics-5.rs: New test. * rust/execute/torture/atomic_store.rs: New test.
-
Arthur Cohen authored
gcc/rust/ChangeLog: * backend/rust-constexpr.cc (build_anon_member_initialization): Workaround uninitialized values. (build_data_member_initialization): Likewise.
-
Arthur Cohen authored
gcc/rust/ChangeLog: * backend/rust-compile-intrinsic.cc (sorry_handler): New intrinsic handler. gcc/testsuite/ChangeLog: * rust/compile/torture/intrinsics-3.rs: New test.
-
Arthur Cohen authored
gcc/rust/ChangeLog: * expand/rust-macro-builtins.cc (MacroBuiltin::assert): Rename to... (MacroBuiltin::assert_handler): ..this. (MacroBuiltin::file): Rename to... (MacroBuiltin::file_handler): ..this. (MacroBuiltin::column): Rename to... (MacroBuiltin::column_handler): ..this. (MacroBuiltin::include_bytes): Rename to... (MacroBuiltin::include_bytes_handler): ..this. (MacroBuiltin::include_str): Rename to... (MacroBuiltin::include_str_handler): ..this. (MacroBuiltin::compile_error): Rename to... (MacroBuiltin::compile_error_handler): ..this. (MacroBuiltin::concat): Rename to... (MacroBuiltin::concat_handler): ..this. (MacroBuiltin::env): Rename to... (MacroBuiltin::env_handler): ..this. (MacroBuiltin::cfg): Rename to... (MacroBuiltin::cfg_handler): ..this. (MacroBuiltin::include): Rename to... (MacroBuiltin::include_handler): ..this. (MacroBuiltin::line): Rename to... (MacroBuiltin::line_handler): ..this. * expand/rust-macro-builtins.h: Rename all handlers. * util/rust-hir-map.cc (Mappings::insert_macro_def): Use new handler names.
-
Simon Cook authored
gcc/rust/ChangeLog: * util/rust-inline-visitor.h: Remove some offending system includes.
-
YizhePKU authored
gcc/rust/ChangeLog: * util/rust-inline-visitor.h: New file.
-
Philip Herron authored
gcc/rust/ChangeLog: * backend/rust-compile-expr.cc (CompileExpr::visit): Refactor checking of closures. (CompileExpr::generate_possible_fn_trait_call): New function. * backend/rust-compile-expr.h: Declare `generate_possible_fn_trait_call`. gcc/testsuite/ChangeLog: * rust/execute/torture/closure2.rs: New test.
-
Philip Herron authored
gcc/rust/ChangeLog: * typecheck/rust-tyty-bounds.cc (TypeCheckBase::get_predicate_from_bound): Add missing implementation.
-
Philip Herron authored
gcc/rust/ChangeLog: * Make-lang.in: Compile rust-ast-lower-type.cc. * ast/rust-path.h: Add `get_locus` method to `TypePathFunction`. * hir/rust-ast-lower-base.cc (ASTLowerTypePath::visit): Move implementation to rust-ast-lower-type.cc. (ASTLowerQualifiedPathInType::visit): Likewise. (ASTLoweringType::visit): Likewise. * hir/rust-ast-lower-type.h: Move implementations to source file. * hir/tree/rust-hir-path.h: Likewise. * hir/rust-ast-lower-type.cc: New file.
-
Philip Herron authored
gcc/rust/ChangeLog: * resolve/rust-ast-resolve-type.cc (ResolveRelativeTypePath::go): Add missing handling of function case.
-
Philip Herron authored
gcc/rust/ChangeLog: * backend/rust-compile-context.h: Add new functions: `insert_closure_decl` and `lookup_closure_decl`. * backend/rust-compile-expr.cc (CompileExpr::visit): Start compiling Closures properly. (CompileExpr::generate_closure_function): New function. (CompileExpr::generate_closure_fntype): Likewise. * backend/rust-compile-expr.h: Declare `generate_closure_function` and `generate_closure_fntype`. * backend/rust-compile-type.cc (TyTyResolveCompile::visit): Visit closure types properly. * backend/rust-mangle.cc (legacy_mangle_name): Add support for closures. * backend/rust-tree.h (RS_CLOSURE_FLAG): Add new tree macro. (RS_CLOSURE_TYPE_P): And checking for it on tree nodes. * typecheck/rust-tyty.cc (ClosureType::is_equal): Add implementation. gcc/testsuite/ChangeLog: * rust/execute/torture/closure1.rs: New test.
-
Philip Herron authored
gcc/rust/ChangeLog: * hir/tree/rust-hir-expr.h: Add `get_params` method. * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Typecheck closure nodes. (TypeCheckExpr::resolve_fn_trait_call): New function. * typecheck/rust-hir-type-check-expr.h: Declare `resolve_fn_trait_call` and `resolve_possible_fn_trait_call_method_name`. * typecheck/rust-hir-type-check.h: Declare `get_context_type`. * typecheck/rust-tyctx.cc (TypeCheckContextItem::get_context_type): New function. * typecheck/rust-tyty-cmp.h: Visit closures properly. * typecheck/rust-tyty-rules.h: Likewise. * typecheck/rust-tyty.cc (BaseType::bounds_compatible): Add commented out assertin. (ClosureType::as_string): Implement it. (ClosureType::clone): Fix closure cloning. (ClosureType::setup_fn_once_output): New function. * typecheck/rust-tyty.h: Improve `ClosureType` class and declare `setup_fn_once_output`.
-
Philip Herron authored
gcc/rust/ChangeLog: * checks/errors/rust-const-checker.cc (ConstChecker::visit): Visit closures properly. * checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit): Likewise. * checks/lints/rust-lint-marklive.h: Likewise.
-
Philip Herron authored
gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Simplify method call type checking by removing visitor and instead using one static cast. Use the new interface. * typecheck/rust-tyty-call.cc (TypeCheckMethodCallExpr::visit): Likewise. (TypeCheckMethodCallExpr::go): Likewise. (TypeCheckMethodCallExpr::check): Likewise. * typecheck/rust-tyty-call.h (class TypeCheckMethodCallExpr): Likewise. (class Argument): Likewise.
-
Philip Herron authored
gcc/rust/ChangeLog: * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit): Visit closure properly when name resolving. (ResolveExpr::resolve_closure_param): Implement closure name resolving. * resolve/rust-ast-resolve-expr.h: Declare visitors for closure types.
-
Philip Herron authored
gcc/rust/ChangeLog: * hir/rust-ast-lower-pattern.cc (ASTLoweringPattern::ASTLoweringPattern): Improve formatting. (ASTLoweringPattern::translate): Likewise. * hir/rust-ast-lower-pattern.h: Likewise. * resolve/rust-ast-resolve-expr.h: Likewise.
-
Philip Herron authored
gcc/rust/ChangeLog: * Make-lang.in: Add new object file for expression lowering. * ast/rust-expr.h: Move implementation of expr lowering to source file. * backend/rust-compile-block.h: Likewise. * backend/rust-compile-expr.cc (CompileExpr::visit): Likewise. * backend/rust-compile-expr.h: Likewise. * checks/errors/privacy/rust-privacy-reporter.cc (PrivacyReporter::visit): Likewise. * checks/errors/privacy/rust-privacy-reporter.h: Likewise. * checks/errors/rust-const-checker.cc (ConstChecker::visit): Likewise. * checks/errors/rust-const-checker.h: Likewise. * checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit): Likewise. * checks/errors/rust-unsafe-checker.h: Likewise. * hir/rust-ast-lower-base.h: Likewise. * hir/rust-ast-lower-expr.h (RUST_AST_LOWER_EXPR): Likewise. * hir/rust-ast-lower.cc (ASTLoweringBase::lower_closure_param): Likewise. * hir/rust-hir-dump.cc (Dump::visit): Likewise. * hir/rust-hir-dump.h: Likewise. * hir/tree/rust-hir-expr.h (class ClosureExpr): Likewise. (class ClosureExprInner): Likewise. (class ClosureExprInnerTyped): Likewise. * hir/tree/rust-hir-full-decls.h (class ClosureExprInner): Likewise. (class ClosureExprInnerTyped): Likewise. * hir/tree/rust-hir-full-test.cc (ClosureExprInnerTyped::as_string): Likewise. (ClosureExprInner::as_string): Likewise. (ClosureExprInner::accept_vis): Likewise. (ClosureExpr::accept_vis): Likewise. (ClosureExprInnerTyped::accept_vis): Likewise. * hir/tree/rust-hir-visitor.h: Likewise. * hir/tree/rust-hir.h (class Expr): Likewise. * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Likewise. * typecheck/rust-hir-type-check-expr.h: Likewise. * hir/rust-ast-lower-expr.cc: New file.
-
Philip Herron authored
gcc/rust/ChangeLog: * util/rust-lang-item.h: Add handling for `fn_once_output`.
-
Arthur Cohen authored
gcc/rust/ChangeLog: * ast/rust-ast-fragment.cc (Fragment::Fragment): Add better APIs. (Fragment::complete): New function. (Fragment::unexpanded): New function. * ast/rust-ast-fragment.h: Declare new APIs and add documentation. * expand/rust-attribute-visitor.h: Use new Fragment API. * expand/rust-macro-builtins.cc (MacroBuiltin::file): Likewise. (MacroBuiltin::column): Likewise. (MacroBuiltin::include_bytes): Likewise. (MacroBuiltin::include_str): Likewise. (MacroBuiltin::concat): Likewise. (MacroBuiltin::env): Likewise. (MacroBuiltin::cfg): Likewise. (MacroBuiltin::include): Likewise. (MacroBuiltin::line): Likewise. * expand/rust-macro-expand.cc (parse_many): Likewise. (transcribe_expression): Likewise. (transcribe_type): Likewise. * expand/rust-macro-expand.h (struct MacroExpander): Likewise.
-
Arthur Cohen authored
gcc/rust/ChangeLog: * ast/rust-ast.h (class ASTFragment): Remove old ASTFragment class. * ast/rust-macro.h (class MacroRulesDefinition): Use new Fragment API. * expand/rust-attribute-visitor.h: Likewise. * expand/rust-macro-builtins.cc (macro_end_token): Likewise. (MacroBuiltin::assert): Likewise. (MacroBuiltin::file): Likewise. (MacroBuiltin::column): Likewise. (MacroBuiltin::include_bytes): Likewise. (MacroBuiltin::include_str): Likewise. (MacroBuiltin::compile_error): Likewise. (MacroBuiltin::concat): Likewise. (MacroBuiltin::env): Likewise. (MacroBuiltin::cfg): Likewise. (MacroBuiltin::include): Likewise. (MacroBuiltin::line): Likewise. * expand/rust-macro-builtins.h: Likewise. * expand/rust-macro-expand.cc (MacroExpander::expand_decl_macro): Likewise. (MacroExpander::expand_invoc): Likewise. (MacroExpander::match_repetition): Likewise. (parse_many): Likewise. (transcribe_many_items): Likewise. (transcribe_many_ext): Likewise. (transcribe_many_trait_items): Likewise. (transcribe_many_impl_items): Likewise. (transcribe_many_trait_impl_items): Likewise. (transcribe_expression): Likewise. (transcribe_type): Likewise. (transcribe_on_delimiter): Likewise. (tokens_to_str): Likewise. * expand/rust-macro-expand.h (struct MacroExpander): Likewise. * util/rust-hir-map.cc (Mappings::insert_macro_def): Likewise.
-