diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2017-01-12 14:49:46 +0100 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2017-01-12 14:49:46 +0100 |
commit | eacfa9bc8c4c90dc97a0c51bb8e438167c9d9207 (patch) | |
tree | 6b291649fee96b809ed677512dd3c41c8f8037d4 /gcc/ada/sem_prag.adb | |
parent | 52108814f54cf767e7e69f58d8cf3a86d167eeca (diff) | |
download | gcc-eacfa9bc8c4c90dc97a0c51bb8e438167c9d9207.zip gcc-eacfa9bc8c4c90dc97a0c51bb8e438167c9d9207.tar.gz gcc-eacfa9bc8c4c90dc97a0c51bb8e438167c9d9207.tar.bz2 |
[multiple changes]
2017-01-12 Arnaud Charlet <charlet@adacore.com>
* sem_util.adb (Unique_Entity): For concurrent
bodies that are defined with stubs and complete a declaration
of a single concurrent object return the entity of an implicit
concurrent type, not the entity of the anonymous concurrent
object.
* debug.adb: -gnatd.J is no longer used.
* make.adb (Globalize): Removed, no longer used.
* sem_ch9.adb: minor typo in comment for entry index
2017-01-12 Patrick Bernardi <bernardi@adacore.com>
* aspect.adb, aspect.ads: Added new aspect Secondary_Stack_Size.
* exp_ch3.adb (Build_Init_Statements): As part of initialising
the value record of a task, set its _Secondary_Stack_Size field
if present.
* exp_ch9.adb (Expand_N_Task_Type_Declaration): Create
a _Secondary_Stack_Size field in the value record of
the task if a Secondary_Stack_Size rep item is present.
(Make_Task_Create_Call): Include secondary stack size
parameter. If No_Secondary_Stack restriction is in place, passes
stack size of 0.
* par-prag.adb, sem_prag.adb, sem_prag.ads: Added new pragma
Secondary_Stack_Size.
* s-secsta.adb, s-secsta.ads (Minimum_Secondary_Stack_Size): New
function to define the overhead of the secondary stack.
* s-tarest.adb (Create_Restricted_Task,
Create_Restricted_Task_Sequential): Functions now include
Secondary_Stack_Size parameter to pass to Initialize_ATCB.
* s-tarest.adb (Create_Restricted_Task,
Create_Restricted_Task_Sequential): Calls to Initialize_ATCB now
include Secondary_Stack_Size parameter.
(Task_Wrapper): Secondary stack now allocated to the size specified by
the Secondary_Stack_Size parameter in the task's ATCB.
* s-taskin.adb, s-taskin.adb (Common_ATCB, Initialize_ATCB): New
Secondary_Stack_Size component.
* s-tassta.adb, s-tassta.ads (Create_Restricted_Task,
Create_Restricted_Task_Sequential): Function now include
Secondary_Stack_Size parameter.
(Task_Wrapper): Secondary stack now allocated to the size
specified by the Secondary_Stack_Size parameter in the task's
ATCB.
* s-tproft.adb (Register_Foreign_Thread): Amended Initialize_ATCB call
to include Secondary_Stack_Size parameter.
* sem_ch13.adb (Analyze_Aspect_Specification): Add support for
Secondary_Stack_Size aspect, turning the aspect into its corresponding
internal attribute.
(Analyze_Attribute_Definition): Process Secondary_Stack_Size attribute.
* snames.adb-tmpl, snames.ads-tmpl: Added names
Name_Secondary_Stack_Size, Name_uSecondary_Stack_Size,
Attribute_Secondary_Stack_Size and Pragma_Secondary_Stack_Size.
From-SVN: r244358
Diffstat (limited to 'gcc/ada/sem_prag.adb')
-rw-r--r-- | gcc/ada/sem_prag.adb | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index d737a93..031e00c 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -20553,6 +20553,50 @@ package body Sem_Prag is rv; -------------------------- + -- Secondary_Stack_Size -- + -------------------------- + + -- pragma Secondary_Stack_Size (EXPRESSION); + + when Pragma_Secondary_Stack_Size => Secondary_Stack_Size : declare + P : constant Node_Id := Parent (N); + Arg : Node_Id; + Ent : Entity_Id; + + begin + GNAT_Pragma; + Check_No_Identifiers; + Check_Arg_Count (1); + + if Nkind (P) = N_Task_Definition then + Arg := Get_Pragma_Arg (Arg1); + Ent := Defining_Identifier (Parent (P)); + + -- The expression must be analyzed in the special + -- manner described in "Handling of Default Expressions" + -- in sem.ads. + + Preanalyze_Spec_Expression (Arg, Any_Integer); + + -- The pragma cannot appear if the No_Secondary_Stack + -- restriction is in effect. + + Check_Restriction (No_Secondary_Stack, Arg); + + -- Anything else is incorrect + + else + Pragma_Misplaced; + end if; + + -- Check duplicate pragma before we chain the pragma in the Rep + -- Item chain of Ent. + + Check_Duplicate_Pragma (Ent); + Record_Rep_Item (Ent, N); + end Secondary_Stack_Size; + + -------------------------- -- Short_Circuit_And_Or -- -------------------------- @@ -28625,6 +28669,7 @@ package body Sem_Prag is Pragma_Restriction_Warnings => 0, Pragma_Restrictions => 0, Pragma_Reviewable => -1, + Pragma_Secondary_Stack_Size => -1, Pragma_Short_Circuit_And_Or => 0, Pragma_Share_Generic => 0, Pragma_Shared => 0, |