Commit 17bb3f18 by Robert Dewar Committed by Arnaud Charlet

cstand.adb: Complete previous change.

2010-06-22  Robert Dewar  <dewar@adacore.com>

	* cstand.adb: Complete previous change.
	* g-dirope.ads: Add comment.
	* s-stchop.adb, sfn_scan.adb: Minor reformatting.

From-SVN: r161206
parent ea7f928b
2010-06-22 Robert Dewar <dewar@adacore.com>
* cstand.adb: Complete previous change.
* g-dirope.ads: Add comment.
* s-stchop.adb, sfn_scan.adb: Minor reformatting.
2010-06-22 Ed Schonberg <schonberg@adacore.com> 2010-06-22 Ed Schonberg <schonberg@adacore.com>
* cstand.adb: Add tree nodes for pragma Pack on string types. * cstand.adb: Add tree nodes for pragma Pack on string types.
......
...@@ -119,10 +119,6 @@ package body CStand is ...@@ -119,10 +119,6 @@ package body CStand is
(New_Node_Kind : Node_Kind := N_Defining_Identifier) return Entity_Id; (New_Node_Kind : Node_Kind := N_Defining_Identifier) return Entity_Id;
-- Builds a new entity for Standard -- Builds a new entity for Standard
procedure Pack_String_Type (String_Type : Entity_Id);
-- Generate the proper tree for the pragma Pack that applies to each
-- string type.
procedure Print_Standard; procedure Print_Standard;
-- Print representation of package Standard if switch set -- Print representation of package Standard if switch set
...@@ -328,6 +324,9 @@ package body CStand is ...@@ -328,6 +324,9 @@ package body CStand is
procedure Build_Exception (S : Standard_Entity_Type); procedure Build_Exception (S : Standard_Entity_Type);
-- Procedure to declare given entity as an exception -- Procedure to declare given entity as an exception
procedure Pack_String_Type (String_Type : Entity_Id);
-- Generate proper tree for pragma Pack that applies to given type
--------------------- ---------------------
-- Build_Exception -- -- Build_Exception --
--------------------- ---------------------
...@@ -345,6 +344,24 @@ package body CStand is ...@@ -345,6 +344,24 @@ package body CStand is
Append (Decl, Decl_S); Append (Decl, Decl_S);
end Build_Exception; end Build_Exception;
----------------------
-- Pack_String_Type --
----------------------
procedure Pack_String_Type (String_Type : Entity_Id) is
Prag : constant Node_Id :=
Make_Pragma (Stloc,
Chars => Name_Pack,
Pragma_Argument_Associations =>
New_List (
Make_Pragma_Argument_Association (Stloc,
Expression => New_Occurrence_Of (String_Type, Stloc))));
begin
Append (Prag, Decl_S);
Record_Rep_Item (String_Type, Prag);
end Pack_String_Type;
-- Start of processing for Create_Standard -- Start of processing for Create_Standard
begin begin
...@@ -1631,19 +1648,6 @@ package body CStand is ...@@ -1631,19 +1648,6 @@ package body CStand is
return E; return E;
end New_Standard_Entity; end New_Standard_Entity;
----------------------
-- Pack_String_Type --
----------------------
procedure Pack_String_Type (String_Type : Entity_Id) is
begin
Record_Rep_Item (String_Type,
Make_Pragma (Stloc,
Chars => Name_Pack,
Pragma_Argument_Associations =>
New_List (New_Occurrence_Of (String_Type, Stloc))));
end Pack_String_Type;
-------------------- --------------------
-- Print_Standard -- -- Print_Standard --
-------------------- --------------------
......
...@@ -210,7 +210,7 @@ package GNAT.Directory_Operations is ...@@ -210,7 +210,7 @@ package GNAT.Directory_Operations is
-- --
-- System_Default -- System_Default
-- Uses either UNIX on Unix and OpenVMS systems, or DOS on Windows, -- Uses either UNIX on Unix and OpenVMS systems, or DOS on Windows,
-- depending on the running environment. -- depending on the running environment. What about other OS's???
--------------- ---------------
-- Iterators -- -- Iterators --
......
...@@ -48,28 +48,24 @@ package body System.Stack_Checking.Operations is ...@@ -48,28 +48,24 @@ package body System.Stack_Checking.Operations is
function Set_Stack_Info function Set_Stack_Info
(Stack : not null access Stack_Access) return Stack_Access; (Stack : not null access Stack_Access) return Stack_Access;
-- The function Set_Stack_Info is the actual function that updates the -- The function Set_Stack_Info is the actual function that updates the
-- cache containing a pointer to the Stack_Info. It may also be used for -- cache containing a pointer to the Stack_Info. It may also be used for
-- detecting asynchronous abort in combination with Invalidate_Self_Cache. -- detecting asynchronous abort in combination with Invalidate_Self_Cache.
--
-- Set_Stack_Info should do the following things in order: -- Set_Stack_Info should do the following things in order:
-- 1) Get the Stack_Access value for the current task -- 1) Get the Stack_Access value for the current task
-- 2) Set Stack.all to the value obtained in 1) -- 2) Set Stack.all to the value obtained in 1)
-- 3) Optionally Poll to check for asynchronous abort -- 3) Optionally Poll to check for asynchronous abort
--
-- This order is important because if at any time a write to the stack -- This order is important because if at any time a write to the stack
-- cache is pending, that write should be followed by a Poll to prevent -- cache is pending, that write should be followed by a Poll to prevent
-- loosing signals. -- loosing signals.
--
-- Note: This function must be compiled with Polling turned off -- Note: This function must be compiled with Polling turned off
--
-- Note: on systems with real thread-local storage, -- Note: on systems with real thread-local storage, Set_Stack_Info should
-- Set_Stack_Info should return an access value for such local -- return an access value for such local storage. In those cases the cache
-- storage. In those cases the cache will always be up-to-date. -- will always be up-to-date.
-- The following constants should be imported from some system-specific
-- constants package. The constants must be static for performance reasons.
---------------------------- ----------------------------
-- Invalidate_Stack_Cache -- -- Invalidate_Stack_Cache --
......
...@@ -37,10 +37,10 @@ package body SFN_Scan is ...@@ -37,10 +37,10 @@ package body SFN_Scan is
-- Allow easy access to control character definitions -- Allow easy access to control character definitions
EOF : constant Character := ASCII.SUB; EOF : constant Character := ASCII.SUB;
-- The character SUB (16#1A#) is DOS-derived systems, such as Windows -- The character SUB (16#1A#) is used in DOS-derived systems, such as
-- to signal the end of a text file. If this character appears as the -- Windows to signal the end of a text file. If this character appears as
-- last character of a file scanned by a call to Scan_SFN_Pragmas, -- the last character of a file scanned by a call to Scan_SFN_Pragmas, then
-- then it is ignored, otherwise it is treated as an illegal character. -- it is ignored, otherwise it is treated as an illegal character.
type String_Ptr is access String; type String_Ptr is access String;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment