public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/rust/master] libproc_macro: Add drop function to Literal struct
@ 2023-05-02 7:09 Thomas Schwinge
0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2023-05-02 7:09 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:ca50a4f3a665031a92e5030650049f7484756028
commit ca50a4f3a665031a92e5030650049f7484756028
Author: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Date: Wed Apr 12 17:56:36 2023 +0200
libproc_macro: Add drop function to Literal struct
Add a drop function to clean internal fields of a Literal struct.
ChangeLog:
* libgrust/libproc_macro/literal.cc (Literal__drop): Replace
implementation by a call to Literal::drop.
(Literal::drop): Add drop implementation.
* libgrust/libproc_macro/literal.h: Add function prototype.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Diff:
---
libgrust/libproc_macro/literal.cc | 11 +++++++++--
libgrust/libproc_macro/literal.h | 2 ++
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/libgrust/libproc_macro/literal.cc b/libgrust/libproc_macro/literal.cc
index aad7090d7ab..221c57a0da5 100644
--- a/libgrust/libproc_macro/literal.cc
+++ b/libgrust/libproc_macro/literal.cc
@@ -25,10 +25,9 @@
#include <cstdlib>
namespace Literal {
-extern "C" {
void
-Literal__drop (Literal *lit)
+Literal::drop (Literal *lit)
{
switch (lit->tag)
{
@@ -51,6 +50,14 @@ Literal__drop (Literal *lit)
}
}
+extern "C" {
+
+void
+Literal__drop (Literal *lit)
+{
+ Literal::drop (lit);
+}
+
Literal
Literal__string (const unsigned char *str, std::uint64_t len)
{
diff --git a/libgrust/libproc_macro/literal.h b/libgrust/libproc_macro/literal.h
index b7894222105..2c61231e8b2 100644
--- a/libgrust/libproc_macro/literal.h
+++ b/libgrust/libproc_macro/literal.h
@@ -188,6 +188,8 @@ public:
static Literal make_unsigned (UnsignedSuffixPayload p);
static Literal make_signed (SignedSuffixPayload p);
+
+ static void drop (Literal *lit);
};
extern "C" {
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-05-02 7:09 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-02 7:09 [gcc/devel/rust/master] libproc_macro: Add drop function to Literal struct Thomas Schwinge
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).