diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2011-08-31 10:37:37 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2011-08-31 10:37:37 +0200 |
commit | 0a190dfd4af27afb8eaf03082af81acbb5bf8a80 (patch) | |
tree | 05f58af667e348f42a36576e56904ec7c8c9e1c0 | |
parent | 8861e60f317087011b73617dd4efa5eb9e7a1acf (diff) | |
download | gcc-0a190dfd4af27afb8eaf03082af81acbb5bf8a80.zip gcc-0a190dfd4af27afb8eaf03082af81acbb5bf8a80.tar.gz gcc-0a190dfd4af27afb8eaf03082af81acbb5bf8a80.tar.bz2 |
[multiple changes]
2011-08-31 Hristian Kirtchev <kirtchev@adacore.com>
* sem_ch12 (Check_Private_View): Revert previous change.
* sem_res.adb (Conversion_Check): Do not emit the error message if the
conversion is in a generic instance.
2011-08-31 Matthew Heaney <heaney@adacore.com>
* a-cbhase.adb (Symmetric_Difference): Dereference correct node array.
* a-chtgbo.adb (Free): Allow 0 as index value.
2011-08-31 Matthew Heaney <heaney@adacore.com>
* a-cborma.adb (Insert): Add comment to explain why no element
assignment.
2011-08-31 Gary Dismukes <dismukes@adacore.com>
* sem_util.adb (Find_Body_Discriminal): Test whether the scope of the
spec discriminant is already a concurrent type, in which case just use
it, otherwise fetch the Corresponding_Concurrent_Type as before.
From-SVN: r178356
-rw-r--r-- | gcc/ada/ChangeLog | 22 | ||||
-rw-r--r-- | gcc/ada/a-cbhase.adb | 2 | ||||
-rw-r--r-- | gcc/ada/a-cborma.adb | 11 | ||||
-rw-r--r-- | gcc/ada/a-chtgbo.adb | 10 | ||||
-rw-r--r-- | gcc/ada/sem_ch12.adb | 7 | ||||
-rw-r--r-- | gcc/ada/sem_res.adb | 14 | ||||
-rw-r--r-- | gcc/ada/sem_util.adb | 17 |
7 files changed, 67 insertions, 16 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 94af331..06d9091 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,25 @@ +2011-08-31 Hristian Kirtchev <kirtchev@adacore.com> + + * sem_ch12 (Check_Private_View): Revert previous change. + * sem_res.adb (Conversion_Check): Do not emit the error message if the + conversion is in a generic instance. + +2011-08-31 Matthew Heaney <heaney@adacore.com> + + * a-cbhase.adb (Symmetric_Difference): Dereference correct node array. + * a-chtgbo.adb (Free): Allow 0 as index value. + +2011-08-31 Matthew Heaney <heaney@adacore.com> + + * a-cborma.adb (Insert): Add comment to explain why no element + assignment. + +2011-08-31 Gary Dismukes <dismukes@adacore.com> + + * sem_util.adb (Find_Body_Discriminal): Test whether the scope of the + spec discriminant is already a concurrent type, in which case just use + it, otherwise fetch the Corresponding_Concurrent_Type as before. + 2011-08-30 Eric Botcazou <ebotcazou@adacore.com> * system-irix-n64.ads, system-linux-armeb.ads, system-linux-armel.ads, diff --git a/gcc/ada/a-cbhase.adb b/gcc/ada/a-cbhase.adb index 3b85e2e..faef78e 100644 --- a/gcc/ada/a-cbhase.adb +++ b/gcc/ada/a-cbhase.adb @@ -1274,7 +1274,7 @@ package body Ada.Containers.Bounded_Hashed_Sets is ------------- procedure Process (R_Node : Count_Type) is - N : Node_Type renames Left.Nodes (R_Node); + N : Node_Type renames Right.Nodes (R_Node); X : Count_Type; B : Boolean; diff --git a/gcc/ada/a-cborma.adb b/gcc/ada/a-cborma.adb index 89ec131..4cc2686 100644 --- a/gcc/ada/a-cborma.adb +++ b/gcc/ada/a-cborma.adb @@ -773,7 +773,16 @@ package body Ada.Containers.Bounded_Ordered_Maps is begin Node.Key := Key; - -- Why is the following commented out ??? + -- Were this insertion operation to accept an element parameter, this + -- is the point where the element value would be used, to update the + -- element component of the new node. However, this insertion + -- operation is special, in the sense that it does not accept an + -- element parameter. Rather, this version of Insert allocates a node + -- (inserting it among the active nodes of the container in the + -- normal way, with the node's position being determined by the Key), + -- and passes back a cursor designating the node. It is then up to + -- the caller to assign a value to the node's element. + -- Node.Element := New_Item; end Assign; diff --git a/gcc/ada/a-chtgbo.adb b/gcc/ada/a-chtgbo.adb index a425469..a9c0c8a 100644 --- a/gcc/ada/a-chtgbo.adb +++ b/gcc/ada/a-chtgbo.adb @@ -136,15 +136,19 @@ package body Ada.Containers.Hash_Tables.Generic_Bounded_Operations is (HT : in out Hash_Table_Type'Class; X : Count_Type) is - pragma Assert (X > 0); + N : Nodes_Type renames HT.Nodes; + + begin + if X = 0 then + return; + end if; + pragma Assert (X <= HT.Capacity); - N : Nodes_Type renames HT.Nodes; -- pragma Assert (N (X).Prev >= 0); -- node is active -- Find a way to mark a node as active vs. inactive; we could -- use a special value in Color_Type for this. ??? - begin -- The hash table actually contains two data structures: a list for -- the "active" nodes that contain elements that have been inserted -- onto the container, and another for the "inactive" nodes of the free diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb index d48dcae..4cf739f 100644 --- a/gcc/ada/sem_ch12.adb +++ b/gcc/ada/sem_ch12.adb @@ -5748,17 +5748,12 @@ package body Sem_Ch12 is end if; -- For composite types with inconsistent representation exchange - -- component types accordingly. We exchange the private and full view - -- of a designated type when the related access type is an actual in - -- an instance. This ensures that the full view of designated type is - -- available when inside the body of the instance. - -- Is this right ??? + -- component types accordingly. elsif Is_Access_Type (T) and then Is_Private_Type (Designated_Type (T)) and then not Has_Private_View (N) and then Present (Full_View (Designated_Type (T))) - and then Used_As_Generic_Actual (T) then Switch_View (Designated_Type (T)); diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index 5e41099..c2aa404 100644 --- a/gcc/ada/sem_res.adb +++ b/gcc/ada/sem_res.adb @@ -10155,7 +10155,19 @@ package body Sem_Res is Msg : String) return Boolean is begin - if not Valid then + if not Valid + + -- A generic unit has already been analyzed and we have verified + -- that a particular conversion is OK in that context. Since the + -- instance is reanalyzed without relying on the relationships + -- established during the analysis of the generic, it is possible + -- to end up with inconsistent views of private types. Do not emit + -- the error message in such cases. The rest of the machinery in + -- Valid_Conversion still ensures the proper compatibility of + -- target and operand types. + + and then not In_Instance + then Error_Msg_N (Msg, Operand); end if; diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 1cbadaa4..a63a7bf 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -3701,13 +3701,22 @@ package body Sem_Util is function Find_Body_Discriminal (Spec_Discriminant : Entity_Id) return Entity_Id is - pragma Assert (Is_Concurrent_Record_Type (Scope (Spec_Discriminant))); - - Tsk : constant Entity_Id := - Corresponding_Concurrent_Type (Scope (Spec_Discriminant)); + Tsk : Entity_Id; Disc : Entity_Id; begin + -- If expansion is suppressed, then the scope can be the concurrent type + -- itself rather than a corresponding concurrent record type. + + if Is_Concurrent_Type (Scope (Spec_Discriminant)) then + Tsk := Scope (Spec_Discriminant); + + else + pragma Assert (Is_Concurrent_Record_Type (Scope (Spec_Discriminant))); + + Tsk := Corresponding_Concurrent_Type (Scope (Spec_Discriminant)); + end if; + -- Find discriminant of original concurrent type, and use its current -- discriminal, which is the renaming within the task/protected body. |