Land the footprint-reporting feature.

Also, clean up some unused and duplicative symbols.

In generated test code, comment and whitespace diffs only
except for YY_INT_ALIGNED going away.

#48 in the retargeting patch series
This commit is contained in:
Eric S. Raymond 2020-09-30 08:05:09 -04:00
parent 31c3f7703d
commit 981867ff15
4 changed files with 5 additions and 10 deletions

View File

@ -425,11 +425,6 @@ static void cpp_epilog (void)
#endif
}
static const char *cpp_yy_int_aligned(void)
{
return long_align ? "long int" : "short int";
}
static void cpp_comment(const char *txt)
{
char buf[MAXLINE];
@ -654,7 +649,6 @@ struct flex_backend_t cpp_backend = {
.prolog = cpp_prolog,
.skel = cpp_skel,
.epilog = cpp_epilog,
.yy_int_aligned = cpp_yy_int_aligned,
.trace_fmt = "#line %d \"%s\"\n",
.int_define_fmt = "#define %s %d\n",
.string_define_fmt = "#define %s %s\n",

View File

@ -310,7 +310,6 @@ struct flex_backend_t {
void (*prolog)(void);
const char **skel;
void (*epilog)(void);
const char *(*yy_int_aligned)(void); // Generate aligned type for this back end
char *trace_fmt; // Trace message format
// Language syntax generation
char *int_define_fmt; // Format for integer constant definitions

View File

@ -815,6 +815,7 @@ void visible_define (const char *symname)
void make_tables (void)
{
char buf[128];
int i;
int did_eof_rule = false;
struct yytbl_data *yynultrans_tbl = NULL;
@ -915,6 +916,10 @@ void make_tables (void)
else
gentabs ();
snprintf(buf, sizeof(buf), "footprint: %ld bytes\n", footprint);
backend->comment(buf);
outc ('\n');
// Only at this point do we know if the automaton has backups.
// Some m4 conditionals require this information.

View File

@ -1254,9 +1254,6 @@ void readin (void)
if (did_outfilename)
line_directive_out (stdout, 0);
/* Create the alignment type. */
buf_strdefine (&userdef_buf, "YY_INT_ALIGNED", backend->yy_int_aligned());
/* Define the start condition macros. */
{
struct Buf tmpbuf;