[Ada] Reflect ACT changes of 2001-10-30

Geert Bosch bosch@darwin.gnat.com
Tue Dec 11 15:02:00 GMT 2001


2001-12-11  Ed Schonberg <schonber@gnat.com>

	* freeze.adb: Make Freeze_Fixed_Point_Type visible, for use in
	sem_attr.
	
	* sem_attr.adb: Simplify previous fix for Address.
	(Set_Bounds): If prefix is a non-frozen fixed-point type, freeze now, 
	to avoid anomalies where the bound of the type appears to raise 
	constraint error.

2001-12-11  Robert Dewar <dewar@gnat.com>

	* lib-xref.adb (Output_Refs): Make sure pointers are always properly 
	handled.
	
2001-12-11  Ed Schonberg <schonber@gnat.com>

	* sem_ch12.adb (Analyze_Subprogram_Instantiation): Check for a 
	renamed unit before checking for recursive instantiations.
	
2001-12-11  Emmanuel Briot <briot@gnat.com>

	* prj.ads: Add comments for some of the fields.

*** freeze.adb	2001/09/18 20:02:26	1.281
--- freeze.adb	2001/10/30 01:36:22	1.282
***************
*** 105,115 ****
     --  that if a foreign convention is specified, and no specific size
     --  is given, then the size must be at least Integer'Size.
  
-    procedure Freeze_Fixed_Point_Type (Typ : Entity_Id);
-    --  Freeze fixed point type. For fixed-point types, we have to defer
-    --  setting the size and bounds till the freeze point, since they are
-    --  potentially affected by the presence of size and small clauses.
- 
     procedure Freeze_Static_Object (E : Entity_Id);
     --  If an object is frozen which has Is_Statically_Allocated set, then
     --  all referenced types must also be marked with this flag. This routine
--- 105,110 ----

*** sem_attr.adb	2001/10/29 21:17:23	1.558
--- sem_attr.adb	2001/10/30 01:36:26	1.559
***************
*** 1555,1562 ****
              then
                 Set_Address_Taken (Entity (P));
  
!             elsif ((Ekind (Entity (P)) = E_Task_Type
!                       or else Ekind (Entity (P)) = E_Protected_Type)
                      and then Etype (Entity (P)) = Base_Type (Entity (P)))
                or else Ekind (Entity (P)) = E_Package
                or else Is_Generic_Unit (Entity (P))
--- 1555,1561 ----
              then
                 Set_Address_Taken (Entity (P));
  
!             elsif (Is_Concurrent_Type (Etype (Entity (P)))
                      and then Etype (Entity (P)) = Base_Type (Entity (P)))
                or else Ekind (Entity (P)) = E_Package
                or else Is_Generic_Unit (Entity (P))
***************
*** 3740,3746 ****
        --  array subtype. Sets the variables Index_Lo and Index_Hi to the low
        --  and high bound expressions for the index referenced by the attribute
        --  designator (i.e. the first index if no expression is present, and
!       --  the N'th index if the value N is present as an expression).
  
        ---------------
        -- Aft_Value --
--- 3739,3746 ----
        --  array subtype. Sets the variables Index_Lo and Index_Hi to the low
        --  and high bound expressions for the index referenced by the attribute
        --  designator (i.e. the first index if no expression is present, and
!       --  the N'th index if the value N is present as an expression). Also
!       --  used for First and Last of scalar types.
  
        ---------------
        -- Aft_Value --
***************
*** 4015,4020 ****
--- 4015,4028 ----
  
           elsif Is_Scalar_Type (P_Type) then
              Ityp := P_Type;
+ 
+             if Is_Fixed_Point_Type (P_Type)
+               and then not Is_Frozen (Base_Type (P_Type))
+               and then Compile_Time_Known_Value (Type_Low_Bound (P_Type))
+               and then Compile_Time_Known_Value (Type_High_Bound (P_Type))
+             then
+                Freeze_Fixed_Point_Type (Base_Type (P_Type));
+             end if;
  
           --  For array case, get type of proper index
  

*** lib-xref.adb	2001/10/29 02:35:13	1.58
--- lib-xref.adb	2001/10/30 06:11:43	1.59
***************
*** 698,705 ****
  
                                if Tref /= Etype (Tref) then
                                   Tref := First_Subtype (Etype (Tref));
!                                  Left := '<';
!                                  Right := '>';
  
                                --  If non-derived ptr, get designated type
  
--- 698,712 ----
  
                                if Tref /= Etype (Tref) then
                                   Tref := First_Subtype (Etype (Tref));
! 
!                                  --  Set brackets for derived type, but don't
!                                  --  override pointer case since the fact that
!                                  --  something is a pointer is more important
! 
!                                  if Left /= '(' then
!                                     Left := '<';
!                                     Right := '>';
!                                  end if;
  
                                --  If non-derived ptr, get designated type
  

*** sem_ch12.adb	2001/10/26 12:41:09	1.792
--- sem_ch12.adb	2001/10/30 14:37:18	1.793
***************
*** 3052,3063 ****
        elsif In_Open_Scopes (Gen_Unit) then
           Error_Msg_NE ("instantiation of & within itself", N, Gen_Unit);
  
-       elsif Contains_Instance_Of (Gen_Unit, Current_Scope, Gen_Id) then
-          Error_Msg_Node_2 := Current_Scope;
-          Error_Msg_NE
-            ("circular Instantiation: & instantiated in &!", N, Gen_Unit);
-          Circularity_Detected := True;
- 
        elsif K = E_Procedure
          and then Ekind (Gen_Unit) /= E_Generic_Procedure
        then
--- 3052,3057 ----
***************
*** 3090,3095 ****
--- 3084,3097 ----
           then
              Gen_Unit := Renamed_Object (Gen_Unit);
              Set_Entity (Gen_Id, Gen_Unit);
+          end if;
+ 
+          if Contains_Instance_Of (Gen_Unit, Current_Scope, Gen_Id) then
+             Error_Msg_Node_2 := Current_Scope;
+             Error_Msg_NE
+               ("circular Instantiation: & instantiated in &!", N, Gen_Unit);
+             Circularity_Detected := True;
+             return;
           end if;
  
           if In_Extended_Main_Source_Unit (N) then

*** prj.ads	2001/10/20 10:48:13	1.23
--- prj.ads	2001/10/30 16:45:36	1.24
***************
*** 86,92 ****
              Value : String_Id := No_String;
        end case;
     end record;
!    --  Values for variables and array elements
  
     Nil_Variable_Value : constant Variable_Value :=
       (Kind     => Undefined,
--- 86,93 ----
              Value : String_Id := No_String;
        end case;
     end record;
!    --  Values for variables and array elements.
!    --  Default is True if the current value is the default one for the variable
  
     Nil_Variable_Value : constant Variable_Value :=
       (Kind     => Undefined,
***************
*** 383,392 ****
--- 384,397 ----
        Include_Path : String_Access := null;
        --  The cached value of ADA_INCLUDE_PATH for this project file.
        --  Set by gnatmake (prj.Env.Set_Ada_Paths).
+       --  Do not use this field directly outside of the compiler, use
+       --  Prj.Env.Ada_Source_Path instead.
  
        Objects_Path : String_Access := null;
        --  The cached value of ADA_OBJECTS_PATH for this project file.
        --  Set by gnatmake (prj.Env.Set_Ada_Paths).
+       --  Do not use this field directly outside of the compiler, use
+       --  Prj.Env.Ada_Source_Path instead.
  
        Config_File_Name : Name_Id := No_Name;
        --  The name of the configuration pragmas file, if any.



More information about the Gcc-patches mailing list