Remaining structures from the rust bridge that missed a drop function
now have one.
libgrust/ChangeLog:
* libproc_macro/group.cc (Group::drop): Add drop
implementation.
* libproc_macro/group.h: Add drop prototype.
* libproc_macro/tokenstream.cc (TokenStream::drop): Add
drop implementation.
(TokenStream__drop): Change to a call to TokenStream::drop.
* libproc_macro/tokenstream.h: Add drop prototype.
* libproc_macro/tokentree.cc (TokenTree::drop): Add
drop implementation.
* libproc_macro/tokentree.h: Add drop prototype.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Add a drop function to clean internal fields of a Literal struct.
libgrust/ChangeLog:
* libproc_macro/literal.cc (Literal__drop): Replace
implementation by a call to Literal::drop.
(Literal::drop): Add drop implementation.
* libproc_macro/literal.h: Add function prototype.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Add a drop function that cleans internal fields of a given Ident struct.
libgrust/ChangeLog:
* libproc_macro/ident.cc (Ident__drop): Replace by call
to Ident::drop.
(Ident::drop): Add drop function.
* libproc_macro/ident.h: Add drop prototype.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Add remaining missing tokenstream structures. Most are interdependent.
libgrust/ChangeLog:
* libproc_macro/group.cc: New file.
* libproc_macro/group.h: New file.
* libproc_macro/tokenstream.cc: New file.
* libproc_macro/tokenstream.h: New file.
* libproc_macro/tokentree.cc: New file.
* libproc_macro/tokentree.h: New file.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Add Punct struct for rust interface as well as a basic named
constructor.
libgrust/ChangeLog:
* libproc_macro/punct.cc: New file.
* libproc_macro/punct.h: New file.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Add a new Ident namespace to group Ident related enumeration and
structures.
libgrust/ChangeLog:
* libproc_macro/ident.cc (Ident::make_ident): Add Ident
namespace.
* libproc_macro/ident.h (Ident__clone): Likewise.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Add named constructor directly in Ident struct.
libgrust/ChangeLog:
* libproc_macro/ident.cc (Ident__new): Use named
constructor.
(Ident__new_raw): Use named constructor.
(Ident__clone): Use clone member function.
(Ident::clone): Make clone const.
(Ident::make_ident): Add named construcot.
* libproc_macro/ident.h (struct Ident): Add named
constructor prototypes.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Change rust interface on drop function to take a mut pointer instead.
This will match the drop trait interface more closely.
libgrust/ChangeLog:
* libproc_macro/rust/bridge/ident.rs: Change drop
function interface.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Add implementation and representation for ident cpp structure as well as
a high level wrapper interface.
libgrust/ChangeLog:
* libproc_macro/ident.cc: New file.
* libproc_macro/ident.h: New file.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Add a Literal namespace to gather all every literal related code.
libgrust/ChangeLog:
* libproc_macro/literal.cc (Literal__from_string):
Add abort because unimplemented.
* libproc_macro/literal.h (Literal__from_string): Add
namespace.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
The rust API requires a mut reference, hence having a mutable pointer
seems to match better. Furthermore the implementation is now modifying
the struct in order to set the size to 0 instead of simply freeing the
data, this will allow us to easily identify mistaken manual call to this
function.
libgrust/ChangeLog:
* libproc_macro/rust/bridge/literal.rs: Make the
pointer mutable.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Add literal type related ffi functions implementation.
libgrust/ChangeLog:
* libproc_macro/literal.h (Literal__drop): Implement
drop.
(Literal__string): Constructor from a string function prototype.
(Literal__byte_string): Constructor from a byte string function
prototype.
(Literal__from_string): Add function body, no implementation
yet.
* libproc_macro/literal.cc: New file.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
libgrust/ChangeLog:
* libproc_macro/rust/bridge.rs: New file.
* libproc_macro/rust/bridge/group.rs: New file.
* libproc_macro/rust/bridge/ident.rs: New file.
* libproc_macro/rust/bridge/literal.rs: New file.
* libproc_macro/rust/bridge/punct.rs: New file.
* libproc_macro/rust/bridge/span.rs: New file.
* libproc_macro/rust/bridge/token_stream.rs: New file.
* libproc_macro/rust/group.rs: New file.
* libproc_macro/rust/ident.rs: New file.
* libproc_macro/rust/lib.rs: New file.
* libproc_macro/rust/literal.rs: New file.
* libproc_macro/rust/punct.rs: New file.
* libproc_macro/rust/span.rs: New file.
* libproc_macro/rust/token_stream.rs: New file.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
..., but not for host builds, which don't need it, and it may cause the build
to fail.
Use what appears to be the standard pattern for that (see
'libbacktrace/configure.ac', 'zlib/configure.ac').
PR rust/113056
libgrust/
* configure.ac: 'AM_ENABLE_MULTILIB' only for target builds.
* configure: Regenerate.