[COMMITTED 076/141] gccrs: fix name resolution for generics where type param is declared later

2025-03-24 Thread arthur . cohen
From: Philip Herron Rust allows you to use generics within type bounds when they are declared later on. This changes the name resolution to walk the genric params in two passes to ensure the type parameters are setup before drilling down into the type parameters This issue has exposed another ty

[COMMITTED 032/141] gccrs: Make foreverstack debug string const

2025-03-24 Thread arthur . cohen
From: Pierre-Emmanuel Patry Those function should not change anything within the foreverstack, it can therefore be made const. gcc/rust/ChangeLog: * resolve/rust-forever-stack.h: Make debug functions const. * resolve/rust-forever-stack.hxx: Likewise. Signed-off-by: Pierre-Emman

[COMMITTED 012/141] gccrs: Check for type paths nr2.0 can't handle yet

2025-03-24 Thread arthur . cohen
From: Owen Avery Some of our tests only work with name resolution 2.0 because the latter misinterprets type paths. This change should cause the compiler to error out if it would otherwise misinterpret a type path. A fix for type path resolution isn't included in this comment, since doing so would

[COMMITTED 040/141] gccrs: Add option_env! support

2025-03-24 Thread arthur . cohen
From: Liam Naddell gcc/rust/ChangeLog: * expand/rust-macro-builtins-utility.cc: Add macro expansion for option_env with eager expansion * expand/rust-macro-builtins.cc: Add option_env to builtin list * expand/rust-macro-builtins.h: Add option_env handler to header

[COMMITTED 061/141] gccrs: Add test case to show issue is fixed

2025-03-24 Thread arthur . cohen
From: Philip Herron This was fixed as part of: "gccrs: Fix compilation of trait-items which map to impl items" Fixes Rust-GCC#3402 gcc/testsuite/ChangeLog: * rust/compile/nr2/exclude: nr2 cant handle this * rust/compile/issue-3402-1.rs: New test. * rust/compile/issue-3

[COMMITTED 015/141] gccrs: Infer crate name after file opening

2025-03-24 Thread arthur . cohen
From: Dylan Gardner Fixes #3129. gcc/rust/ChangeLog: * rust-session-manager.cc (Session::handle_crate_name): Remove crate name inference (Session::compile_crate): Add crate name inference and error if inferred name is empty. Remove CompileOptions::get_instance ()

[COMMITTED 104/141] gccrs: lower: Always crash when lowering macro invocations

2025-03-24 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * hir/rust-ast-lower-base.cc (ASTLoweringBase::visit): Add base implementation for visitor. --- gcc/rust/hir/rust-ast-lower-base.cc | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/gcc/rust/hir/rust-ast

[COMMITTED 093/141] gccrs: derive(Eq): Also derive StructuralEq

2025-03-24 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * expand/rust-derive-eq.cc: Adapt functions to return two generated impls. * expand/rust-derive-eq.h: Likewise. * expand/rust-derive.cc (DeriveVisitor::derive): Likewise. --- gcc/rust/expand/rust-derive-eq.cc | 68

[COMMITTED 094/141] gccrs: derive(Eq): Create copies of Eq typepath to avoid NodeId confusion

2025-03-24 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * expand/rust-derive-eq.cc: Copy `Eq` typepath. --- gcc/rust/expand/rust-derive-eq.cc | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gcc/rust/expand/rust-derive-eq.cc b/gcc/rust/expand/rust-derive-eq.cc index 47a8350d2ff

[COMMITTED 100/141] gccrs: derive(Hash): Add implementation.

2025-03-24 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * Make-lang.in: Compile it. * expand/rust-derive.cc (DeriveVisitor::derive): Call it. * expand/rust-derive-hash.cc: New file. * expand/rust-derive-hash.h: New file. gcc/testsuite/ChangeLog: * rust/compile/derive

[COMMITTED 069/141] gccrs: Get rid of duplicate interface gccrs#3396

2025-03-24 Thread arthur . cohen
From: GS-GOAT <86884129+gs-g...@users.noreply.github.com> gcc/rust/ChangeLog: * typecheck/rust-autoderef.cc (insert_implicit_type): Update single-parameter call to pass explicit HirId. * typecheck/rust-hir-type-check-expr.cc: Same. * typecheck/rust-hir-type

[COMMITTED 111/141] gccrs: session-manager: Call into DesugarQuestionMark

2025-03-24 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * rust-session-manager.cc (Session::compile_crate): Call DesugarQuestionMark::go(). --- gcc/rust/rust-session-manager.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gcc/rust/rust-session-manager.cc b/gcc/rust/rust-session-manager.cc

[COMMITTED 107/141] gccrs: nr2.0: Handle lang item type path segments

2025-03-24 Thread arthur . cohen
From: Owen Avery gcc/rust/ChangeLog: * resolve/rust-forever-stack.hxx (ForeverStack::find_starting_point): Stop when hitting a lang item segment. (ForeverStack::resolve_segments): Resolve lang item segments. (ForeverStacl::resolve_path): Handle single segm

[COMMITTED 044/141] gccrs: scan-deadcode: Do not warn unused fields if they start with '_'

2025-03-24 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * checks/lints/rust-lint-scan-deadcode.h: Check if the field name starts with an underscore before warning. --- gcc/rust/checks/lints/rust-lint-scan-deadcode.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/rust

[COMMITTED 058/141] gccrs: Fix compilation of trait-items which map to impl items

2025-03-24 Thread arthur . cohen
From: Philip Herron When we have paths such as Try::from_error the Try references the Trait and then from_error references the from_error trait item. So this resolves directly to a trait implementation which has the type: fn (v: placeholder) -> Self Remember that a path such as: Try::from_er

[COMMITTED 122/141] gccrs: remove visitor which is not needed here

2025-03-24 Thread arthur . cohen
From: Philip Herron Just a small refactor to remove a visitor which is not needed. gcc/rust/ChangeLog: * backend/rust-compile-resolve-path.cc (ResolvePathRef::Compile): remove visitor (ResolvePathRef::ResolvePathRef): likewise (ResolvePathRef::visit): likewise *

[COMMITTED 118/141] gccrs: Add enum variant string information to definition

2025-03-24 Thread arthur . cohen
From: Pierre-Emmanuel Patry New enum variant status now appears in the string representation of the resolver's definition. gcc/rust/ChangeLog: * resolve/rust-rib.cc (Rib::Definition::to_string): Add enum variant status. Signed-off-by: Pierre-Emmanuel Patry --- gcc/rust/resolv

[COMMITTED 071/141] gccrs: add variant_count intrinsic

2025-03-24 Thread arthur . cohen
From: Philip Herron Addresses Rust-GCC#3348 gcc/rust/ChangeLog: * backend/rust-compile-intrinsic.cc (variant_count_handler): new intrinsic gcc/testsuite/ChangeLog: * rust/execute/torture/enum_intrinsics2.rs: New test. Signed-off-by: Philip Herron --- gcc/rust/backend/rust-

[COMMITTED 103/141] gccrs: nr2.0: Implement macro_use for modules

2025-03-24 Thread arthur . cohen
From: Owen Avery gcc/rust/ChangeLog: * resolve/rust-early-name-resolver-2.0.cc: Include rust-attribute-values.h. (Early::visit): If a module has a macro_use attribute, avoid pushing a new textual macro scope. gcc/testsuite/ChangeLog: * rust/compile/nr2/e

[COMMITTED 068/141] gccrs: remove bad type checking diagnostic

2025-03-24 Thread arthur . cohen
From: Philip Herron This was a bad diagnostic added when I was working on slices and iterators also the name of the function is also bad. This is all about setting up associated types based on the current context of the bounds assocated with the associated trait bounds on this function. The tell

[COMMITTED 119/141] gccrs: Remove nr2 exhaustiveness test from exclusion list

2025-03-24 Thread arthur . cohen
From: Pierre-Emmanuel Patry gcc/testsuite/ChangeLog: * rust/compile/nr2/exclude: Remove test. Signed-off-by: Pierre-Emmanuel Patry --- gcc/testsuite/rust/compile/nr2/exclude | 1 - 1 file changed, 1 deletion(-) diff --git a/gcc/testsuite/rust/compile/nr2/exclude b/gcc/testsuite/rust

[COMMITTED 036/141] gccrs: add new -frust-overflow-checks flag to control overflow checks

2025-03-24 Thread arthur . cohen
From: Philip Herron This will be crucial for more complex gimple debugging to make it easier to follow the code vs the original rust code. gcc/rust/ChangeLog: * backend/rust-compile-expr.cc (CompileExpr::visit): disable overflow checks * lang.opt: new flag Signed-off-by: Phili

[COMMITTED 055/141] gccrs: coercion sites allow for type inference as well.

2025-03-24 Thread arthur . cohen
From: Philip Herron Addresses Rust-GCC#3382 and Rust-GCC#3381 gcc/rust/ChangeLog: * typecheck/rust-type-util.cc (coercion_site): allow inference vars gcc/testsuite/ChangeLog: * rust/compile/reference1.rs: fix error message Signed-off-by: Philip Herron --- gcc/rust/typecheck

[COMMITTED 047/141] gccrs: derive-visitor: Add method for setting up derived impl generics

2025-03-24 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * expand/rust-derive.cc (DeriveVisitor::setup_impl_generics): New method. * expand/rust-derive.h: Declare it, define DeriveVisitor::ImplGenerics struct. --- gcc/rust/expand/rust-derive.cc | 74 ++ gcc/rust

[COMMITTED 045/141] gccrs: ast-builder: Add new functions to create type paths.

2025-03-24 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * ast/rust-ast-builder.cc (Builder::type_path): New functions. * ast/rust-ast-builder.h: Declare them. --- gcc/rust/ast/rust-ast-builder.cc | 21 - gcc/rust/ast/rust-ast-builder.h | 4 2 files changed, 24

[COMMITTED 066/141] gccrs: ast: Add DesugarForLoop class

2025-03-24 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * ast/rust-desugar-for-loops.cc: New file. * ast/rust-desugar-for-loops.h: New file. * hir/rust-ast-lower-expr.cc (ASTLoweringExpr::visit): Make lowering of for-loops an unreachable. * Make-lang.in: Compile it. gcc

[COMMITTED 051/141] gccrs: nr2.0: Remove accidental copies of resolver

2025-03-24 Thread arthur . cohen
From: Owen Avery gcc/rust/ChangeLog: * backend/rust-compile-expr.cc (CompileExpr::generate_closure_function): Take NameResolutionContext by reference instead of by value. * backend/rust-compile-item.cc (CompileItem::visit): Likewise. * backend/rust

[COMMITTED 105/141] gccrs: name-resolution: early: Remove overzealous overrides

2025-03-24 Thread arthur . cohen
From: Arthur Cohen Some empty overrides were incorrectly being set-up instead of using the correct behavior from DefaultASTVisitor. gcc/rust/ChangeLog: * resolve/rust-early-name-resolver.cc: Remove definitions. * resolve/rust-early-name-resolver.h: Remove declarations

[COMMITTED 048/141] gccrs: derive(Clone, Copy): Cleanup using new method from DeriveVisitor

2025-03-24 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * expand/rust-derive-clone.cc: Cleanup using DeriveVisitor::setup_impl_generics. * expand/rust-derive-copy.cc: Likewise. --- gcc/rust/expand/rust-derive-clone.cc | 87 ++-- gcc/rust/expand/rust-derive-copy.cc | 87

[COMMITTED 063/141] gccrs: inline-asm: Fix some warnings

2025-03-24 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.cc (strip_double_quotes): Special case empty strings ("\"\""). (parse_reg_operand): Remove use of the `struct` keyword. (parse_reg_operand_in): Likewise. (p

[COMMITTED 083/141] gccrs: Add comments to resolve_segments

2025-03-24 Thread arthur . cohen
From: Owen Avery gcc/rust/ChangeLog: * resolve/rust-forever-stack.hxx (ForeverStack::resolve_segments): Add comments explaining the behaviour of a while loop. Signed-off-by: Owen Avery --- gcc/rust/resolve/rust-forever-stack.hxx | 11 +++ 1 file changed, 11 ins

[COMMITTED 030/141] gccrs: Remove some tests from nr2 exclusion file

2025-03-24 Thread arthur . cohen
From: Pierre-Emmanuel Patry Those test are now passing. gcc/testsuite/ChangeLog: * rust/compile/nr2/exclude: Remove passing tests. Signed-off-by: Pierre-Emmanuel Patry --- gcc/testsuite/rust/compile/nr2/exclude | 11 --- 1 file changed, 11 deletions(-) diff --git a/gcc/tests

[COMMITTED 084/141] gccrs: nr2.0: Fix issue with external crates

2025-03-24 Thread arthur . cohen
From: Owen Avery gcc/rust/ChangeLog: * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit): When visiting an external crate declaration, handle failed crate name lookups. This can happen when Session::load_extern_crate fails to load a crate during the

[COMMITTED 137/141] gccrs: nr2.0: Adjust visitors for struct expressions

2025-03-24 Thread arthur . cohen
From: Owen Avery gcc/rust/ChangeLog: * ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Make sure to always visit the struct name. * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Avoid visiting the struct name twice. gcc/testsuite/ChangeLog:

[COMMITTED 139/141] gccrs: nr2.0: Adjust indentifier expression handling

2025-03-24 Thread arthur . cohen
From: Owen Avery gcc/rust/ChangeLog: * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Make sure to return early after a resolution error, improve the resolution error message, fix a typo, handle ambiguous resolutions, and remove an old comment. gcc/testsui

[COMMITTED 062/141] gccrs: Add warning about default visitor usage

2025-03-24 Thread arthur . cohen
From: Pierre-Emmanuel Patry We already lost some time on this unusual pattern, a comment will hopefully prevent this from happening again. gcc/rust/ChangeLog: * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit): Add warning about current code. Signed-off-by: Pierre-E

[COMMITTED 064/141] gccrs: nr2.0: Resolve instances of TypePath more accurately

2025-03-24 Thread arthur . cohen
From: Owen Avery gcc/rust/ChangeLog: * util/rust-unwrap-segment.cc: New file. * util/rust-unwrap-segment.h: New file. * Make-lang.in: Add rust-unwrap-segment.o to the object list. * resolve/rust-forever-stack.hxx: Include rust-unwrap-segment.h. (ForeverSta

[COMMITTED 049/141] gccrs: derive(Debug): Add stub implementation.

2025-03-24 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * expand/rust-derive-debug.cc: New file. * expand/rust-derive-debug.h: New file. * Make-lang.in: Compile them. * expand/rust-derive.cc (DeriveVisitor::derive): Call into DeriveDebug. gcc/testsuite/ChangeLog: * rust

[COMMITTED 128/141] gccrs: Add a function to get the crate number from node id

2025-03-24 Thread arthur . cohen
From: Pierre-Emmanuel Patry gcc/rust/ChangeLog: * util/rust-hir-map.cc (Mappings::lookup_crate_num): Add function to retrieve crate number from it's node id. (Mappings::node_is_crate): change function with call to lookup_crate_num to avoid looping through all crat

[COMMITTED 143/146] gccrs: derive(Clone): Implement clone for enum tuple variants

2025-03-24 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * expand/rust-derive-clone.cc (DeriveClone::variant_match_path): New function. (DeriveClone::clone_enum_identifier): Rename. (DeriveClone::clone_enum_tuple): New function. (DeriveClone::visit_enum): Visit tuple variants

[COMMITTED 001/145] gccrs: contrib: Add libgrust to update-copyright.py script

2025-03-17 Thread arthur . cohen
From: Sahil Yeole contrib/ChangeLog: * update-copyright.py: Add libgrust folder. Signed-off-by: Sahil Yeole --- contrib/update-copyright.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contrib/update-copyright.py b/contrib/update-copyright.py index 0e45609d5eb..838c44f33eb 100

[COMMITTED 002/145] gccrs: git: Ignore libgrust build folders

2025-03-17 Thread arthur . cohen
From: Arthur Cohen ChangeLog: * .gitignore: Add libgrust target folders to the ignore list. --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index f044fe16b5f..7150fc3b29c 100644 --- a/.gitignore +++ b/.gitignore @@ -71,3 +71,6 @@ stamp

[COMMITTED 005/145] gccrs: borrowck: Polonius dump

2025-03-17 Thread arthur . cohen
From: Jakub Dupak gcc/rust/ChangeLog: * checks/errors/borrowck/polonius/rust-polonius.h (struct FullPoint): Polonius facts dump. (struct Facts): Polonius facts dump. * checks/errors/borrowck/rust-bir-dump.cc (Dump::go): Polonius facts dump. (Dump::

[COMMITTED 007/145] gccrs: borrowck: Link Polonius and run it

2025-03-17 Thread arthur . cohen
From: Jakub Dupak gcc/rust/ChangeLog: * Make-lang.in: Link Polonius. * checks/errors/borrowck/rust-borrow-checker.cc: Run Polonius. Signed-off-by: Jakub Dupak --- gcc/rust/Make-lang.in | 9 ++--- gcc/rust/checks/errors/borrowck/rust-borrow-

[COMMITTED 009/145] gccrs: borrowck: Testsuite

2025-03-17 Thread arthur . cohen
From: Jakub Dupak gcc/testsuite/ChangeLog: * rust/borrowck/borrowck.exp: New test. * rust/borrowck/position_dependant_outlives.rs: New test. * rust/borrowck/reference.rs: New test. * rust/borrowck/return_ref_to_local.rs: New test. * rust/borrowck/subset.rs

[COMMITTED 003/145] gccrs: Remove redundant macro definition

2025-03-17 Thread arthur . cohen
From: zhanghe9702 gcc/rust/ChangeLog: * backend/rust-tree.h: removing the CLASSTYPE_VBASECLASSES macro which is duplicated three times. Signed-off-by: Zhang He --- gcc/rust/backend/rust-tree.h | 12 1 file changed, 12 deletions(-) diff --git a/gcc/rust/backend/rus

[COMMITTED 006/145] gccrs: borrowck: Build Polonius automatically

2025-03-17 Thread arthur . cohen
From: Jakub Dupak This is minimalistic version to build Polonius with Cargo. gcc/rust/ChangeLog: * Make-lang.in: Build Polonius. Signed-off-by: Jakub Dupak --- gcc/rust/Make-lang.in | 7 +++ 1 file changed, 7 insertions(+) diff --git a/gcc/rust/Make-lang.in b/gcc/rust/Make-lang.

[COMMITTED 067/145] gccrs: Parse raw ref operator

2025-03-17 Thread arthur . cohen
From: Pierre-Emmanuel Patry The raw ref operator is an unstable feature required to obtain a pointer to unaligned adresses (mainly unaligned struct fields) without UB. gcc/rust/ChangeLog: * ast/rust-ast-builder.cc (Builder::ref): Adapt constructor to the new API. * ast/r

[COMMITTED 063/145] gccrs: Add dropck_eyepatch feature gate for may_dangle

2025-03-17 Thread arthur . cohen
From: Pierre-Emmanuel Patry Add a new feature gate for may_dangle generic param outer attributes. gcc/rust/ChangeLog: * checks/errors/rust-feature-gate.cc: Visit and gate may_dangle attributes. * checks/errors/rust-feature-gate.h: Update visit function prototype

[COMMITTED 076/145] gccrs: Introduce first implementation of parse_clobber_abi

2025-03-17 Thread arthur . cohen
From: jjasmine gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.cc (parse_clobber_abi): title. (parseAsmArg): title. * expand/rust-macro-builtins-asm.h (parse_clobber_abi): title. --- gcc/rust/expand/rust-macro-builtins-asm.cc | 76 +- gcc/rust/ex

[COMMITTED 079/145] gccrs: First draft of parse_option finished

2025-03-17 Thread arthur . cohen
From: jjasmine Finish up on parse_option, formatted parse_clobber_abi gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.cc (parse_clobber_abi): format (check_and_set): helper function, is try_set_option equivalent (parse_options): new function * expand/rust-mac

[COMMITTED 092/145] gccrs: Scaffolding parse_reg

2025-03-17 Thread arthur . cohen
From: jjasmine gcc/rust/ChangeLog: * ast/rust-expr.h (struct InlineAsmRegOrRegClass): Scaffolding parse_reg * expand/rust-macro-builtins-asm.cc (parse_reg): Likewise. (parse_operand): Likewise. (parseAsmArg): Likewise. --- gcc/rust/ast/rust-expr.h

[COMMITTED 083/145] gccrs: Add a simple no-op test for asm!

2025-03-17 Thread arthur . cohen
From: jjasmine gcc/testsuite/ChangeLog: * rust/compile/inline_asm_nop.rs: Simple test for asm! --- gcc/testsuite/rust/compile/inline_asm_nop.rs | 10 ++ 1 file changed, 10 insertions(+) create mode 100644 gcc/testsuite/rust/compile/inline_asm_nop.rs diff --git a/gcc/testsuite/

[COMMITTED 080/145] gccrs: Introduced is_global_asm to InlineAsm AST

2025-03-17 Thread arthur . cohen
From: jjasmine gcc/rust/ChangeLog: * ast/rust-expr.h: Introduced is_global_asm to InlineAsm AST --- gcc/rust/ast/rust-expr.h | 1 + 1 file changed, 1 insertion(+) diff --git a/gcc/rust/ast/rust-expr.h b/gcc/rust/ast/rust-expr.h index a5afbffee99..84fb5e8ab33 100644 --- a/gcc/rust/ast/r

[COMMITTED 075/145] gccrs: Working on parseAsmArg

2025-03-17 Thread arthur . cohen
From: jjasmine gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.cc (enum InlineAsmRegOrRegClass): title. (parseAsmArg): title. (check_identifier): title. (parse_operand): title. (parse_options): title. (parse_reg): title. (parseDirSpec

[COMMITTED 062/145] gccrs: Allow multiple outer attributes on generic params

2025-03-17 Thread arthur . cohen
From: Pierre-Emmanuel Patry Previously generic params only allowed one outer attribute in front of them. gcc/rust/ChangeLog: * ast/rust-ast-collector.cc (TokenCollector::visit): Visit outer attributes. * ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Change outer

[COMMITTED 081/145] gccrs: Make InlineAsm non-abstract for usage in parsing.

2025-03-17 Thread arthur . cohen
From: jjasmine gcc/rust/ChangeLog: * ast/rust-expr.h: Make InlineAsm non-abstract for usage in parsing. --- gcc/rust/ast/rust-expr.h | 44 1 file changed, 36 insertions(+), 8 deletions(-) diff --git a/gcc/rust/ast/rust-expr.h b/gcc/rust/ast/rust

[COMMITTED 077/145] gccrs: Working on parse_options for a bit more

2025-03-17 Thread arthur . cohen
From: jjasmine gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.cc (parse_options): title. --- gcc/rust/expand/rust-macro-builtins-asm.cc | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/gcc/rust/expand/rust-macro-builtins-asm.cc b/gcc/rust/expand/

[COMMITTED 085/145] gccrs: Add tests parsing with trailing commas inline asm

2025-03-17 Thread arthur . cohen
From: jjasmine gcc/testsuite/ChangeLog: * rust/compile/inline_asm_nop_2.rs: New test. --- gcc/testsuite/rust/compile/inline_asm_nop_2.rs | 10 ++ 1 file changed, 10 insertions(+) create mode 100644 gcc/testsuite/rust/compile/inline_asm_nop_2.rs diff --git a/gcc/testsuite/rust/

[COMMITTED 082/145] gccrs: Replace scaffolded InlineAsm with real InlineAsm.

2025-03-17 Thread arthur . cohen
From: jjasmine Replace scaffolded InlineAsm with real InlineAsm node in rust-expr.h gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.cc (parseDirSpec): replace scaffolded InlineAsm with real InlineAsm. (parse_clobber_abi): likewise. (check_and_set): likewise.

[COMMITTED 087/145] gccrs: Implemented parse_clobber_abi to pass new tests

2025-03-17 Thread arthur . cohen
From: jjasmine gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.cc (parse_clobber_abi): implemented parse_clobber_abi (parse_format_string): likewise. (parseAsmArg): likewise. (parse_asm): likewise. * expand/rust-macro-builtins-asm.h (parseAsmA

[COMMITTED 088/145] gccrs: Parsing of options(...) done.

2025-03-17 Thread arthur . cohen
From: jjasmine This is without any mutually exclusive options checked, or any relationship with reg_operands. Very primitive. gcc/rust/ChangeLog: * ast/rust-expr.h: parsing of options(...) * expand/rust-macro-builtins-asm.cc (check_and_set): likewise. (parse_opti

[COMMITTED 095/145] gccrs: Remove global_asm and non_global_asm handler

2025-03-17 Thread arthur . cohen
From: jjasmine gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.cc (MacroBuiltin::global_asm_handler): Remove global_asm and non_global_asm handler (MacroBuiltin::nonglobal_asm_handler): Likewise. (MacroBuiltin::asm_handler): Likewise. * expand

[COMMITTED 086/145] gccrs: Added faulty tests for inline asm cloberring

2025-03-17 Thread arthur . cohen
From: jjasmine gcc/testsuite/ChangeLog: * rust/compile/inline_asm_faulty_clobber.rs: New test. * rust/compile/inline_asm_faulty_clobber_1.rs: New test. * rust/compile/inline_asm_faulty_clobber_2.rs: New test. --- .../rust/compile/inline_asm_faulty_clobber.rs | 1

[COMMITTED 091/145] gccrs: Resolve static decl warning

2025-03-17 Thread arthur . cohen
From: jjasmine gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.h (parseAsmArg): Resolve static decl warning (parse_nonglobal_asm): Resolve static decl warning --- gcc/rust/expand/rust-macro-builtins-asm.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deleti

[COMMITTED 098/145] gccrs: Working towards parse_reg and parse_reg_operand

2025-03-17 Thread arthur . cohen
From: jjasmine gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.cc (parse_reg): Working towards parse_reg and parse_reg_operand (parse_reg_operand): Working towards parse_reg and parse_reg_operand (parse_asm_arg): Add todo about errors

[COMMITTED 099/145] gccrs: Got AST::Fragment to be created from InlineAsm

2025-03-17 Thread arthur . cohen
From: jjasmine gcc/rust/ChangeLog: * ast/rust-expr.h (struct AnonConst): Got AST::Fragment to be created from InlineAsm. (struct InlineAsmOperand): Likewise. (class InlineAsm): Likewise. * expand/rust-macro-builtins-asm.cc (parse_reg_operand): Likewise.

[COMMITTED 074/145] gccrs: Almost done with top level parsing

2025-03-17 Thread arthur . cohen
From: jjasmine gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.cc (struct AsmParseError): title. (enum InlineAsmDirSpec): title. (enum InlineAsmOptions): title. (struct AsmArg): title. (parseAsmArg): title. (parse_global_asm): title. (

[COMMITTED 101/145] gccrs: Slim down the test cases

2025-03-17 Thread arthur . cohen
From: jjasmine gcc/testsuite/ChangeLog: * rust/compile/inline_asm_faulty_clobber.rs: compress the test * rust/compile/inline_asm_nop.rs: compress the test * rust/compile/inline_asm_faulty_clobber_1.rs: Removed. * rust/compile/inline_asm_faulty_clob

[COMMITTED 100/145] gccrs: Refactoring for inline asm pr

2025-03-17 Thread arthur . cohen
From: jjasmine gcc/rust/ChangeLog: * ast/rust-expr.h (struct AnonConst): major refactoring of inline asm, mostly concerns naming convention, trinary conditionals, warnings, adding rust_unreachables in not-yet supported errors. (struct InlineAsmRegOrRegClas

[COMMITTED 089/145] gccrs: Wraps inline_asm tests in unsafe {}

2025-03-17 Thread arthur . cohen
From: jjasmine gcc/testsuite/ChangeLog: * rust/compile/inline_asm_faulty_clobber.rs: Wraps inline_asm tests in unsafe {} * rust/compile/inline_asm_faulty_clobber_1.rs: likewise. * rust/compile/inline_asm_faulty_clobber_2.rs: likewise. * rust/compile/inline

[COMMITTED 084/145] gccrs: Top level parsing test for asm!

2025-03-17 Thread arthur . cohen
From: jjasmine gcc/testsuite/ChangeLog: * rust/compile/inline_asm_ident_first.rs: New test. --- gcc/testsuite/rust/compile/inline_asm_ident_first.rs | 10 ++ 1 file changed, 10 insertions(+) create mode 100644 gcc/testsuite/rust/compile/inline_asm_ident_first.rs diff --git a/g

[COMMITTED 131/145] gccrs: Store parse result of parse_format_string(s)

2025-03-17 Thread arthur . cohen
From: badumbatish gcc/rust/ChangeLog: * ast/rust-expr.h (struct TupleTemplateStr): Store parse result of parse_format_string(s) * expand/rust-macro-builtins-asm.cc (parse_format_strings): Likewise Signed-off-by: badumbatish --- gcc/rust/ast/rust-expr.h

[COMMITTED 097/145] gccrs: Renamed parseAsmArg to conform to other function names

2025-03-17 Thread arthur . cohen
From: jjasmine gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.cc (parseAsmArg): Renamed parseAsmArg to conform to other function names (parse_asm_arg): Likewise. (parse_asm): Likewise. * expand/rust-macro-builtins-asm.h (parseAsmArg): Likewise.

[COMMITTED 078/145] gccrs: Fix clobber_api brackets

2025-03-17 Thread arthur . cohen
From: jjasmine gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.cc (parse_clobber_abi): title. --- gcc/rust/expand/rust-macro-builtins-asm.cc | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/gcc/rust/expand/rust-macro-builtins-asm.cc b/gcc/rust/e

[COMMITTED 144/145] gccrs: [gccrs#2987] Patch ICE when deriving Clone and Copy

2025-03-17 Thread arthur . cohen
From: Liam Naddell gcc/rust/ChangeLog: * expand/rust-expand-visitor.cc: Fix ICE caused by unique_ptr UB and buggy iterator use gcc/testsuite/ChangeLog: * rust/compile/issue-2987.rs: Add test for deriving Clone and Copy at the same time Signed-off-by: Liam Naddell

[COMMITTED 142/145] gccrs: Added options for ParseMode

2025-03-17 Thread arthur . cohen
From: badumbatish gcc/rust/ChangeLog: * ast/rust-fmt.cc (Pieces::collect): Added options for ParseMode * ast/rust-fmt.h (collect_pieces): Likewise. (struct Pieces): Likewise. * expand/rust-macro-builtins-format-args.cc (MacroBuiltin::format_args_handler):

[COMMITTED 1/2] gccrs: polonius: Vendor Rust dependencies

2025-03-18 Thread arthur . cohen
From: Arthur Cohen Resent to cut out the patch's content, as it did not pass the ML filters. This fixes PR #119333 by allowing our borrow-checker interface to be built offline. This was already done for our components in libgrust/, but had never been done for the borrow-checker.

[COMMITTED 090/144] gccrs: rust fix ICE when hir lowering qualified path expressions without an as

2025-03-19 Thread arthur . cohen
From: Philip Herron Qualified path expressions usually are ::... but the as is optional this adds the extra checking in hir lowering to not hit that nullptr. Fixes #3082 gcc/rust/ChangeLog: * hir/rust-ast-lower-type.cc (ASTLowerQualifiedPathInType::visit): check for valid as se

[COMMITTED 109/144] gccrs: Make AST default visitor visit functions public

2025-03-19 Thread arthur . cohen
From: Pierre-Emmanuel Patry Make those functions public so they can be used within a lambda on GCC 4.8. gcc/rust/ChangeLog: * ast/rust-ast-visitor.h: Make visit functions public. Signed-off-by: Pierre-Emmanuel Patry --- gcc/rust/ast/rust-ast-visitor.h | 1 - 1 file changed, 1 deletio

[COMMITTED 071/144] gccrs: Used `IndexVec` for Loans

2025-03-20 Thread arthur . cohen
From: Kushal Pal gcc/rust/ChangeLog: * checks/errors/borrowck/rust-bir-place.h: Used `IndexVec` with ScopeId as index. * checks/errors/borrowck/rust-borrow-checker-diagnostics.cc (BorrowCheckerDiagnostics::get_loan): Convert Polonius::Loan to BIR::Loan, so

[COMMITTED 019/144] gccrs: Simplify construction of BIR::Statement

2025-03-19 Thread arthur . cohen
From: Kushal Pal gcc/rust/ChangeLog: * checks/errors/borrowck/rust-bir-builder-internal.h: Use `make_*` functions to create BIR::Statements. * checks/errors/borrowck/rust-bir.h: Make a complete constructor and introduce `make_*` functions to create various

[COMMITTED 068/144] gccrs: Strong type BasicBlockId

2025-03-19 Thread arthur . cohen
From: Kushal Pal gcc/rust/ChangeLog: * checks/errors/borrowck/rust-bir-builder-expr-stmt.cc (ExprStmtBuilder::visit): Use value of BasicBlockId as index. * checks/errors/borrowck/rust-bir-builder-internal.h (struct BuilderContext): Likewise. * checks/err

[COMMITTED 092/144] gccrs: toplevel: Add note for resolving use declarations

2025-03-19 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::handle_use_dec): Add notes on the problem. * resolve/rust-toplevel-name-resolver-2.0.h: Likewise. --- gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc | 11 +++ gcc

[COMMITTED 061/144] gccrs: Fix v0-mangle1.rs test when run with ASAN

2025-03-19 Thread arthur . cohen
From: Owen Avery gcc/rust/ChangeLog: * util/rust-canonical-path.h (CanonicalPath::CanonicalPath): Properly initialize crate_num with copy constructor. gcc/testsuite/ChangeLog: * rust/compile/v0-mangle1.rs: Make v0-mangle test more crate_num agnostic. Si

[COMMITTED 064/144] gccrs: Strong type FreeRegion

2025-03-19 Thread arthur . cohen
From: Kushal Pal gcc/rust/ChangeLog: * checks/errors/borrowck/rust-bir-builder-internal.h: Use STATIC_FREE_REGION, use value of FreeRegion for origin. * checks/errors/borrowck/rust-bir-builder.h: Use free region value. * checks/errors/borrowck/rust-bir-dum

[COMMITTED 022/144] gccrs: Fixed testcase

2025-03-19 Thread arthur . cohen
From: Kushal Pal gcc/testsuite/ChangeLog: * rust/borrowck/test_move.rs: Assigning `a` to `c` is the correct way to test the behaviour. Signed-off-by: Kushal Pal --- gcc/testsuite/rust/borrowck/test_move.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a

[COMMITTED 102/144] gccrs: Fix missing error on duplicated nodes

2025-03-19 Thread arthur . cohen
From: Pierre-Emmanuel Patry When we tried to insert a shadowable node and another shadowable node has been inserted before, we didn't emit any error if the node has already been inserted previously and failed silently. gcc/rust/ChangeLog: * resolve/rust-rib.cc (Rib::insert): Emit an err

[COMMITTED 106/144] gccrs: Remove regular visit code

2025-03-19 Thread arthur . cohen
From: Pierre-Emmanuel Patry Regular visit code can be replaced with default visit functions. gcc/rust/ChangeLog: * resolve/rust-default-resolver.cc (DefaultResolver::visit): Remove default visit code and replace it with call to default visitor. * resolve/rust-default-res

[COMMITTED 038/144] gccrs: Fix the parser's operand and flags storage

2025-03-19 Thread arthur . cohen
From: badumbatish gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.cc (parse_reg_operand): Fix parsing logic & reassignment logic (parse_reg_operand_in): Fix parsing (parse_reg_operand_out): Fix parsing (parse_reg_operand_inout): Fix parsing (p

[COMMITTED 043/144] gccrs: Scaffolding new compile-asm files

2025-03-19 Thread arthur . cohen
From: badumbatish gcc/rust/ChangeLog: * Make-lang.in: Scaffolding new compile-asm files * backend/rust-compile-expr.cc (CompileExpr::visit): Likewise * hir/tree/rust-hir-expr.h: Likewise * backend/rust-compile-asm.cc: New file. Likewise * backend/r

[COMMITTED 044/144] gccrs: Scaffolding code

2025-03-19 Thread arthur . cohen
From: badumbatish gcc/rust/ChangeLog: * backend/rust-compile-asm.cc (CompileAsm::add_stmt): Scaffolding code. (CompileAsm::asm_build_asm_stmt): Likewise. (CompileAsm::asm_build_expr): Likewise. (CompileAsm::asm_construct_string_tree): Likewise. * b

[COMMITTED 073/144] gccrs: Used `IndexVec` for Places

2025-03-19 Thread arthur . cohen
From: Kushal Pal gcc/rust/ChangeLog: * checks/errors/borrowck/rust-bir-place.h: Use strong types as index. Signed-off-by: Kushal Pal --- .../checks/errors/borrowck/rust-bir-place.h | 56 +-- 1 file changed, 27 insertions(+), 29 deletions(-) diff --git a/gcc/

[COMMITTED 115/144] gccrs: Make node id getter const.

2025-03-19 Thread arthur . cohen
From: Pierre-Emmanuel Patry gcc/rust/ChangeLog: * ast/rust-ast.h: Node id getter could be const. Signed-off-by: Pierre-Emmanuel Patry --- gcc/rust/ast/rust-ast.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/rust/ast/rust-ast.h b/gcc/rust/ast/rust-ast.h index

[COMMITTED 050/144] gccrs: Start work on expand inline asm

2025-03-19 Thread arthur . cohen
From: badumbatish gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.cc (parse_reg_operand): Remove warnings (parse_reg_operand_out): Remove warnings (expand_inline_asm): New function for eventual expansion (parse_asm): Use expand_inline_asm gcc/testsui

[COMMITTED 113/144] gccrs: Update exclude list with working tests

2025-03-19 Thread arthur . cohen
From: Pierre-Emmanuel Patry gcc/testsuite/ChangeLog: * rust/compile/nr2/exclude: Remove working tests from nr2 exclude list. Signed-off-by: Pierre-Emmanuel Patry --- gcc/testsuite/rust/compile/nr2/exclude | 27 +- 1 file changed, 1 insertion(+), 26 deletions(-)

[COMMITTED 047/144] gccrs: Minor fix to asm codegen pr

2025-03-19 Thread arthur . cohen
From: badumbatish gcc/rust/ChangeLog: * backend/rust-compile-asm.cc (CompileAsm::asm_build_expr): Use expr's is_simple_asm and is_inline_asm (CompileAsm::asm_is_simple): removed (CompileAsm::asm_is_inline): removed * backend/rust-compile-asm.h: Add docs to

[COMMITTED 052/144] gccrs: Lower the HIR to tree with CompileExpr

2025-03-19 Thread arthur . cohen
From: badumbatish gcc/rust/ChangeLog: * backend/rust-compile-asm.cc (CompileAsm::asm_construct_outputs): Lower the HIR to tree with CompileExpr * backend/rust-compile-asm.h: Remove static from method --- gcc/rust/backend/rust-compile-asm.cc | 15 +++ gcc/rust

[COMMITTED 138/144] gccrs: Use name resolver 2.0 in MarkLive

2025-03-19 Thread arthur . cohen
From: Owen Avery gcc/rust/ChangeLog: * checks/lints/rust-lint-marklive.cc (MarkLive::visit_path_segment): Use name resolver 2.0 when enabled. (MarkLive::visit): Likewise. Signed-off-by: Owen Avery --- gcc/rust/checks/lints/rust-lint-marklive.cc | 31 +++

[COMMITTED 128/144] gccrs: Handle TypeAlias during toplevel resolution 2.0

2025-03-19 Thread arthur . cohen
From: Owen Avery gcc/rust/ChangeLog: * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit): Handle TypeAlias. * resolve/rust-toplevel-name-resolver-2.0.h (TopLevel::visit): Likewise. gcc/testsuite/ChangeLog: * rust/compile/nr2/exclude: Remove ty

<    5   6   7   8   9   10   11   12   13   14   >