OSDN Git Service

2011-10-13 Ed Schonberg <schonberg@adacore.com>
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 13 Oct 2011 11:05:50 +0000 (11:05 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 13 Oct 2011 11:05:50 +0000 (11:05 +0000)
* sem_util.ads, sem_util.adb (Available_Full_View_Of_Component):
New predicate to determine whether some operations on an array
type are available when the full view of its component may differ
from the view of the point of the array declaration.
* sem_ch4.adb (Find_Equality_Types): Use
Available_Full_View_Of_Component.
* sem_type.adb (Valid_Boolean_Arg, Valid_Comparison_Arg): Ditto

2011-10-13  Ed Schonberg  <schonberg@adacore.com>

* sem_ch9.adb: Analyze aspects while discriminants of protected
type are visible.

2011-10-13  Geert Bosch  <bosch@adacore.com>

* Makefile.rtl (GNATRTL_TASKING_OBJECTS): Add
a-nlcoar.o, a-nllcar.o, a-nucoar.o and s-gearop.o, as these no
longer depend on an external library.
* gcc-interface/Makefile.in (GNATRTL_LINEARALGEBRA_OBJS): Remove
a-nlcoar.o, a-nllcar.o, a-nucoar.o and s-gearop.o.
Update dependencies.
* gcc-interface/Make-lang.in: Update dependencies.

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

gcc/ada/ChangeLog
gcc/ada/Makefile.rtl
gcc/ada/gcc-interface/Make-lang.in
gcc/ada/gcc-interface/Makefile.in
gcc/ada/sem_ch4.adb
gcc/ada/sem_ch9.adb
gcc/ada/sem_type.adb
gcc/ada/sem_util.adb
gcc/ada/sem_util.ads

index 2b23da9..7ce57e9 100644 (file)
@@ -1,3 +1,28 @@
+2011-10-13  Ed Schonberg  <schonberg@adacore.com>
+
+       * sem_util.ads, sem_util.adb (Available_Full_View_Of_Component):
+       New predicate to determine whether some operations on an array
+       type are available when the full view of its component may differ
+       from the view of the point of the array declaration.
+       * sem_ch4.adb (Find_Equality_Types): Use
+       Available_Full_View_Of_Component.
+       * sem_type.adb (Valid_Boolean_Arg, Valid_Comparison_Arg): Ditto
+
+2011-10-13  Ed Schonberg  <schonberg@adacore.com>
+
+       * sem_ch9.adb: Analyze aspects while discriminants of protected
+       type are visible.
+
+2011-10-13  Geert Bosch  <bosch@adacore.com>
+
+       * Makefile.rtl (GNATRTL_TASKING_OBJECTS): Add
+       a-nlcoar.o, a-nllcar.o, a-nucoar.o and s-gearop.o, as these no
+       longer depend on an external library.
+       * gcc-interface/Makefile.in (GNATRTL_LINEARALGEBRA_OBJS): Remove
+       a-nlcoar.o, a-nllcar.o, a-nucoar.o and s-gearop.o.
+       Update dependencies.
+       * gcc-interface/Make-lang.in: Update dependencies. 
+
 2011-10-13  Cyrille Comar  <comar@adacore.com>
 
        * gnat_ugn.texi: Minor editing.
index 88b37bc..d70583c 100644 (file)
@@ -189,24 +189,27 @@ GNATRTL_NONTASKING_OBJS= \
   a-ngcoty$(objext) \
   a-ngelfu$(objext) \
   a-ngrear$(objext) \
-  a-nllrar$(objext) \
-  a-nlrear$(objext) \
-  a-nurear$(objext) \
   a-nlcefu$(objext) \
+  a-nlcoar$(objext) \
   a-nlcoty$(objext) \
   a-nlelfu$(objext) \
+  a-nlrear$(objext) \
+  a-nllcar$(objext) \
   a-nllcef$(objext) \
   a-nllcty$(objext) \
   a-nllefu$(objext) \
+  a-nllrar$(objext) \
   a-nscefu$(objext) \
   a-nscoty$(objext) \
   a-nselfu$(objext) \
+  a-nucoar$(objext) \
   a-nucoty$(objext) \
   a-nudira$(objext) \
   a-nuelfu$(objext) \
   a-nuflra$(objext) \
   a-numaux$(objext) \
   a-numeri$(objext) \
+  a-nurear$(objext) \
   a-rbtgbo$(objext) \
   a-rbtgbk$(objext) \
   a-rbtgso$(objext) \
@@ -515,6 +518,7 @@ GNATRTL_NONTASKING_OBJS= \
   s-fvadfl$(objext) \
   s-fvaffl$(objext) \
   s-fvagfl$(objext) \
+  s-gearop$(objext) \
   s-geveop$(objext) \
   s-gloloc$(objext) \
   s-htable$(objext) \
index a3ec5d3..81e14f2 100644 (file)
@@ -3710,9 +3710,9 @@ ada/sem_aggr.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
    ada/lib-list.adb ada/lib-load.ads ada/lib-sort.adb ada/lib-util.ads \
    ada/lib-xref.ads ada/namet.ads ada/namet.adb ada/namet-sp.ads \
    ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads \
-   ada/output.ads ada/par_sco.ads ada/put_alfa.ads ada/restrict.ads \
-   ada/restrict.adb ada/rident.ads ada/rtsfind.ads ada/scans.ads \
-   ada/sem.ads ada/sem.adb ada/sem_aggr.ads ada/sem_aggr.adb \
+   ada/opt.adb ada/output.ads ada/par_sco.ads ada/put_alfa.ads \
+   ada/restrict.ads ada/restrict.adb ada/rident.ads ada/rtsfind.ads \
+   ada/scans.ads ada/sem.ads ada/sem.adb ada/sem_aggr.ads ada/sem_aggr.adb \
    ada/sem_attr.ads ada/sem_aux.ads ada/sem_aux.adb ada/sem_cat.ads \
    ada/sem_ch10.ads ada/sem_ch11.ads ada/sem_ch12.ads ada/sem_ch13.ads \
    ada/sem_ch13.adb ada/sem_ch2.ads ada/sem_ch3.ads ada/sem_ch4.ads \
index 69c0ee3..160a15e 100644 (file)
@@ -573,6 +573,8 @@ ifeq ($(strip $(filter-out e500% powerpc% wrs vxworks,$(targ))),)
         endif
       endif
       EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o s-vxwexc.o
+      EXTRA_LIBGNAT_OBJS+=sigtramp-ppcvxw.o
+      EXTRA_LIBGNAT_SRCS+=sigtramp-ppcvxw.c
     endif
   endif
 
@@ -617,6 +619,9 @@ ifeq ($(strip $(filter-out powerpc% e500v2 wrs vxworksae,$(targ))),)
   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o s-vxwexc.o
   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o s-vxwext.o
 
+  EXTRA_LIBGNAT_SRCS+=sigtramp-ppcvxw.c
+  EXTRA_LIBGNAT_OBJS+=sigtramp-ppcvxw.o
+
   # Extra pairs for the vthreads runtime
   ifeq ($(strip $(filter-out vthreads,$(THREAD_KIND))),)
     LIBGNAT_TARGET_PAIRS += \
@@ -679,8 +684,8 @@ ifeq ($(strip $(filter-out e500% powerpc% wrs vxworksmils,$(targ))),)
   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o s-thread.o s-vxwexc.o
   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o s-vxwext.o
 
-  EXTRA_LIBGNAT_SRCS+=vx_stack_info.c
-  EXTRA_LIBGNAT_OBJS+=vx_stack_info.o
+  EXTRA_LIBGNAT_SRCS+=vx_stack_info.c sigtramp-ppcvxw.c
+  EXTRA_LIBGNAT_OBJS+=vx_stack_info.o sigtramp-ppcvxw.o
   GNATRTL_SOCKETS_OBJS =
 
   ifeq ($(strip $(filter-out yes,$(TRACE))),)
@@ -2229,11 +2234,10 @@ LIBGNAT_OBJS = adadecode.o adaint.o argv.o cio.o cstreams.o ctrl_c.o    \
 
 include $(fsrcdir)/ada/Makefile.rtl
 
-GNATRTL_LINEARALGEBRA_OBJS = a-nlcoar.o a-nllcar.o \
-  a-nucoar.o i-forbla.o i-forlap.o s-gearop.o
+GNATRTL_LINEARALGEBRA_OBJS = i-forbla.o i-forlap.o
 
 GNATRTL_OBJS = $(GNATRTL_NONTASKING_OBJS) $(GNATRTL_TASKING_OBJS) \
-  $(GNATRTL_LINEARALGEBRA_OBJS) g-trasym.o memtrack.o
+  $(GNATRTL_LINEARALGEBRA_OBJS) memtrack.o
 
 # Default run time files
 
@@ -2413,7 +2417,6 @@ install-gnatlib: ../stamp-gnatlib-$(RTSDIR)
        for file in $(RTSDIR)/*.ali; do \
            $(INSTALL_DATA_DATE) $$file $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
        done
-       -$(INSTALL_DATA) $(RTSDIR)/g-trasym$(objext) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
        -cd $(RTSDIR); for file in *$(arext);do \
            $(INSTALL_DATA) $$file $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
            $(RANLIB_FOR_TARGET) $(DESTDIR)$(ADA_RTL_OBJ_DIR)/$$file; \
@@ -2835,6 +2838,7 @@ mkdir.o   : mkdir.c
 socket.o  : socket.c gsocket.h
 sysdep.o  : sysdep.c
 raise.o   : raise.c raise.h
+sigtramp-ppcvxw.o : sigtramp-ppcvxw.c sigtramp.h
 vx_stack_info.o : vx_stack_info.c
 
 raise-gcc.o : raise-gcc.c raise.h
index 9bd6bbd..8fc5045 100644 (file)
@@ -5548,9 +5548,15 @@ package body Sem_Ch4 is
          end if;
 
          if T1 /= Standard_Void_Type
-           and then not Is_Limited_Type (T1)
-           and then not Is_Limited_Composite (T1)
            and then Has_Compatible_Type (R, T1)
+           and then
+             ((not Is_Limited_Type (T1)
+                and then not Is_Limited_Composite (T1))
+
+               or else
+                (Is_Array_Type (T1)
+                   and then not Is_Limited_Type (Component_Type (T1))
+                   and then Available_Full_View_Of_Component (T1)))
          then
             if Found
               and then Base_Type (T1) /= Base_Type (T_F)
index b4a4c45..3677a7b 100644 (file)
@@ -1163,7 +1163,11 @@ package body Sem_Ch9 is
    begin
       if No_Run_Time_Mode then
          Error_Msg_CRT ("protected type", N);
-         goto Leave;
+         if Has_Aspects (N) then
+            Analyze_Aspect_Specifications (N, Def_Id);
+         end if;
+
+         return;
       end if;
 
       Tasking_Used := True;
@@ -1256,6 +1260,13 @@ package body Sem_Ch9 is
          Next_Entity (E);
       end loop;
 
+      --  If aspects are present, analyze them now. They can make references
+      --  to the discriminants of the type.
+
+      if Has_Aspects (N) then
+         Analyze_Aspect_Specifications (N, Def_Id);
+      end if;
+
       End_Scope;
 
       --  Case of a completion of a private declaration
@@ -1287,11 +1298,6 @@ package body Sem_Ch9 is
             Process_Full_View (N, T, Def_Id);
          end if;
       end if;
-
-   <<Leave>>
-      if Has_Aspects (N) then
-         Analyze_Aspect_Specifications (N, Def_Id);
-      end if;
    end Analyze_Protected_Type_Declaration;
 
    ---------------------
index fff01b1..c391163 100644 (file)
@@ -3372,18 +3372,28 @@ package body Sem_Type is
 
    function Valid_Boolean_Arg (T : Entity_Id) return Boolean is
    begin
-      return Is_Boolean_Type (T)
-        or else T = Any_Composite
-        or else (Is_Array_Type (T)
-                  and then T /= Any_String
-                  and then Number_Dimensions (T) = 1
-                  and then Is_Boolean_Type (Component_Type (T))
-                  and then (not Is_Private_Composite (T)
-                             or else In_Instance)
-                  and then (not Is_Limited_Composite (T)
-                             or else In_Instance))
+      if Is_Boolean_Type (T)
         or else Is_Modular_Integer_Type (T)
-        or else T = Universal_Integer;
+        or else T = Universal_Integer
+        or else T = Any_Composite
+      then
+         return True;
+
+      elsif Is_Array_Type (T)
+        and then T /= Any_String
+        and then Number_Dimensions (T) = 1
+        and then Is_Boolean_Type (Component_Type (T))
+        and then
+         ((not Is_Private_Composite (T)
+            and then not Is_Limited_Composite (T))
+           or else In_Instance
+           or else Available_Full_View_Of_Component (T))
+      then
+         return True;
+
+      else
+         return False;
+      end if;
    end Valid_Boolean_Arg;
 
    --------------------------
@@ -3395,10 +3405,12 @@ package body Sem_Type is
 
       if T = Any_Composite then
          return False;
+
       elsif Is_Discrete_Type (T)
         or else Is_Real_Type (T)
       then
          return True;
+
       elsif Is_Array_Type (T)
           and then Number_Dimensions (T) = 1
           and then Is_Discrete_Type (Component_Type (T))
@@ -3408,6 +3420,14 @@ package body Sem_Type is
                      or else In_Instance)
       then
          return True;
+
+      elsif Is_Array_Type (T)
+        and then Number_Dimensions (T) = 1
+        and then Is_Discrete_Type (Component_Type (T))
+        and then Available_Full_View_Of_Component (T)
+      then
+         return True;
+
       elsif Is_String_Type (T) then
          return True;
       else
index 43fb39f..660611d 100644 (file)
@@ -333,6 +333,16 @@ package body Sem_Util is
       end if;
    end Apply_Compile_Time_Constraint_Error;
 
+   function Available_Full_View_Of_Component (T : Entity_Id) return Boolean is
+      ST  : constant Entity_Id := Scope (T);
+      SCT : constant Entity_Id := Scope (Component_Type (T));
+
+   begin
+      return In_Open_Scopes (ST)
+        and then In_Open_Scopes (SCT)
+        and then Scope_Depth (ST) >= Scope_Depth (SCT);
+   end Available_Full_View_Of_Component;
+
    --------------------------------
    -- Bad_Predicated_Subtype_Use --
    --------------------------------
index 2314633..32e6ae6 100644 (file)
@@ -94,6 +94,15 @@ package Sem_Util is
    --  not end with a ? (this is used when the caller wants to parameterize
    --  whether an error or warning is given.
 
+   function Available_Full_View_Of_Component (T : Entity_Id) return Boolean;
+   --  If at the point of declaration an array type has a private or limited
+   --  component, several array operations are not avaiable on the type, and
+   --  the array type is flagged accordingly. If in the immediate scope of
+   --  the array type the component becomes non-private or non-limited, these
+   --  operations become avaiable. This can happen if the scopes of both types
+   --  are open, and the scope of the array is not outside the scope of the
+   --  component.
+
    procedure Bad_Predicated_Subtype_Use
      (Msg : String;
       N   : Node_Id;
@@ -836,8 +845,8 @@ package Sem_Util is
    --  by the derived type declaration for type Typ.
 
    function Is_Iterator (Typ : Entity_Id) return Boolean;
-   --  AI05-0139-2: Check whether Typ is derived from the predefined interface
-   --  Ada.Iterator_Interfaces.Forward_Iterator.
+   --  AI05-0139-2 : check whether Typ is one of the predefined interfaces
+   --  in Ada.Iterator_Interfaces, or it is derived from one.
 
    function Is_LHS (N : Node_Id) return Boolean;
    --  Returns True iff N is used as Name in an assignment statement