]> git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: libproc_macro: Change Ident structure
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Wed, 19 Jul 2023 09:50:23 +0000 (11:50 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 17:55:56 +0000 (18:55 +0100)
commitf7af0b90ef489eb90bcab2dd47a171dc550fb303
tree48396bf81ea49cc605bc6954ffba97eca99c2afd
parentbee12555414e19c9cbeaf3b7550f9f93e939e392
gccrs: libproc_macro: Change Ident structure

Use FFIString in Ident structure rather that a raw pointer and a
length, this will reduce the size of the code dealing with raw
pointers. Which should prevent some error.

gcc/rust/ChangeLog:

* util/rust-token-converter.cc (from_ident): Adapt code to new
constructor.

libgrust/ChangeLog:

* libproc_macro/ident.cc (Ident__new): Constructor
accepts an FFIString now.
(Ident__new_raw): Likewise.
(Ident::clone): Internal members change means clone also change.
(Ident::make_ident): Change constructor call.
(Ident::drop): Add call to FFIString::clone.
* libproc_macro/ident.h (struct Ident): Remove raw
pointer and length, add an FFIString inside instead.
(Ident__new): Change constructor.
(Ident__new_raw): Change constructor.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/rust/util/rust-token-converter.cc
libgrust/libproc_macro/ident.cc
libgrust/libproc_macro/ident.h