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]

[Ada] Patch to make constants visible at -O0


The following patch makes all constants visible from the debugger when
compiling without optimization.

  -Geert

2001-10-10  Richard Kenner <kenner@gnat.com>

	* decl.c: (gnat_to_gnu_entity, case object): Also materialize 
	VAR_DECL for constant if not Is_Public but -O0.

*** decl.c	2001/10/01 23:14:20	1.4
--- decl.c	2001/10/04 20:22:57	1.5
*************** gnat_to_gnu_entity (gnat_entity, gnu_exp
*** 1033,1043 ****
  					     STACK_CHECK_MAX_VAR_SIZE))))
  	  update_setjmp_buf (TREE_VALUE (gnu_block_stack));
  
! 	/* If this is a public constant and we're not making a VAR_DECL for
! 	   it, make one just for export or debugger use.  Likewise if
! 	   the address is taken or if the object or type is aliased.  */
  	if (definition && TREE_CODE (gnu_decl) == CONST_DECL
  	    && (Is_Public (gnat_entity)
  		|| Address_Taken (gnat_entity)
  		|| Is_Aliased (gnat_entity)
  		|| Is_Aliased (Etype (gnat_entity))))
--- 1033,1045 ----
  					     STACK_CHECK_MAX_VAR_SIZE))))
  	  update_setjmp_buf (TREE_VALUE (gnu_block_stack));
  
! 	/* If this is a public constant or we're not optimizing and we're not
! 	   making a VAR_DECL for it, make one just for export or debugger
! 	   use.  Likewise if the address is taken or if the object or type is
! 	   aliased.  */
  	if (definition && TREE_CODE (gnu_decl) == CONST_DECL
  	    && (Is_Public (gnat_entity)
+ 		|| optimize == 0
  		|| Address_Taken (gnat_entity)
  		|| Is_Aliased (gnat_entity)
  		|| Is_Aliased (Etype (gnat_entity))))



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