|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r83932 - trunk/tools/build/v2/build
From: steven_at_[hidden]
Date: 2013-04-16 15:24:31
Author: steven_watanabe
Date: 2013-04-16 15:24:30 EDT (Tue, 16 Apr 2013)
New Revision: 83932
URL: http://svn.boost.org/trac/boost/changeset/83932
Log:
Optimize generators.find-viable-generators-aux.
Text files modified:
trunk/tools/build/v2/build/generators.jam | 61 +++++++++++++++++++++++++++------------
1 files changed, 42 insertions(+), 19 deletions(-)
Modified: trunk/tools/build/v2/build/generators.jam
==============================================================================
--- trunk/tools/build/v2/build/generators.jam (original)
+++ trunk/tools/build/v2/build/generators.jam 2013-04-16 15:24:30 EDT (Tue, 16 Apr 2013)
@@ -1123,27 +1123,42 @@
{
# Select generators that can create the required target type.
local viable-generators = ;
- local generator-rank = ;
import type ;
- local t = [ type.all-bases $(target-type) ] ;
+ local t = $(target-type) ;
- generators.dout [ indent ] find-viable-generators target-type= $(target-type)
- property-set= [ $(property-set).as-path ] ;
+ if $(.debug)
+ {
+ generators.dout [ indent ] find-viable-generators target-type= $(target-type)
+ property-set= [ $(property-set).as-path ] ;
+ generators.dout [ indent ] "trying type" $(target-type) ;
+ }
- # Get the list of generators for the requested type. If no generator is
- # registered, try base type, and so on.
- local generators ;
- while $(t[1])
+ local generators = $(.generators.$(target-type)) ;
+ if $(generators)
{
- generators.dout [ indent ] "trying type" $(t[1]) ;
- if $(.generators.$(t[1]))
+ if $(.debug)
{
generators.dout [ indent ] "there are generators for this type" ;
- generators = $(.generators.$(t[1])) ;
+ }
+ }
+ else
+ {
+ local t = [ type.base $(target-type) ] ;
- if $(t[1]) != $(target-type)
+ # Get the list of generators for the requested type. If no generator is
+ # registered, try base type, and so on.
+ while $(t)
+ {
+ if $(.debug)
+ {
+ generators.dout [ indent ] "trying type" $(t) ;
+ }
+ if $(.generators.$(t))
{
+ generators.dout [ indent ] "there are generators for this type" ;
+ generators = $(.generators.$(t)) ;
+
# We are here because there were no generators found for
# target-type but there are some generators for its base type.
# We will try to use them, but they will produce targets of
@@ -1157,25 +1172,33 @@
# should work. That list is only used when inheriting a
# toolset, which should have been done before running
# generators.
- generators2 += [ $(g).clone-and-change-target-type $(t[1]) :
+ generators2 += [ $(g).clone-and-change-target-type $(t) :
$(target-type) ] ;
generators.register $(generators2[-1]) ;
}
generators = $(generators2) ;
+ t = ;
+ }
+ else
+ {
+ t = [ type.base $(t) ] ;
}
- t = ;
}
- t = $(t[2-]) ;
}
for local g in $(generators)
{
- generators.dout [ indent ] "trying generator" [ $(g).id ] "(" [ $(g).source-types ] -> [ $(g).target-types ] ")" ;
+ if $(.debug)
+ {
+ generators.dout [ indent ] "trying generator" [ $(g).id ] "(" [ $(g).source-types ] -> [ $(g).target-types ] ")" ;
+ }
- local m = [ $(g).match-rank $(property-set) ] ;
- if $(m)
+ if [ $(g).match-rank $(property-set) ]
{
- generators.dout [ indent ] " is viable" ;
+ if $(.debug)
+ {
+ generators.dout [ indent ] " is viable" ;
+ }
viable-generators += $(g) ;
}
}
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