OSDN Git Service

* sem_ch12.adb (Instantiate_Package_Body): if instance is a compilation
[pf3gnuchains/gcc-fork.git] / gcc / ada / ChangeLog
index 1c1279d..ed9675a 100644 (file)
@@ -1,3 +1,585 @@
+To: gcc-patches@gcc.gnu.org
+Subject: [Ada] Reflect 2001-10-22 changes
+
+2001-12-05  Ed Schonberg <schonber@gnat.com>
+
+       * sem_ch12.adb (Instantiate_Package_Body): if instance is a compilation
+        unit, always replace instance node with new body, for ASIS use.
+
+2001-12-05  Vincent Celier <celier@gnat.com>
+       
+       * prj-nmsc.adb (Language_Independent_Check): Issue a warning if 
+       libraries are not supported and both attributes Library_Name and 
+       Library_Dir are specified.
+       
+       * prj-proc.adb (Expression): Set location of Result to location of 
+       first term.
+       
+       * Makefile.in: Add mlib.o, mlib-fil.o, mlib-tgt and mlib-utl to GNATLS.
+       (prj-nmsc is now importing MLib.Tgt)
+       
+       * prj-proc.adb: Put the change indicated above that was forgotten.
+
+*** sem_ch12.adb       2001/10/14 14:08:26     1.790
+--- sem_ch12.adb       2001/10/22 17:38:58     1.791
+***************
+*** 2550,2566 ****
+  
+           Set_Instance_Spec (N, Act_Decl);
+  
+!          --  Case of not a compilation unit
+  
+           if Nkind (Parent (N)) /= N_Compilation_Unit then
+              Mark_Rewrite_Insertion (Act_Decl);
+              Insert_Before (N, Act_Decl);
+              Analyze (Act_Decl);
+- 
+-          --  Case of compilation unit that is generic instantiation
+  
+!          --  Place declaration on current node so context is complete
+!          --  for analysis (including nested instantiations).
+  
+           else
+              if Cunit_Entity (Current_Sem_Unit) = Defining_Entity (N) then
+--- 2550,2570 ----
+  
+           Set_Instance_Spec (N, Act_Decl);
+  
+!          --  If not a compilation unit, insert the package declaration
+!          --  after the instantiation node.
+  
+           if Nkind (Parent (N)) /= N_Compilation_Unit then
+              Mark_Rewrite_Insertion (Act_Decl);
+              Insert_Before (N, Act_Decl);
+              Analyze (Act_Decl);
+  
+!          --  For an instantiation that is a compilation unit, place
+!          --  declaration on current node so context is complete
+!          --  for analysis (including nested instantiations). It this
+!          --  is the main unit, the declaration eventually replaces the
+!          --  instantiation node. If the instance body is later created, it
+!          --  replaces the instance node, and the declation is attached to
+!          --  it (see Build_Instance_Compilation_Unit_Nodes).
+  
+           else
+              if Cunit_Entity (Current_Sem_Unit) = Defining_Entity (N) then
+***************
+*** 2602,2608 ****
+             First_Private_Entity (Act_Decl_Id));
+  
+           if Nkind (Parent (N)) = N_Compilation_Unit
+!            and  then not Needs_Body
+           then
+              Rewrite (N, Act_Decl);
+           end if;
+--- 2606,2612 ----
+             First_Private_Entity (Act_Decl_Id));
+  
+           if Nkind (Parent (N)) = N_Compilation_Unit
+!            and then not Needs_Body
+           then
+              Rewrite (N, Act_Decl);
+           end if;
+***************
+*** 3321,3326 ****
+--- 3325,3337 ----
+        Set_Library_Unit  (Decl_Cunit, Body_Cunit);
+        Set_Library_Unit  (Body_Cunit, Decl_Cunit);
+  
++       --  If the instance is not the main unit, its context, categorization,
++       --  and elaboration entity are not relevant to the compilation.
++ 
++       if Parent (N) /= Cunit (Main_Unit) then
++          return;
++       end if;
++ 
+        --  The context clause items on the instantiation, which are now
+        --  attached to the body compilation unit (since the body overwrote
+        --  the original instantiation node), semantically belong on the spec,
+***************
+*** 6581,6590 ****
+  
+           if Nkind (Parent (Inst_Node)) = N_Compilation_Unit then
+  
+              if Parent (Inst_Node) = Cunit (Main_Unit) then
+-                Build_Instance_Compilation_Unit_Nodes
+-                  (Inst_Node, Act_Body, Act_Decl);
+-                Analyze (Inst_Node);
+  
+                 --  If the instance is a child unit itself, then set the
+                 --  scope of the expanded body to be the parent of the
+--- 6592,6605 ----
+  
+           if Nkind (Parent (Inst_Node)) = N_Compilation_Unit then
+  
++             --  Replace instance node with body of instance, and create
++             --  new node for corresponding instance declaration.
++ 
++             Build_Instance_Compilation_Unit_Nodes
++               (Inst_Node, Act_Body, Act_Decl);
++             Analyze (Inst_Node);
++ 
+              if Parent (Inst_Node) = Cunit (Main_Unit) then
+  
+                 --  If the instance is a child unit itself, then set the
+                 --  scope of the expanded body to be the parent of the
+***************
+*** 6597,6606 ****
+                    Set_Scope
+                      (Defining_Entity (Inst_Node), Scope (Act_Decl_Id));
+                 end if;
+- 
+-             else
+-                Set_Parent (Act_Body, Parent (Inst_Node));
+-                Analyze (Act_Body);
+              end if;
+  
+           --  Case where instantiation is not a library unit
+--- 6612,6617 ----
+
+*** prj-nmsc.adb       2001/10/20 04:14:18     1.29
+--- prj-nmsc.adb       2001/10/22 21:55:07     1.30
+***************
+*** 34,39 ****
+--- 34,40 ----
+  with GNAT.Case_Util;             use GNAT.Case_Util;
+  with GNAT.Directory_Operations;  use GNAT.Directory_Operations;
+  with GNAT.OS_Lib;                use GNAT.OS_Lib;
++ with MLib.Tgt;
+  with Namet;                      use Namet;
+  with Osint;                      use Osint;
+  with Output;                     use Output;
+***************
+*** 1948,2008 ****
+             Data.Library_Name /= No_Name;
+  
+           if Data.Library then
+-             if Current_Verbosity = High then
+-                Write_Line ("This is a library project file");
+-             end if;
+  
+!             pragma Assert (Lib_Version.Kind = Single);
+  
+!             if Lib_Version.Value = Empty_String then
+                 if Current_Verbosity = High then
+!                   Write_Line ("No library version specified");
+                 end if;
+  
+!             else
+!                Stringt.String_To_Name_Buffer (Lib_Version.Value);
+!                Data.Lib_Internal_Name := Name_Find;
+!             end if;
+  
+!             pragma Assert (The_Lib_Kind.Kind = Single);
+  
+!             if The_Lib_Kind.Value = Empty_String then
+!                if Current_Verbosity = High then
+!                   Write_Line ("No library kind specified");
+                 end if;
+  
+!             else
+!                Stringt.String_To_Name_Buffer (The_Lib_Kind.Value);
+  
+!                declare
+!                   Kind_Name : constant String :=
+!                     To_Lower (Name_Buffer (1 .. Name_Len));
+  
+!                   OK : Boolean := True;
+  
+!                begin
+  
+!                   if Kind_Name = "static" then
+!                      Data.Library_Kind := Static;
+  
+!                   elsif Kind_Name = "dynamic" then
+!                      Data.Library_Kind := Dynamic;
+  
+!                   elsif Kind_Name = "relocatable" then
+!                      Data.Library_Kind := Relocatable;
+  
+!                   else
+!                      Error_Msg
+!                        ("illegal value for Library_Kind",
+!                         The_Lib_Kind.Location);
+!                      OK := False;
+!                   end if;
+  
+!                   if Current_Verbosity = High and then OK then
+!                      Write_Str ("Library kind = ");
+!                      Write_Line (Kind_Name);
+!                   end if;
+!                end;
+              end if;
+           end if;
+        end;
+--- 1949,2016 ----
+             Data.Library_Name /= No_Name;
+  
+           if Data.Library then
+  
+!             if not MLib.Tgt.Libraries_Are_Supported then
+!                Error_Msg ("?libraries are not supported on this platform",
+!                            Lib_Name.Location);
+  
+!             else
+                 if Current_Verbosity = High then
+!                   Write_Line ("This is a library project file");
+                 end if;
+  
+!                pragma Assert (Lib_Version.Kind = Single);
+  
+!                if Lib_Version.Value = Empty_String then
+!                   if Current_Verbosity = High then
+!                      Write_Line ("No library version specified");
+!                   end if;
+  
+!                else
+!                   Stringt.String_To_Name_Buffer (Lib_Version.Value);
+!                   Data.Lib_Internal_Name := Name_Find;
+                 end if;
+  
+!                pragma Assert (The_Lib_Kind.Kind = Single);
+  
+!                if The_Lib_Kind.Value = Empty_String then
+!                   if Current_Verbosity = High then
+!                      Write_Line ("No library kind specified");
+!                   end if;
+  
+!                else
+!                   Stringt.String_To_Name_Buffer (The_Lib_Kind.Value);
+  
+!                   declare
+!                      Kind_Name : constant String :=
+!                        To_Lower (Name_Buffer (1 .. Name_Len));
+  
+!                      OK : Boolean := True;
+  
+!                   begin
+  
+!                      if Kind_Name = "static" then
+!                         Data.Library_Kind := Static;
+  
+!                      elsif Kind_Name = "dynamic" then
+!                         Data.Library_Kind := Dynamic;
+  
+!                      elsif Kind_Name = "relocatable" then
+!                         Data.Library_Kind := Relocatable;
+! 
+!                      else
+!                         Error_Msg
+!                           ("illegal value for Library_Kind",
+!                            The_Lib_Kind.Location);
+!                         OK := False;
+!                      end if;
+! 
+!                      if Current_Verbosity = High and then OK then
+!                         Write_Str ("Library kind = ");
+!                         Write_Line (Kind_Name);
+!                      end if;
+!                   end;
+!                end if;
+              end if;
+           end if;
+        end;
+
+*** prj-proc.adb       2001/10/05 16:11:38     1.18
+--- prj-proc.adb       2001/10/22 21:59:35     1.19
+***************
+*** 662,667 ****
+--- 662,668 ----
+  
+        if Data.Modifies /= No_Project
+          and then Projects.Table (Data.Modifies).Name = With_Name
++ 
+        then
+           return Data.Modifies;
+  
+
+*** Makefile.in        2001/10/22 00:45:45     1.1415
+--- Makefile.in        2001/10/22 22:07:09     1.1416
+***************
+*** 488,493 ****
+--- 488,497 ----
+   hostparm.o \
+   krunch.o   \
+   lib.o      \
++  mlib.o     \
++  mlib-fil.o \
++  mlib-tgt.o \
++  mlib-utl.o \
+   namet.o    \
+   nlists.o   \
+   opt.o      \
+
+*** prj-proc.adb       2001/10/22 21:59:35     1.19
+--- prj-proc.adb       2001/10/22 22:11:00     1.20
+***************
+*** 246,252 ****
+        --  Reference to the last string elements in Result, when Kind is List.
+  
+     begin
+!       Result.Location := Location_Of (From_Project_Node);
+  
+        --  Process each term of the expression, starting with First_Term
+  
+--- 246,252 ----
+        --  Reference to the last string elements in Result, when Kind is List.
+  
+     begin
+!       Result.Location := Location_Of (First_Term);
+  
+        --  Process each term of the expression, starting with First_Term
+  
+***************
+*** 639,645 ****
+           end case;
+  
+           The_Term := Next_Term (The_Term);
+- 
+        end loop;
+  
+        return Result;
+--- 639,644 ----
+***************
+*** 662,668 ****
+  
+        if Data.Modifies /= No_Project
+          and then Projects.Table (Data.Modifies).Name = With_Name
+- 
+        then
+           return Data.Modifies;
+  
+--- 661,666 ----
+2001-12-05  Robert Dewar <dewar@gnat.com>
+
+       * Makefile.in: Add dependencies for System.IO for GNAT.Regexp
+
+2001-12-05  Ed Schonberg <schonber@gnat.com>
+
+       * sem_ch3.adb (Build_Derived_Concurrent_Type): If derivation imposes a
+       constraint, introduce explicit subtype declaration and derive from it.
+       
+       * sem_ch3.adb: Minor reformatting
+
+2001-12-05  Robert Dewar <dewar@gnat.com>
+
+       * checks.adb (Determine_Range): Increase cache size for checks. 
+       Minor reformatting
+       
+       * exp_ch6.adb: Minor reformatting
+       (Expand_N_Subprogram_Body): Reset Is_Pure for any subprogram that has
+       a parameter whose root type is System.Address, since treating such
+       subprograms as pure in the code generator is almost surely a mistake
+       that will lead to unexpected results.
+       
+       * exp_util.adb (Remove_Side_Effects): Clean up old ??? comment and 
+       change handling of conversions.
+       
+       * g-regexp.adb: Use System.IO instead of Ada.Text_IO.
+
+2001-12-05  Ed Schonberg <schonber@gnat.com>
+
+       * sem_ch3.adb (Analyze_Object_Declaration): If expression is an 
+       aggregate with static wrong size, attach generated Raise node to 
+       declaration.
+
+2001-12-05  Robert Dewar <dewar@gnat.com>
+
+       * sem_attr.adb (Analyze_Attribute): Defend against bad Val attribute. 
+       Fixes compilation abandoned bomb in B24009B.
+
+2001-12-05  Ed Schonberg <schonber@gnat.com>
+
+       * sem_ch12.adb:
+       Document use of Associated_Node on Selected_Components.
+       (Save_Global_Operand_Descendants): Change to Save_Entity_Descendants,
+       to clarify use of untyped descendant fields.
+
+2001-12-05  Robert Dewar <dewar@gnat.com>
+
+       * prj-dect.ads: Add ??? comment
+       Add 2001 to copyright notice (was not done in after all)
+       
+       * prj-part.adb: Minor reformatting. Reword one awkward error message.
+       
+       * prj.ads: Minor reformatting throughout, and add some ??? comments
+       
+       * snames.ads: Minor reformatting
+
+2001-12-05  Geert Bosch <bosch@gnat.com>
+
+       * snames.adb: Autoupdate
+
+2001-12-05  Vincent Celier <celier@gnat.com>
+
+       * prj-dect.adb (Parse): Rename parameter Modifying to Extends.
+       
+       * prj-dect.ads (Parse): Rename parameter Modifying to Extends.
+       
+       * prj-env.adb: Minor comment changes (modifying -> extends).
+       
+       * prj-nmsc.adb: Minor comment changes (modifying -> extends).
+       
+       * prj-part.adb (Parse_Single_Project): Change Tok_Modifying to 
+       Tok_Extends.
+       
+       * prj.adb (Initialize): Change Modifying to Extends.
+       
+       * scans.ads (Token_Type): Change Tok_Modifying to Tok_Extends.
+       
+       * prj.ads: Minor comment change (Modifying -> extending).
+       
+       * snames.ads: Change modifying to extends.
+
+2001-12-05  Robert Dewar <dewar@gnat.com>
+
+       * sem_warn.adb: Remove stuff for conditionals, we are not going to 
+       do this after all.
+       
+       * sem_warn.ads: Remove stuff for conditionals, we are not going to 
+       do this after all.  Add 2001 to copyright notice
+
+2001-12-04  Geert Bosch <bosch@gnat.com>
+
+       *  einfo.h, sinfo.h, treeprs.ads: Regenerate.
+
+2001-12-04  Robert Dewar <dewar@gnat.com>
+
+       * errout.adb (Error_Msg): Ignore attempt to put error msg at junk 
+       location if we already have errors. Stops some cases of cascaded 
+       errors.
+       
+       * errout.adb: Improve comment.
+
+2001-12-04  Robert Dewar <dewar@gnat.com>
+
+       * sem_ch12.adb:
+       (Analyze_Formal_Type_Definition): Defend against Error.
+       (Analyze_Formal_Subprogram): Defend against Error.
+       
+       * par-ch12.adb (F_Formal_Type_Declaration): In case of error, 
+       remove following semicolon if present. Removes cascaded error.
+
+2001-12-04  Douglas B. Rupp <rupp@gnat.com>
+
+       * bindgen.adb:
+       (Gen_Exception_Table_Ada): Write "begin" and then return if Num
+        exceptions equals 0.
+       (Gen_Exception_Table_C): Return if Num exceptions equals 0.
+       Fixes PIWG E tests (which have to be run with -gnatL).
+
+2001-12-04  Robert Dewar <dewar@gnat.com>
+
+       * einfo.ads: Minor reformatting
+
+2001-12-04  Ed Schonberg <schonber@gnat.com>
+
+       * einfo.ads: Block_Node points to the identifier of the block, not to 
+       the block node itself, to preserve the link when the block is 
+       rewritten, e.g. within an if-statement with a static condition. 
+       
+       * inline.adb (Cleanup_Scopes): recover block statement from block 
+       entity using new meaning of Block_Node.
+       
+       * sem_ch5.adb (Analyze_Block_Statement): set Block_Node to point to 
+       identifier of block node, rather than to node itself.
+
+2001-12-04  Gary Dismukes <dismukes@gnat.com>
+       
+       * layout.adb:
+       (Get_Max_Size): Fix "start of processing" comment to say Get_Max_Size.
+       (Discrimify): Go back to setting the Etypes of the selected component
+       because the Vname component does not exist at this point and will 
+       fail name resolution. Also set Analyzed.
+       Remove with and use of Sem_Res.
+
+2001-12-04  Arnaud Charlet <charlet@gnat.com>
+
+       * Makefile.in: (HIE_SOURCES): add s-fat*.
+
+2001-12-04  Robert Dewar <dewar@gnat.com>
+
+       * sem_attr.adb:
+       (Compile_Time_Known_Attribute): New procedure.
+       (Eval_Attribute, case Size): Use Compile_Time_Known_Attribute to ensure
+        proper range check.
+
+2001-12-04  Ed Schonberg <schonber@gnat.com>
+
+       * sem_ch7.adb (New_Private_Type): Set Is_Tagged_Type flag before 
+       processing discriminants to diagnose illegal default values.
+
+2001-12-04  Ed Schonberg <schonber@gnat.com>
+
+       * sem_attr.adb (Resolve_Attribute): Handle properly an non-classwide 
+       access discriminant within a type extension that constrains its 
+       parent discriminants.
+
+2001-12-04  Ed Schonberg <schonber@gnat.com>
+
+       * sem_ch3.adb (Find_Type_Of_Subtype_Indic): If subtype indication 
+       is malformed, use instance of Any_Id to allow analysis to proceed.
+       
+       * par-ch12.adb (P_Formal_Type_Declaration): Propagate Error if 
+       type definition is illegal.
+       (P_Formal_Derived_Type_Definition): Better recovery when TAGGED is
+       misplaced.
+
+2001-12-04  Ed Schonberg <schonber@gnat.com>
+
+       * sem_warn.adb (Output_Unreferenced_Messages): Extend previous fix to 
+       constants.
+
+2001-12-04  Robert Dewar <dewar@gnat.com>
+
+       * errout.adb: Minor reformatting
+
+2001-12-04  Robert Dewar <dewar@gnat.com>
+
+       * exp_util.adb: Minor reformatting from last change
+       
+       * errout.adb (Check_For_Warning): For a Raised_Constraint_Error node 
+       which is a rewriting of an expression, traverse the original 
+       expression to remove warnings that may have been posted on it.
+
+2001-12-04  Ed Schonberg <schonber@gnat.com>
+
+       * exp_util.adb (Must_Be_Aligned): Return false for a component of a 
+       record that has other packed components.
+
+2001-12-04  Douglass B. Rupp <rupp@gnat.com>
+
+       * adaint.c: Minor cleanups.
+
+2001-12-04  Douglass B. Rupp <rupp@gnat.com>
+
+       * adaint.c: Do not use utime.h on vxworks.
+
+2001-12-04  Arnaud Charlet <charlet@gnat.com>
+
+       * Makefile.adalib: Clarify step 3 (use of gnat.adc) as it causes 
+       more confusion than it solves.
+
+2001-12-04  Geert bosch <bosch@gnat.com>
+
+       * einfo.h, nmake.adb, nmake.ads, sinfo.h treeprs.ads: Regenerate.
+
+2001-12-04  Geert Bosch  <bosch@gnat.com>
+
+       * Makefile.in (update-sources): New target. 
+       For use by gcc_release script.
+
+2001-12-04  Ed Schonberg <schonber@gnat.com>
+
+       * sem_prag.adb (Analyze_Pragma, case Validity_Checks): do not treat as 
+       a configuration pragma, it is now legal wherever a pragma can appear.
+
+2001-12-04  Zack Weinberg  <zack@codesourcery.com>
+
+       * Makefile.in: Don't set ALL.  Delete @cross_defines@,
+       @cross_overrides@, @build_overrides@ stanzas.  INTERNAL_CFLAGS
+       is now @CROSS@ -DIN_GCC; update comment.
+
 2001-12-04  Robert Dewar <dewar@gnat.com>
 
        * einfo.adb (Has_Pragma_Pure_Function): New flag.