OSDN Git Service

* gcc-interface/gigi.h (create_label_decl): Adjust.
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 27 Jan 2012 09:12:14 +0000 (09:12 +0000)
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 27 Jan 2012 09:12:14 +0000 (09:12 +0000)
* gcc-interface/utils.c (create_label_decl): Add GNAT_NODE parameter
and invoke gnat_pushdecl on it.  Remove obsolete settings.
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Label>: Adjust call to
create_label_decl.
* gcc-interface/trans.c (gnat_to_gnu) <N_Null): Likewise.  Ignore the
label for debugging purposes.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@183606 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/ChangeLog
gcc/ada/gcc-interface/decl.c
gcc/ada/gcc-interface/gigi.h
gcc/ada/gcc-interface/trans.c
gcc/ada/gcc-interface/utils.c

index 361a1fa..d11bb8e 100644 (file)
@@ -1,5 +1,15 @@
 2012-01-27  Eric Botcazou  <ebotcazou@adacore.com>
 
 2012-01-27  Eric Botcazou  <ebotcazou@adacore.com>
 
+       * gcc-interface/gigi.h (create_label_decl): Adjust.
+       * gcc-interface/utils.c (create_label_decl): Add GNAT_NODE parameter
+       and invoke gnat_pushdecl on it.  Remove obsolete settings.
+       * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Label>: Adjust call to
+       create_label_decl.
+       * gcc-interface/trans.c (gnat_to_gnu) <N_Null): Likewise.  Ignore the
+       label for debugging purposes.
+
+2012-01-27  Eric Botcazou  <ebotcazou@adacore.com>
+
        * gcc-interface/decl.c (gnat_to_gnu_entity) <object>: For an aliased
        object with an unconstrained nominal subtype and if optimization isn't
        enabled, create a special VAR_DECL for debugging purposes.
        * gcc-interface/decl.c (gnat_to_gnu_entity) <object>: For an aliased
        object with an unconstrained nominal subtype and if optimization isn't
        enabled, create a special VAR_DECL for debugging purposes.
index a373061..dbacaef 100644 (file)
@@ -4619,7 +4619,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
       break;
 
     case E_Label:
       break;
 
     case E_Label:
-      gnu_decl = create_label_decl (gnu_entity_name);
+      gnu_decl = create_label_decl (gnu_entity_name, gnat_entity);
       break;
 
     case E_Block:
       break;
 
     case E_Block:
index e22c444..9b14743 100644 (file)
@@ -672,8 +672,9 @@ extern tree create_field_decl (tree field_name, tree field_type,
 extern tree create_param_decl (tree param_name, tree param_type,
                                bool readonly);
 
 extern tree create_param_decl (tree param_name, tree param_type,
                                bool readonly);
 
-/* Return a LABEL_DECL node for LABEL_NAME.  */
-extern tree create_label_decl (tree label_name);
+/* Return a LABEL_DECL with LABEL_NAME.  GNAT_NODE is used for the position
+   of the decl.  */
+extern tree create_label_decl (tree, Node_Id);
 
 /* Return a FUNCTION_DECL node.  SUBPROG_NAME is the name of the subprogram,
    ASM_NAME is its assembler name, SUBPROG_TYPE is its type (a FUNCTION_TYPE
 
 /* Return a FUNCTION_DECL node.  SUBPROG_NAME is the name of the subprogram,
    ASM_NAME is its assembler name, SUBPROG_TYPE is its type (a FUNCTION_TYPE
index 01fdd49..4ba6fb3 100644 (file)
@@ -5881,7 +5881,8 @@ gnat_to_gnu (Node_Id gnat_node)
         the next statement that the middle-end knows how to preserve.  */
       if (!optimize && Comes_From_Source (gnat_node))
        {
         the next statement that the middle-end knows how to preserve.  */
       if (!optimize && Comes_From_Source (gnat_node))
        {
-         tree stmt, label = create_label_decl (NULL_TREE);
+         tree stmt, label = create_label_decl (NULL_TREE, gnat_node);
+         DECL_IGNORED_P (label) = 1;
          start_stmt_group ();
          stmt = build1 (GOTO_EXPR, void_type_node, label);
          set_expr_location_from_node (stmt, gnat_node);
          start_stmt_group ();
          stmt = build1 (GOTO_EXPR, void_type_node, label);
          set_expr_location_from_node (stmt, gnat_node);
index a71a3d2..ab8ca9d 100644 (file)
@@ -6,7 +6,7 @@
  *                                                                          *
  *                          C Implementation File                           *
  *                                                                          *
  *                                                                          *
  *                          C Implementation File                           *
  *                                                                          *
- *          Copyright (C) 1992-2011, Free Software Foundation, Inc.         *
+ *          Copyright (C) 1992-2012, Free Software Foundation, Inc.         *
  *                                                                          *
  * GNAT is free software;  you can  redistribute it  and/or modify it under *
  * terms of the  GNU General Public License as published  by the Free Soft- *
  *                                                                          *
  * GNAT is free software;  you can  redistribute it  and/or modify it under *
  * terms of the  GNU General Public License as published  by the Free Soft- *
@@ -1849,17 +1849,19 @@ potential_alignment_gap (tree prev_field, tree curr_field, tree offset)
   return true;
 }
 
   return true;
 }
 
-/* Return a LABEL_DECL node for LABEL_NAME.  */
+/* Return a LABEL_DECL with LABEL_NAME.  GNAT_NODE is used for the position
+   of the decl.  */
 
 tree
 
 tree
-create_label_decl (tree label_name)
+create_label_decl (tree label_name, Node_Id gnat_node)
 {
 {
-  tree label_decl = build_decl (input_location,
-                               LABEL_DECL, label_name, void_type_node);
+  tree label_decl
+    = build_decl (input_location, LABEL_DECL, label_name, void_type_node);
 
 
-  DECL_CONTEXT (label_decl)     = current_function_decl;
-  DECL_MODE (label_decl)        = VOIDmode;
-  DECL_SOURCE_LOCATION (label_decl) = input_location;
+  DECL_MODE (label_decl) = VOIDmode;
+
+  /* Add this decl to the current binding level.  */
+  gnat_pushdecl (label_decl, gnat_node);
 
   return label_decl;
 }
 
   return label_decl;
 }