2011-08-03 Robert Dewar <dewar@adacore.com>
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 3 Aug 2011 08:11:09 +0000 (08:11 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 3 Aug 2011 08:11:09 +0000 (08:11 +0000)
* exp_ch5.adb, sem_prag.adb, exp_ch4.adb: Minor reformatting.

2011-08-03  Ed Schonberg  <schonberg@adacore.com>

* sem_ch3.adb (Build_Itype_Reference): do not create an itype reference
for an itype created within a generic unit.

2011-08-03  Eric Botcazou  <ebotcazou@adacore.com>

* gnat_ugn.texi (Switches for gcc): Make it clearer that -fno-inline
suppresses all inlining.

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

gcc/ada/ChangeLog
gcc/ada/exp_ch4.adb
gcc/ada/exp_ch5.adb
gcc/ada/gnat_ugn.texi
gcc/ada/sem_ch3.adb
gcc/ada/sem_prag.adb

index 251718f..85d42bd 100644 (file)
@@ -1,5 +1,19 @@
 2011-08-03  Robert Dewar  <dewar@adacore.com>
 
+       * exp_ch5.adb, sem_prag.adb, exp_ch4.adb: Minor reformatting.
+
+2011-08-03  Ed Schonberg  <schonberg@adacore.com>
+
+       * sem_ch3.adb (Build_Itype_Reference): do not create an itype reference
+       for an itype created within a generic unit.
+
+2011-08-03  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * gnat_ugn.texi (Switches for gcc): Make it clearer that -fno-inline
+       suppresses all inlining.
+
+2011-08-03  Robert Dewar  <dewar@adacore.com>
+
        * sem_ch3.adb, sem_res.adb, exp_ch13.adb, exp_disp.adb,
        exp_aggr.adb: Minor reformatting.
 
index 2037950..27e6279 100644 (file)
@@ -7596,15 +7596,13 @@ package body Exp_Ch4 is
 
       function Is_Subtype_Declaration return Boolean;
       --  The replacement of a discriminant reference by its value is required
-      --  if this is part of the initialization of an temporary generated by
-      --  change of representation. This shows up as the construction of a
+      --  if this is part of the initialization of an temporary generated by a
+      --  change of representation. This shows up as the construction of a
       --  discriminant constraint for a subtype declared at the same point as
-      --  the entity in the prefix of the selected component.
-      --  We recognize this case when the context of the reference is:
-      --
-      --   subtype ST is T(Obj.D);
-      --
-      --   The entity for Obj comes from source, and ST has the same sloc.
+      --  the entity in the prefix of the selected component. We recognize this
+      --  case when the context of the reference is:
+      --    subtype ST is T(Obj.D);
+      --  where the entity for Obj comes from source, and ST has the same sloc.
 
       -----------------------
       -- In_Left_Hand_Side --
@@ -7625,7 +7623,6 @@ package body Exp_Ch4 is
 
       function Is_Subtype_Declaration return Boolean is
          Par : constant Node_Id := Parent (N);
-
       begin
          return
            Nkind (Par) = N_Index_Or_Discriminant_Constraint
@@ -7767,9 +7764,9 @@ package body Exp_Ch4 is
 
                   if Disc = Entity (Selector_Name (N))
                     and then (Is_Entity_Name (Dval)
-                              or else Nkind (Dval) = N_Integer_Literal
-                              or else Is_Subtype_Declaration
-                              or else Is_Static_Expression (Dval))
+                               or else Nkind (Dval) = N_Integer_Literal
+                               or else Is_Subtype_Declaration
+                               or else Is_Static_Expression (Dval))
                   then
                      --  Here we have the matching discriminant. Check for
                      --  the case of a discriminant of a component that is
index dad9427..51ae183 100644 (file)
@@ -1934,13 +1934,13 @@ package body Exp_Ch5 is
 
                --  If the type is tagged, we may as well use the predefined
                --  primitive assignment. This avoids inlining a lot of code
-               --  and in the class-wide case, the assignment is replaced by a
-               --  dispatching call to _assign. It is suppressed in the case of
-               --  assignments created by the expander that correspond to
-               --  initializations, where we do want to copy the tag
-               --  (Expand_Ctrl_Actions flag is set True in this case).
-               --  It is also suppressed if restriction No_Dispatching_Calls is
-               --  in force because in that case predefined primitives are not
+               --  and in the class-wide case, the assignment is replaced
+               --  by a dispatching call to _assign. It is suppressed in the
+               --  case of assignments created by the expander that correspond
+               --  to initializations, where we do want to copy the tag
+               --  (Expand_Ctrl_Actions flag is set True in this case). It is
+               --  also suppressed if restriction No_Dispatching_Calls is in
+               --  force because in that case predefined primitives are not
                --  generated.
 
                or else (Is_Tagged_Type (Typ)
index ba83f78..dd90a83 100644 (file)
@@ -3961,10 +3961,9 @@ and @command{gcc} cannot be used to run the GNAT binder.
 
 @item -fno-inline
 @cindex @option{-fno-inline} (@command{gcc})
-Suppresses all back-end inlining, even if other optimization or inlining
-switches are set.
-This includes suppression of inlining that results
-from the use of the pragma @code{Inline_Always}.
+Suppresses all inlining, even if other optimization or inlining
+switches are set.  This includes suppression of inlining that
+results from the use of the pragma @code{Inline_Always}.
 Any occurrences of pragma @code{Inline} or @code{Inline_Always}
 are ignored, and @option{-gnatn} and @option{-gnatN} have no
 effect if this switch is present.
index 5de3b0e..aa6f6b2 100644 (file)
@@ -8631,8 +8631,15 @@ package body Sem_Ch3 is
    is
       IR : constant Node_Id := Make_Itype_Reference (Sloc (Nod));
    begin
-      Set_Itype (IR, Ityp);
-      Insert_After (Nod, IR);
+
+      --  Itype references are only created for use by the back-end.
+
+      if Inside_A_Generic then
+         return;
+      else
+         Set_Itype (IR, Ityp);
+         Insert_After (Nod, IR);
+      end if;
    end Build_Itype_Reference;
 
    ------------------------
index 4cab6b4..4d6a55c 100644 (file)
@@ -4729,7 +4729,6 @@ package body Sem_Prag is
          if Is_Generic_Instance (Subprogram_Def) then
             Set_Encoded_Interface_Name
               (Alias (Get_Base_Subprogram (Subprogram_Def)), Link_Nam);
-
          else
             Set_Encoded_Interface_Name
               (Get_Base_Subprogram (Subprogram_Def), Link_Nam);