aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/aspects.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2013-10-10 14:10:58 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2013-10-10 14:10:58 +0200
commite28072cdc85406f97fb06389639f5b9933101201 (patch)
tree33b0b66fb30d3aa482ca82a0cb0342e91e27b07b /gcc/ada/aspects.adb
parent13b72c22f731e9be33af0331f244f3407dca12f8 (diff)
downloadgcc-e28072cdc85406f97fb06389639f5b9933101201.zip
gcc-e28072cdc85406f97fb06389639f5b9933101201.tar.gz
gcc-e28072cdc85406f97fb06389639f5b9933101201.tar.bz2
[multiple changes]
2013-10-10 Ed Schonberg <schonberg@adacore.com> * par-ch13.adb (Aspect_Specifications_Present)): In earlier than Ada2012 mode, assume that a legal aspect name following "with" keyword is an older gnat switch and not a misplaced with_clause. 2013-10-10 Hristian Kirtchev <kirtchev@adacore.com> * aspects.adb: Add an entry for Aspect_Refined_Pre in table Canonical_Aspect. (Aspects_On_Body_OK): Renamed to Aspects_On_Body_Or_Stub_OK. (Aspects_On_Body_Or_Stub_OK): Update the query in table Aspect_On_Body_OK. * aspects.ads: Add an entry for Aspect_Refined_Pre in tables Aspect_Id, Aspect_Argument, Aspect_Names, Aspect_Delay, Aspect_On_Body_Or_Stub_OK. Table Aspect_On_Body_OK is now known as Aspect_On_Body_Or_Stub_OK. Add a section of aspect specifications that apply to body stubs. (Aspects_On_Body_OK): Renamed to Aspects_On_Body_Or_Stub_OK. (Aspects_On_Body_Or_Stub_OK): Update the comment on usage. * par-prag.adb: Add pragma Refined_Pre to the list of pragmas that do not require special processing by the parser. * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Delay the analysis of aspect specifications that apply to a body stub until the proper body is analyzed. * sem_ch10.adb: Add with and use clause for Sem_Ch13. (Analyze_Package_Body_Stub): Set the corresponding spec of the stub. (Analyze_Proper_Body): Relocate all pragmas that apply to a subprogram body stub to the declarations of the proper body. Analyze the aspect specifications of the stub when the proper body is not present. (Analyze_Protected_Body_Stub): Set the corresponding spec of the stub. (Analyze_Task_Body_Stub): Set the corresponding spec of the stub. (Move_Stub_Pragmas_To_Body): New routine. * sem_ch13.adb (Analyze_Aspect_Specifications): Add processing for aspect Refined_Pre. (Check_Aspect_At_Freeze_Point): Aspect Refined_Pre does not need delayed processing at the freeze point. * sem_prag.adb: Remove with and use clause for Snames. Add an entry for Pragma_Refined_Pre in table Sig_Flags. (Analyze_Pragma): Add processing for pragma Refined_Pre. * sem_prag.ads: Add with and use clause for Snames. Add table Pragma_On_Stub_OK. * sinfo.adb (Corresponding_Spec_Of_Stub): New routine. (Set_Corresponding_Spec_Of_Stub): New routine. * sinfo.ads: Add new attribute Corresponding_Spec_Of_Stub along with comment on usage and occurrences in nodes. (Corresponding_Spec_Of_Stub): New routine along with pragma Inline. (Set_Corresponding_Spec_Of_Stub): New routine along with pragma Inline. * snames.ads-tmpl: Add new predefined name for Refined_Pre. Add new Pragma_Id for Refined_Pre. 2013-10-10 Ed Schonberg <schonberg@adacore.com> * sem_ch12.adb (Analyze_Package_Instantiation, Analyze_Subprogram_Instantiation): Improve error message when name in instantiation does not designate a generic unit of the right kind. From-SVN: r203355
Diffstat (limited to 'gcc/ada/aspects.adb')
-rw-r--r--gcc/ada/aspects.adb17
1 files changed, 9 insertions, 8 deletions
diff --git a/gcc/ada/aspects.adb b/gcc/ada/aspects.adb
index 1d73646..e20cae4 100644
--- a/gcc/ada/aspects.adb
+++ b/gcc/ada/aspects.adb
@@ -140,11 +140,11 @@ package body Aspects is
end if;
end Aspect_Specifications;
- ------------------------
- -- Aspects_On_Body_OK --
- ------------------------
+ --------------------------------
+ -- Aspects_On_Body_Or_Stub_OK --
+ --------------------------------
- function Aspects_On_Body_OK (N : Node_Id) return Boolean is
+ function Aspects_On_Body_Or_Stub_OK (N : Node_Id) return Boolean is
Aspect : Node_Id;
Aspects : List_Id;
@@ -159,12 +159,12 @@ package body Aspects is
N_Task_Body));
-- Look through all aspects and see whether they can be applied to a
- -- body.
+ -- body [stub].
Aspects := Aspect_Specifications (N);
Aspect := First (Aspects);
while Present (Aspect) loop
- if not Aspect_On_Body_OK (Get_Aspect_Id (Aspect)) then
+ if not Aspect_On_Body_Or_Stub_OK (Get_Aspect_Id (Aspect)) then
return False;
end if;
@@ -172,7 +172,7 @@ package body Aspects is
end loop;
return True;
- end Aspects_On_Body_OK;
+ end Aspects_On_Body_Or_Stub_OK;
-----------------
-- Find_Aspect --
@@ -368,9 +368,9 @@ package body Aspects is
N_Single_Protected_Declaration => True,
N_Single_Task_Declaration => True,
N_Subprogram_Body => True,
+ N_Subprogram_Body_Stub => True,
N_Subprogram_Declaration => True,
N_Subprogram_Renaming_Declaration => True,
- N_Subprogram_Body_Stub => True,
N_Subtype_Declaration => True,
N_Task_Body => True,
N_Task_Body_Stub => True,
@@ -466,6 +466,7 @@ package body Aspects is
Aspect_Pure_05 => Aspect_Pure_05,
Aspect_Pure_12 => Aspect_Pure_12,
Aspect_Pure_Function => Aspect_Pure_Function,
+ Aspect_Refined_Pre => Aspect_Refined_Pre,
Aspect_Remote_Access_Type => Aspect_Remote_Access_Type,
Aspect_Remote_Call_Interface => Aspect_Remote_Call_Interface,
Aspect_Remote_Types => Aspect_Remote_Types,