summaryrefslogtreecommitdiff
path: root/gcc/ada/sem_prag.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2012-06-14 10:43:53 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2012-06-14 10:43:53 +0000
commit89b3b365e674149b80d4e3ed5d385e6968d0e272 (patch)
tree70d45c982e7dd024eb7d80959751e61224d87d28 /gcc/ada/sem_prag.adb
parent714e7f2d55d8cc52efd908a3ee227979a76a4de5 (diff)
downloadgcc-89b3b365e674149b80d4e3ed5d385e6968d0e272.tar.gz
2012-06-14 Vincent Pucci <pucci@adacore.com>
* einfo.adb einfo.ads (Get_Rep_Item): Removed. (Get_Rep_Item_For_Entity): Removed. (Get_Rep_Pragma): Removed. (Get_Rep_Pragma_For_Entity): Removed. (Has_Rep_Item): Removed. (Has_Rep_Pragma): Removed. (Has_Rep_Pragma_For_Entity): Removed. * exp_ch9.adb (Expand_N_Task_Type_Declaration): Has_Rep_Pragma_For_Entity replaced by Has_Rep_Pragma and Get_Rep_Pragma_For_Entity replaced by Get_Rep_Pragma. (Make_Task_Create_Call): Has_Rep_Pragma_For_Entity replaced by Has_Rep_Pragma and Get_Rep_Pragma_For_Entity replaced by Get_Rep_Pragma. * exp_intr.adb: Dependency to Sem_Aux added for call to Get_Rep_Pragma. * sem_aux.adb (Get_Rep_Item): New routine. (Get_Rep_Pragma): New routine. (Has_Rep_Item): New routine. (Has_Rep_Pragma): New routine. (Nearest_Ancestor): Minor reformatting. * sem_aux.ads (Get_Rep_Item): New routine. (Get_Rep_Pragma): New routine. (Has_Rep_Item): New routine. (Has_Rep_Pragma): New routine. * sem_ch13.adb (Duplicate_Clause): Restore original error messages. * sem_eval.adb (Subtypes_Statically_Match): Get_Rep_Item_For_Entity replaced by Get_Rep_Item. * sem_prag.adb (Analyze_Pragma): Restore original error messages. (Check_Duplicate_Pragma): Restore original error messages. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@188607 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_prag.adb')
-rw-r--r--gcc/ada/sem_prag.adb26
1 files changed, 14 insertions, 12 deletions
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index 72fe18e52a2..35e1f6404ee 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -1613,7 +1613,7 @@ package body Sem_Prag is
-- previously given aspect specification or attribute definition
-- clause for the same pragma.
- P := Get_Rep_Item_For_Entity (E, Pragma_Name (N));
+ P := Get_Rep_Item (E, Pragma_Name (N), Check_Parents => False);
if Present (P) then
Error_Msg_Name_1 := Pragma_Name (N);
@@ -1630,12 +1630,8 @@ package body Sem_Prag is
or else From_Aspect_Specification (P)
then
Error_Msg_NE ("aspect% for & previously given#", N, Id);
-
- elsif Nkind (P) = N_Pragma then
- Error_Msg_NE ("pragma% for & duplicates pragma#", N, Id);
-
else
- Error_Msg_NE ("pragma% for & duplicates clause#", N, Id);
+ Error_Msg_NE ("pragma% for & duplicates pragma#", N, Id);
end if;
raise Pragma_Exit;
@@ -8024,7 +8020,6 @@ package body Sem_Prag is
-- Item chain of Ent.
Check_Duplicate_Pragma (Ent);
-
Record_Rep_Item (Ent, N);
end CPU;
@@ -8317,7 +8312,6 @@ package body Sem_Prag is
-- Item chain of Ent.
Check_Duplicate_Pragma (Ent);
-
Record_Rep_Item (Ent, N);
-- Anything else is incorrect
@@ -10284,7 +10278,6 @@ package body Sem_Prag is
-- Item chain of Ent.
Check_Duplicate_Pragma (Ent);
-
Record_Rep_Item (Ent, N);
end if;
end Interrupt_Priority;
@@ -12410,7 +12403,6 @@ package body Sem_Prag is
-- Item chain of Ent.
Check_Duplicate_Pragma (Ent);
-
Record_Rep_Item (Ent, N);
end Priority;
@@ -13928,7 +13920,12 @@ package body Sem_Prag is
-- Check duplicate pragma before we chain the pragma in the Rep
-- Item chain of Ent.
- Check_Duplicate_Pragma (Ent);
+ if Has_Rep_Pragma
+ (Ent, Name_Task_Info, Check_Parents => False)
+ then
+ Error_Pragma ("duplicate pragma% not allowed");
+ end if;
+
Record_Rep_Item (Ent, N);
end Task_Info;
@@ -13965,7 +13962,12 @@ package body Sem_Prag is
-- Check duplicate pragma before we chain the pragma in the Rep
-- Item chain of Ent.
- Check_Duplicate_Pragma (Ent);
+ if Has_Rep_Pragma
+ (Ent, Name_Task_Name, Check_Parents => False)
+ then
+ Error_Pragma ("duplicate pragma% not allowed");
+ end if;
+
Record_Rep_Item (Ent, N);
end Task_Name;