]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
dwarf2out.c (fortran_common): Update comment.
authorJakub Jelinek <jakub@redhat.com>
Fri, 29 Aug 2008 18:54:53 +0000 (20:54 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 29 Aug 2008 18:54:53 +0000 (20:54 +0200)
* dwarf2out.c (fortran_common): Update comment.
(gen_variable_die): Swap com_die and var_die variables in Fortran
COMMON block handling code.

From-SVN: r139783

gcc/ChangeLog
gcc/dwarf2out.c

index 1158c2fb60a655750e06149f495f8fd6d28aa2f0..d326fc9d10139b166b2e960a64523062e6670ab0 100644 (file)
@@ -1,5 +1,9 @@
 2008-08-29  Jakub Jelinek  <jakub@redhat.com>
 
+       * dwarf2out.c (fortran_common): Update comment.
+       (gen_variable_die): Swap com_die and var_die variables in Fortran
+       COMMON block handling code.
+
        * dwarf2out.c (descr_info_loc): Handle VAR_DECL.
 
        * dwarf2out.c (gen_const_die): New function.
index 22c36249facfa5e9014235e57fd6b9a04edd1d73..567fc7ad95707fedf53c17dcbf7de349addef69e 100644 (file)
@@ -11556,8 +11556,8 @@ secname_for_decl (const_tree decl)
   return secname;
 }
 
-/* Check whether decl is a Fortran COMMON symbol.  If not, NULL_RTX is returned.
-   If so, the rtx for the SYMBOL_REF for the COMMON block is returned, and the
+/* Check whether decl is a Fortran COMMON symbol.  If not, NULL_TREE is
+   returned.  If so, the decl for the COMMON block is returned, and the
    value is the offset into the common block for the symbol.  */
 
 static tree
@@ -13780,10 +13780,10 @@ gen_variable_die (tree decl, dw_die_ref context_die)
       dw_die_ref com_die;
       dw_loc_descr_ref loc;
 
-      com_die = lookup_decl_die (decl);
-      if (com_die)
+      var_die = lookup_decl_die (decl);
+      if (var_die)
        {
-         if (get_AT (com_die, DW_AT_location) == NULL)
+         if (get_AT (var_die, DW_AT_location) == NULL)
            {
              loc = loc_descriptor_from_tree (com_decl);
              if (loc)
@@ -13791,54 +13791,54 @@ gen_variable_die (tree decl, dw_die_ref context_die)
                  if (off)
                    add_loc_descr (&loc, new_loc_descr (DW_OP_plus_uconst,
                                                        off, 0));
-                 add_AT_loc (com_die, DW_AT_location, loc);
-                 remove_AT (com_die, DW_AT_declaration);
+                 add_AT_loc (var_die, DW_AT_location, loc);
+                 remove_AT (var_die, DW_AT_declaration);
                }
            }
          return;
        }
       field = TREE_OPERAND (DECL_VALUE_EXPR (decl), 0);
-      var_die = lookup_decl_die (com_decl);
+      com_die = lookup_decl_die (com_decl);
       loc = loc_descriptor_from_tree (com_decl);
-      if (var_die == NULL)
+      if (com_die == NULL)
        {
          const char *cnam
            = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (com_decl));
 
-         var_die = new_die (DW_TAG_common_block, context_die, decl);
-         add_name_and_src_coords_attributes (var_die, com_decl);
+         com_die = new_die (DW_TAG_common_block, context_die, decl);
+         add_name_and_src_coords_attributes (com_die, com_decl);
          if (loc)
            {
-             add_AT_loc (var_die, DW_AT_location, loc);
+             add_AT_loc (com_die, DW_AT_location, loc);
              /* Avoid sharing the same loc descriptor between
                 DW_TAG_common_block and DW_TAG_variable.  */
              loc = loc_descriptor_from_tree (com_decl);
            }
           else if (DECL_EXTERNAL (decl))
-           add_AT_flag (var_die, DW_AT_declaration, 1);
-         add_pubname_string (cnam, var_die); /* ??? needed? */
-         equate_decl_number_to_die (com_decl, var_die);
+           add_AT_flag (com_die, DW_AT_declaration, 1);
+         add_pubname_string (cnam, com_die); /* ??? needed? */
+         equate_decl_number_to_die (com_decl, com_die);
        }
-      else if (get_AT (var_die, DW_AT_location) == NULL && loc)
+      else if (get_AT (com_die, DW_AT_location) == NULL && loc)
        {
-         add_AT_loc (var_die, DW_AT_location, loc);
+         add_AT_loc (com_die, DW_AT_location, loc);
          loc = loc_descriptor_from_tree (com_decl);
-         remove_AT (var_die, DW_AT_declaration);
+         remove_AT (com_die, DW_AT_declaration);
        }
-      com_die = new_die (DW_TAG_variable, var_die, decl);
-      add_name_and_src_coords_attributes (com_die, decl);
-      add_type_attribute (com_die, TREE_TYPE (decl), TREE_READONLY (decl),
+      var_die = new_die (DW_TAG_variable, com_die, decl);
+      add_name_and_src_coords_attributes (var_die, decl);
+      add_type_attribute (var_die, TREE_TYPE (decl), TREE_READONLY (decl),
                          TREE_THIS_VOLATILE (decl), context_die);
-      add_AT_flag (com_die, DW_AT_external, 1);
+      add_AT_flag (var_die, DW_AT_external, 1);
       if (loc)
        {
          if (off)
            add_loc_descr (&loc, new_loc_descr (DW_OP_plus_uconst, off, 0));
-         add_AT_loc (com_die, DW_AT_location, loc);
+         add_AT_loc (var_die, DW_AT_location, loc);
        }
       else if (DECL_EXTERNAL (decl))
-       add_AT_flag (com_die, DW_AT_declaration, 1);
-      equate_decl_number_to_die (decl, com_die);
+       add_AT_flag (var_die, DW_AT_declaration, 1);
+      equate_decl_number_to_die (decl, var_die);
       return;
     }