Nowhere in the code we call set Ekind to E_Protected_Object, so all the
code that tests this is necessarily dead. This patch removes references
to E_Protected_Object.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* einfo.ads (E_Protected_Object): Enumeration literal removed.
* lib-xref.ads (Xref_Entity_Letters): Remove reference to
removed literal.
* sem_ch3.adb (Check_Completion): Likewise.
* sem_util.adb (Has_Enabled_Property): Likewise.
diff --git a/gcc/ada/einfo.ads b/gcc/ada/einfo.ads
--- a/gcc/ada/einfo.ads
+++ b/gcc/ada/einfo.ads
@@ -5214,10 +5214,6 @@ package Einfo is
-- there are some attributes that are significant for the body entity.
-- For example, collection of exception handlers.
- E_Protected_Object,
- -- A protected object, created by an object declaration that declares
- -- an object of a protected type.
-
E_Protected_Body,
-- A protected body. This entity serves almost no function, since all
-- semantic analysis uses the protected entity (E_Protected_Type).
diff --git a/gcc/ada/lib-xref.ads b/gcc/ada/lib-xref.ads
--- a/gcc/ada/lib-xref.ads
+++ b/gcc/ada/lib-xref.ads
@@ -514,7 +514,6 @@ package Lib.Xref is
E_Package_Body => ' ',
E_Protected_Body => ' ',
- E_Protected_Object => ' ',
E_Subprogram_Body => ' ',
E_Task_Body => ' ');
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -11676,9 +11676,8 @@ package body Sem_Ch3 is
end if;
elsif Is_Entry (E) then
- if not Has_Completion (E) and then
- (Ekind (Scope (E)) = E_Protected_Object
- or else Ekind (Scope (E)) = E_Protected_Type)
+ if not Has_Completion (E)
+ and then Ekind (Scope (E)) = E_Protected_Type
then
Post_Error;
end if;
@@ -11722,11 +11721,6 @@ package body Sem_Ch3 is
then
Post_Error;
- elsif Ekind (E) = E_Protected_Object
- and then not Has_Completion (Etype (E))
- then
- Post_Error;
-
elsif Ekind (E) = E_Record_Type then
if Is_Tagged_Type (E) then
Check_Abstract_Overriding (E);
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -11541,14 +11541,6 @@ package body Sem_Util is
return Type_Or_Variable_Has_Enabled_Property
(Item_Id => First_Subtype (Item_Id));
- -- By default, protected objects only have the properties Async_Readers
- -- and Async_Writers. If they have Part_Of components, they also inherit
- -- their properties Effective_Reads and Effective_Writes
- -- (SPARK RM 7.1.2(16)).
-
- elsif Ekind (Item_Id) = E_Protected_Object then
- return Protected_Type_Or_Variable_Has_Enabled_Property;
-
-- Otherwise a property is enabled when the related item is effectively
-- volatile.