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]

Cgraph cleanup 1


Hi,
looks like it is time for long planned cgraph API cleanups.  If the IPA merge
proceeds I would like to simplify primarily the way cgraph interface with
passmanager and decompose more of the cgraph manipulation into separate IPA
passes with hopefully better definition than they have right now.

This is first easy pass updating comments (especially the overall API comment
that to my surprise is still more or less acurate, just few TODOs can go away).
I also brought local cgraph_assemble_pending_functions that is no longer used
in hackish way in C++ frontend.

Bootstrapped/regtested i686-linux, will commit it tomorrow if there are no
complains.
2006-12-09  Jan Hubicka  <jh@suse.cz>
	* cgraph.c: Update copyright.
	* cgraph.h: Likewise
	(cgraph_update_pending_function): Remove prototype.
	* cgraphunit.c: Update copyright; update overall comment.
	(cgraph_assemble_pending_functions): Make local.
Index: cgraph.c
===================================================================
*** cgraph.c	(revision 119658)
--- cgraph.c	(working copy)
***************
*** 1,5 ****
  /* Callgraph handling code.
!    Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
     Contributed by Jan Hubicka
  
  This file is part of GCC.
--- 1,5 ----
  /* Callgraph handling code.
!    Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
     Contributed by Jan Hubicka
  
  This file is part of GCC.
Index: cgraph.h
===================================================================
*** cgraph.h	(revision 119658)
--- cgraph.h	(working copy)
***************
*** 1,5 ****
  /* Callgraph handling code.
!    Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
     Contributed by Jan Hubicka
  
  This file is part of GCC.
--- 1,5 ----
  /* Callgraph handling code.
!    Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
     Contributed by Jan Hubicka
  
  This file is part of GCC.
*************** struct cgraph_node *cgraph_master_clone 
*** 309,315 ****
  void cgraph_add_new_function (tree);
  
  /* In cgraphunit.c  */
- bool cgraph_assemble_pending_functions (void);
  bool cgraph_varpool_assemble_pending_decls (void);
  void cgraph_finalize_function (tree, bool);
  void cgraph_finalize_compilation_unit (void);
--- 309,314 ----
Index: cgraphunit.c
===================================================================
*** cgraphunit.c	(revision 119658)
--- cgraphunit.c	(working copy)
***************
*** 1,5 ****
  /* Callgraph based interprocedural optimizations.
!    Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
     Contributed by Jan Hubicka
  
  This file is part of GCC.
--- 1,5 ----
  /* Callgraph based interprocedural optimizations.
!    Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
     Contributed by Jan Hubicka
  
  This file is part of GCC.
*************** Software Foundation, 51 Franklin Street,
*** 32,38 ****
        This function is called once front-end has parsed whole body of function
        and it is certain that the function body nor the declaration will change.
  
!       (There is one exception needed for implementing GCC extern inline function.)
  
      - cgraph_varpool_finalize_variable
  
--- 32,39 ----
        This function is called once front-end has parsed whole body of function
        and it is certain that the function body nor the declaration will change.
  
!       (There is one exception needed for implementing GCC extern inline
! 	function.)
  
      - cgraph_varpool_finalize_variable
  
*************** Software Foundation, 51 Franklin Street,
*** 41,57 ****
  
      - cgraph_finalize_compilation_unit
  
!       This function is called once compilation unit is finalized and it will
!       no longer change.
  
        In the unit-at-a-time the call-graph construction and local function
        analysis takes place here.  Bodies of unreachable functions are released
        to conserve memory usage.
  
!       ???  The compilation unit in this point of view should be compilation
!       unit as defined by the language - for instance C frontend allows multiple
!       compilation units to be parsed at once and it should call function each
!       time parsing is done so we save memory.
  
      - cgraph_optimize
  
--- 42,56 ----
  
      - cgraph_finalize_compilation_unit
  
!       This function is called once (source level) compilation unit is finalized
!       and it will no longer change.
  
        In the unit-at-a-time the call-graph construction and local function
        analysis takes place here.  Bodies of unreachable functions are released
        to conserve memory usage.
  
!       The function can be called multiple times when multiple source level
!       compilation units are combined (such as in C frontend)
  
      - cgraph_optimize
  
*************** Software Foundation, 51 Franklin Street,
*** 60,78 ****
        taken are marked as local.  Backend can then use this information to
        modify calling conventions, do better inlining or similar optimizations.
  
-     - cgraph_assemble_pending_functions
-     - cgraph_varpool_assemble_pending_variables
- 
-       In non-unit-at-a-time mode these functions can be used to force compilation
-       of functions or variables that are known to be needed at given stage
-       of compilation
- 
      - cgraph_mark_needed_node
      - cgraph_varpool_mark_needed_node
  
!       When function or variable is referenced by some hidden way (for instance
!       via assembly code and marked by attribute "used"), the call-graph data structure
!       must be updated accordingly by this function.
  
      - analyze_expr callback
  
--- 59,72 ----
        taken are marked as local.  Backend can then use this information to
        modify calling conventions, do better inlining or similar optimizations.
  
      - cgraph_mark_needed_node
      - cgraph_varpool_mark_needed_node
  
!       When function or variable is referenced by some hidden way the call-graph
!       data structure must be updated accordingly by this function.
!       There should be little need to call this function and all the references
!       should be made explicit to cgraph code.  At present these functions are
!       used by C++ frotend to explicitely mark the keyed methods.
  
      - analyze_expr callback
  
*************** cgraph_varpool_remove_unreferenced_decls
*** 351,357 ****
  /* When not doing unit-at-a-time, output all functions enqueued.
     Return true when such a functions were found.  */
  
! bool
  cgraph_assemble_pending_functions (void)
  {
    bool output = false;
--- 345,351 ----
  /* When not doing unit-at-a-time, output all functions enqueued.
     Return true when such a functions were found.  */
  
! static bool
  cgraph_assemble_pending_functions (void)
  {
    bool output = false;


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