mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-11 21:33:04 +00:00
gnulib: move timevar to it
* lib/timevar.c, lib/timevar.h, m4/timevar.m4: Remove. * gnulib: Update. * configure.ac: Adjust. * lib/timevar.def: Use lower case for the timevvars. Adjust dependencies.
This commit is contained in:
28
src/ielr.c
28
src/ielr.c
@@ -929,7 +929,7 @@ ielr_compute_state (bitsetv follow_kernel_items, bitsetv always_follows,
|
||||
* compatibility or, if <tt>annotation_lists = NULL</tt>, the canonical
|
||||
* LR(1) state compatibility test was used.
|
||||
* - If <tt>annotation_lists = NULL</tt>, reduction lookahead sets were
|
||||
* computed in all states. TV_IELR_PHASE4 was pushed while they were
|
||||
* computed in all states. tv_ielr_phase4 was pushed while they were
|
||||
* computed from item lookahead sets.
|
||||
*/
|
||||
static void
|
||||
@@ -1004,7 +1004,7 @@ ielr_split_states (bitsetv follow_kernel_items, bitsetv always_follows,
|
||||
lookahead sets. */
|
||||
if (!annotation_lists)
|
||||
{
|
||||
timevar_push (TV_IELR_PHASE4);
|
||||
timevar_push (tv_ielr_phase4);
|
||||
initialize_LA ();
|
||||
for (state_list *node = first_state; node; node = node->next)
|
||||
if (!node->state->consistent)
|
||||
@@ -1037,7 +1037,7 @@ ielr_split_states (bitsetv follow_kernel_items, bitsetv always_follows,
|
||||
}
|
||||
}
|
||||
}
|
||||
timevar_pop (TV_IELR_PHASE4);
|
||||
timevar_pop (tv_ielr_phase4);
|
||||
}
|
||||
|
||||
/* Free state list. */
|
||||
@@ -1080,7 +1080,7 @@ ielr (void)
|
||||
}
|
||||
|
||||
/* Phase 0: LALR(1). */
|
||||
timevar_push (TV_LALR);
|
||||
timevar_push (tv_lalr);
|
||||
if (lr_type == LR_TYPE__CANONICAL_LR)
|
||||
set_goto_map ();
|
||||
else
|
||||
@@ -1088,10 +1088,10 @@ ielr (void)
|
||||
if (lr_type == LR_TYPE__LALR)
|
||||
{
|
||||
bitsetv_free (goto_follows);
|
||||
timevar_pop (TV_LALR);
|
||||
timevar_pop (tv_lalr);
|
||||
return;
|
||||
}
|
||||
timevar_pop (TV_LALR);
|
||||
timevar_pop (tv_lalr);
|
||||
|
||||
{
|
||||
bitsetv follow_kernel_items;
|
||||
@@ -1104,14 +1104,14 @@ ielr (void)
|
||||
{
|
||||
/* Phase 1: Compute Auxiliary Tables. */
|
||||
state ***predecessors;
|
||||
timevar_push (TV_IELR_PHASE1);
|
||||
timevar_push (tv_ielr_phase1);
|
||||
ielr_compute_auxiliary_tables (
|
||||
&follow_kernel_items, &always_follows,
|
||||
lr_type == LR_TYPE__CANONICAL_LR ? NULL : &predecessors);
|
||||
timevar_pop (TV_IELR_PHASE1);
|
||||
timevar_pop (tv_ielr_phase1);
|
||||
|
||||
/* Phase 2: Compute Annotations. */
|
||||
timevar_push (TV_IELR_PHASE2);
|
||||
timevar_push (tv_ielr_phase2);
|
||||
if (lr_type != LR_TYPE__CANONICAL_LR)
|
||||
{
|
||||
obstack_init (&annotations_obstack);
|
||||
@@ -1125,11 +1125,11 @@ ielr (void)
|
||||
bitsetv_free (goto_follows);
|
||||
lalr_free ();
|
||||
}
|
||||
timevar_pop (TV_IELR_PHASE2);
|
||||
timevar_pop (tv_ielr_phase2);
|
||||
}
|
||||
|
||||
/* Phase 3: Split States. */
|
||||
timevar_push (TV_IELR_PHASE3);
|
||||
timevar_push (tv_ielr_phase3);
|
||||
{
|
||||
state_number nstates_lr0 = nstates;
|
||||
ielr_split_states (follow_kernel_items, always_follows,
|
||||
@@ -1144,11 +1144,11 @@ ielr (void)
|
||||
free (annotation_lists);
|
||||
bitsetv_free (follow_kernel_items);
|
||||
bitsetv_free (always_follows);
|
||||
timevar_pop (TV_IELR_PHASE3);
|
||||
timevar_pop (tv_ielr_phase3);
|
||||
}
|
||||
|
||||
/* Phase 4: Compute Reduction Lookaheads. */
|
||||
timevar_push (TV_IELR_PHASE4);
|
||||
timevar_push (tv_ielr_phase4);
|
||||
free (goto_map);
|
||||
free (from_state);
|
||||
free (to_state);
|
||||
@@ -1163,5 +1163,5 @@ ielr (void)
|
||||
lalr ();
|
||||
bitsetv_free (goto_follows);
|
||||
}
|
||||
timevar_pop (TV_IELR_PHASE4);
|
||||
timevar_pop (tv_ielr_phase4);
|
||||
}
|
||||
|
||||
52
src/main.c
52
src/main.c
@@ -82,7 +82,7 @@ main (int argc, char *argv[])
|
||||
|
||||
timevar_enabled = trace_flag & trace_time;
|
||||
timevar_init ();
|
||||
timevar_start (TV_TOTAL);
|
||||
timevar_start (tv_total);
|
||||
|
||||
if (trace_flag & trace_bitsets)
|
||||
bitset_stats_enable ();
|
||||
@@ -91,29 +91,29 @@ main (int argc, char *argv[])
|
||||
and FATTRS. In file reader.c. The other parts are recorded in
|
||||
the grammar; see gram.h. */
|
||||
|
||||
timevar_push (TV_READER);
|
||||
timevar_push (tv_reader);
|
||||
reader ();
|
||||
timevar_pop (TV_READER);
|
||||
timevar_pop (tv_reader);
|
||||
|
||||
if (complaint_status == status_complaint)
|
||||
goto finish;
|
||||
|
||||
/* Find useless nonterminals and productions and reduce the grammar. */
|
||||
timevar_push (TV_REDUCE);
|
||||
timevar_push (tv_reduce);
|
||||
reduce_grammar ();
|
||||
timevar_pop (TV_REDUCE);
|
||||
timevar_pop (tv_reduce);
|
||||
|
||||
/* Record other info about the grammar. In files derives and
|
||||
nullable. */
|
||||
timevar_push (TV_SETS);
|
||||
timevar_push (tv_sets);
|
||||
derives_compute ();
|
||||
nullable_compute ();
|
||||
timevar_pop (TV_SETS);
|
||||
timevar_pop (tv_sets);
|
||||
|
||||
/* Compute LR(0) parser states. See state.h for more info. */
|
||||
timevar_push (TV_LR0);
|
||||
timevar_push (tv_lr0);
|
||||
generate_states ();
|
||||
timevar_pop (TV_LR0);
|
||||
timevar_pop (tv_lr0);
|
||||
|
||||
/* Add lookahead sets to parser states. Except when LALR(1) is
|
||||
requested, split states to eliminate LR(1)-relative
|
||||
@@ -124,7 +124,7 @@ main (int argc, char *argv[])
|
||||
lookahead is not enough to disambiguate the parsing. In file
|
||||
conflicts. Also resolve s/r conflicts based on precedence
|
||||
declarations. */
|
||||
timevar_push (TV_CONFLICTS);
|
||||
timevar_push (tv_conflicts);
|
||||
conflicts_solve ();
|
||||
if (!muscle_percent_define_flag_if ("lr.keep-unreachable-state"))
|
||||
{
|
||||
@@ -136,12 +136,12 @@ main (int argc, char *argv[])
|
||||
free (old_to_new);
|
||||
}
|
||||
conflicts_print ();
|
||||
timevar_pop (TV_CONFLICTS);
|
||||
timevar_pop (tv_conflicts);
|
||||
|
||||
/* Compute the parser tables. */
|
||||
timevar_push (TV_ACTIONS);
|
||||
timevar_push (tv_actions);
|
||||
tables_generate ();
|
||||
timevar_pop (TV_ACTIONS);
|
||||
timevar_pop (tv_actions);
|
||||
|
||||
grammar_rules_useless_report (_("rule useless in parser due to conflicts"));
|
||||
|
||||
@@ -153,25 +153,25 @@ main (int argc, char *argv[])
|
||||
/* Output the detailed report on the grammar. */
|
||||
if (report_flag)
|
||||
{
|
||||
timevar_push (TV_REPORT);
|
||||
timevar_push (tv_report);
|
||||
print_results ();
|
||||
timevar_pop (TV_REPORT);
|
||||
timevar_pop (tv_report);
|
||||
}
|
||||
|
||||
/* Output the graph. */
|
||||
if (graph_flag)
|
||||
{
|
||||
timevar_push (TV_GRAPH);
|
||||
timevar_push (tv_graph);
|
||||
print_graph ();
|
||||
timevar_pop (TV_GRAPH);
|
||||
timevar_pop (tv_graph);
|
||||
}
|
||||
|
||||
/* Output xml. */
|
||||
if (xml_flag)
|
||||
{
|
||||
timevar_push (TV_XML);
|
||||
timevar_push (tv_xml);
|
||||
print_xml ();
|
||||
timevar_pop (TV_XML);
|
||||
timevar_pop (tv_xml);
|
||||
}
|
||||
|
||||
/* Stop if there were errors, to avoid trashing previous output
|
||||
@@ -180,16 +180,16 @@ main (int argc, char *argv[])
|
||||
goto finish;
|
||||
|
||||
/* Lookahead tokens are no longer needed. */
|
||||
timevar_push (TV_FREE);
|
||||
timevar_push (tv_free);
|
||||
lalr_free ();
|
||||
timevar_pop (TV_FREE);
|
||||
timevar_pop (tv_free);
|
||||
|
||||
/* Output the tables and the parser to ftable. In file output. */
|
||||
timevar_push (TV_PARSER);
|
||||
timevar_push (tv_parser);
|
||||
output ();
|
||||
timevar_pop (TV_PARSER);
|
||||
timevar_pop (tv_parser);
|
||||
|
||||
timevar_push (TV_FREE);
|
||||
timevar_push (tv_free);
|
||||
nullable_free ();
|
||||
derives_free ();
|
||||
tables_free ();
|
||||
@@ -207,7 +207,7 @@ main (int argc, char *argv[])
|
||||
code_scanner_free ();
|
||||
skel_scanner_free ();
|
||||
quotearg_free ();
|
||||
timevar_pop (TV_FREE);
|
||||
timevar_pop (tv_free);
|
||||
|
||||
if (trace_flag & trace_bitsets)
|
||||
bitset_stats_dump (stderr);
|
||||
@@ -215,7 +215,7 @@ main (int argc, char *argv[])
|
||||
finish:
|
||||
|
||||
/* Stop timing and print the times. */
|
||||
timevar_stop (TV_TOTAL);
|
||||
timevar_stop (tv_total);
|
||||
timevar_print (stderr);
|
||||
|
||||
cleanup_caret ();
|
||||
|
||||
@@ -603,7 +603,7 @@ output_skeleton (void)
|
||||
}
|
||||
|
||||
/* Read and process m4's output. */
|
||||
timevar_push (TV_M4);
|
||||
timevar_push (tv_m4);
|
||||
{
|
||||
FILE *in = xfdopen (filter_fd[0], "r");
|
||||
scan_skel (in);
|
||||
@@ -614,7 +614,7 @@ output_skeleton (void)
|
||||
xfclose (in);
|
||||
}
|
||||
wait_subprocess (pid, "m4", false, false, true, true, NULL);
|
||||
timevar_pop (TV_M4);
|
||||
timevar_pop (tv_m4);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
Reference in New Issue
Block a user