FIx minor errors in last dwarf2out.c patch

Richard Kenner kenner@vlsi1.ultra.nyu.edu
Sat Dec 29 12:59:00 GMT 2001


This fixes some minor things pointed out by RTH.

Sat Dec 29 15:48:54 2001  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>

	* dwarf2out.c (compute_section_prefix): Avoid cast warning.
	(gen_decl_die): Only check DECL_IGNORED_P on decls.
	(dwarf2out_decl): Check for DECL_IGNORED_P only when needed.

*** dwarf2out.c	2001/12/25 17:11:35	1.341
--- dwarf2out.c	2001/12/29 20:50:30
*************** compute_section_prefix (unit_die)
*** 5495,5511 ****
       dw_die_ref unit_die;
  {
!   char *name, *p;
    int i;
    unsigned char checksum[16];
    struct md5_ctx ctx;
  
    md5_init_ctx (&ctx);
    die_checksum (unit_die, &ctx);
    md5_finish_ctx (&ctx, checksum);
  
-   p = (char *) lbasename (get_AT_string (unit_die, DW_AT_name));
-   name = (char *) alloca (strlen (p) + 64);
    sprintf (name, "%s.", p);
- 
    clean_symbol_name (name);
  
--- 5495,5513 ----
       dw_die_ref unit_die;
  {
!   const char *base = lbasename (get_AT_string (unit_die, DW_AT_name));
!   char *name = (char *) alloca (strlen (base) + 64);
!   char *p;
    int i;
    unsigned char checksum[16];
    struct md5_ctx ctx;
  
+   /* Compute the checksum of the DIE, then append part of it as hex digits to
+      the name filename of the unit.  */
+ 
    md5_init_ctx (&ctx);
    die_checksum (unit_die, &ctx);
    md5_finish_ctx (&ctx, checksum);
  
    sprintf (name, "%s.", p);
    clean_symbol_name (name);
  
*************** compute_section_prefix (unit_die)
*** 5521,5525 ****
  }
  
! /* Returns nonzero iff DIE represents a type, in the sense of TYPE_P.  */
  
  static int
--- 5523,5527 ----
  }
  
! /* Returns nonzero if DIE represents a type, in the sense of TYPE_P.  */
  
  static int
*************** gen_decl_die (decl, context_die)
*** 11234,11238 ****
    tree origin;
  
!   if (DECL_IGNORED_P (decl))
      return;
  
--- 11236,11240 ----
    tree origin;
  
!   if (DECL_P (decl) && DECL_IGNORED_P (decl))
      return;
  
*************** dwarf2out_decl (decl)
*** 11420,11426 ****
    dw_die_ref context_die = comp_unit_die;
  
-   if (DECL_IGNORED_P (decl))
-     return;
- 
    switch (TREE_CODE (decl))
      {
--- 11422,11425 ----
*************** dwarf2out_decl (decl)
*** 11503,11507 ****
  	  if ((get_AT_unsigned (comp_unit_die, DW_AT_language)
  	       == DW_LANG_C_plus_plus)
! 	      && TREE_CODE (TREE_TYPE (decl)) == BOOLEAN_TYPE)
  	    modified_type_die (TREE_TYPE (decl), 0, 0, NULL);
  
--- 11502,11507 ----
  	  if ((get_AT_unsigned (comp_unit_die, DW_AT_language)
  	       == DW_LANG_C_plus_plus)
! 	      && TREE_CODE (TREE_TYPE (decl)) == BOOLEAN_TYPE
! 	      && ! DECL_IGNORED_P (decl))
  	    modified_type_die (TREE_TYPE (decl), 0, 0, NULL);
  



More information about the Gcc-patches mailing list