Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r77521 - trunk/tools/build/v2/engine
From: steven_at_[hidden]
Date: 2012-03-24 18:15:43


Author: steven_watanabe
Date: 2012-03-24 18:15:42 EDT (Sat, 24 Mar 2012)
New Revision: 77521
URL: http://svn.boost.org/trac/boost/changeset/77521

Log:
Remove argument_list. It's unused.
Text files modified:
   trunk/tools/build/v2/engine/builtins.c | 12 ++-----
   trunk/tools/build/v2/engine/function.c | 3 -
   trunk/tools/build/v2/engine/rules.c | 59 ++++-----------------------------------
   trunk/tools/build/v2/engine/rules.h | 16 ----------
   4 files changed, 12 insertions(+), 78 deletions(-)

Modified: trunk/tools/build/v2/engine/builtins.c
==============================================================================
--- trunk/tools/build/v2/engine/builtins.c (original)
+++ trunk/tools/build/v2/engine/builtins.c 2012-03-24 18:15:42 EDT (Sat, 24 Mar 2012)
@@ -84,12 +84,11 @@
 {
     FUNCTION * func;
     RULE * result;
- argument_list* arg_list = 0;
     OBJECT * name = object_new( name_ );
 
     func = function_builtin( f, flags, args );
 
- result = new_rule_body( root_module(), name, arg_list, func, 1 );
+ result = new_rule_body( root_module(), name, func, 1 );
 
     function_free( func );
 
@@ -1593,7 +1592,7 @@
     native_rule_t * np;
     if ( module->native_rules && (np = (native_rule_t *)hash_find( module->native_rules, list_front( rule_name ) ) ) )
     {
- new_rule_body( module, np->name, 0, np->procedure, 1 );
+ new_rule_body( module, np->name, np->procedure, 1 );
     }
     else
     {
@@ -1841,7 +1840,7 @@
         if ( pFunc && PyCallable_Check( pFunc ) )
         {
             module_t * m = bindmodule( jam_module );
- new_rule_body( m, jam_rule, 0, function_python( pFunc, 0 ), 0 );
+ new_rule_body( m, jam_rule, function_python( pFunc, 0 ), 0 );
         }
         else
         {
@@ -2005,12 +2004,9 @@
         object_free( module_name );
     }
     rule_name = object_new( rule );
- r = bindrule( rule_name, m );
+ new_rule_body( m, rule_name, function_python( func, bjam_signature ), 0 );
     object_free( rule_name );
 
- /* Make pFunc owned. */
- r->procedure = function_python( func, bjam_signature );
-
     Py_INCREF( Py_None );
     return Py_None;
 }

Modified: trunk/tools/build/v2/engine/function.c
==============================================================================
--- trunk/tools/build/v2/engine/function.c (original)
+++ trunk/tools/build/v2/engine/function.c 2012-03-24 18:15:42 EDT (Sat, 24 Mar 2012)
@@ -295,8 +295,7 @@
 static void function_set_rule( JAM_FUNCTION * function, FRAME * frame, STACK * s, int idx )
 {
     SUBFUNCTION * sub = function->functions + idx;
- argument_list * args = 0;
- new_rule_body( frame->module, sub->name, args, sub->code, !sub->local );
+ new_rule_body( frame->module, sub->name, sub->code, !sub->local );
 }
 
 static void function_set_actions( JAM_FUNCTION * function, FRAME * frame, STACK * s, int idx )

Modified: trunk/tools/build/v2/engine/rules.c
==============================================================================
--- trunk/tools/build/v2/engine/rules.c (original)
+++ trunk/tools/build/v2/engine/rules.c 2012-03-24 18:15:42 EDT (Sat, 24 Mar 2012)
@@ -45,7 +45,7 @@
  */
 
 static void set_rule_actions( RULE *, rule_actions * );
-static void set_rule_body ( RULE *, argument_list *, FUNCTION * procedure );
+static void set_rule_body ( RULE *, FUNCTION * procedure );
 
 static struct hash * targethash = 0;
 
@@ -86,7 +86,6 @@
         r->procedure = 0;
         r->module = 0;
         r->actions = 0;
- r->arguments = 0;
         r->exported = 0;
         r->module = target_module;
     }
@@ -110,7 +109,7 @@
     RULE * r = enter_rule( rulename, target_module );
     if ( r->module != src_module ) /* if the rule was imported from elsewhere, clear it now */
     {
- set_rule_body( r, 0, 0 );
+ set_rule_body( r, 0 );
         set_rule_actions( r, 0 );
         r->module = src_module; /* r will be executed in the source module */
     }
@@ -125,9 +124,6 @@
     if ( r->procedure )
         function_free( r->procedure );
     r->procedure = 0;
- if ( r->arguments )
- args_free( r->arguments );
- r->arguments = 0;
     if ( r->actions )
         actions_free( r->actions );
     r->actions = 0;
@@ -488,43 +484,6 @@
 
 
 /*
- * args_new() - make a new reference-counted argument list.
- */
-
-argument_list * args_new()
-{
- argument_list * r = (argument_list *)BJAM_MALLOC( sizeof(argument_list) );
- r->reference_count = 0;
- lol_init( r->data );
- return r;
-}
-
-
-/*
- * args_refer() - add a new reference to the given argument list.
- */
-
-void args_refer( argument_list * a )
-{
- ++a->reference_count;
-}
-
-
-/*
- * args_free() - release a reference to the given argument list.
- */
-
-void args_free( argument_list * a )
-{
- if ( --a->reference_count <= 0 )
- {
- lol_free( a->data );
- BJAM_FREE( a );
- }
-}
-
-
-/*
  * actions_refer() - add a new reference to the given actions.
  */
 
@@ -552,14 +511,8 @@
  * set_rule_body() - set the argument list and procedure of the given rule.
  */
 
-static void set_rule_body( RULE * rule, argument_list * args, FUNCTION * procedure )
+static void set_rule_body( RULE * rule, FUNCTION * procedure )
 {
- if ( args )
- args_refer( args );
- if ( rule->arguments )
- args_free( rule->arguments );
- rule->arguments = args;
-
     if ( procedure )
         function_refer( procedure );
     if ( rule->procedure )
@@ -616,11 +569,11 @@
  * exported to the global module as modulename.rulename.
  */
 
-RULE * new_rule_body( module_t * m, OBJECT * rulename, argument_list * args, FUNCTION * procedure, int exported )
+RULE * new_rule_body( module_t * m, OBJECT * rulename, FUNCTION * procedure, int exported )
 {
     RULE * local = define_rule( m, rulename, m );
     local->exported = exported;
- set_rule_body( local, args, procedure );
+ set_rule_body( local, procedure );
 
     /* Mark the procedure with the global rule name, regardless of whether the
      * rule is exported. That gives us something reasonably identifiable that we
@@ -749,7 +702,7 @@
 RULE * import_rule( RULE * source, module_t * m, OBJECT * name )
 {
     RULE * dest = define_rule( source->module, name, m );
- set_rule_body( dest, source->arguments, source->procedure );
+ set_rule_body( dest, source->procedure );
     set_rule_actions( dest, source->actions );
     return dest;
 }

Modified: trunk/tools/build/v2/engine/rules.h
==============================================================================
--- trunk/tools/build/v2/engine/rules.h (original)
+++ trunk/tools/build/v2/engine/rules.h 2012-03-24 18:15:42 EDT (Sat, 24 Mar 2012)
@@ -52,13 +52,6 @@
 
 /* RULE - a generic jam rule, the product of RULE and ACTIONS. */
 
-/* A rule's argument list. */
-struct argument_list
-{
- int reference_count;
- LOL data[1];
-};
-
 /* Build actions corresponding to a rule. */
 struct rule_actions
 {
@@ -82,8 +75,6 @@
 {
     OBJECT * name;
     FUNCTION * procedure;
- argument_list * arguments; /* argument checking info, or NULL for unchecked
- */
     rule_actions * actions; /* build actions, or NULL for no actions */
     module_t * module; /* module in which this rule is executed */
     int exported; /* nonzero if this rule is supposed to appear in
@@ -253,16 +244,11 @@
 void actions_refer( rule_actions * );
 void actions_free ( rule_actions * );
 
-/* Argument list related functions. */
-void args_free ( argument_list * );
-argument_list * args_new ();
-void args_refer( argument_list * );
-
 /* Rule related functions. */
 RULE * bindrule ( OBJECT * rulename, module_t * );
 RULE * import_rule ( RULE * source, module_t *, OBJECT * name );
 void rule_localize ( RULE * rule, module_t * module );
-RULE * new_rule_body ( module_t *, OBJECT * rulename, argument_list *, FUNCTION * func, int exprt );
+RULE * new_rule_body ( module_t *, OBJECT * rulename, FUNCTION * func, int exprt );
 RULE * new_rule_actions( module_t *, OBJECT * rulename, FUNCTION * command, LIST * bindlist, int flags );
 void rule_free ( RULE * );
 


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