mirror of
https://github.com/westes/flex.git
synced 2026-01-26 15:39:06 +00:00
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:
parent
31c3f7703d
commit
981867ff15
@ -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",
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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.
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user