OSDN Git Service

2009-07-10 Thomas Quinot <quinot@adacore.com>
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 10 Jul 2009 13:18:49 +0000 (13:18 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 10 Jul 2009 13:18:49 +0000 (13:18 +0000)
* exp_ch7.adb: Update comments.

2009-07-10  Arnaud Charlet  <charlet@adacore.com>

* exp_ch13.adb (Expand_N_Record_Representation_Clause): Ignore mod
clause if -gnatI is set instead of crashing.

2009-07-10  Ed Schonberg  <schonberg@adacore.com>

* sem_ch11.adb (Same_Expression): Null is always equal to itself.
Additional work to remove redundant successive raise statements, in
this case access checks.

2009-07-10  Vincent Celier  <celier@adacore.com>

* make.adb (Compile): Always create a deep copy of the mapping file
argument (-gnatem=...) as it may be deallocate/reallocate by
Normalize_Arguments.

2009-07-10  Javier Miranda  <miranda@adacore.com>

* einfo.adb (Directly_Designated_Type): Add assertion.

* sem_res.adb (Check_Fully_Declared_Prefix): Add missing check on
access types before using attribute Directly_Designated_Type.

2009-07-10  Emmanuel Briot  <briot@adacore.com>

* prj.ads: Minor typo fix

2009-07-10  Ed Schonberg  <schonberg@adacore.com>

* sem_ch6.adb (Add_Extra_Formal): Protected operations do no need
special treatment.

* exp_ch6.adb (Expand_Protected_Subprogram_Call): If rewritten
subprogram is a function call, resolve properly, to ensure that extra
actuals are added as needed.

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

gcc/ada/ChangeLog
gcc/ada/einfo.adb
gcc/ada/exp_ch13.adb
gcc/ada/exp_ch6.adb
gcc/ada/exp_ch7.adb
gcc/ada/make.adb
gcc/ada/prj.ads
gcc/ada/sem_ch11.adb
gcc/ada/sem_ch6.adb
gcc/ada/sem_res.adb

index a089ac4..37e512b 100644 (file)
@@ -1,5 +1,46 @@
 2009-07-10  Thomas Quinot  <quinot@adacore.com>
 
+       * exp_ch7.adb: Update comments.
+
+2009-07-10  Arnaud Charlet  <charlet@adacore.com>
+
+       * exp_ch13.adb (Expand_N_Record_Representation_Clause): Ignore mod
+       clause if -gnatI is set instead of crashing.
+
+2009-07-10  Ed Schonberg  <schonberg@adacore.com>
+
+       * sem_ch11.adb (Same_Expression): Null is always equal to itself.
+       Additional work to remove redundant successive raise statements, in
+       this case access checks.
+
+2009-07-10  Vincent Celier  <celier@adacore.com>
+
+       * make.adb (Compile): Always create a deep copy of the mapping file
+       argument (-gnatem=...) as it may be deallocate/reallocate by
+       Normalize_Arguments.
+
+2009-07-10  Javier Miranda  <miranda@adacore.com>
+
+       * einfo.adb (Directly_Designated_Type): Add assertion.
+       
+       * sem_res.adb (Check_Fully_Declared_Prefix): Add missing check on
+       access types before using attribute Directly_Designated_Type.
+
+2009-07-10  Emmanuel Briot  <briot@adacore.com>
+
+       * prj.ads: Minor typo fix
+
+2009-07-10  Ed Schonberg  <schonberg@adacore.com>
+
+       * sem_ch6.adb (Add_Extra_Formal): Protected operations do no need
+       special treatment.
+
+       * exp_ch6.adb (Expand_Protected_Subprogram_Call): If rewritten
+       subprogram is a function call, resolve properly, to ensure that extra
+       actuals are added as needed.
+
+2009-07-10  Thomas Quinot  <quinot@adacore.com>
+
        * sem_aggr.adb: Minor comments editing
 
        * exp_tss.adb, exp_ch3.adb: Minor reformatting
index b28293a..f038f23 100644 (file)
@@ -808,6 +808,7 @@ package body Einfo is
 
    function Directly_Designated_Type (Id : E) return E is
    begin
+      pragma Assert (Is_Access_Type (Id));
       return Node20 (Id);
    end Directly_Designated_Type;
 
index 7d903eb..3b682cf 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 1992-2008, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2009, 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- --
@@ -396,7 +396,7 @@ package body Exp_Ch13 is
       AtM_Nod : Node_Id;
 
    begin
-      if Present (Mod_Clause (N)) then
+      if Present (Mod_Clause (N)) and then not Ignore_Rep_Clauses then
          Mod_Val := Expr_Value (Expression (Mod_Clause (N)));
          Citems  := Pragmas_Before (Mod_Clause (N));
 
index 785da60..c3abeca 100644 (file)
@@ -3236,6 +3236,7 @@ package body Exp_Ch6 is
                        (Passoc, Next_Named_Actual (Parent (Temp)));
                   end loop;
                end;
+
             end if;
          end;
       end if;
@@ -4652,14 +4653,23 @@ package body Exp_Ch6 is
 
       end if;
 
-      Analyze (N);
-
       --  If it is a function call it can appear in elaboration code and
       --  the called entity must be frozen here.
 
       if Ekind (Subp) = E_Function then
          Freeze_Expression (Name (N));
       end if;
+
+      --  Analyze and resolve the new call. The actuals have already been
+      --  resolved, but expansion  of a function call will add extra actuals
+      --  if needed. Analysis of a procedure call already includes resolution.
+
+      Analyze (N);
+
+      if Ekind (Subp) = E_Function then
+         Resolve (N, Etype (Subp));
+      end if;
+
    end Expand_Protected_Subprogram_Call;
 
    --------------------------------
index 44da95f..bd0d371 100644 (file)
@@ -444,8 +444,9 @@ package body Exp_Ch7 is
 
       --  If the type is declared in a package declaration and designates a
       --  Taft amendment type that requires finalization, place declaration
-      --  of finaliztion list in the body, because no client of the package
-      --  can create objects of the type and thus make use of this list.
+      --  of finalization list in the body, because no client of the package
+      --  can create objects of the type and thus make use of this list. This
+      --  ensures the tree for the spec is identical whenever it is compiled.
 
       if Has_Completion_In_Body (Directly_Designated_Type (Typ))
         and then In_Package_Body (Current_Scope)
index f08c680..f91d705 100644 (file)
@@ -3090,9 +3090,9 @@ package body Make is
             end if;
          end if;
 
-         if Create_Mapping_File then
+         if Create_Mapping_File and then Mapping_File_Arg /= null then
             Comp_Last := Comp_Last + 1;
-            Comp_Args (Comp_Last) := Mapping_File_Arg;
+            Comp_Args (Comp_Last) := new String'(Mapping_File_Arg.all);
          end if;
 
          Get_Name_String (S);
index 3889e66..797a479 100644 (file)
@@ -669,7 +669,7 @@ package Prj is
 
       Unit                   : Unit_Index          := No_Unit_Index;
       --  Name of the unit, if language is unit based. This is only set for
-      --  those finles that are part of the compilation set (for instance a
+      --  those files that are part of the compilation set (for instance a
       --  file in an extended project that is overridden will not have this
       --  field set).
 
index 73c966c..d54c6f8 100644 (file)
@@ -585,6 +585,9 @@ package body Sem_Ch11 is
             return Same_Expression (Left_Opnd (C1), Left_Opnd (C2))
               and then Same_Expression (Right_Opnd (C1), Right_Opnd (C2));
 
+         elsif Nkind (C1) = N_Null then
+            return True;
+
          else
             return False;
          end if;
index 29dd6e5..9e2143a 100644 (file)
@@ -5496,16 +5496,8 @@ package body Sem_Ch6 is
              (No (P_Formal)
                or else Present (Extra_Accessibility (P_Formal)))
          then
-            --  Temporary kludge: for now we avoid creating the extra formal
-            --  for access parameters of protected operations because of
-            --  problem with the case of internal protected calls. ???
-
-            if Nkind (Parent (Parent (Parent (E)))) /= N_Protected_Definition
-              and then Nkind (Parent (Parent (Parent (E)))) /= N_Protected_Body
-            then
-               Set_Extra_Accessibility
-                 (Formal, Add_Extra_Formal (Formal, Standard_Natural, E, "F"));
-            end if;
+            Set_Extra_Accessibility
+              (Formal, Add_Extra_Formal (Formal, Standard_Natural, E, "F"));
          end if;
 
          --  This label is required when skipping extra formal generation for
index 7c3eff5..8a88cd3 100644 (file)
@@ -675,6 +675,7 @@ package body Sem_Res is
 
       elsif Ada_Version >= Ada_05
         and then Is_Entity_Name (Pref)
+        and then Is_Access_Type (Etype (Pref))
         and then Ekind (Directly_Designated_Type (Etype (Pref))) =
                                                        E_Incomplete_Type
         and then Is_Tagged_Type (Directly_Designated_Type (Etype (Pref)))