From: ceriel Date: Tue, 10 Feb 1987 16:50:32 +0000 (+0000) Subject: Added some code to handle -Oego,opt,asopt and the like. X-Git-Tag: release-5-5~4686 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=2295cd130a18b5a8cc3cb404f6c348a3baefe999;p=ack.git Added some code to handle -Oego,opt,asopt and the like. By default, optimizers can be excluded by giving them a negative priority in the description files. This is currently done for the global optimizer --- diff --git a/util/ack/data.h b/util/ack/data.h index 5208efc90..f9f6d1a19 100644 --- a/util/ack/data.h +++ b/util/ack/data.h @@ -5,7 +5,9 @@ EXTERN char *stopsuffix; /* Suffix to stop at */ EXTERN char *machine; /* The machine id */ EXTERN char *callname; /* argv[0] */ -EXTERN char *rts; /* The runtime-system id */ +EXTERN char *rts; /* The runtime-system */ +EXTERN char *rtsuf; /* The runtime-system module suffix */ +EXTERN char *Optlist; /* Which optimizers */ EXTERN list_head arguments; /* List of arguments */ EXTERN list_head flags; /* List of flags */ diff --git a/util/ack/main.c b/util/ack/main.c index e4432de56..3a68bf283 100644 --- a/util/ack/main.c +++ b/util/ack/main.c @@ -175,6 +175,8 @@ vieuwargs(argc,argv) char **argv ; { hide=YES ; break ; case 'O': Optflag++ ; + Optlist= &argp[2] ; + eaten=1 ; break ; case 'v': if ( argp[2] ) { v_flag += atoi(&argp[2]) ; diff --git a/util/ack/scan.c b/util/ack/scan.c index a43193fc5..67f00b43d 100644 --- a/util/ack/scan.c +++ b/util/ack/scan.c @@ -84,6 +84,7 @@ try(f_scan,suffix) list_elem *f_scan; char *suffix; { scan_found(); return ; } + if (! f_scan) return; scanlist(f_scan, scan) { trafo= t_cont(*scan) ; if ( satisfy(trafo,suffix) ) { @@ -129,10 +130,10 @@ try(f_scan,suffix) list_elem *f_scan; char *suffix; { scan_found() ; return ; } - if ( l_next(*scan) ) { - try(l_next(*scan),trafo->t_out); + if (! l_next(*scan) && !stopsuffix) { + scan_found() ; } else { - if ( !stopsuffix ) scan_found() ; + try(l_next(*scan),trafo->t_out); } trafo->t_scan= NO ; }