Add -R param to enable or disable recursion report
This commit is contained in:
parent
56ef450a24
commit
1a608c25a1
@ -817,6 +817,7 @@ SC_VDECL int pc_optimize; /* (peephole) optimization level */
|
||||
SC_VDECL int pc_memflags; /* special flags for the stack/heap usage */
|
||||
SC_VDECL int pc_naked; /* if true mark following function as naked */
|
||||
SC_VDECL int pc_compat; /* running in compatibility mode? */
|
||||
SC_VDECL int pc_recursion; /* enable detailed recursion report? */
|
||||
|
||||
SC_VDECL constvalue sc_automaton_tab; /* automaton table */
|
||||
SC_VDECL constvalue sc_state_tab; /* state table */
|
||||
|
@ -1097,6 +1097,9 @@ static void parseoptions(int argc,char **argv,char *oname,char *ename,char *pnam
|
||||
case 'p':
|
||||
strlcpy(pname,option_value(ptr),_MAX_PATH); /* set name of implicit include file */
|
||||
break;
|
||||
case 'R':
|
||||
pc_recursion=toggle_option(ptr,pc_recursion);
|
||||
break;
|
||||
#if !defined SC_LIGHT
|
||||
case 'r':
|
||||
strlcpy(rname,option_value(ptr),_MAX_PATH); /* set name of report file */
|
||||
@ -1417,6 +1420,7 @@ static void about(void)
|
||||
pc_printf(" 1 JIT-compatible optimizations only\n");
|
||||
pc_printf(" 2 full optimizations\n");
|
||||
pc_printf(" -p<name> set name of \"prefix\" file\n");
|
||||
pc_printf(" -R[+/-] add detailed recursion report with call chains (default=%c)\n",pc_recursion ? '+' : '-');
|
||||
#if !defined SC_LIGHT
|
||||
pc_printf(" -r[name] write cross reference report to console or to specified file\n");
|
||||
#endif
|
||||
@ -4606,7 +4610,7 @@ static long max_stacksize(symbol *root,int *recursion)
|
||||
assert(symstack[1]==NULL);
|
||||
recursion_detected=0;
|
||||
size=max_stacksize_recurse(symstack,sym,rsymstack,0L,&maxparams,&recursion_detected);
|
||||
if (recursion_detected) {
|
||||
if (recursion_detected && pc_recursion) {
|
||||
if (rsymstack[1]==NULL) {
|
||||
pc_printf("recursion detected: function %s directly calls itself\n", sym->name);
|
||||
} else {
|
||||
|
@ -92,6 +92,7 @@ SC_VDEFINE int pc_optimize=sOPTIMIZE_NOMACRO; /* (peephole) optimization level *
|
||||
SC_VDEFINE int pc_memflags=0; /* special flags for the stack/heap usage */
|
||||
SC_VDEFINE int pc_naked=FALSE; /* if true mark following function as naked */
|
||||
SC_VDEFINE int pc_compat=FALSE; /* running in compatibility mode? */
|
||||
SC_VDEFINE int pc_recursion=FALSE; /* enable detailed recursion report? */
|
||||
|
||||
SC_VDEFINE constvalue sc_automaton_tab = { NULL, "", 0, 0}; /* automaton table */
|
||||
SC_VDEFINE constvalue sc_state_tab = { NULL, "", 0, 0}; /* state table */
|
||||
|
Loading…
x
Reference in New Issue
Block a user