* exp_dbug.ads: Document new convention for the XVZ variable.
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 20 Sep 2008 10:29:08 +0000 (10:29 +0000)
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 20 Sep 2008 10:29:08 +0000 (10:29 +0000)
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Array_Type>: Generate
debug info if necessary for the type padding the component type.
<E_Array_Subtype>: Likewise.
(maybe_pad_type): Emit the XVZ variable in units.
* gcc-interface/trans.c (Loop_Statement_to_gnu): Fix formatting nits.
(Subprogram_Body_to_gnu): Set the source line of the subprogram's node
on statements generated to initialize the parameter attributes cache.
Set the source line of the end label of the body on the special return
statement built for a procedure with copy-in copy-out parameters.

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

gcc/ada/ChangeLog
gcc/ada/exp_dbug.ads
gcc/ada/gcc-interface/decl.c
gcc/ada/gcc-interface/trans.c

index 186a594..f7dfb86 100644 (file)
@@ -1,5 +1,18 @@
 2008-09-20  Eric Botcazou  <ebotcazou@adacore.com>
 
+       * exp_dbug.ads: Document new convention for the XVZ variable.
+       * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Array_Type>: Generate
+       debug info if necessary for the type padding the component type.
+       <E_Array_Subtype>: Likewise.
+       (maybe_pad_type): Emit the XVZ variable in units.
+       * gcc-interface/trans.c (Loop_Statement_to_gnu): Fix formatting nits.
+       (Subprogram_Body_to_gnu): Set the source line of the subprogram's node
+       on statements generated to initialize the parameter attributes cache.
+       Set the source line of the end label of the body on the special return
+       statement built for a procedure with copy-in copy-out parameters.
+
+2008-09-20  Eric Botcazou  <ebotcazou@adacore.com>
+
        PR ada/37585
        * gcc-interface/utils.c (create_subprog_decl): Disable inlining for
        inlined external functions if they contain a nested function not
index 71c2f79..3a6297c 100644 (file)
@@ -851,7 +851,7 @@ package Exp_Dbug is
       --  The size of the objects typed as x should be obtained from the
       --  structure of x (and x___XVE, if applicable) as for ordinary types
       --  unless there is a variable named x___XVZ, which, if present, will
-      --  hold the size (in bits) of x.
+      --  hold the size (in bytes) of x.
 
       --  The type x will either be a subtype of y (see also Subtypes of
       --  Variant Records, below) or will contain no fields at all. The layout,
index c254990..a8fa1ba 100644 (file)
@@ -1955,8 +1955,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
               never be declared otherwise.  This is necessary to ensure
               that its subtrees are properly marked.  */
            if (tem != orig_tem)
-             create_type_decl (TYPE_NAME (tem), tem, NULL, true, false,
-                               gnat_entity);
+             create_type_decl (TYPE_NAME (tem), tem, NULL, true,
+                               debug_info_p, gnat_entity);
          }
 
        if (Has_Volatile_Components (gnat_entity))
@@ -2324,7 +2324,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
                     to ensure that its subtrees are properly marked.  */
                  if (gnu_type != orig_gnu_type)
                    create_type_decl (TYPE_NAME (gnu_type), gnu_type, NULL,
-                                     true, false, gnat_entity);
+                                     true, debug_info_p, gnat_entity);
                }
 
              if (Has_Volatile_Components (Base_Type (gnat_entity)))
@@ -5867,8 +5867,8 @@ maybe_pad_type (tree type, tree size, unsigned int align,
 
       if (size && TREE_CODE (size) != INTEGER_CST && definition)
        create_var_decl (concat_id_with_name (name, "XVZ"), NULL_TREE,
-                        bitsizetype, TYPE_SIZE (record), false, false, false,
-                        false, NULL, gnat_entity);
+                        sizetype, TYPE_SIZE_UNIT (record), false, false,
+                        false, false, NULL, gnat_entity);
     }
 
   rest_of_record_type_compilation (record);
index 938408b..9a6f4cf 100644 (file)
@@ -1689,17 +1689,20 @@ Loop_Statement_to_gnu (Node_Id gnat_node)
   push_stack (&gnu_loop_label_stack, NULL_TREE,
              LOOP_STMT_LABEL (gnu_loop_stmt));
 
-  /* Set the condition that under which the loop should continue.
-     For "LOOP .... END LOOP;" the condition is always true.  */
+  /* Set the condition under which the loop must keep going.
+     For the case "LOOP .... END LOOP;" the condition is always true.  */
   if (No (gnat_iter_scheme))
     ;
-  /* The case "WHILE condition LOOP ..... END LOOP;" */
+
+  /* For the case "WHILE condition LOOP ..... END LOOP;" it's immediate.  */
   else if (Present (Condition (gnat_iter_scheme)))
     LOOP_STMT_TOP_COND (gnu_loop_stmt)
       = gnat_to_gnu (Condition (gnat_iter_scheme));
+
+  /* Otherwise we have an iteration scheme and the condition is given by
+     the bounds of the subtype of the iteration variable.  */
   else
     {
-      /* We have an iteration scheme.  */
       Node_Id gnat_loop_spec = Loop_Parameter_Specification (gnat_iter_scheme);
       Entity_Id gnat_loop_var = Defining_Entity (gnat_loop_spec);
       Entity_Id gnat_type = Etype (gnat_loop_var);
@@ -1745,7 +1748,7 @@ Loop_Statement_to_gnu (Node_Id gnat_node)
       gnu_loop_var = convert (get_base_type (gnu_type), gnu_loop_var);
 
       /* Set either the top or bottom exit condition as appropriate depending
-        on whether or not we know an overflow cannot occur. */
+        on whether or not we know an overflow cannot occur.  */
       if (gnu_cond_expr)
        LOOP_STMT_BOT_COND (gnu_loop_stmt)
          = build_binary_op (NE_EXPR, integer_type_node,
@@ -1763,12 +1766,12 @@ Loop_Statement_to_gnu (Node_Id gnat_node)
                           convert (TREE_TYPE (gnu_loop_var),
                                    integer_one_node));
       set_expr_location_from_node (LOOP_STMT_UPDATE (gnu_loop_stmt),
-                         gnat_iter_scheme);
+                                  gnat_iter_scheme);
     }
 
   /* If the loop was named, have the name point to this loop.  In this case,
      the association is not a ..._DECL node, but the end label from this
-     LOOP_STMT. */
+     LOOP_STMT.  */
   if (Present (Identifier (gnat_node)))
     save_gnu_tree (Entity (Identifier (gnat_node)),
                   LOOP_STMT_LABEL (gnu_loop_stmt), true);
@@ -1788,7 +1791,7 @@ Loop_Statement_to_gnu (Node_Id gnat_node)
     }
 
   /* If we have an outer COND_EXPR, that's our result and this loop is its
-     "true" statement.  Otherwise, the result is the LOOP_STMT. */
+     "true" statement.  Otherwise, the result is the LOOP_STMT.  */
   if (gnu_cond_expr)
     {
       COND_EXPR_THEN (gnu_cond_expr) = gnu_loop_stmt;
@@ -1981,11 +1984,11 @@ Subprogram_Body_to_gnu (Node_Id gnat_node)
       for (i = 0; VEC_iterate (parm_attr, cache, i, pa); i++)
        {
          if (pa->first)
-           add_stmt (pa->first);
+           add_stmt_with_node (pa->first, gnat_node);
          if (pa->last)
-           add_stmt (pa->last);
+           add_stmt_with_node (pa->last, gnat_node);
          if (pa->length)
-           add_stmt (pa->length);
+           add_stmt_with_node (pa->length, gnat_node);
        }
 
       add_stmt (gnu_result);
@@ -2017,7 +2020,7 @@ Subprogram_Body_to_gnu (Node_Id gnat_node)
 
       add_stmt_with_node
        (build_return_expr (DECL_RESULT (gnu_subprog_decl), gnu_retval),
-        gnat_node);
+        End_Label (Handled_Statement_Sequence (gnat_node)));
       gnat_poplevel ();
       gnu_result = end_stmt_group ();
     }