| 226 | |
| 227 | |
| 228 | int make0rescan( TARGET * t, TARGET * rescanning ) |
| 229 | { |
| 230 | int result = 0; |
| 231 | TARGETS * c; |
| 232 | |
| 233 | /* Check whether we have already found a cycle. */ |
| 234 | if ( target_scc( t ) == rescanning ) |
| 235 | return 1; |
| 236 | |
| 237 | /* If we have already visited this node, ignore it. */ |
| 238 | if ( t->rescanning == rescanning ) |
| 239 | return 0; |
| 240 | |
| 241 | /* If t is already updated, ignore it. */ |
| 242 | if ( t->scc_root == NULL && t->progress > T_MAKE_ACTIVE ) |
| 243 | return 0; |
| 244 | |
| 245 | t->rescanning = rescanning; |
| 246 | for ( c = t->depends; c; c = c->next ) |
| 247 | { |
| 248 | TARGET * dependency = c->target; |
| 249 | /* Always start at the root of each new strongly connected component. */ |
| 250 | if ( target_scc( dependency ) != target_scc( t ) ) |
| 251 | dependency = target_scc( dependency ); |
| 252 | result |= make0rescan( dependency, rescanning ); |
| 253 | |
| 254 | /* Make sure that we pick up the new include node. */ |
| 255 | if ( c->target->includes == rescanning ) |
| 256 | result = 1; |
| 257 | } |
| 258 | if ( result && t->scc_root == NULL ) |
| 259 | { |
| 260 | t->scc_root = rescanning; |
| 261 | rescanning->depends = targetentry( rescanning->depends, t ); |
| 262 | } |
| 263 | return result; |
| 264 | } |
| 265 | |
| 266 | |
| 267 | /* |
no test coverage detected