Subject: [Boost-commit] svn:boost r48588 - trunk/tools/build/v2/build
Date: 2008-09-04 17:43:31
Date: 2008-09-04 17:43:30 EDT (Thu, 04 Sep 2008)
New Revision: 48588
Optimized Boost Build's generator selection related viable-source-types-real() rule. Made it be smarter about which target types it inserts into a list of target types from which to collect all source types and avoid adding some target types that have already been added to the list.
Text files modified:
trunk/tools/build/v2/build/generators.jam | 21 +++++++++++++++++++--
1 files changed, 19 insertions(+), 2 deletions(-)
--- trunk/tools/build/v2/build/generators.jam (original)
+++ trunk/tools/build/v2/build/generators.jam 2008-09-04 17:43:30 EDT (Thu, 04 Sep 2008)
@@ -709,10 +709,15 @@
local result ;
+ # 't0' is the initial list of target types we need to process to get a list
+ # of their viable source target types. New target types will not be added to
+ # this list.
+ local t0 = [ type.all-bases $(target-type) ] ;
# 't' is the list of target types which have not yet been processed to get a
# list of their viable source target types. This list will get expanded as
# we locate more target types to process.
- local t = [ type.all-bases $(target-type) ] ;
+ local t = $(t0) ;
@@ -746,7 +751,19 @@
if ! $(n) in $(result)
- t += $(n) ;
+ # Here there is no point in adding target types to
+ # the list of types to process in case they are or
+ # have already been on that list. We optimize this
+ # check by realizing that we only need to avoid the
+ # original target type's base types. Other target
+ # types that are or have been on the list of target
+ # types to process have been added to the 'result'
+ # list as well and have thus already been eliminated
+ # by the previous if.
+ if ! $(n) in $(t0)
+ t += $(n) ;
result += $(n) ;
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk