mirror of
https://github.com/gcc-mirror/gcc.git
synced 2024-11-21 13:40:47 +00:00
gccrs: libproc_macro: Add drop function to Literal struct
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>
This commit is contained in:
parent
c9534eb5d9
commit
2fa0bbc3ee
@ -25,10 +25,9 @@
|
|||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
|
||||||
namespace Literal {
|
namespace Literal {
|
||||||
extern "C" {
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Literal__drop (Literal *lit)
|
Literal::drop (Literal *lit)
|
||||||
{
|
{
|
||||||
switch (lit->tag)
|
switch (lit->tag)
|
||||||
{
|
{
|
||||||
@ -51,6 +50,14 @@ Literal__drop (Literal *lit)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
|
||||||
|
void
|
||||||
|
Literal__drop (Literal *lit)
|
||||||
|
{
|
||||||
|
Literal::drop (lit);
|
||||||
|
}
|
||||||
|
|
||||||
Literal
|
Literal
|
||||||
Literal__string (const unsigned char *str, std::uint64_t len)
|
Literal__string (const unsigned char *str, std::uint64_t len)
|
||||||
{
|
{
|
||||||
|
@ -188,6 +188,8 @@ public:
|
|||||||
|
|
||||||
static Literal make_unsigned (UnsignedSuffixPayload p);
|
static Literal make_unsigned (UnsignedSuffixPayload p);
|
||||||
static Literal make_signed (SignedSuffixPayload p);
|
static Literal make_signed (SignedSuffixPayload p);
|
||||||
|
|
||||||
|
static void drop (Literal *lit);
|
||||||
};
|
};
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
Loading…
Reference in New Issue
Block a user