]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Fri, 1 Aug 2014 10:24:57 +0000 (12:24 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Fri, 1 Aug 2014 10:24:57 +0000 (12:24 +0200)
2014-08-01  Robert Dewar  <dewar@adacore.com>

* sem_ch10.adb: Minor reformatting.

2014-08-01  Ed Schonberg  <schonberg@adacore.com>

* sem_ch6.adb (Same_Generic_Actual): Make function symmetric,
because either type may be a subtype of the other.

2014-08-01  Vincent Celier  <celier@adacore.com>

* makeusg.adb: Add documentation for debug switch -dn.

2014-08-01  Ed Schonberg  <schonberg@adacore.com>

* sem_dim.adb (Process_Minus, Process_Divide): Label dimension
expression with standard operator and type, for pretty-printing
use, when in ASIS_Mode. When generating code dimensional analysis
is not involved and dimension expressions are handled statically,
and other operators are resolved in the usual way.

2014-08-01  Ed Schonberg  <schonberg@adacore.com>

* sem_ch3.adb (Build_Derived_Record_Type): Remove setting of
Parent_Subtype in ASIS mode, leads to several failures.
* sem_ch4.adb (Analyze_Selected_Component): In an instance,
if the prefix is a type extension, check whether component is
declared in the parent type, possibly in a parent unit. Needed
in ASIS mode when Parent_Subtype is not set.

From-SVN: r213449

gcc/ada/ChangeLog
gcc/ada/makeusg.adb
gcc/ada/sem_ch10.adb
gcc/ada/sem_ch3.adb
gcc/ada/sem_ch4.adb
gcc/ada/sem_ch6.adb
gcc/ada/sem_dim.adb

index d5606e6a248c6315129b42dd131ca7f075ebc418..54b32b47e361a88f2d4a41f00605dce68adf9ebe 100644 (file)
@@ -1,3 +1,33 @@
+2014-08-01  Robert Dewar  <dewar@adacore.com>
+
+       * sem_ch10.adb: Minor reformatting.
+
+2014-08-01  Ed Schonberg  <schonberg@adacore.com>
+
+       * sem_ch6.adb (Same_Generic_Actual): Make function symmetric,
+       because either type may be a subtype of the other.
+
+2014-08-01  Vincent Celier  <celier@adacore.com>
+
+       * makeusg.adb: Add documentation for debug switch -dn.
+
+2014-08-01  Ed Schonberg  <schonberg@adacore.com>
+
+       * sem_dim.adb (Process_Minus, Process_Divide): Label dimension
+       expression with standard operator and type, for pretty-printing
+       use, when in ASIS_Mode. When generating code dimensional analysis
+       is not involved and dimension expressions are handled statically,
+       and other operators are resolved in the usual way.
+
+2014-08-01  Ed Schonberg  <schonberg@adacore.com>
+
+       * sem_ch3.adb (Build_Derived_Record_Type): Remove setting of
+       Parent_Subtype in ASIS mode, leads to several failures.
+       * sem_ch4.adb (Analyze_Selected_Component): In an instance,
+       if the prefix is a type extension, check whether component is
+       declared in the parent type, possibly in a parent unit. Needed
+       in ASIS mode when Parent_Subtype is not set.
+
 2014-08-01  Robert Dewar  <dewar@adacore.com>
 
        * sem_prag.adb: Minor reformatting.
index 16eb5f968b15dbf9419952ea8a10a393ac63ed67..3c708bf0eac329145d27e19805973ca04d738199 100644 (file)
@@ -257,6 +257,12 @@ begin
    Write_Eol;
    Write_Eol;
 
+   --  Line for -dn
+
+   Write_Str ("  -dn      Do not delete temporary files");
+   Write_Eol;
+   Write_Eol;
+
    Write_Str ("  --create-map-file   Create map file mainprog.map");
    Write_Eol;
 
index 13deef6bc492c9cf3fdfd3c987b1557cbb8b38c9..a3c6784be2c06d7a6524e8b5a0a59b5a030cb753 100644 (file)
@@ -507,14 +507,17 @@ package body Sem_Ch10 is
 
             --  Avoid checking implicitly generated with clauses, limited with
             --  clauses or withs that have pragma Elaborate or Elaborate_All.
-            --  With_clauses introduced for renamings of parent clauses are not
-            --  marked implicit because they need to be properly installed, but
-            --  they do not come from source and do not require warnings.
 
             if Nkind (Clause) = N_With_Clause
               and then not Implicit_With (Clause)
               and then not Limited_Present (Clause)
               and then not Elaborate_Present (Clause)
+
+              --  With_clauses introduced for renamings of parent clauses
+              --  are not marked implicit because they need to be properly
+              --  installed, but they do not come from source and do not
+              --  require warnings.
+
               and then Comes_From_Source (Clause)
             then
                --  Package body-to-spec check
index adbfd5011df7bbbeac26b72ca60d10006fbccc4f..df59cb7c63cbe90e0140ce7dff97ca1ea65fc4f1 100644 (file)
@@ -8418,17 +8418,11 @@ package body Sem_Ch3 is
       --  STEP 5c: Process the record extension for non private tagged types
 
       elsif not Private_Extension then
+         Expand_Record_Extension (Derived_Type, Type_Def);
 
-         --  Add the _parent field in the derived type. In ASIS mode there is
-         --  not enough semantic information for full expansion, but set the
-         --  parent subtype to allow resolution of selected components in
-         --  instance bodies.
-
-         if ASIS_Mode then
-            Set_Parent_Subtype (Derived_Type, Parent_Type);
-         else
-            Expand_Record_Extension (Derived_Type, Type_Def);
-         end if;
+         --  Note : previously in ASIS mode we set the Parent_Subtype of the
+         --  derived type to propagate some semantic information. This led
+         --  to other ASIS failures and has been removed.
 
          --  Ada 2005 (AI-251): Addition of the Tag corresponding to all the
          --  implemented interfaces if we are in expansion mode
index d5573273e8709a37a390c39fd1fd9060424a3da6..64f0a7451f66478538e60c233fe0588750cf72ca 100644 (file)
@@ -4646,6 +4646,7 @@ package body Sem_Ch4 is
                end loop;
 
                if Present (Par) and then Is_Generic_Actual_Type (Par) then
+
                   --  Now look for component in ancestor types
 
                   Par := Generic_Parent_Type (Declaration_Node (Par));
@@ -4655,6 +4656,14 @@ package body Sem_Ch4 is
                        or else Par = Etype (Par);
                      Par := Etype (Par);
                   end loop;
+
+               --  In ASIS mode the generic parent type may be absent. Examine
+               --  the parent type directly for a component that may have been
+               --  visible in a parent generic unit.
+
+               elsif Is_Derived_Type (Prefix_Type) then
+                  Par := Etype (Prefix_Type);
+                  Find_Component_In_Instance (Par);
                end if;
             end;
 
@@ -4664,6 +4673,7 @@ package body Sem_Ch4 is
             if No (Entity (Sel)) then
                raise Program_Error;
             end if;
+
             return;
 
          --  Component not found, specialize error message when appropriate
index 1bfa90e46cd8b8e7f220c7671c3818af7245a2d0..1fb0e7e1f58fc95ee5fab9d069dd03445c82118d 100644 (file)
@@ -7274,21 +7274,38 @@ package body Sem_Ch6 is
          --  Check that the types of corresponding formals have the same
          --  generic actual if any. We have to account for subtypes of a
          --  generic formal, declared between a spec and a body, which may
-         --  appear distinct in an instance but matched in the generic.
+         --  appear distinct in an instance but matched in the generic, and
+         --  the subtype may be used either in the spec or the body of the
+         --  subprogram being checked.
 
          -------------------------
          -- Same_Generic_Actual --
          -------------------------
 
          function Same_Generic_Actual (T1, T2 : Entity_Id) return Boolean is
+
+            function Is_Declared_Subtype (S1, S2 : Entity_Id) return Boolean;
+            --  Predicate to check whether S1 is a subtype of S2 in the source
+            --  of the instance.
+
+            -------------------------
+            -- Is_Declared_Subtype --
+            -------------------------
+
+            function Is_Declared_Subtype (S1, S2 : Entity_Id) return Boolean is
+            begin
+               return Comes_From_Source (Parent (S1))
+                 and then Nkind (Parent (S1)) = N_Subtype_Declaration
+                 and then Is_Entity_Name (Subtype_Indication (Parent (S1)))
+                 and then Entity (Subtype_Indication (Parent (S1))) = S2;
+            end Is_Declared_Subtype;
+
+         --  Start of processing for Same_Generic_Actual
+
          begin
             return Is_Generic_Actual_Type (T1) = Is_Generic_Actual_Type (T2)
-              or else
-                (Present (Parent (T1))
-                  and then Comes_From_Source (Parent (T1))
-                  and then Nkind (Parent (T1)) = N_Subtype_Declaration
-                  and then Is_Entity_Name (Subtype_Indication (Parent (T1)))
-                  and then Entity (Subtype_Indication (Parent (T1))) = T2);
+              or else Is_Declared_Subtype (T1, T2)
+              or else Is_Declared_Subtype (T2, T1);
          end Same_Generic_Actual;
 
       --  Start of processing for Different_Generic_Profile
index 6bb74ee0714029042b86c009413db193606d9a10..37d2f7a9123c31a3708eaec4272dc7b7512a5662 100644 (file)
@@ -2262,10 +2262,14 @@ package body Sem_Dim is
 
          --  Provide minimal semantic information on dimension expressions,
          --  even though they have no run-time existence. This is for use by
-         --  ASIS tools, in particular pretty-printing.
+         --  ASIS tools, in particular pretty-printing. If generating code
+         --  standard operator resolution will take place.
+
+         if ASIS_Mode then
+            Set_Entity (N, Standard_Op_Minus);
+            Set_Etype  (N, Standard_Integer);
+         end if;
 
-         Set_Entity (N, Standard_Op_Minus);
-         Set_Etype  (N, Standard_Integer);
          return Result;
       end Process_Minus;
 
@@ -2294,10 +2298,14 @@ package body Sem_Dim is
 
          --  Provide minimal semantic information on dimension expressions,
          --  even though they have no run-time existence. This is for use by
-         --  ASIS tools, in particular pretty-printing.
+         --  ASIS tools, in particular pretty-printing. If generating code
+         --  standard operator resolution will take place.
+
+         if ASIS_Mode then
+            Set_Entity (N, Standard_Op_Divide);
+            Set_Etype  (N, Standard_Integer);
+         end if;
 
-         Set_Entity (N, Standard_Op_Divide);
-         Set_Etype  (N, Standard_Integer);
          return Result;
       end Process_Divide;