- Timestamp:
- May 2, 2011, 5:43:36 PM (13 years ago)
- Location:
- CMT/HEAD
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
CMT/HEAD/ChangeLog
r572 r574 1 2011-05-02 <rybkin@lal.in2p3.fr> 456 2 3 * source/cmt_use.cxx: In class Use, in function show_sub_uses, make output 4 of "cmt show uses" command compatible with original as it is used by tools, 5 tbroadcast, for example, in function set_auto_imports, increase/decrease 6 level before/after considering sub-uses 7 1 8 2011-04-29 <rybkin@lal.in2p3.fr> 455 2 9 -
CMT/HEAD/source/cmt_use.cxx
r572 r574 3961 3961 cmt_map <Use*, bool>& visited) 3962 3962 { 3963 static int level (-1); 3964 level++; 3963 static int level (0); 3965 3964 /* 3966 3965 if (level == 0) … … 3988 3987 else 3989 3988 { 3990 level--;3991 3989 return; 3992 3990 } … … 3995 3993 if (visited.has (this)) 3996 3994 { 3997 level--;3998 3995 return; 3999 3996 } … … 4026 4023 } 4027 4024 4025 level++; 4028 4026 for (int i = 0; i < sub_uses.size (); i++) 4029 4027 //for (int i = sub_uses.size () - 1; i >= 0; i--) … … 4079 4077 } 4080 4078 } 4079 level--; 4081 4080 4082 4081 if (Cmt::get_debug ()) … … 4085 4084 } 4086 4085 4087 level--;4088 4086 return; 4089 4087 } … … 4495 4493 Use* current = &(Use::current ()); 4496 4494 static State context_state (auto_imports); 4497 static int level (-1); 4498 level++; 4495 static int level (0); 4499 4496 4500 4497 if (level == 0) 4501 4498 { 4502 4499 unselect_all (); 4503 selected = true; 4504 } 4505 4506 State saved_context_state (context_state); 4507 switch (context_state) 4508 { 4509 case Unspecified: 4510 case On: 4511 if (!visited.has (this) 4512 || level == 1) 4513 // show all direct sub-uses of current use 4514 { 4515 context_state = UseContext::mask_auto_imports (context_state, specified_state); 4516 } 4517 else if (Off != auto_imports && Off != specified_state 4518 // else if (specified_state == auto_imports && Off != specified_state 4519 && !selected) 4520 // show this sub-use as it may have been used to make Off != auto_imports 4521 // and is sufficient in order to consider it Off != auto_imports, 4522 // mark selected not to consider use again and thus avoid looping this way 4523 { 4524 selected = true; 4525 // auto_imports = specified_state; 4526 context_state = UseContext::mask_auto_imports (context_state, specified_state); 4527 } 4528 else 4529 { 4530 level--; 4531 return; 4532 } 4533 break; 4534 case Off: 4535 if (visited.has (this) 4536 ) 4537 { 4538 level--; 4539 return; 4540 } 4541 break; 4500 selected = false; 4542 4501 } 4543 4502 … … 4594 4553 } 4595 4554 4555 // if (selected) return; 4556 // selected = true; 4557 4558 State saved_context_state (context_state); 4559 4560 switch (context_state) 4561 { 4562 case Unspecified: 4563 case On: 4564 if (!visited.has (this) || 4565 !selected) 4566 // selected == true means that 4567 // this use has been shown with its actual auto_imports 4568 // either Off != auto_imports or Off == auto_imports, 4569 // mark selected not to consider use again and thus avoid looping this way 4570 { 4571 switch (specified_state) 4572 { 4573 case Unspecified: 4574 case On: 4575 if (Off != auto_imports) 4576 { 4577 // this path to use is informative 4578 // want to revisit sub-uses 4579 // to possibly find Off != auto_imports paths to them 4580 selected = true; 4581 } 4582 break; 4583 case Off: 4584 if (Off == auto_imports) 4585 { 4586 // this path to use is informative 4587 // no point in revisiting sub-uses 4588 selected = true; 4589 if (visited.has (this)) return; 4590 } 4591 else 4592 { 4593 // this path to use is not informative 4594 // no point in (re)visiting sub-uses 4595 return; 4596 } 4597 break; 4598 } 4599 context_state = UseContext::mask_auto_imports (context_state, specified_state); 4600 } 4601 else 4602 { 4603 return; 4604 } 4605 break; 4606 case Off: 4607 if (!visited.has (this) || 4608 !selected) 4609 { 4610 if (Off == auto_imports) 4611 { 4612 // this path to use is informative 4613 // no point in revisiting sub-uses 4614 selected = true; 4615 if (visited.has (this)) return; 4616 } 4617 else 4618 { 4619 // this path to use is not informative 4620 // no point in (re)visiting sub-uses 4621 return; 4622 } 4623 } 4624 else 4625 { 4626 return; 4627 } 4628 break; 4629 } 4630 4596 4631 static bool yes (true); 4597 4632 visited.add (this, yes); 4598 4633 4634 level++; 4599 4635 for (int i = 0; i < sub_uses.size (); i++) 4600 4636 { … … 4614 4650 else 4615 4651 { 4652 sub_uses[i]->select (); 4616 4653 visited.add (sub_uses[i], yes); 4617 4654 continue;
Note: See TracChangeset
for help on using the changeset viewer.