[COMMITTED 081/101] gccrs: Generate error for `async` trait fucntions

2024-01-30 Thread arthur . cohen
From: Kushal Pal Fixes #2767 gcc/rust/ChangeLog: * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Added check for `async` function inside trait. gcc/testsuite/ChangeLog: * rust/compile/issue-2767.rs: New test. Signed-off-by: Kushal Pal --- gcc/rust/che

[COMMITTED 089/101] gccrs: Handle `async` functions in traits

2024-01-30 Thread arthur . cohen
From: Kushal Pal Fixes #2785 gcc/rust/ChangeLog: * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Added check for `async` functions inside trait. * parse/rust-parse-impl.h (Parser::parse_trait_item): Added switch-case for ASYNC token. gcc/testsuite

[COMMITTED 090/101] gccrs: Fix inconsistent formatting

2024-01-30 Thread arthur . cohen
From: Kushal Pal gcc/rust/ChangeLog: * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Enclose const in single quotes. gcc/testsuite/ChangeLog: * rust/compile/const_trait_fn.rs: Enclose const in single quotes. Signed-off-by: Kushal Pal --- gcc/ru

[COMMITTED 088/101] gccrs: Handle newlines during string parsing while lexing

2024-01-30 Thread arthur . cohen
From: Nirmal Patel If newline strings are encountered while lexing, the lexer now handles newline characters by incrementing current line number. This provides correct line number when displaying errors. If the lexer encounters end of file before string end, then it will use the start of the stri

[COMMITTED 097/101] gccrs: AST: Fix for lifetime lowering

2024-01-30 Thread arthur . cohen
From: Jakub Dupak gcc/rust/ChangeLog: * hir/rust-ast-lower-type.cc (ASTLoweringTypeBounds::visit): fix for lifetimes (ASTLowerWhereClauseItem::visit): fix for lifetimes Signed-off-by: Jakub Dupak --- gcc/rust/hir/rust-ast-lower-type.cc | 21 + 1 file chang

[COMMITTED] Initial libgrust build patches

2023-12-14 Thread Arthur Cohen
Hi, This patchset contains the initial changes to add the libgrust folder to gcc, which will later contain libraries used by our Rust frontend. This work was done by Pierre-Emmanuel Patry as part of his work on supporting procedural macros in our frontend. It was then tested by Thomas Schwinge, a

[COMMITTED 1/4] libgrust: Add ChangeLog file

2023-12-14 Thread Arthur Cohen
From: Pierre-Emmanuel Patry libgrust/ChangeLog: * ChangeLog: New file. Signed-off-by: Pierre-Emmanuel Patry --- libgrust/ChangeLog | 6 ++ 1 file changed, 6 insertions(+) create mode 100644 libgrust/ChangeLog diff --git a/libgrust/ChangeLog b/libgrust/ChangeLog new file mode 100

[COMMITTED 2/4] libgrust: Add entry for maintainers

2023-12-14 Thread Arthur Cohen
From: Pierre-Emmanuel Patry ChangeLog: * MAINTAINERS: Add maintainers for libgrust. contrib/ChangeLog: * gcc-changelog/git_commit.py: Add libgrust. Co-authored-by: Arthur Cohen Signed-off-by: Pierre-Emmanuel Patry --- MAINTAINERS | 1 + contrib/gcc

[COMMITTED 4/4] build: Add libgrust as compilation modules

2023-12-14 Thread Arthur Cohen
From: Pierre-Emmanuel Patry Define the libgrust directory as a host compilation module as well as for targets. Disable target libgrust if we're not building target libstdc++. ChangeLog: * Makefile.def: Add libgrust as host & target module. * configure.ac: Add libgrust to host to

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

2024-01-04 Thread Arthur Cohen
Hi Joseph, Thanks for the review! On 12/18/23 20:00, Joseph Myers wrote: On Fri, 8 Sep 2023, Arthur Cohen wrote: + if (c < 0x80) + { +if (('A' <= c && c <= 'Z') || ('a' <= c && c <= 'z')) + return CPP_XID_START | C

[COMMITTED] libcpp: add function to check XID properties

2024-01-04 Thread Arthur Cohen
From: Raiki Tamura This commit adds a new function intended for checking the XID properties of a possibly unicode character, as well as the accompanying enum describing the possible properties. libcpp/ChangeLog: * charset.cc (cpp_check_xid_property): New. * include/cpplib.h

Re: Rust front-end patches v4

2022-12-13 Thread Arthur Cohen
-execution-test-cases.patch Patches 08 to 46 contain 'gcc/rust/' specific changes which will be hard to review for someone not familiar with the codebase. These changes include various transformations on our HIR, or checks specific to the Rust programming language. -- Arthur Cohen Too

Re: Rust front-end patches v4

2022-12-13 Thread Arthur Cohen
ented with :) We plan on removing that flag as soon as possible, but in the meantime, we think it will help not creating divide within the Rust ecosystem, as well as not waste Rust crate maintainers' time. Thanks again, Arthur On 12/13/22 14:26, Arthur Cohen wrote: Hi everyone, I have

Re: Rust front-end patches v4

2022-12-13 Thread Arthur Cohen
Hi Martin, On 12/13/22 14:30, Martin Liška wrote: On 12/13/22 14:26, Arthur Cohen wrote: Thank you, and congratulations, to all the contributors. We thank you!! Congratulations. Thank you :) I have one question: do you have a list of supported architectures Rust FE can support right now

Re: [PATCH] rust: Fix up aarch64-linux bootstrap [PR106072]

2022-12-14 Thread Arthur Cohen
our upstream dev branch, so in the meantime feel free to apply your patch. When I'll get to updating master, I'm expecting these kinds of tiny conflicts and we'll deal with them. Thanks a lot for working on this and sorry that my tardiness in updating has caused a duplication of eff

Re: [PATCH] testsuite: Add support for Rust and Modula-2 effective target tests

2022-12-15 Thread Arthur Cohen
Hi Jakub, On 12/15/22 13:23, Jakub Jelinek wrote: Hi! This patch allows magic comments also for Rust and Modula-2 for effective target tests etc. and fixes up the Assembly entry - it is a glob, so /* Assembly can match /whatever Assembly and not just /* Assembly. Tested on x86_64-linux with ma

Re: [PATCH] gccrs: avoid printing to stderr in selftest::rust_flatten_list

2023-01-02 Thread Arthur Cohen
TRUE (!paths.empty ()); ASSERT_EQ (paths.size (), 2); ASSERT_EQ (paths[0].get_segments ()[0].as_string (), "foo"); Looks good to me. OK for trunk :) Thanks for taking the time! All the best, -- Arthur Cohen Toolchain Engineer Embecosm GmbH Geschäftsführer: Jeremy Ben

Re: [PATCH] gccrs: add selftest-rust-gdb and selftest-rust-valgrind "make" targets

2023-01-02 Thread Arthur Cohen
nfo files that should be installed. rust.install-info: OK for trunk :) Thanks again! -- Arthur Cohen Toolchain Engineer Embecosm GmbH Geschäftsführer: Jeremy Bennett Niederlassung: Nürnberg Handelsregister: HR-B 36368 www.embecosm.de Fürther Str. 27 90429 Nürnberg Tel.: 091 - 128 707 04

Re: [PATCH] gccrs: avoid printing to stderr in selftest::rust_flatten_list

2023-01-05 Thread Arthur Cohen
Hi David, On 1/4/23 20:28, David Malcolm wrote: On Mon, 2023-01-02 at 13:47 +0100, Arthur Cohen wrote: Hi David, Sorry for the delayed reply! On 12/16/22 18:01, David Malcolm wrote: Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. OK for trunk? gcc/rust/Chang

Re: [PATCH] gccrs: avoid printing to stderr in selftest::rust_flatten_list

2023-01-05 Thread Arthur Cohen
On 1/5/23 16:36, David Malcolm wrote: On Thu, 2023-01-05 at 15:44 +0100, Arthur Cohen wrote: Hi David, On 1/4/23 20:28, David Malcolm wrote: On Mon, 2023-01-02 at 13:47 +0100, Arthur Cohen wrote: Hi David, Sorry for the delayed reply! On 12/16/22 18:01, David Malcolm wrote: Successfully

[PATCHSET] Add error metadata to diagnostics

2023-09-06 Thread Arthur Cohen
This short patchset from David Malcolm enables errors to contain extra metadata - this is particularly useful for the Rust frontend, which will rely on that implementation to emit standard Rust error codes [1]. This series of patches is necessary for much of our more recent additions to the fronte

[PATCH 1/2] diagnostics: add error_meta

2023-09-06 Thread Arthur Cohen
From: David Malcolm --- gcc/diagnostic-core.h | 3 +++ gcc/diagnostic.cc | 15 +++ 2 files changed, 18 insertions(+) diff --git a/gcc/diagnostic-core.h b/gcc/diagnostic-core.h index 7334c79e8e6..c9e27fd2e6e 100644 --- a/gcc/diagnostic-core.h +++ b/gcc/diagnostic-core.h @@ -92,6

[PATCH 2/2] Experiment with adding an error code to an error

2023-09-06 Thread Arthur Cohen
From: David Malcolm --- gcc/rust/rust-diagnostics.cc | 11 +++ gcc/rust/rust-diagnostics.h | 18 ++ gcc/rust/rust-gcc-diagnostics.cc | 33 +++ gcc/rust/typecheck/rust-casts.cc | 2 +- .../rust/compile/bad_a

Re: [PATCH 1/2] diagnostics: add error_meta

2023-09-06 Thread Arthur Cohen
On 9/6/23 16:12, David Malcolm wrote: On Wed, 2023-09-06 at 15:53 +0200, Arthur Cohen wrote: From: David Malcolm I guess I can review this patch :) Needs a ChangeLog entry, so here's one: gcc/ChangeLog * diagnostic-core.h (error_meta): New decl. * diagnostic.cc (error

Re: [PATCHSET] Add error metadata to diagnostics

2023-09-07 Thread Arthur Cohen
Pushed to trunk this morning with Changelogs and SoB lines. Thanks for the review David! All the best, Arthur On 9/6/23 15:53, Arthur Cohen wrote: This short patchset from David Malcolm enables errors to contain extra metadata - this is particularly useful for the Rust frontend, which will

[PATCH 01/14] rust: Add skeleton support and documentation for targetrustm hooks.

2023-09-07 Thread arthur . cohen
From: Iain Buclaw gcc/ChangeLog: * Makefile.in (tm_rust_file_list, tm_rust_include_list, TM_RUST_H, RUST_TARGET_DEF, RUST_TARGET_H, RUST_TARGET_OBJS): New variables. (tm_rust.h, cs-tm_rust.h, default-rust.o, rust/rust-target-hooks-def.h, s-rust-target-hooks-def-h)

[PATCH 03/14] rust: Reintroduce TARGET_RUST_OS_INFO hook

2023-09-07 Thread arthur . cohen
From: Iain Buclaw gcc/ChangeLog: * doc/tm.texi: Regenerate. * doc/tm.texi.in: Document TARGET_RUST_OS_INFO. gcc/rust/ChangeLog: * rust-session-manager.cc (Session::init): Call targetrustm.rust_os_info. * rust-target.def (rust_os_info): New hook. --- gcc

[PATCH 02/14] rust: Reintroduce TARGET_RUST_CPU_INFO hook

2023-09-07 Thread arthur . cohen
From: Iain Buclaw gcc/ChangeLog: * doc/tm.texi: Regenerate. * doc/tm.texi.in: Add @node for Rust language and ABI, and document TARGET_RUST_CPU_INFO. gcc/rust/ChangeLog: * rust-lang.cc (rust_add_target_info): Remove sorry. * rust-session-manager.cc: Repl

[PATCH 04/14] rust: Implement TARGET_RUST_CPU_INFO for i[34567]86-*-* and x86_64-*-*

2023-09-07 Thread arthur . cohen
From: Iain Buclaw There are still quite a lot of the previously reverted i386-rust.cc missing, so it's only a partial reimplementation. gcc/ChangeLog: * config/i386/t-i386 (i386-rust.o): New rule. * config/i386/i386-rust.cc: New file. * config/i386/i386-rust.h: New file.

[PATCH 11/14] rust: Implement TARGET_RUST_OS_INFO for *-*-vxworks*

2023-09-07 Thread arthur . cohen
From: Iain Buclaw gcc/ChangeLog: * config.gcc (*-*-vxworks*): Set rust_target_objs and target_has_targetrustm. * config/t-vxworks (vxworks-rust.o): New rule. * config/vxworks-rust.cc: New file. --- gcc/config.gcc | 3 +++ gcc/config/t-vxworks |

[PATCH 05/14] rust: Implement TARGET_RUST_OS_INFO for *-*-darwin*

2023-09-07 Thread arthur . cohen
From: Iain Buclaw gcc/ChangeLog: * config.gcc (*-*-darwin*): Set rust_target_objs and target_has_targetrustm. * config/t-darwin (darwin-rust.o): New rule. * config/darwin-rust.cc: New file. --- gcc/config.gcc| 2 ++ gcc/config/darwin-rust.cc | 44 +++

[PATCH 13/14] rust: Implement TARGET_RUST_OS_INFO for i[34567]86-*-mingw* and x86_64-*-mingw*.

2023-09-07 Thread arthur . cohen
From: Iain Buclaw gcc/ChangeLog: * config.gcc (i[34567]86-*-mingw* | x86_64-*-mingw*): Set rust_target_objs and target_has_targetrustm. * config/t-winnt (winnt-rust.o): New rule. * config/winnt-rust.cc: New file. --- gcc/config.gcc | 2 ++ gcc/config/t

[PATCH 06/14] rust: Implement TARGET_RUST_OS_INFO for *-*-freebsd*

2023-09-07 Thread arthur . cohen
From: Iain Buclaw gcc/ChangeLog: * config.gcc (*-*-freebsd*): Set rust_target_objs and target_has_targetrustm. * config/t-freebsd (freebsd-rust.o): New rule. * config/freebsd-rust.cc: New file. --- gcc/config.gcc | 2 ++ gcc/config/freebsd-rust.cc |

[PATCH 12/14] rust: Implement TARGET_RUST_OS_INFO for *-*-fuchsia*.

2023-09-07 Thread arthur . cohen
From: Iain Buclaw gcc/ChangeLog: * config.gcc (*-*-fuchsia): Set tmake_rule, rust_target_objs, and target_has_targetrustm. * config/fuchsia-rust.cc: New file. * config/t-fuchsia: New file. --- gcc/config.gcc | 3 +++ gcc/config/fuchsia-rust.cc | 40 +

[PATCH 07/14] rust: Implement TARGET_RUST_OS_INFO for *-*-netbsd*

2023-09-07 Thread arthur . cohen
From: Iain Buclaw gcc/ChangeLog: * config.gcc (*-*-netbsd*): Set rust_target_objs and target_has_targetrustm. * config/t-netbsd (netbsd-rust.o): New rule. * config/netbsd-rust.cc: New file. --- gcc/config.gcc| 2 ++ gcc/config/netbsd-rust.cc | 40 +++

[PATCH 10/14] rust: Implement TARGET_RUST_OS_INFO for *-*-dragonfly*

2023-09-07 Thread arthur . cohen
From: Iain Buclaw gcc/ChangeLog: * config.gcc (*-*-dragonfly*): Set rust_target_objs and target_has_targetrustm. * config/t-dragonfly (dragonfly-rust.o): New rule. * config/dragonfly-rust.cc: New file. --- gcc/config.gcc | 2 ++ gcc/config/dragonfl

[PATCH 08/14] rust: Implement TARGET_RUST_OS_INFO for *-*-openbsd*

2023-09-07 Thread arthur . cohen
From: Iain Buclaw gcc/ChangeLog: * config.gcc (*-*-openbsd*): Set rust_target_objs and target_has_targetrustm. * config/t-openbsd (openbsd-rust.o): New rule. * config/openbsd-rust.cc: New file. --- gcc/config.gcc | 2 ++ gcc/config/openbsd-rust.cc |

[PATCH 14/14] rust: Implement TARGET_RUST_OS_INFO for *-*-*linux*.

2023-09-07 Thread arthur . cohen
From: Iain Buclaw gcc/ChangeLog: * config.gcc (*linux*): Set rust target_objs, and target_has_targetrustm, * config/t-linux (linux-rust.o): New rule. * config/linux-rust.cc: New file. --- gcc/config.gcc | 2 ++ gcc/config/linux-rust.cc | 57 +++

[PATCH 09/14] rust: Implement TARGET_RUST_OS_INFO for *-*-solaris2*.

2023-09-07 Thread arthur . cohen
From: Iain Buclaw gcc/ChangeLog: * config.gcc (*-*-solaris2*): Set rust_target_objs and target_has_targetrustm. * config/t-sol2 (sol2-rust.o): New rule. * config/sol2-rust.cc: New file. --- gcc/config.gcc | 2 ++ gcc/config/sol2-rust.cc | 40 +++

[PATCHSET] Reintroduce targetrustm hooks

2023-09-07 Thread Arthur Cohen
Alright, was not expecting to mess up this patchset so bad so here we go: This patchset reintroduces proper targetrustm hooks without the old problematic mess of macros we had, which had been removed for the first merge of gccrs upstream. Tested on x86-64 GNU Linux, and has also been present in

[PATCH] libcpp: add function to check XID properties

2023-09-08 Thread Arthur Cohen
From: Raiki Tamura libcpp/ChangeLog: * charset.cc (check_xid_property):new function to check XID_Start and XID_Continue * include/cpplib.h (check_xid_property):add enum representing XID properties Signed-off-by: Raiki Tamura --- libcpp/charset.cc | 36 +

[PATCH v2] libcpp: add function to check XID properties

2023-09-08 Thread Arthur Cohen
From: Raiki Tamura This commit adds a new function intended for checking the XID properties of a possibly unicode character, as well as the accompanying enum describing the possible properties. libcpp/ChangeLog: * charset.cc (cpp_check_xid_property): New. * include/cpplib.h

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

2023-09-08 Thread Arthur Cohen
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 accompanying enum describing the possible properties. libcpp/ChangeLog:

[COMMITTED] gccrs: move functions from rust-gcc-diagnostics to rust-diagnostics.cc

2023-09-11 Thread Arthur Cohen
From: Parthib <94271200+parthib...@users.noreply.github.com> gcc/rust/ChangeLog: * Make-lang.in: Removed rust-gcc-diagnostics object file. * rust-diagnostics.cc (rust_be_get_quotechars): Added from original file. (rust_be_internal_error_at): Likewise.

Re: [PATH] [CLEANUP] Remove trailing whitespace characters

2023-09-11 Thread Arthur Cohen
On 9/11/23 16:43, Eric Gallager via Gcc-patches wrote: On Mon, Sep 11, 2023 at 9:43 AM Jakub Jelinek via Gcc-patches wrote: On Mon, Sep 11, 2023 at 09:27:48AM -0400, David Malcolm via Gcc-patches wrote: On Sun, 2023-09-10 at 16:36 +0200, Guillaume Gomez wrote: When going through the code, I

Re: [PATCH 3/3] diagnostics: use the .opt.urls files to urlify quoted text

2023-11-14 Thread Arthur Cohen
Hi David, ACK for the Rust patches. Thanks a lot for working on this :) Kindly, Arthur On 11/10/23 22:42, David Malcolm wrote: This patch adds machinery for using the .opt.urls files linking to the documentation of our options in gcc_urlifier. For every enabled .opt file, the corresponding .

Re: GCC/Rust libgrust-v2/to-submit branch

2023-11-21 Thread Arthur Cohen
Hi Thomas! A newer version of the library has been force-pushed to the branch `libgrust-v2/to-submit`. On 11/20/23 15:55, Thomas Schwinge wrote: Hi! Arthur and Pierre-Emmanuel have prepared a GCC/Rust libgrust-v2/to-submit branch:

Re: [PATCHSET] Reintroduce targetrustm hooks

2023-09-14 Thread Arthur Cohen
On 9/14/23 12:12, Richard Biener wrote: On Wed, Sep 13, 2023 at 10:14 PM Iain Buclaw via Gcc-patches wrote: Excerpts from Arthur Cohen's message of September 7, 2023 3:41 pm: Alright, was not expecting to mess up this patchset so bad so here we go: This patchset reintroduces proper target

[PATCH 1/3] librust: Add libproc_macro and build system

2023-09-20 Thread Arthur Cohen
From: Pierre-Emmanuel Patry This patch series adds the build system changes to allow the Rust frontend to develop and distribute its own libraries. The first library we have been working on is the `proc_macro` library, comprised of a C++ library as well as a user-facing Rust library. Follow up c

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

2023-09-20 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 3/3] build: Regenerate build files

2023-09-21 Thread Arthur Cohen
From: Pierre-Emmanuel Patry Resending this patch without most of the diff so it fits on the ML. - Regenerate all build files. ChangeLog: * Makefile.in: * configure: Regenerate. * libgrust/Makefile.in: New file. * libgrust/aclocal.m4: New file. * lib

Re: [PATCHSET] Reintroduce targetrustm hooks

2023-09-21 Thread Arthur Cohen
Pushed the patches to trunk. Thank you both for the review. Kindly, Arthur On 9/14/23 12:12, Richard Biener via Gcc-rust wrote: On Wed, Sep 13, 2023 at 10:14 PM Iain Buclaw via Gcc-patches wrote: Excerpts from Arthur Cohen's message of September 7, 2023 3:41 pm: Alright, was not expecting

Re: [PATCH v2] Fix Xcode 16 build break with NULL != nullptr

2024-07-10 Thread Arthur Cohen
Hi Daniel, Thanks for patching the Rust frontend as well. Looks great to me. Best, Arthur On 7/10/24 11:43, Daniel Bertalan wrote: As of Xcode 16 beta 2 with the macOS 15 SDK, each re-inclusion of the stddef.h header causes the NULL macro in C++ to be re-defined to an integral constant (__nul

[PATCH wwwdocs] gcc-14/changes: Add Rust section to New languages

2024-05-14 Thread Arthur Cohen
--- htdocs/gcc-14/changes.html | 13 + 1 file changed, 13 insertions(+) diff --git a/htdocs/gcc-14/changes.html b/htdocs/gcc-14/changes.html index 924e045a..dd3fea8d 100644 --- a/htdocs/gcc-14/changes.html +++ b/htdocs/gcc-14/changes.html @@ -626,6 +626,19 @@ You may also want to chec

Re: [PATCH] rust: Do not link with libdl and libpthread unconditionally

2024-05-31 Thread Arthur Cohen
Hi Richard, On 4/30/24 09:55, Richard Biener wrote: On Fri, Apr 19, 2024 at 11:49 AM Arthur Cohen wrote: Hi everyone, This patch checks for the presence of dlopen and pthread_create in libc. If that is not the case, we check for the existence of -ldl and -lpthread, as these libraries are

[COMMITTED 1/2] borrowck: Avoid overloading issues on 32bit architectures

2024-08-12 Thread Arthur Cohen
On architectures where `size_t` is `unsigned int`, such as 32bit x86, we encounter an issue with `PlaceId` and `FreeRegion` being aliases to the same types. This poses an issue for overloading functions for these two types, such as `push_subset` in that case. This commit renames one of these `push_

[COMMITTED 2/2] borrowck: Fix debug prints on 32-bits architectures

2024-08-12 Thread Arthur Cohen
gcc/rust/ChangeLog: * checks/errors/borrowck/rust-bir-builder.h: Cast size_t values to unsigned long before printing. * checks/errors/borrowck/rust-bir-fact-collector.h: Likewise. --- gcc/rust/checks/errors/borrowck/rust-bir-builder.h| 3 ++- gcc/rust/checks/error

Re: [PATCH] rust: avoid clobbering LIBS

2024-08-12 Thread Arthur Cohen
Hi Marc, Patch looks good to me :) Thanks! On 8/6/24 18:43, Marc Poulhiès wrote: Save LIBS around calls to AC_SEARCH_LIBS to avoid clobbering $LIBS. ChangeLog: * configure: Regenerate. * configure.ac: Save LIBS around calls to AC_SEARCH_LIBS. Signed-off-by: Marc Poulhiès Rev

Re: [PATCH] rust: Do not link with libdl and libpthread unconditionally

2024-06-11 Thread Arthur Cohen
Thanks Richi! Tested again and pushed on trunk. Best, Arthur On 5/31/24 15:02, Richard Biener wrote: On Fri, May 31, 2024 at 12:24 PM Arthur Cohen wrote: Hi Richard, On 4/30/24 09:55, Richard Biener wrote: On Fri, Apr 19, 2024 at 11:49 AM Arthur Cohen wrote: Hi everyone, This patch

[PATCH] gccrs: configure.ac: Fix quoting around ldl/lpthread checks

2024-06-14 Thread Arthur Cohen
ChangeLog: * configure.ac: Add quoting around both variable checks performed, which will fix the noise reported when libc contains both ldl and lpthread. A typo around `pthread_create` being typed `pthread_crate` is also fixed. * configure: Regenerate. --- configur

Re: [PATCH] build: Fix missing variable quotes

2024-06-14 Thread Arthur Cohen
Hi Collin, Sorry about the mess. As Sam pointed out, there was already a patch proposed in the bugzilla PR which I've posted on the ML as well for review. The only difference with your patch is that it also changes ac_cv_search_pthread_crate to ac_cv_search_pthread_create, as otherwise the ch

[PATCHSET 14.2] Add documentation rules for Rust frontend

2024-06-14 Thread Arthur Cohen
Hi everyone, This is a quick and simple patchset to our Makefile in order to have proper documentation rules for the Rust frontend. Let me know if these changes would be accepted into 14.2, or if we should rather integrate them to trunk for 15.1 as part of our upstreaming process. If the changes

[PATCH 14.2 2/3] rust: Add rust.install-dvi and rust.install-html rules

2024-06-14 Thread Arthur Cohen
From: Christophe Lyon rust has the (empty) rust.dvi and rust.html rules, but lacks the (empty) rust.install-dvi and rust.install-html ones. 2024-04-04 Christophe Lyon gcc/rust/ * Make-lang.in (rust.install-dvi, rust.install-html): New rules. --- gcc/rust/Make-lang.in | 2 ++

[PATCH 14.2 1/3] gccrs: Add base documentation for using the Rust frontend.

2024-06-14 Thread Arthur Cohen
gcc/rust/ChangeLog: * Make-lang.in: Add documentation targets. * gccrs.texi: New file. --- gcc/rust/Make-lang.in | 25 +++-- gcc/rust/gccrs.texi | 207 ++ 2 files changed, 225 insertions(+), 7 deletions(-) create mode 100644 gcc/rust/gcc

[PATCH 14.2 3/3] rust: Copy install-html rule from Ada frontend

2024-06-14 Thread Arthur Cohen
gcc/rust/ChangeLog: * Make-lang.in: Add proper rust.install-html rule. --- gcc/rust/Make-lang.in | 19 ++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/gcc/rust/Make-lang.in b/gcc/rust/Make-lang.in index 2395541425f..815a8b315c0 100644 --- a/gcc/rust/Make-

Re: [PATCH 05/52] rust: Replace uses of {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE

2024-06-21 Thread Arthur Cohen
Hi, Sorry about the delay in my answer! The patch looks good to me :) Will you push it as part of your patchset? Kindly, Arthur On 6/3/24 05:00, Kewen Lin wrote: Joseph pointed out "floating types should have their mode, not a poorly defined precision value" in the discussion[1], as he and

Re: [PATCH 05/52] rust: Replace uses of {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE

2024-06-25 Thread Arthur Cohen
Hi Kewen, Sorry for not answering earlier - yes, this sounds good to me :) thanks for taking care of that. Best, Arthur On 6/21/24 12:36, Kewen.Lin wrote: Hi Arthur, on 2024/6/21 18:17, Arthur Cohen wrote: Hi, Sorry about the delay in my answer! The patch looks good to me :) Will you

[PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work

2024-08-01 Thread Arthur Cohen
From: Thomas Schwinge 'gcc/tree.h': #define main_identifier_nodeglobal_trees[TI_MAIN_IDENTIFIER] #define MAIN_NAME_P(NODE) \ (IDENTIFIER_NODE_CHECK (NODE) == main_identifier_node) ..., which is not initialized by default, but has to be set up by every front end ind

[PATCH 002/125] gccrs: Fix false positive for top-level AltPattern

2024-08-01 Thread Arthur Cohen
From: Owen Avery gcc/rust/ChangeLog: * hir/rust-ast-lower-pattern.cc (ASTLoweringPattern::visit): Reset is_let_top_level while visiting GroupedPattern. gcc/testsuite/ChangeLog: * rust/compile/let_alt.rs: Check for false positive. Signed-off-by: Owen Avery ---

[PATCH 003/125] gccrs: minor cleanup in langhook.type_for_mode

2024-08-01 Thread Arthur Cohen
From: Marc Poulhiès gcc/rust/ChangeLog: * rust-lang.cc (grs_langhook_type_for_mode): simplify code for xImode. Add missing long_double_type_node. Signed-off-by: Marc Poulhiès --- gcc/rust/rust-lang.cc | 39 +++ 1 file changed, 15 insertions(

[PATCH 004/125] gccrs: fmt: Start working on format_args!() parser

2024-08-01 Thread Arthur Cohen
This commit adds a base class for parsing the various constructs of a Rust format string, according to the grammar in the reference: https://doc.rust-lang.org/std/fmt/index.html#syntax gcc/rust/ChangeLog: * Make-lang.in: Compile rust-fmt object * ast/rust-fmt.cc: New file.

[PATCH 006/125] gccrs: Add 'gcc/rust/Make-lang.in:LIBFORMAT_PARSER'

2024-08-01 Thread Arthur Cohen
From: Thomas Schwinge ... to avoid verbatim repetition. gcc/rust/ * Make-lang.in (LIBPROC_MACRO_INTERNAL): New. (RUST_LIBDEPS, crab1$(exeext), rust/libformat_parser.a): Use it. --- gcc/rust/Make-lang.in | 12 1 file changed, 8 insertions(+), 4 deletions(-)

[PATCH 008/125] Rust: Don't cache 'libformat_parser.a'

2024-08-01 Thread Arthur Cohen
From: Thomas Schwinge gcc/rust/ * Make-lang.in (LIBFORMAT_PARSER): Point to the actual build artifact. ($(LIBFORMAT_PARSER)): Don't cache it. --- gcc/rust/Make-lang.in | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gcc/rust/Make-lang.in b/gcc/rust/M

[PATCH 012/125] gccrs: libformat_parser: Start experimenting with cbindgen

2024-08-01 Thread Arthur Cohen
libgrust/ChangeLog: * libformat_parser/cbindgen.toml: New file. * libformat_parser/libformat-parser.h: New file. gcc/rust/ChangeLog: * ast/rust-fmt.h: Add remaining FFI types. --- gcc/rust/ast/rust-fmt.h | 4 +- libgrust/libformat_parser/cbindgen.t

[PATCH 005/125] gccrs: libgrust: Add format_parser library

2024-08-01 Thread Arthur Cohen
Compile libformat_parser and link to it. gcc/rust/ChangeLog: * Make-lang.in: Compile libformat_parser. * ast/rust-fmt.cc: New FFI definitions. * ast/rust-fmt.h: Likewise. * expand/rust-macro-builtins.cc (MacroBuiltin::format_args_handler): Call into libfor

[PATCH 009/125] Rust: Move 'libformat_parser' build into the GCC build directory

2024-08-01 Thread Arthur Cohen
From: Thomas Schwinge Fixes #2883. gcc/rust/ChangeLog: * Make-lang.in (LIBFORMAT_PARSER): Point to the GCC build directory. * ($(LIBFORMAT_PARSER)): Build in the GCC build directory. --- gcc/rust/Make-lang.in | 11 +-- 1 file changed, 9 insertions(+), 2 deletions

[PATCH 013/125] gccrs: libformat_parser: Update header and remove old interface

2024-08-01 Thread Arthur Cohen
gcc/rust/ChangeLog: * ast/rust-fmt.cc (Pieces::collect): Use new Pieces API. * ast/rust-fmt.h: Update interface with new FFI bindings. libgrust/ChangeLog: * libformat_parser/src/lib.rs: Add IntoFFI trait. * libformat_parser/libformat-parser.h: Removed. --- gcc/ru

[PATCH 011/125] gccrs: libformat_parser: Add FFI safe interface

2024-08-01 Thread Arthur Cohen
libgrust/ChangeLog: * libformat_parser/generic_format_parser/src/lib.rs: Add generic library. * libformat_parser/src/lib.rs: Add base for FFI interface. --- .../generic_format_parser/src/lib.rs | 2 +- libgrust/libformat_parser/src/lib.rs | 301

[PATCH 010/125] Rust: Move 'libformat_parser' build into libgrust

2024-08-01 Thread Arthur Cohen
From: Thomas Schwinge Addresses #2883. contrib/ * gcc_update (files_and_dependencies): Update for 'libformat_parser' in libgrust. gcc/rust/ * Make-lang.in (LIBFORMAT_PARSER): Point to 'libformat_parser' build in libgrust. (%.toml:, $(LIBFOR

[PATCH 017/125] gccrs: rust-fmt: Store parsed string in Pieces struct

2024-08-01 Thread Arthur Cohen
gcc/rust/ChangeLog: * ast/rust-fmt.cc (Pieces::collect): Fix signature to take ownership of the given string. * ast/rust-fmt.h (struct Pieces): Store parsed string in the struct. libgrust/ChangeLog: * libformat_parser/src/lib.rs: Add debug prompt. --- gcc/rust/as

[PATCH 016/125] gccrs: format_args: Parse entire token invocation

2024-08-01 Thread Arthur Cohen
gcc/rust/ChangeLog: * expand/rust-macro-builtins.cc (MacroBuiltin::format_args_handler): Transform entire invocation token stream into string for the parser. --- gcc/rust/expand/rust-macro-builtins.cc | 40 ++ 1 file changed, 22 insertions(+), 18 deletions(

[PATCH 014/125] gccrs: libformat_parser: Send boxed values across FFI properly

2024-08-01 Thread Arthur Cohen
gcc/rust/ChangeLog: * ast/rust-fmt.cc (Pieces::~Pieces): Call libformat_parser's release function in destructor. * ast/rust-fmt.h (struct PieceSlice): Add capacity. (destroy_pieces): New. (struct Pieces): Add destructor. libgrust/ChangeLog: * libfo

[PATCH 024/125] gccrs: extern-types: Declare external types in name resolver.

2024-08-01 Thread Arthur Cohen
gcc/rust/ChangeLog: * resolve/rust-ast-resolve-implitem.h: Declare external types as new types. --- gcc/rust/resolve/rust-ast-resolve-implitem.h | 19 +++ 1 file changed, 19 insertions(+) diff --git a/gcc/rust/resolve/rust-ast-resolve-implitem.h b/gcc/rust/resolv

[PATCH 018/125] gccrs: libformat_parser: Fix Rust warnings.

2024-08-01 Thread Arthur Cohen
libgrust/ChangeLog: * libformat_parser/generic_format_parser/src/lib.rs: Remove unused deprecated attribute and unused import. * libformat_parser/src/lib.rs: Remove unused import. --- libgrust/libformat_parser/generic_format_parser/src/lib.rs | 2 -- libgrust/libformat_par

[PATCH 026/125] gccrs: extern-types: Lower to HIR::ExternalTypeItem properly

2024-08-01 Thread Arthur Cohen
gcc/rust/ChangeLog: * hir/rust-ast-lower-extern.h: Lower to HIR::ExternalTypeItem nodes. * hir/tree/rust-hir-item.h (class ExternalTypeItem): Create private visibility by default as extern types have no visibility - add a comment about the correctness of this. ---

[PATCH 029/125] gccrs: macro-builtins: Add newline generic format_args!() handler

2024-08-01 Thread Arthur Cohen
gcc/rust/ChangeLog: * expand/rust-macro-builtins.cc (format_args_maker): New function. (try_expand_many_expr): Add comment about reworking function. (MacroBuiltin::format_args_handler): Add newline parameter. * expand/rust-macro-builtins.h: Likewise. --- gcc/rust/e

[PATCH 019/125] gccrs: format-parser: Add `is_some_and` method for Option

2024-08-01 Thread Arthur Cohen
Workaround for Ubuntu 18.04, since we still use it for the GCC 4.8 CI. The default Rust package is 1.65 (and unlikely to change I assume?), but the generic format parser library uses `is_some_and` which was introduced in 1.70. So this is a simple reimplementation, directly taken from the standard l

[PATCH 015/125] gccrs: format_args: Parse format string properly

2024-08-01 Thread Arthur Cohen
gcc/rust/ChangeLog: * expand/rust-macro-builtins.cc (MacroBuiltin::format_args_handler): Construct string to parser properly. --- gcc/rust/expand/rust-macro-builtins.cc | 19 ++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/gcc/rust/expand/rust-mac

[PATCH 035/125] gccrs: Add curly brackets, formatted clang

2024-08-01 Thread Arthur Cohen
From: jjasmine gcc/rust/ChangeLog: * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Add error emitting --- gcc/rust/resolve/rust-late-name-resolver-2.0.cc | 17 - 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/gcc/rust/resolve/rust-late-name-resol

[PATCH 028/125] gccrs: ast: Add base nodes for FormatArgs

2024-08-01 Thread Arthur Cohen
This commit adds a base for creating AST FormatArgs nodes after expanding invocations of `format_args!()`. These nodes will then be expanded to the proper runtime function calls (to core::fmt::rt) during the AST lowering. gcc/rust/ChangeLog: * ast/rust-builtin-ast-nodes.h: New file.

[PATCH 027/125] gccrs: Make DefaultResolver visit more of the AST

2024-08-01 Thread Arthur Cohen
From: Owen Avery gcc/rust/ChangeLog: * resolve/rust-default-resolver.cc (DefaultResolver::visit): Visit inner AST nodes of ClosureExprInner, ClosureExprInnerTyped, IfExpr, IfExprConseqElse, MatchExpr, PathInExpression, EnumItemTuple, EnumItemStruct, and En

[PATCH 025/125] gccrs: hir: Add ExternalTypeItem node

2024-08-01 Thread Arthur Cohen
gcc/rust/ChangeLog: * hir/tree/rust-hir-item.h (class ExternalTypeItem): New class. * hir/tree/rust-hir.cc (ExternalTypeItem::as_string): Likewise. * backend/rust-compile-extern.h: Add base for handling HIR::ExternalTypeItem node. * checks/errors/borrowck/r

[PATCH 020/125] gccrs: Adjust error checks to match name resolution 2.0

2024-08-01 Thread Arthur Cohen
From: Owen Avery gcc/testsuite/ChangeLog: * rust/compile/bad_stmt_enums.rs: Adjust redefinition error. * rust/compile/bad_toplevel_enums.rs: Likewise. * rust/compile/redef_error1.rs: Likewise. * rust/compile/redef_error3.rs: Likewise. * rust/compile/redef_

[PATCH 030/125] gccrs: parser: Add peek(n) method to parser

2024-08-01 Thread Arthur Cohen
gcc/rust/ChangeLog: * parse/rust-parse.h: New method. --- gcc/rust/parse/rust-parse.h | 1 + 1 file changed, 1 insertion(+) diff --git a/gcc/rust/parse/rust-parse.h b/gcc/rust/parse/rust-parse.h index 1614d19e4a5..8c8bf96eb8d 100644 --- a/gcc/rust/parse/rust-parse.h +++ b/gcc/rust/parse/

[PATCH 032/125] gccrs: lower: Add base for lowering FormatArgs nodes

2024-08-01 Thread Arthur Cohen
gcc/rust/ChangeLog: * Make-lang.in: Compile the new source file. * ast/rust-ast-collector.cc (TokenCollector::visit): Error out when visiting FormatArgs nodes. * resolve/rust-ast-resolve-base.cc (ResolverBase::visit): Likewise. * hir/rust-ast-lower-expr.cc (

[PATCH 021/125] gccrs: Fix small FixMe task in rust macro builtins

2024-08-01 Thread Arthur Cohen
From: jjasmine gcc/rust/ChangeLog: * expand/rust-macro-builtins.cc: Change BuiltinMacro in builtin_macro_from_string to tl::optional<> * expand/rust-macro-builtins.h (enum class): Change BuiltinMacro in builtin_macro_from_string to tl::optional<> * resolve

[PATCH 036/125] gccrs: Ensure TupleStructPattern and TuplePattern have items

2024-08-01 Thread Arthur Cohen
From: Owen Avery Note that instances of both classes which have been moved from will have (items == nullptr). gcc/rust/ChangeLog: * ast/rust-pattern.h (class TupleStructPattern): Assert that items != nullptr. (class TuplePattern): Likewise. (TupleStructPattern::h

[PATCH 033/125] gccrs: format-args: Add documentation for future expansion of function

2024-08-01 Thread Arthur Cohen
gcc/rust/ChangeLog: * expand/rust-macro-builtins.cc (MacroBuiltin::format_args_handler): Add documentation regarding future tasks. --- gcc/rust/expand/rust-macro-builtins.cc | 26 +- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/gcc/rust/ex

[PATCH 037/125] gccrs: Clean BiMap to use tl::optional for lookups

2024-08-01 Thread Arthur Cohen
From: Sourabh Jaiswal gcc/rust/Changelog: * expand/rust-expand-visitor.cc (ExpandVisitor::expand_inner_items): Adjust to use has_value () (ExpandVisitor::expand_inner_stmts): Likewise * expand/rust-macro-builtins.cc (builtin_macro_from_string): Likewise (m

[PATCH 022/125] gccrs: lang-items: Cleanup parsing and lookups of lang items.

2024-08-01 Thread Arthur Cohen
gcc/rust/ChangeLog: * Make-lang.in: Compile new rust-lang-item.o. * util/rust-lang-item.h: Split into header and source. * util/rust-lang-item.cc: Cleanup parsing of lang items by using a hashmap and returning optional values, cleanup handling of exhaustive lang it

<    1   2   3   4   5   6   7   8   9   10   >