summaryrefslogtreecommitdiff
path: root/gcc/ada/par-prag.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2006-10-31 17:49:53 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2006-10-31 17:49:53 +0000
commita515f527e78401afc8c81f21d11fa565416e9efe (patch)
tree374a7395bdca27ea31e5e0b8a2dcd982429143b4 /gcc/ada/par-prag.adb
parentaeccd5a4b99421e20f1d428f5fb5a73482cecf20 (diff)
downloadgcc-a515f527e78401afc8c81f21d11fa565416e9efe.tar.gz
2006-10-31 Robert Dewar <dewar@adacore.com>
Jose Ruiz <ruiz@adacore.com> * a-dispat.ads, a-diroro.ads, a-diroro.adb: New files. * ali.adb (Get_Name): Properly handle scanning of wide character names encoded with brackets notation. (Known_ALI_Lines): Add S lines to this list. (Scan_ALI): Acquire S (priority specific dispatching) lines. New flag Elaborate_All_Desirable in unit table * ali.ads (Priority_Specific_Dispatching): Add this range of identifiers to be used for Priority_Specific_Dispatching table entries. (ALIs_Record): Add First_Specific_Dispatching and Last_Specific_Dispatching that point to the first and last entries respectively in the priority specific dispatching table for this unit. (Specific_Dispatching): Add this table for storing each S (priority specific dispatching) line encountered in the input ALI file. New flag Elaborate_All_Desirable in unit table * bcheck.adb: (Check_Configuration_Consistency): Add call to Check_Consistent_Dispatching_Policy. (Check_Consistent_Dispatching_Policy): Add this procedure in charge of verifying that the use of Priority_Specific_Dispatching, Task_Dispatching_Policy, and Locking_Policy is consistent across the partition. * bindgen.adb: (Public_Version_Warning): function removed. (Set_PSD_Pragma_Table): Add this procedure in charge of getting the required information from ALI files in order to initialize the table containing the specific dispatching policy. (Gen_Adainit_Ada): Generate the variables required for priority specific dispatching entries (__gl_priority_specific_dispatching and __gl_num_specific_dispatching). (Gen_Adainit_C): Generate the variables required for priority specific dispatching entries (__gl_priority_specific_dispatching and __gl_num_specific_dispatching). (Gen_Output_File): Acquire settings for Priority_Specific_Dispatching pragma entries. (Gen_Restrictions_String_1, Gen_Restrictions_String_2): Removed. (Gen_Restrictions_Ada, Gen_Restrictions_C, Set_Boolean): New procedures. (Tab_To): Removed. (Gen_Output_File_Ada/_C): Set directly __gl_xxx variables instead of a call to gnat_set_globals. Generate a string containing settings from Priority_Specific_Dispatching pragma entries. (Gen_Object_Files_Options): Do not include the runtime libraries when pragma No_Run_Time is specified. * init.c (__gnat_install_handler, case FreeBSD): Use SA_SIGINFO, for consistency with s-intman-posix.adb. (__gnat_error_handler, case FreeBSD): Account for the fact that the handler is installed with SA_SIGINFO. (__gnat_adjust_context_for_raise, FreeBSD case): New function for FreeBSD ZCX support, copied from Linux version. Add MaRTE-specific definitions for the linux target. Redefine sigaction, sigfillset, and sigemptyset so the routines defined by MaRTE. (__gl_priority_specific_dispatching): Add this variable that stores the string containing priority specific dispatching policies in the partition. (__gl_num_specific_dispatching): Add this variable that indicates the highest priority for which a priority specific dispatching pragma applies. (__gnat_get_specific_dispatching): Add this routine that returns the priority specific dispatching policy, as set by a Priority_Specific_Dispatching pragma appearing anywhere in the current partition. The input argument is the priority number, and the result is the upper case first character of the policy name. (__gnat_set_globals): Now a dummy function. (__gnat_handle_vms_condition): Feed adjust_context_for_raise with mechargs instead of sigargs, as the latter can be retrieved from the former and sigargs is not what we want on ia64. (__gnat_adjust_context_for_raise, alpha-vms): Fetch sigargs from the mechargs argument. (__gnat_adjust_context_for_raise, ia64-vms): New function. (tasking_error): Remove unused symbol. (_abort_signal): Move this symbol to the IRIX specific part since this is the only target that uses this definition. (Check_Abort_Status): Move this symbol to the IRIX specific part since this is the only target that uses this definition. (Lock_Task): Remove unused symbol. (Unlock_Task): Remove unused symbol. * lib-writ.adb (Write_ALI): Output new S lines for Priority_Specific_Dispatching pragmas. Implement new flag BD for elaborate body desirable * lib-writ.ads: Document S lines for Priority Specific Dispatching. (Specific_Dispatching): Add this table for storing the entries corresponding to Priority_Specific_Dispatching pragmas. Document new BD flag for elaborate body desirable * par-prag.adb (Prag): Add Priority_Specific_Dispatching to the list of known pragmas. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@118243 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/par-prag.adb')
-rw-r--r--gcc/ada/par-prag.adb325
1 files changed, 187 insertions, 138 deletions
diff --git a/gcc/ada/par-prag.adb b/gcc/ada/par-prag.adb
index 7646f6e03fe..eb56fc2566c 100644
--- a/gcc/ada/par-prag.adb
+++ b/gcc/ada/par-prag.adb
@@ -39,6 +39,8 @@ with Stylesw; use Stylesw;
with Uintp; use Uintp;
with Uname; use Uname;
+with System.WCh_Con; use System.WCh_Con;
+
separate (Par)
function Prag (Pragma_Node : Node_Id; Semi : Source_Ptr) return Node_Id is
@@ -903,7 +905,7 @@ begin
A := Expression (Arg1);
if Nkind (A) = N_String_Literal then
- S := Strval (A);
+ S := Strval (A);
declare
Slen : constant Natural := Natural (String_Length (S));
@@ -969,8 +971,10 @@ begin
-- Warnings (GNAT) --
---------------------
- -- pragma Warnings (On | Off, [LOCAL_NAME])
+ -- pragma Warnings (On | Off);
+ -- pragma Warnings (On | Off, LOCAL_NAME);
-- pragma Warnings (static_string_EXPRESSION);
+ -- pragma Warnings (On | Off, static_string_EXPRESSION);
-- The one argument ON/OFF case is processed by the parser, since it may
-- control parser warnings as well as semantic warnings, and in any case
@@ -994,6 +998,49 @@ begin
end;
end if;
+ -----------------------------
+ -- Wide_Character_Encoding --
+ -----------------------------
+
+ -- pragma Wide_Character_Encoding (IDENTIFIER | CHARACTER_LITERAL);
+
+ -- This is processed by the parser, since the scanner is affected
+
+ when Pragma_Wide_Character_Encoding => Wide_Character_Encoding : declare
+ A : Node_Id;
+
+ begin
+ Check_Arg_Count (1);
+ Check_No_Identifier (Arg1);
+ A := Expression (Arg1);
+
+ if Nkind (A) = N_Identifier then
+ Get_Name_String (Chars (A));
+ Wide_Character_Encoding_Method :=
+ Get_WC_Encoding_Method (Name_Buffer (1 .. Name_Len));
+
+ elsif Nkind (A) = N_Character_Literal then
+ declare
+ R : constant Char_Code :=
+ Char_Code (UI_To_Int (Char_Literal_Value (A)));
+ begin
+ if In_Character_Range (R) then
+ Wide_Character_Encoding_Method :=
+ Get_WC_Encoding_Method (Get_Character (R));
+ else
+ raise Constraint_Error;
+ end if;
+ end;
+
+ else
+ raise Constraint_Error;
+ end if;
+
+ exception
+ when Constraint_Error =>
+ Error_Msg_N ("invalid argument for pragma%", Arg1);
+ end Wide_Character_Encoding;
+
-----------------------
-- All Other Pragmas --
-----------------------
@@ -1001,142 +1048,144 @@ begin
-- For all other pragmas, checking and processing is handled
-- entirely in Sem_Prag, and no further checking is done by Par.
- when Pragma_Abort_Defer |
- Pragma_Assertion_Policy |
- Pragma_AST_Entry |
- Pragma_All_Calls_Remote |
- Pragma_Annotate |
- Pragma_Assert |
- Pragma_Asynchronous |
- Pragma_Atomic |
- Pragma_Atomic_Components |
- Pragma_Attach_Handler |
- Pragma_Compile_Time_Warning |
- Pragma_Convention_Identifier |
- Pragma_CPP_Class |
- Pragma_CPP_Constructor |
- Pragma_CPP_Virtual |
- Pragma_CPP_Vtable |
- Pragma_C_Pass_By_Copy |
- Pragma_Comment |
- Pragma_Common_Object |
- Pragma_Complete_Representation |
- Pragma_Complex_Representation |
- Pragma_Component_Alignment |
- Pragma_Controlled |
- Pragma_Convention |
- Pragma_Debug_Policy |
- Pragma_Detect_Blocking |
- Pragma_Discard_Names |
- Pragma_Eliminate |
- Pragma_Elaborate |
- Pragma_Elaborate_All |
- Pragma_Elaborate_Body |
- Pragma_Elaboration_Checks |
- Pragma_Explicit_Overriding |
- Pragma_Export |
- Pragma_Export_Exception |
- Pragma_Export_Function |
- Pragma_Export_Object |
- Pragma_Export_Procedure |
- Pragma_Export_Value |
- Pragma_Export_Valued_Procedure |
- Pragma_Extend_System |
- Pragma_External |
- Pragma_External_Name_Casing |
- Pragma_Finalize_Storage_Only |
- Pragma_Float_Representation |
- Pragma_Ident |
- Pragma_Import |
- Pragma_Import_Exception |
- Pragma_Import_Function |
- Pragma_Import_Object |
- Pragma_Import_Procedure |
- Pragma_Import_Valued_Procedure |
- Pragma_Initialize_Scalars |
- Pragma_Inline |
- Pragma_Inline_Always |
- Pragma_Inline_Generic |
- Pragma_Inspection_Point |
- Pragma_Interface |
- Pragma_Interface_Name |
- Pragma_Interrupt_Handler |
- Pragma_Interrupt_State |
- Pragma_Interrupt_Priority |
- Pragma_Java_Constructor |
- Pragma_Java_Interface |
- Pragma_Keep_Names |
- Pragma_License |
- Pragma_Link_With |
- Pragma_Linker_Alias |
- Pragma_Linker_Constructor |
- Pragma_Linker_Destructor |
- Pragma_Linker_Options |
- Pragma_Linker_Section |
- Pragma_Locking_Policy |
- Pragma_Long_Float |
- Pragma_Machine_Attribute |
- Pragma_Main |
- Pragma_Main_Storage |
- Pragma_Memory_Size |
- Pragma_No_Return |
- Pragma_Obsolescent |
- Pragma_No_Run_Time |
- Pragma_No_Strict_Aliasing |
- Pragma_Normalize_Scalars |
- Pragma_Optimize |
- Pragma_Optional_Overriding |
- Pragma_Pack |
- Pragma_Passive |
- Pragma_Polling |
- Pragma_Persistent_BSS |
- Pragma_Preelaborate |
- Pragma_Preelaborate_05 |
- Pragma_Priority |
- Pragma_Profile |
- Pragma_Profile_Warnings |
- Pragma_Propagate_Exceptions |
- Pragma_Psect_Object |
- Pragma_Pure |
- Pragma_Pure_05 |
- Pragma_Pure_Function |
- Pragma_Queuing_Policy |
- Pragma_Remote_Call_Interface |
- Pragma_Remote_Types |
- Pragma_Restricted_Run_Time |
- Pragma_Ravenscar |
- Pragma_Reviewable |
- Pragma_Share_Generic |
- Pragma_Shared |
- Pragma_Shared_Passive |
- Pragma_Storage_Size |
- Pragma_Storage_Unit |
- Pragma_Stream_Convert |
- Pragma_Subtitle |
- Pragma_Suppress |
- Pragma_Suppress_All |
- Pragma_Suppress_Debug_Info |
- Pragma_Suppress_Exception_Locations |
- Pragma_Suppress_Initialization |
- Pragma_System_Name |
- Pragma_Task_Dispatching_Policy |
- Pragma_Task_Info |
- Pragma_Task_Name |
- Pragma_Task_Storage |
- Pragma_Thread_Body |
- Pragma_Time_Slice |
- Pragma_Title |
- Pragma_Unchecked_Union |
- Pragma_Unimplemented_Unit |
- Pragma_Universal_Data |
- Pragma_Unreferenced |
- Pragma_Unreserve_All_Interrupts |
- Pragma_Unsuppress |
- Pragma_Use_VADS_Size |
- Pragma_Volatile |
- Pragma_Volatile_Components |
- Pragma_Weak_External |
- Pragma_Validity_Checks =>
+ when Pragma_Abort_Defer |
+ Pragma_Assertion_Policy |
+ Pragma_AST_Entry |
+ Pragma_All_Calls_Remote |
+ Pragma_Annotate |
+ Pragma_Assert |
+ Pragma_Asynchronous |
+ Pragma_Atomic |
+ Pragma_Atomic_Components |
+ Pragma_Attach_Handler |
+ Pragma_Compile_Time_Warning |
+ Pragma_Convention_Identifier |
+ Pragma_CPP_Class |
+ Pragma_CPP_Constructor |
+ Pragma_CPP_Virtual |
+ Pragma_CPP_Vtable |
+ Pragma_C_Pass_By_Copy |
+ Pragma_Comment |
+ Pragma_Common_Object |
+ Pragma_Complete_Representation |
+ Pragma_Complex_Representation |
+ Pragma_Component_Alignment |
+ Pragma_Controlled |
+ Pragma_Convention |
+ Pragma_Debug_Policy |
+ Pragma_Detect_Blocking |
+ Pragma_Discard_Names |
+ Pragma_Eliminate |
+ Pragma_Elaborate |
+ Pragma_Elaborate_All |
+ Pragma_Elaborate_Body |
+ Pragma_Elaboration_Checks |
+ Pragma_Explicit_Overriding |
+ Pragma_Export |
+ Pragma_Export_Exception |
+ Pragma_Export_Function |
+ Pragma_Export_Object |
+ Pragma_Export_Procedure |
+ Pragma_Export_Value |
+ Pragma_Export_Valued_Procedure |
+ Pragma_Extend_System |
+ Pragma_External |
+ Pragma_External_Name_Casing |
+ Pragma_Finalize_Storage_Only |
+ Pragma_Float_Representation |
+ Pragma_Ident |
+ Pragma_Import |
+ Pragma_Import_Exception |
+ Pragma_Import_Function |
+ Pragma_Import_Object |
+ Pragma_Import_Procedure |
+ Pragma_Import_Valued_Procedure |
+ Pragma_Initialize_Scalars |
+ Pragma_Inline |
+ Pragma_Inline_Always |
+ Pragma_Inline_Generic |
+ Pragma_Inspection_Point |
+ Pragma_Interface |
+ Pragma_Interface_Name |
+ Pragma_Interrupt_Handler |
+ Pragma_Interrupt_State |
+ Pragma_Interrupt_Priority |
+ Pragma_Java_Constructor |
+ Pragma_Java_Interface |
+ Pragma_Keep_Names |
+ Pragma_License |
+ Pragma_Link_With |
+ Pragma_Linker_Alias |
+ Pragma_Linker_Constructor |
+ Pragma_Linker_Destructor |
+ Pragma_Linker_Options |
+ Pragma_Linker_Section |
+ Pragma_Locking_Policy |
+ Pragma_Long_Float |
+ Pragma_Machine_Attribute |
+ Pragma_Main |
+ Pragma_Main_Storage |
+ Pragma_Memory_Size |
+ Pragma_No_Return |
+ Pragma_Obsolescent |
+ Pragma_No_Run_Time |
+ Pragma_No_Strict_Aliasing |
+ Pragma_Normalize_Scalars |
+ Pragma_Optimize |
+ Pragma_Optional_Overriding |
+ Pragma_Pack |
+ Pragma_Passive |
+ Pragma_Preelaborable_Initialization |
+ Pragma_Polling |
+ Pragma_Persistent_BSS |
+ Pragma_Preelaborate |
+ Pragma_Preelaborate_05 |
+ Pragma_Priority |
+ Pragma_Priority_Specific_Dispatching |
+ Pragma_Profile |
+ Pragma_Profile_Warnings |
+ Pragma_Propagate_Exceptions |
+ Pragma_Psect_Object |
+ Pragma_Pure |
+ Pragma_Pure_05 |
+ Pragma_Pure_Function |
+ Pragma_Queuing_Policy |
+ Pragma_Remote_Call_Interface |
+ Pragma_Remote_Types |
+ Pragma_Restricted_Run_Time |
+ Pragma_Ravenscar |
+ Pragma_Reviewable |
+ Pragma_Share_Generic |
+ Pragma_Shared |
+ Pragma_Shared_Passive |
+ Pragma_Storage_Size |
+ Pragma_Storage_Unit |
+ Pragma_Stream_Convert |
+ Pragma_Subtitle |
+ Pragma_Suppress |
+ Pragma_Suppress_All |
+ Pragma_Suppress_Debug_Info |
+ Pragma_Suppress_Exception_Locations |
+ Pragma_Suppress_Initialization |
+ Pragma_System_Name |
+ Pragma_Task_Dispatching_Policy |
+ Pragma_Task_Info |
+ Pragma_Task_Name |
+ Pragma_Task_Storage |
+ Pragma_Thread_Body |
+ Pragma_Time_Slice |
+ Pragma_Title |
+ Pragma_Unchecked_Union |
+ Pragma_Unimplemented_Unit |
+ Pragma_Universal_Data |
+ Pragma_Unreferenced |
+ Pragma_Unreserve_All_Interrupts |
+ Pragma_Unsuppress |
+ Pragma_Use_VADS_Size |
+ Pragma_Volatile |
+ Pragma_Volatile_Components |
+ Pragma_Weak_External |
+ Pragma_Validity_Checks =>
null;
--------------------