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>
#include <cstdlib>
namespace Literal {
-extern "C" {
void
-Literal__drop (Literal *lit)
+Literal::drop (Literal *lit)
{
switch (lit->tag)
{
}
}
+extern "C" {
+
+void
+Literal__drop (Literal *lit)
+{
+ Literal::drop (lit);
+}
+
Literal
Literal__string (const unsigned char *str, std::uint64_t len)
{
static Literal make_unsigned (UnsignedSuffixPayload p);
static Literal make_signed (SignedSuffixPayload p);
+
+ static void drop (Literal *lit);
};
extern "C" {