Combiners (ego, linkers) now use a list of path's(ack.h) to indicate
their input files. Unmatched flags are now sent to the linker.
This commit is contained in:
parent
1188f0e810
commit
8443ef3f8d
1 changed files with 26 additions and 24 deletions
|
@ -40,7 +40,10 @@ char *headvar(),*tailvar() ;
|
||||||
int transform(phase) register trf *phase ; {
|
int transform(phase) register trf *phase ; {
|
||||||
int ok ;
|
int ok ;
|
||||||
|
|
||||||
if ( !setfiles(phase) ) return 0 ;
|
if ( !setfiles(phase) ) {
|
||||||
|
disc_files(phase) ;
|
||||||
|
return 0 ;
|
||||||
|
}
|
||||||
if ( !phase->t_visited ) {
|
if ( !phase->t_visited ) {
|
||||||
/* The flags are set up once.
|
/* The flags are set up once.
|
||||||
At the first time the phase is used.
|
At the first time the phase is used.
|
||||||
|
@ -56,23 +59,17 @@ int transform(phase) register trf *phase ; {
|
||||||
}
|
}
|
||||||
getcallargs(phase) ;
|
getcallargs(phase) ;
|
||||||
ok= runphase(phase) ;
|
ok= runphase(phase) ;
|
||||||
if ( !ok ) rmtemps() ;
|
if ( !ok ) rmfile(&out) ;
|
||||||
/* Free the space occupied by the arguments,
|
/* Free the space occupied by the arguments,
|
||||||
except for the combiner, since we are bound to exit soon
|
except for the linker, since we are bound to exit soon
|
||||||
and do not foresee further need of memory space */
|
and do not foresee further need of memory space */
|
||||||
if ( !phase->t_combine ) discardargs(phase) ;
|
if ( !phase->t_linker ) discardargs(phase) ;
|
||||||
disc_files() ;
|
disc_files(phase) ;
|
||||||
return ok ;
|
return ok ;
|
||||||
}
|
}
|
||||||
|
|
||||||
int do_combine() {
|
|
||||||
setsvar(keeps(RTS), keeps(rts? rts : "") ) ;
|
|
||||||
if ( !outfile ) outfile= combiner->t_out ;
|
|
||||||
getmapflags(combiner);
|
|
||||||
return transform(combiner) ;
|
|
||||||
}
|
|
||||||
|
|
||||||
getmapflags(phase) register trf *phase ; {
|
getmapflags(phase) register trf *phase ; {
|
||||||
|
register path *l_in ;
|
||||||
register list_elem *elem ;
|
register list_elem *elem ;
|
||||||
int scanned ;
|
int scanned ;
|
||||||
register char *ptr ;
|
register char *ptr ;
|
||||||
|
@ -92,13 +89,15 @@ getmapflags(phase) register trf *phase ; {
|
||||||
}
|
}
|
||||||
*(l_content(*elem)) |= scanned ;
|
*(l_content(*elem)) |= scanned ;
|
||||||
}
|
}
|
||||||
if ( phase->t_combine ) {
|
if ( phase->t_linker ) {
|
||||||
scanlist(l_first(c_arguments),elem) {
|
scanlist(l_first(phase->t_inputs),elem) {
|
||||||
if ( mapflag(&(phase->t_mapf),l_content(*elem)) ) {
|
l_in = p_cont(*elem) ;
|
||||||
throws(l_content(*elem)) ;
|
if ( mapflag(&(phase->t_mapf),l_in->p_path) ) {
|
||||||
|
if ( l_in->p_keeps) throws(l_in->p_path) ;
|
||||||
ptr= keeps(getvar(LIBVAR)) ;
|
ptr= keeps(getvar(LIBVAR)) ;
|
||||||
clr_noscan(ptr) ;
|
clr_noscan(ptr) ;
|
||||||
l_content(*elem)= ptr ;
|
l_in->p_path= ptr ;
|
||||||
|
l_in->p_keeps=YES ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
scanlist(l_first(flags),elem) {
|
scanlist(l_first(flags),elem) {
|
||||||
|
@ -170,11 +169,12 @@ transini() {
|
||||||
l_clear(&R_list) ;
|
l_clear(&R_list) ;
|
||||||
scanlist(l_first(tr_list), elem) {
|
scanlist(l_first(tr_list), elem) {
|
||||||
phase = t_cont(*elem) ;
|
phase = t_cont(*elem) ;
|
||||||
if ( !phase->t_combine ) getmapflags(phase);
|
if ( !phase->t_linker ) getmapflags(phase);
|
||||||
}
|
}
|
||||||
setpvar(keeps(NEEDS),needvar) ;
|
setpvar(keeps(NEEDS),needvar) ;
|
||||||
setpvar(keeps(HEAD),headvar) ;
|
setpvar(keeps(HEAD),headvar) ;
|
||||||
setpvar(keeps(TAIL),tailvar) ;
|
setpvar(keeps(TAIL),tailvar) ;
|
||||||
|
if ( linker ) getmapflags(linker) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
set_Rflag(argp) register char *argp ; {
|
set_Rflag(argp) register char *argp ; {
|
||||||
|
@ -608,6 +608,7 @@ char *c_rep(string,place,rep) char *string, *place, *rep ; {
|
||||||
}
|
}
|
||||||
|
|
||||||
static list_head *curargs ;
|
static list_head *curargs ;
|
||||||
|
static list_head *comb_args ;
|
||||||
|
|
||||||
addargs(string) char *string ; {
|
addargs(string) char *string ; {
|
||||||
register char *temp, *repc ;
|
register char *temp, *repc ;
|
||||||
|
@ -620,19 +621,19 @@ addargs(string) char *string ; {
|
||||||
if ( in.p_path ) { /* All but combiner */
|
if ( in.p_path ) { /* All but combiner */
|
||||||
l_add(curargs,keeps(in.p_path)) ;
|
l_add(curargs,keeps(in.p_path)) ;
|
||||||
} else {
|
} else {
|
||||||
scanlist( l_first(c_arguments), elem ) {
|
scanlist( l_first(*comb_args), elem ) {
|
||||||
l_add(curargs,l_content(*elem)) ;
|
l_add(curargs,p_cont(*elem)->p_path) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
if ( in.p_path ) { /* Not for the combiner */
|
if ( in.p_path ) { /* Not for the combiners */
|
||||||
temp=c_rep(string,repc,in.p_path) ;
|
temp=c_rep(string,repc,in.p_path) ;
|
||||||
addargs(temp) ;
|
addargs(temp) ;
|
||||||
throws(temp) ;
|
throws(temp) ;
|
||||||
} else { /* For the combiner */
|
} else { /* For the combiners */
|
||||||
scanlist( l_first(c_arguments), elem ) {
|
scanlist( l_first(*comb_args), elem ) {
|
||||||
temp=c_rep(string,repc,l_content(*elem)) ;
|
temp=c_rep(string,repc,p_cont(*elem)->p_path);
|
||||||
addargs(temp) ;
|
addargs(temp) ;
|
||||||
throws(temp) ;
|
throws(temp) ;
|
||||||
}
|
}
|
||||||
|
@ -668,6 +669,7 @@ getcallargs(phase) register trf *phase ; {
|
||||||
#endif
|
#endif
|
||||||
gr_throw(&arg1) ;
|
gr_throw(&arg1) ;
|
||||||
curargs= &phase->t_args ;
|
curargs= &phase->t_args ;
|
||||||
|
if (phase->t_combine) comb_args = &phase->t_inputs ;
|
||||||
unravel( gr_start(arg2), addargs ) ;
|
unravel( gr_start(arg2), addargs ) ;
|
||||||
gr_throw(&arg2) ;
|
gr_throw(&arg2) ;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue