Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r59831 - in trunk/tools/build/v2: build tools util
From: ghost_at_[hidden]
Date: 2010-02-21 18:46:43


Author: vladimir_prus
Date: 2010-02-21 18:46:42 EST (Sun, 21 Feb 2010)
New Revision: 59831
URL: http://svn.boost.org/trac/boost/changeset/59831

Log:
Fix scalability issues in subvariant.all-referenced-targets.

Text files modified:
   trunk/tools/build/v2/build/virtual-target.jam | 11 +++++++----
   trunk/tools/build/v2/tools/stage.jam | 11 +++++++----
   trunk/tools/build/v2/util/set.jam | 30 ++++++++++++++++++++++++++++++
   3 files changed, 44 insertions(+), 8 deletions(-)

Modified: trunk/tools/build/v2/build/virtual-target.jam
==============================================================================
--- trunk/tools/build/v2/build/virtual-target.jam (original)
+++ trunk/tools/build/v2/build/virtual-target.jam 2010-02-21 18:46:42 EST (Sun, 21 Feb 2010)
@@ -1218,7 +1218,7 @@
     # referred to using the dependency property are returned as properties, not
     # targets.
     #
- rule all-referenced-targets ( )
+ rule all-referenced-targets ( theset )
     {
         # Find directly referenced targets.
         local deps = [ $(self.build-properties).dependency ] ;
@@ -1228,17 +1228,20 @@
         local r ;
         for local t in $(all-targets)
         {
- r += [ $(t:G=).creating-subvariant ] ;
+ if ! [ $(theset).contains $(t) ]
+ {
+ $(theset).add $(t) ;
+ r += [ $(t:G=).creating-subvariant ] ;
+ }
         }
         r = [ sequence.unique $(r) ] ;
         for local s in $(r)
         {
             if $(s) != $(__name__)
             {
- all-targets += [ $(s).all-referenced-targets ] ;
+ $(s).all-referenced-targets $(theset) ;
             }
         }
- return $(all-targets) ;
     }
 
     # Returns the properties specifying implicit include paths to generated

Modified: trunk/tools/build/v2/tools/stage.jam
==============================================================================
--- trunk/tools/build/v2/tools/stage.jam (original)
+++ trunk/tools/build/v2/tools/stage.jam 2010-02-21 18:46:42 EST (Sun, 21 Feb 2010)
@@ -246,20 +246,23 @@
             s += [ $(t).creating-subvariant ] ;
         }
         s = [ sequence.unique $(s) ] ;
-
- local result = $(targets) ;
+
+ local result = [ new set ] ;
+ $(result).add $(targets) ;
+
         for local i in $(s)
         {
- result += [ $(i).all-referenced-targets ] ;
+ $(i).all-referenced-targets $(result) ;
         }
         local result2 ;
- for local r in $(result)
+ for local r in [ $(result).list ]
         {
             if $(r:G) != <use>
             {
                 result2 += $(r:G=) ;
             }
         }
+ DELETE_MODULE $(result) ;
         result = [ sequence.unique $(result2) ] ;
     }
 

Modified: trunk/tools/build/v2/util/set.jam
==============================================================================
--- trunk/tools/build/v2/util/set.jam (original)
+++ trunk/tools/build/v2/util/set.jam 2010-02-21 18:46:42 EST (Sun, 21 Feb 2010)
@@ -3,6 +3,36 @@
 # Distributed under the Boost Software License, Version 1.0.
 # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
 
+class set
+{
+ rule __init__ ( )
+ {
+ }
+
+ rule add ( elements * )
+ {
+ for local e in $(elements)
+ {
+ if ! $($(e))
+ {
+ $(e) = 1 ;
+ self.result += $(e) ;
+ }
+ }
+ }
+
+ rule contains ( element )
+ {
+ return $($(element)) ;
+ }
+
+ rule list ( )
+ {
+ return $(self.result) ;
+ }
+}
+
+
 
 # Returns the elements of set1 that are not in set2.
 #


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