version 1.121, 2018/09/20 11:41:28 |
version 1.122, 2019/12/21 15:29:25 |
|
|
* |
* |
* Side Effects: |
* Side Effects: |
* New elements are added to the parents list of cgn and the |
* New elements are added to the parents list of cgn and the |
* children list of cgn. the unmade field of pgn is updated |
* children list of cgn. the children_left field of pgn is updated |
* to reflect the additional child. |
* to reflect the additional child. |
*--------------------------------------------------------------------- |
*--------------------------------------------------------------------- |
*/ |
*/ |
|
|
if (Lst_AddNew(&pgn->children, cgn)) { |
if (Lst_AddNew(&pgn->children, cgn)) { |
if (specType == SPECIAL_NONE) |
if (specType == SPECIAL_NONE) |
Lst_AtEnd(&cgn->parents, pgn); |
Lst_AtEnd(&cgn->parents, pgn); |
pgn->unmade++; |
pgn->children_left++; |
} |
} |
} |
} |
|
|
|
|
ParseAddDep(GNode *p, GNode *s) |
ParseAddDep(GNode *p, GNode *s) |
{ |
{ |
if (p->order < s->order) { |
if (p->order < s->order) { |
/* XXX: This can cause loops, and loops can cause unmade |
/* XXX: This can cause cycles but finding them is hard |
* targets, but checking is tedious, and the debugging output |
* and debugging output will show the problem. */ |
* can show the problem. */ |
Lst_AtEnd(&s->predecessors, p); |
Lst_AtEnd(&p->successors, s); |
Lst_AtEnd(&p->successors, s); |
Lst_AtEnd(&s->preds, p); |
|
return 1; |
return 1; |
} else |
} else |
return 0; |
return 0; |
|
|
*/ |
*/ |
if (predecessor != NULL) { |
if (predecessor != NULL) { |
Lst_AtEnd(&predecessor->successors, gn); |
Lst_AtEnd(&predecessor->successors, gn); |
Lst_AtEnd(&gn->preds, predecessor); |
Lst_AtEnd(&gn->predecessors, predecessor); |
} |
} |
predecessor = gn; |
predecessor = gn; |
break; |
break; |