This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[3.3] C++ PATCH to cp/decl.c: More TV_NAME_LOOKUP timing


Hi,

  This accounts for more TV_NAME_LOOKUP timing.
Bootstrapped and tested on an i686-pc-linux-gnu.  gcc-3_3-branch.
A slightly modified version will be applied to mainline.

Next  patches will address speeding up name lookup.

-- Gaby
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/ChangeLog,v
retrieving revision 1.3076.2.46
diff -p -r1.3076.2.46 ChangeLog
*** ChangeLog	24 Feb 2003 15:08:17 -0000	1.3076.2.46
--- ChangeLog	25 Feb 2003 13:46:38 -0000
***************
*** 1,3 ****
--- 1,9 ----
+ 2003-02-24 Gabriel Dos Reis  <gdr at integrable-solutions dot net>
+ 
+ 	* decl.c (add_binding): Time TV_NAME_LOOKUP.
+ 	(push_class_binding): Likewise.
+ 	(set_namespace_binding): Likewise.
+ 
  2003-02-24  Kriang Lerdsuwanakij  <lerdsuwa at users dot sourceforge dot net>
  
  	PR c++/9602
Index: decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/decl.c,v
retrieving revision 1.965.2.16
diff -p -r1.965.2.16 decl.c
*** decl.c	23 Feb 2003 14:19:47 -0000	1.965.2.16
--- decl.c	25 Feb 2003 13:46:46 -0000
*************** add_binding (id, decl)
*** 954,959 ****
--- 954,960 ----
    tree binding = IDENTIFIER_BINDING (id);
    int ok = 1;
  
+   timevar_push (TV_NAME_LOOKUP);
    if (TREE_CODE (decl) == TYPE_DECL && DECL_ARTIFICIAL (decl))
      /* The new name is the type name.  */
      BINDING_TYPE (binding) = decl;
*************** add_binding (id, decl)
*** 1010,1016 ****
        ok = 0;
      }
  
!   return ok;
  }
  
  /* Add DECL to the list of things declared in B.  */
--- 1011,1017 ----
        ok = 0;
      }
  
!   POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, ok);
  }
  
  /* Add DECL to the list of things declared in B.  */
*************** push_class_binding (id, decl)
*** 1096,1101 ****
--- 1097,1103 ----
    tree binding = IDENTIFIER_BINDING (id);
    tree context;
  
+   timevar_push (TV_NAME_LOOKUP);
    /* Note that we declared this value so that we can issue an error if
       this is an invalid redeclaration of a name already used for some
       other purpose.  */
*************** push_class_binding (id, decl)
*** 1147,1153 ****
         in this class.  */
      INHERITED_VALUE_BINDING_P (binding) = 1;
  
!   return result;
  }
  
  /* Remove the binding for DECL which should be the innermost binding
--- 1149,1155 ----
         in this class.  */
      INHERITED_VALUE_BINDING_P (binding) = 1;
  
!   POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, result);
  }
  
  /* Remove the binding for DECL which should be the innermost binding
*************** set_namespace_binding (name, scope, val)
*** 2196,2201 ****
--- 2198,2204 ----
  {
    tree b;
  
+   timevar_push (TV_NAME_LOOKUP);
    if (scope == NULL_TREE)
      scope = global_namespace;
  
*************** set_namespace_binding (name, scope, val)
*** 2205,2215 ****
        if (b == NULL_TREE || TREE_CODE (b) != CPLUS_BINDING)
  	{
  	  IDENTIFIER_NAMESPACE_BINDINGS (name) = val;
! 	  return;
  	}
      }
    b = binding_for_name (name, scope);
    BINDING_VALUE (b) = val;
  }
  
  /* Push into the scope of the NAME namespace.  If NAME is NULL_TREE, then we
--- 2208,2219 ----
        if (b == NULL_TREE || TREE_CODE (b) != CPLUS_BINDING)
  	{
  	  IDENTIFIER_NAMESPACE_BINDINGS (name) = val;
!           POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, (void)0);
  	}
      }
    b = binding_for_name (name, scope);
    BINDING_VALUE (b) = val;
+   timevar_pop (TV_NAME_LOOKUP);
  }
  
  /* Push into the scope of the NAME namespace.  If NAME is NULL_TREE, then we

 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]