Re: [PATCH v3] libcpp: add function to check XID properties

2023-10-16 Thread Arthur Cohen
Ping? Best, Arthur On 9/8/23 16:59, Arthur Cohen wrote: From: Raiki Tamura Fixed to include the enum's name which I had forgotten to commit. Thanks This commit adds a new function intended for checking the XID properties of a possibly unicode character, as well as the accompa

[PATCH v2 1/4] libgrust: Add entry for maintainers and stub changelog file.

2023-10-25 Thread Arthur Cohen
ChangeLog: * MAINTAINERS: Add maintainers for libgrust. contrib/ChangeLog: * gcc-changelog/git_commit.py: Add libgrust. * gcc_update: Add libgrust file dependencies Co-authored-by: Pierre-Emmanuel Patry --- MAINTAINERS | 1 + contrib/gcc-changel

[PATCH v2 2/4] libgrust: Add libproc_macro and build system

2023-10-25 Thread Arthur Cohen
From: Pierre-Emmanuel Patry Add some dummy files in libproc_macro along with its build system. libgrust/Changelog: * Makefile.am: New file. * configure.ac: New file. * libproc_macro/Makefile.am: New file. * libproc_macro/proc_macro.cc: New file. * libproc

[PATCH v2 3/4] build: Add libgrust as compilation modules

2023-10-25 Thread Arthur Cohen
From: Pierre-Emmanuel Patry Define the libgrust directory as a host compilation module as well as for targets. ChangeLog: * Makefile.def: Add libgrust as host & target module. * configure.ac: Add libgrust to host tools list. gcc/rust/ChangeLog: * config-lang.in: Add li

[PATCH v2 4/4] build: Regenerate build files

2023-10-25 Thread Arthur Cohen
From: Pierre-Emmanuel Patry Regenerate all build files. ChangeLog: * Makefile.in: * configure: Regenerate. libgrust/ChangeLog: * Makefile.in: New file. * aclocal.m4: New file. * configure: New file. * libproc_macro/Makefile.in: New file. libgm2

Re: [PATCH v2 3/4] build: Add libgrust as compilation modules

2023-10-26 Thread Arthur Cohen
Hi Thomas, On 10/25/23 23:40, Thomas Schwinge wrote: Hi! On 2023-10-25T13:06:48+0200, Arthur Cohen wrote: From: Pierre-Emmanuel Patry Define the libgrust directory as a host compilation module as well as for targets. I don't see a response to Richard's commen

Re: [PATCH] rust: Fix rust-tree.cc compilation on SPARC

2023-02-20 Thread Arthur Cohen
Thanks Rainer! Ok for trunk :) Kindly, -- Arthur On 2/20/23 11:36, Rainer Orth wrote: This patch commit 27a89f84c458ae938bc3eb92ad0d594c06fc3b42 Author: Thomas Schwinge Date: Fri Feb 17 23:36:20 2023 +0100 '#include "tm_p.h"' in 'gcc/rust/backend/rust-tree.cc' broke rust bootstrap

Rust front-end update

2023-02-21 Thread arthur . cohen
Hi everyone, This series contain the majority of gccrs commits which were present on our GitHub repository but did not have a Changelog entry yet. We have cleaned, rebased, tested and fixed all of these to contain proper Changelog entries as well as DCO signoff for big contributions. All of these

[committed 003/103] gccrs: dump: Emit visibility when dumping items

2023-02-21 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::emit_visibility): New function. (Dump::visit): Call into `emit_visibility`. (Dump::format_function_common): Likewise. * ast/rust-ast-dump.h: Declare `emit_visibility`. --- gcc/rust/ast/rust-ast

[committed 004/103] gccrs: Add catch for recusive type queries

2023-02-21 Thread arthur . cohen
From: Philip Herron When we have a type query where by generic substitution occurs we can hit the case where we need to Probe the bounds of the substited item to determine whether the the bounds are compatible this can cause us to end up querying the same type recursively. Fixes #1550 gcc/rust/

[committed 001/103] gccrs: Fix missing dead code analysis ICE on local enum definition

2023-02-21 Thread arthur . cohen
From: Philip Herron When resolving local enum's within a Block the name resolution info is not at the top of the stack so this patch introduces a new mappings class for miscellaneous name resolutions which can be used during path analaysis. Fixes #1272 gcc/rust/ChangeLog: * resolve/rus

[committed 008/103] gccrs: builtins: Move implementation into source file

2023-02-21 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * Make-lang.in: Add `rust-builtins.o` as target * backend/rust-builtins.h: Refactor to new file. * backend/rust-builtins.cc: New file. --- gcc/rust/Make-lang.in | 1 + gcc/rust/backend/rust-builtins.cc | 143

[committed 002/103] gccrs: visibility: Rename get_public_vis_type -> get_vis_type

2023-02-21 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * ast/rust-item.h: Rename get_public_vis_type. * hir/rust-ast-lower.cc (translate_visibility): Use new name. --- gcc/rust/ast/rust-item.h | 2 +- gcc/rust/hir/rust-ast-lower.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions

[committed 011/103] gccrs: Support looking up super traits for trait items

2023-02-21 Thread arthur . cohen
From: Philip Herron When supporting calls to super traits we need to allow lookups based on the super traits as specified on the TraitReferences. Fixes #1555 gcc/rust/ChangeLog: * typecheck/rust-hir-trait-ref.h (lookup_trait_item): Add lookup in super_trait. gcc/testsuite/Chan

[committed 009/103] gccrs: Track DefId on ADT variants

2023-02-21 Thread arthur . cohen
From: Philip Herron We must track the DefID on variants for algebraic data types as this will allow us to enforce unique'ness on path queries relating to this. gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-enumitem.cc (TypeCheckEnumItem::visit): Adjust VariantDef ctor call

[committed 006/103] gccrs: ast: dump assignment and compound assignment expr

2023-02-21 Thread arthur . cohen
From: David Faust gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Dump assignment and compound assignment expressions. --- gcc/rust/ast/rust-ast-dump.cc | 56 +-- 1 file changed, 54 insertions(+), 2 deletions(-) diff --git a/gcc/rust/as

[committed 012/103] gccrs: ast: dump: add emit_generic_params helper

2023-02-21 Thread arthur . cohen
From: David Faust gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): move generic params dump ... (Dump::emit_generic_params): ... here. * ast/rust-ast-dump.h (emit_generic_params): New. --- gcc/rust/ast/rust-ast-dump.cc | 30 +- gcc/ru

[committed 015/103] gccrs: intrinsics: Add data prefetching intrinsics

2023-02-21 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * backend/rust-builtins.cc (BuiltinsContext::setup): Declare prefetch intrinsics. * backend/rust-compile-intrinsic.cc (enum class Prefetch): Add kinds of prefetch intrinsics. (prefetch_data_handler): New function

[committed 007/103] gccrs: ast: dump If expressions

2023-02-21 Thread arthur . cohen
From: David Faust gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Implement visitor for If expressions. --- gcc/rust/ast/rust-ast-dump.cc | 22 +++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/gcc/rust/ast/rust-ast-dump.cc b/gcc/rus

[committed 016/103] gccrs: fix ICE on missing closing paren

2023-02-21 Thread arthur . cohen
From: Marc Poulhiès Fix crash (segfault) on a missing closing parenthesis when parsing the expressions in a block. The returned `expr` was missing a check before being used. Add corresponding test. Signed-off-by: Marc Poulhiès gcc/rust/ChangeLog: * parse/rust-parse-impl.h (Parser::pa

[committed 013/103] gccrs: ast: dump: add format_{tuple, struct}_field helpers

2023-02-21 Thread arthur . cohen
From: David Faust gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::format_tuple_field): New. (Dump::format_struct_field): New. * ast/rust-ast-dump.h (format_tuple_field): New. (format_struct_field): New. --- gcc/rust/ast/rust-ast-dump.cc | 17 +

[committed 005/103] gccrs: testing: try loop in const function

2023-02-21 Thread arthur . cohen
From: Faisal Abbas Signed-off-by: Faisal Abbas <90.abbasfai...@gmail.com> gcc/testsuite/ChangeLog: * rust/compile/const9.rs: New test. Signed-off-by: Faisal Abbas --- gcc/testsuite/rust/compile/const9.rs | 18 ++ 1 file changed, 18 insertions(+) create mode 100644 gc

[committed 014/103] gccrs: ast: dump structs, enums and unions

2023-02-21 Thread arthur . cohen
From: David Faust gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Fill empty functions for structs, enums and unions. --- gcc/rust/ast/rust-ast-dump.cc | 135 -- 1 file changed, 127 insertions(+), 8 deletions(-) diff --git a/gcc/rust/as

[committed 021/103] gccrs: Support type resolution on super traits on dyn objects

2023-02-21 Thread arthur . cohen
From: Philip Herron When checking if specified bounds satisfy other bounds we must lookup the super traits. To finish the support for super traits we need to redo the computation of method addresses to support super traits. Addresses #914 gcc/rust/ChangeLog: * backend/rust-compile.cc:

[committed 027/103] gccrs: ast: dump: ComparisonExpr and LazyBooleanExpr

2023-02-21 Thread arthur . cohen
From: David Faust gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Add dumps for ComparisonExpr and LazyBooleanExpr. --- gcc/rust/ast/rust-ast-dump.cc | 50 +-- 1 file changed, 48 insertions(+), 2 deletions(-) diff --git a/gcc/rust/ast/r

[committed 010/103] gccrs: Ensure uniqueness on Path probe's

2023-02-21 Thread arthur . cohen
From: Philip Herron When we lookup names in paths such as Foo::bar, foo is a type we resolve and then we lookup 'bar' based on what type Foo is which includes probing relevant bounds of this type. We currently return a vector of possible candidates and this patch changes it so that we return a se

[committed 018/103] gccrs: rust-ast-resolve-item: Add note about resolving glob uses

2023-02-21 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * resolve/rust-ast-resolve-item.cc (ResolveItem::visit): Add note for glob import resolving. --- gcc/rust/resolve/rust-ast-resolve-item.cc | 8 1 file changed, 8 insertions(+) diff --git a/gcc/rust/resolve/rust-ast-resolve

[committed 025/103] gccrs: ast: dump: fix extra newline in block without tail

2023-02-21 Thread arthur . cohen
From: David Faust gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Fix block formatting. --- gcc/rust/ast/rust-ast-dump.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/rust/ast/rust-ast-dump.cc b/gcc/rust/ast/rust-ast-dump.cc index 7cbdfa21fcb..3b

[committed 024/103] gccrs: Method resolution must support multiple candidates

2023-02-21 Thread arthur . cohen
From: Philip Herron This patch fixes bad method resolution in our operator_overload_9 case. When we have a &mut reference to something and we deref we must resolve to the mutable reference impl block. The interface we are using to resolve methods is the can_eq interface which allows for permissiv

[committed 032/103] gccrs: ast: dump TypeAlias

2023-02-21 Thread arthur . cohen
From: Jakub Dupak gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Add code for dumping type aliases. Signed-off-by: Jakub Dupak --- gcc/rust/ast/rust-ast-dump.cc | 20 ++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/gcc/rust/ast/rust-ast-d

[committed 029/103] gccrs: ast: dump: various simple Exprs

2023-02-21 Thread arthur . cohen
From: David Faust Adds dump for: - BorrowExpr - DereferenceExpr - ErrorPropagationExpr - NegationExpr - TypeCastExpr - GroupedExpr gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Add dump for, BorrowExpr, DereferenceExpr, ErrorPropagationExpr, NegationExpr, TypeCastEx

[committed 017/103] gccrs: mappings: Add MacroInvocation -> MacroRulesDef mappings

2023-02-21 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * util/rust-hir-map.h: Add new mappings. * util/rust-hir-map.cc (Mappings::insert_macro_invocation): Add insertion function into mappings. (Mappings::lookup_macro_invocation): Add lookup function for mappings. --- gcc/rust

[committed 023/103] gccrs: Add ABI mappings for rust-call to map to ABI::RUST

2023-02-21 Thread arthur . cohen
From: Philip Herron gcc/rust/ChangeLog: * util/rust-abi.cc (get_abi_from_string): Add missing "rust-call" possibility for ABI variant. --- gcc/rust/util/rust-abi.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gcc/rust/util/rust-abi.cc b/gcc/rust/util/rust-abi.cc index

[committed 037/103] gccrs: ast: Module: unloaded module and inner attributes

2023-02-21 Thread arthur . cohen
From: Jakub Dupak gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Properly handle unloaded modules. Signed-off-by: Jakub Dupak --- gcc/rust/ast/rust-ast-dump.cc | 41 +++ 1 file changed, 32 insertions(+), 9 deletions(-) diff --git a/gcc/rust/

[committed 038/103] gccrs: dump: Dump macro rules definition

2023-02-21 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Add missing visitors for macro definition dumping. (get_delimiters): New function. * ast/rust-ast-dump.h: Declare `get_delimiters` and add documentation. * ast/rust-macro.h: Add

[committed 020/103] gccrs: early-name-resolver: Add simple macro name resolution

2023-02-21 Thread arthur . cohen
From: Arthur Cohen This name resolver performs the same macro name resolution as what was previously done by the AttrVisitor visitor and macro expander. It also resolves macro expressions in builtin-macros properly, as well as expanded AST nodes when necessary. gcc/rust/ChangeLog

[committed 019/103] gccrs: ast: Add accept_vis() method to `GenericArg`

2023-02-21 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * ast/rust-path.h: Add `accept_vis` method to `GenericArg` class. --- gcc/rust/ast/rust-path.h | 17 + 1 file changed, 17 insertions(+) diff --git a/gcc/rust/ast/rust-path.h b/gcc/rust/ast/rust-path.h index b12e4c2bafa

[committed 040/103] gccrs: ast: Refactor ASTFragment -> Fragment class

2023-02-21 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * Make-lang.in: Add `rust-ast-fragment.o` object file. * ast/rust-ast-fragment.cc: New file. * ast/rust-ast-fragment.h: New file. --- gcc/rust/Make-lang.in | 1 + gcc/rust/ast/rust-ast-fragment.cc | 168

[committed 043/103] gccrs: Add missing fn_once_output langitem

2023-02-21 Thread arthur . cohen
From: Philip Herron gcc/rust/ChangeLog: * util/rust-lang-item.h: Add handling for `fn_once_output`. --- gcc/rust/util/rust-lang-item.h | 7 +++ 1 file changed, 7 insertions(+) diff --git a/gcc/rust/util/rust-lang-item.h b/gcc/rust/util/rust-lang-item.h index c7e0e5c811d..02eeaee60d

[committed 022/103] gccrs: Add mappings for fn_once lang item

2023-02-21 Thread arthur . cohen
From: Philip Herron gcc/rust/ChangeLog: * util/rust-lang-item.h: Add `fn_once` lang item. --- gcc/rust/util/rust-lang-item.h | 9 + 1 file changed, 9 insertions(+) diff --git a/gcc/rust/util/rust-lang-item.h b/gcc/rust/util/rust-lang-item.h index 4d9dc8a3d3a..c7e0e5c811d 100644

[committed 048/103] gccrs: Add closures to lints and error checking

2023-02-21 Thread arthur . cohen
From: Philip Herron 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. --- gcc/rust/checks/erro

[committed 042/103] gccrs: ast: Improve Fragment API

2023-02-21 Thread arthur . cohen
From: Arthur Cohen 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

[committed 031/103] gccrs: Refactor TraitResolver to not require a visitor

2023-02-21 Thread arthur . cohen
From: Philip Herron gcc/rust/ChangeLog: * typecheck/rust-hir-trait-resolve.cc (TraitResolver::TraitResolver): Do not nullptr init `resolved_trait_reference` anymore. (TraitResolver::resolve_path): Simplify function and rename to... (TraitResolver::resolve_path_to

[committed 026/103] gccrs: ast: dump: minor fixups to IfExpr formatting

2023-02-21 Thread arthur . cohen
From: David Faust gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Fix IfExpr formatting. --- gcc/rust/ast/rust-ast-dump.cc | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gcc/rust/ast/rust-ast-dump.cc b/gcc/rust/ast/rust-ast-dump.cc index 3b00c9fedb6..

[committed 045/103] gccrs: Formatting cleanup in HIR lowering pattern

2023-02-21 Thread arthur . cohen
From: Philip Herron 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: L

[committed 033/103] gccrs: Support outer attribute handling on trait items just like normal items

2023-02-21 Thread arthur . cohen
From: Philip Herron gcc/rust/ChangeLog: * hir/rust-ast-lower-base.h (class ItemWrapper): New class. * hir/rust-ast-lower-base.cc (ASTLoweringBase::handle_outer_attributes): Use `ItemWrapper` class. (ASTLoweringBase::handle_doc_item_attribute): Likewise. (

[committed 028/103] gccrs: ast: dump: ArrayExpr

2023-02-21 Thread arthur . cohen
From: David Faust gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Add dump code for ArrayExpr. --- gcc/rust/ast/rust-ast-dump.cc | 32 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/gcc/rust/ast/rust-ast-dump.cc b/gcc/rust/ast/r

[committed 053/103] gccrs: Add missing type resolution for function type segments

2023-02-21 Thread arthur . cohen
From: Philip Herron gcc/rust/ChangeLog: * typecheck/rust-tyty-bounds.cc (TypeCheckBase::get_predicate_from_bound): Add missing implementation. --- gcc/rust/typecheck/rust-tyty-bounds.cc | 69 +++--- 1 file changed, 62 insertions(+), 7 deletions(-) diff --gi

[committed 047/103] gccrs: Refactor method call type checking

2023-02-21 Thread arthur . cohen
From: Philip Herron 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 (TypeCheck

[committed 035/103] gccrs: dump: Dump items within modules

2023-02-21 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Dump items in modules properly. --- gcc/rust/ast/rust-ast-dump.cc | 18 +- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/gcc/rust/ast/rust-ast-dump.cc b/gcc/rust/ast/rust-ast

[committed 030/103] gccrs: ast: dump: RangeExprs

2023-02-21 Thread arthur . cohen
From: David Faust gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Add dump for RangeExprs. --- gcc/rust/ast/rust-ast-dump.cc | 31 +-- 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/gcc/rust/ast/rust-ast-dump.cc b/gcc/rust/ast/rust-a

[committed 054/103] gccrs: Support Closure calls as generic trait bounds

2023-02-21 Thread arthur . cohen
From: Philip Herron 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/tests

[committed 044/103] gccrs: Refactor expression hir lowering into cc file

2023-02-21 Thread arthur . cohen
From: Philip Herron 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::visi

[committed 061/103] gccrs: intrinsics: Add unchecked operation intrinsics

2023-02-21 Thread arthur . cohen
From: Arthur Cohen 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

[committed 046/103] gccrs: Add name resolution for closures

2023-02-21 Thread arthur . cohen
From: Philip Herron 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 visitor

[committed 034/103] gccrs: dump: Emit visibility when dumping items

2023-02-21 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * ast/rust-ast-dump.cc: Emit visibility when dumping items. --- gcc/rust/ast/rust-ast-dump.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/gcc/rust/ast/rust-ast-dump.cc b/gcc/rust/ast/rust-ast-dump.cc index fdcd97561bb..b7557bdee0c 100644

[committed 058/103] gccrs: intrinsics: Add `sorry_handler` intrinsic handler

2023-02-21 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * backend/rust-compile-intrinsic.cc (sorry_handler): New intrinsic handler. gcc/testsuite/ChangeLog: * rust/compile/torture/intrinsics-3.rs: New test. --- gcc/rust/backend/rust-compile-intrinsic.cc | 10 ++ gcc/testsuite

[committed 051/103] gccrs: Add missing name resolution to Function type-path segments

2023-02-21 Thread arthur . cohen
From: Philip Herron gcc/rust/ChangeLog: * resolve/rust-ast-resolve-type.cc (ResolveRelativeTypePath::go): Add missing handling of function case. --- gcc/rust/resolve/rust-ast-resolve-type.cc | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/gcc

[committed 036/103] gccrs: dump: Fix module dumping

2023-02-21 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Fix formatting when dumping modules. --- gcc/rust/ast/rust-ast-dump.cc | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gcc/rust/ast/rust-ast-dump.cc b/gcc/rust/ast/rust-ast-dump.cc

[committed 060/103] gccrs: intrinsics: Add early implementation for atomic_store_{seqcst, relaxed, release}

2023-02-21 Thread arthur . cohen
From: Arthur Cohen 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

[committed 059/103] gccrs: constexpr: Add `rust_sorry_at` in places relying on init values

2023-02-21 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * backend/rust-constexpr.cc (build_anon_member_initialization): Workaround uninitialized values. (build_data_member_initialization): Likewise. --- gcc/rust/backend/rust-constexpr.cc | 96 +++--- 1 file

[committed 052/103] gccrs: Add missing hir lowering to function type-path segments

2023-02-21 Thread arthur . cohen
From: Philip Herron 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.

[committed 039/103] gccrs: Add check for recursive trait cycles

2023-02-21 Thread arthur . cohen
From: Philip Herron gcc/rust/ChangeLog: * typecheck/rust-hir-trait-resolve.cc (TraitResolver::resolve_trait): Check if a trait query is currently in progress. * typecheck/rust-hir-type-check.h (class TraitQueryGuard): Add helpers around checking for trait querie

[committed 063/103] gccrs: intrinsics: Cleanup error handling around atomic_store_*

2023-02-21 Thread arthur . cohen
From: Arthur Cohen 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

[committed 073/103] gccrs: ast: Dump where clause and recursively needed nodes

2023-02-21 Thread arthur . cohen
From: Jakub Dupak 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

[committed 057/103] gccrs: builtins: Rename all bang macro handlers

2023-02-21 Thread arthur . cohen
From: Arthur Cohen 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

[committed 041/103] gccrs: rust: Replace uses of ASTFragment -> Fragment

2023-02-21 Thread arthur . cohen
From: Arthur Cohen 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

[committed 066/103] gccrs: ast: transform helper methods to visits and add methods to simplify repeated patterns

2023-02-21 Thread arthur . cohen
From: Jakub Dupak 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.

[committed 076/103] gccrs: ast: Dump raw pointer type

2023-02-21 Thread arthur . cohen
From: Jakub Dupak gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Add missing RawPointer visitor. Signed-off-by: Jakub Dupak --- gcc/rust/ast/rust-ast-dump.cc | 200 +++--- 1 file changed, 112 insertions(+), 88 deletions(-) diff --git a/gcc/rust/

[committed 065/103] gccrs: ast: visitor pattern -> overload syntax compatibility layer

2023-02-21 Thread arthur . cohen
From: Jakub Dupak 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 --- gcc/rust/ast/rust-ast-dump.cc | 7 +++ gcc/rust/ast/rust-ast-dump.h | 8

[committed 049/103] gccrs: Initial Type resolution for closures

2023-02-21 Thread arthur . cohen
From: Philip Herron 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-c

[committed 070/103] gccrs: add Location to AST::Visibility

2023-02-21 Thread arthur . cohen
From: Dave 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. --- gcc/rust/ast/rust-item.h | 19

[committed 064/103] gccrs: intrinsics: Implement atomic_load intrinsics

2023-02-21 Thread arthur . cohen
From: Arthur Cohen 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

[committed 050/103] gccrs: Closure support at CallExpr

2023-02-21 Thread arthur . cohen
From: Philip Herron 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_f

[committed 082/103] gccrs: ast: Dump impl trait type

2023-02-21 Thread arthur . cohen
From: Jakub Dupak gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Add missing visitor. Signed-off-by: Jakub Dupak --- gcc/rust/ast/rust-ast-dump.cc | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/gcc/rust/ast/rust-ast-dump.cc b/gcc/rust/ast/

[committed 072/103] gccrs: ast: add visit overload for references

2023-02-21 Thread arthur . cohen
From: Jakub Dupak 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.

[committed 068/103] gccrs: ast: Dump unit struct

2023-02-21 Thread arthur . cohen
From: Jakub Dupak gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Add handling for unit structures. Signed-off-by: Jakub Dupak --- gcc/rust/ast/rust-ast-dump.cc | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gcc/rust/ast/rust-ast-dump.cc b/gcc/rust/a

[committed 056/103] gccrs: rust: Allow gccrs to build on x86_64-apple-darwin with clang/libc++

2023-02-21 Thread arthur . cohen
From: Simon Cook gcc/rust/ChangeLog: * util/rust-inline-visitor.h: Remove some offending system includes. --- gcc/rust/util/rust-inline-visitor.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/gcc/rust/util/rust-inline-visitor.h b/gcc/rust/util/rust-inline-visitor.h index 18920d

[committed 083/103] gccrs: ast: Dump trait object type

2023-02-21 Thread arthur . cohen
From: Jakub Dupak gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Add missing visitor. Signed-off-by: Jakub Dupak --- gcc/rust/ast/rust-ast-dump.cc | 17 + 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/gcc/rust/ast/rust-ast-dump.cc b/gcc/rust

[committed 075/103] gccrs: ast: Dump array type

2023-02-21 Thread arthur . cohen
From: Jakub Dupak gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Add missing array visitor Signed-off-by: Jakub Dupak --- gcc/rust/ast/rust-ast-dump.cc | 7 +++ 1 file changed, 7 insertions(+) diff --git a/gcc/rust/ast/rust-ast-dump.cc b/gcc/rust/ast/rust-ast-dump.cc i

[committed 080/103] gccrs: ast: Dump bare function type

2023-02-21 Thread arthur . cohen
From: Jakub Dupak + 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 b

[committed 055/103] gccrs: Implement the inline visitor

2023-02-21 Thread arthur . cohen
From: YizhePKU gcc/rust/ChangeLog: * util/rust-inline-visitor.h: New file. --- gcc/rust/util/rust-inline-visitor.h | 95 + 1 file changed, 95 insertions(+) create mode 100644 gcc/rust/util/rust-inline-visitor.h diff --git a/gcc/rust/util/rust-inline-visitor

[committed 085/103] gccrs: ast: Dump trait object type one bound

2023-02-21 Thread arthur . cohen
From: Jakub Dupak gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Add missing visitor. Signed-off-by: Jakub Dupak --- gcc/rust/ast/rust-ast-dump.cc | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/gcc/rust/ast/rust-ast-dump.cc b/gcc/rust/ast/ru

[committed 077/103] gccrs: ast: Dump never type

2023-02-21 Thread arthur . cohen
From: Jakub Dupak gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Add missing never type visitor. Signed-off-by: Jakub Dupak --- gcc/rust/ast/rust-ast-dump.cc | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gcc/rust/ast/rust-ast-dump.cc b/gcc/rust/a

[committed 090/103] gccrs: ast: Dump no comma after self in fn params if it is the last one

2023-02-21 Thread arthur . cohen
From: Jakub Dupak gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Fix dumping of fn params. Signed-off-by: Jakub Dupak --- gcc/rust/ast/rust-ast-dump.cc | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/gcc/rust/ast/rust-ast-dump.cc b/gcc/

[committed 093/103] gccrs: Get rid of make builtin macro

2023-02-21 Thread arthur . cohen
From: Philip Herron This macro is a mess and a helper method is much better for this case. gcc/rust/ChangeLog: * resolve/rust-name-resolver.cc (MKBUILTIN_TYPE): Remove macro. (Rib::Rib): Remove `mappings` field. (Resolver::generate_builtins): Use `setup_builtin` instead

[committed 079/103] gccrs: ast: Dump inferred type

2023-02-21 Thread arthur . cohen
From: Jakub Dupak gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Add missing visitor. Signed-off-by: Jakub Dupak --- gcc/rust/ast/rust-ast-dump.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gcc/rust/ast/rust-ast-dump.cc b/gcc/rust/ast/rust-ast-dump.cc index 9393

[committed 062/103] gccrs: intrinsics: Use lambdas for wrapping_ intrinsics

2023-02-21 Thread arthur . cohen
From: Arthur Cohen 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

[committed 095/103] gccrs: Add closure binding's tracking to name resolution

2023-02-21 Thread arthur . cohen
From: Philip Herron When we have a closure block referencing variables in a parent function, we must track what these are. We do this by having a context of closures so if we have a variable reference and its declared in a rib whose node id is less than the node id of the closure's node id we kno

[committed 084/103] gccrs: ast: Dump parenthesised type

2023-02-21 Thread arthur . cohen
From: Jakub Dupak gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Add missing visitor. Signed-off-by: Jakub Dupak --- gcc/rust/ast/rust-ast-dump.cc | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/gcc/rust/ast/rust-ast-dump.cc b/gcc/rust/ast/ru

[committed 097/103] gccrs: Add initial support for argument capture of closures

2023-02-21 Thread arthur . cohen
From: Philip Herron When we have a closure expression that captures a parent function's variable we must setup the closure data to contain this. Ignoring moveability and mutability requires for now, this patch creates the closure structure with fields for each of the captured variables. When it c

[committed 067/103] gccrs: ast: refer correctly to arguments in docs-strings

2023-02-21 Thread arthur . cohen
From: Jakub Dupak gcc/rust/ChangeLog: * ast/rust-ast-dump.h: Fix documentation. Signed-off-by: Jakub Dupak --- gcc/rust/ast/rust-ast-dump.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gcc/rust/ast/rust-ast-dump.h b/gcc/rust/ast/rust-ast-dump.h index 7a805

[committed 094/103] gccrs: Refactor name resolver to take a Rib::ItemType

2023-02-21 Thread arthur . cohen
From: Philip Herron This allows us to track the type of declaration that is stored within a Rib. gcc/rust/ChangeLog: * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit): Add Rib argument. (ResolveExpr::resolve_closure_param): Likewise. * resolve/rust-ast-resolve-imp

[committed 086/103] gccrs: ast: Dump type param type

2023-02-21 Thread arthur . cohen
From: Jakub Dupak gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Add missing visitor. Signed-off-by: Jakub Dupak --- gcc/rust/ast/rust-ast-dump.cc | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/gcc/rust/ast/rust-ast-dump.cc b/gcc/rust/ast

[committed 069/103] gccrs: add lang item "phantom_data"

2023-02-21 Thread arthur . cohen
From: Raiki Tamura 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. --- gcc/rust/util/rust-lang-item.h | 9 + gcc/testsuite/rust/compi

[committed 103/103] gccrs: add math intrinsics

2023-02-21 Thread arthur . cohen
From: Raiki Tamura gcc/rust/ChangeLog: * backend/rust-builtins.cc (BuiltinsContext::setup_math_fns): New functions. gcc/testsuite/ChangeLog: * rust/compile/torture/intrinsics-math.rs: New test. --- gcc/rust/backend/rust-builtins.cc | 122 +++- .../rust/com

[committed 089/103] gccrs: ast: Dump remove /* stmp */ comment to not clutter the dump

2023-02-21 Thread arthur . cohen
From: Jakub Dupak gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Remove extraneous string when dumping statements. Signed-off-by: Jakub Dupak --- gcc/rust/ast/rust-ast-dump.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gcc/rust/ast/rust-as

[committed 071/103] gccrs: typecheck: Fix overzealous `delete` call

2023-02-21 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * typecheck/rust-tyty-call.cc (TypeCheckCallExpr::visit): Fix extra call to `delete`. --- gcc/rust/typecheck/rust-tyty-call.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/gcc/rust/typecheck/rust-tyty-call.cc b/gcc/rust/typecheck

[committed 100/103] gccrs: Cleanup unused parameters to fix the bootstrap build

2023-02-21 Thread arthur . cohen
From: Philip Herron gcc/rust/ChangeLog: * backend/rust-compile-type.cc (TyTyResolveCompile::visit): Remove unused parameters. * backend/rust-constexpr.cc (constant_value_1): Likewise. (fold_non_dependent_init): Likewise. * backend/rust-tree.cc (publicly_uniquely_

[committed 091/103] gccrs: Remove default location. Add visibility location to create_* functions

2023-02-21 Thread arthur . cohen
From: Dave gcc/rust/ChangeLog: * ast/rust-item.h: Remoe default location for Visibility class. * parse/rust-parse-impl.h (Parser::parse_visibility): Pass proper location when instantiating visibilities. --- gcc/rust/ast/rust-item.h | 33 ++---

  1   2   3   4   5   6   7   8   9   10   >