Commit 94fd3dc6 by Arnaud Charlet

[multiple changes]

2009-04-08  Robert Dewar  <dewar@adacore.com>

	* gnat_rm.texi: Add documentation for pragma Thread_Local_Storage

	* sem_ch3.adb: Minor comment updates

2009-04-08  Ed Schonberg  <schonberg@adacore.com>

	* inline.adb (Back_End_Cannot_Inline): restrict warning to subprograms
	that come from source.

From-SVN: r145732
parent d1d1c602
2009-04-08 Robert Dewar <dewar@adacore.com>
* gnat_rm.texi: Add documentation for pragma Thread_Local_Storage
* sem_ch3.adb: Minor comment updates
2009-04-08 Ed Schonberg <schonberg@adacore.com>
* inline.adb (Back_End_Cannot_Inline): restrict warning to subprograms
that come from source.
2009-04-08 Tristan Gingold <gingold@adacore.com> 2009-04-08 Tristan Gingold <gingold@adacore.com>
* gcc-interface/utils.c, gcc-interface/decl.c, gcc-interface/gigi.h: * gcc-interface/utils.c, gcc-interface/decl.c, gcc-interface/gigi.h:
...@@ -194,6 +194,7 @@ Implementation Defined Pragmas ...@@ -194,6 +194,7 @@ Implementation Defined Pragmas
* Pragma Task_Info:: * Pragma Task_Info::
* Pragma Task_Name:: * Pragma Task_Name::
* Pragma Task_Storage:: * Pragma Task_Storage::
* Pragma Thread_Local_Storage::
* Pragma Time_Slice:: * Pragma Time_Slice::
* Pragma Title:: * Pragma Title::
* Pragma Unchecked_Union:: * Pragma Unchecked_Union::
...@@ -683,8 +684,7 @@ compiler system. ...@@ -683,8 +684,7 @@ compiler system.
@noindent @noindent
Ada defines a set of pragmas that can be used to supply additional Ada defines a set of pragmas that can be used to supply additional
information to the compiler. These language defined pragmas are information to the compiler. These language defined pragmas are
implemented in GNAT and work as described in the Ada Reference implemented in GNAT and work as described in the Ada Reference Manual.
Manual.
In addition, Ada allows implementations to define additional pragmas In addition, Ada allows implementations to define additional pragmas
whose meaning is defined by the implementation. GNAT provides a number whose meaning is defined by the implementation. GNAT provides a number
...@@ -797,6 +797,7 @@ consideration, the use of these pragmas should be minimized. ...@@ -797,6 +797,7 @@ consideration, the use of these pragmas should be minimized.
* Pragma Task_Info:: * Pragma Task_Info::
* Pragma Task_Name:: * Pragma Task_Name::
* Pragma Task_Storage:: * Pragma Task_Storage::
* Pragma Thread_Local_Storage::
* Pragma Time_Slice:: * Pragma Time_Slice::
* Pragma Title:: * Pragma Title::
* Pragma Unchecked_Union:: * Pragma Unchecked_Union::
...@@ -4656,6 +4657,35 @@ created, depending on the target. This pragma can appear anywhere a ...@@ -4656,6 +4657,35 @@ created, depending on the target. This pragma can appear anywhere a
@code{Storage_Size} attribute definition clause is allowed for a task @code{Storage_Size} attribute definition clause is allowed for a task
type. type.
@node Pragma Thread_Local_Storage
@unnumberedsec Pragma Thread_Local_Storage
@findex Thread_Local_Storage
@cindex Task specific storage
@cindex TLS (Thread Local Storage)
Syntax:
@smallexample @c ada
pragma Thread_Local_Storage ([Entity =>] LOCAL_NAME);
@end smallexample
@noindent
This pragma specifies that the specified entity, which must be
a variable declared in a library level package, is to be marked as
"Thread Local Storage" (@code{TLS}). On systems supporting this (which
include Solaris, GNU/Linux and VxWorks 6), this causes each thread
(and hence each Ada task) to see a distinct copy of the variable.
The variable may not have default initialization, and if there is
an explicit initialization, it must be either @code{null} for an
access variable, or a static expression for a scalar variable.
This provides a low level mechanism similar to that provided by
the @code{Ada.Task_Attributes} package, but much more efficient
and is also useful in writing interface code that will interact
with foreign threads.
If this pragma is used on a system where @code{TLS} is not supported,
then an error message will be generated and the program will be rejected.
@node Pragma Time_Slice @node Pragma Time_Slice
@unnumberedsec Pragma Time_Slice @unnumberedsec Pragma Time_Slice
@findex Time_Slice @findex Time_Slice
......
...@@ -403,6 +403,7 @@ package body Inline is ...@@ -403,6 +403,7 @@ package body Inline is
or else Nkind (N) = N_Function_Call or else Nkind (N) = N_Function_Call
then then
if Is_Entity_Name (Name (N)) if Is_Entity_Name (Name (N))
and then Comes_From_Source (Entity (Name (N)))
and then and then
Nkind (Unit_Declaration_Node (Entity (Name (N)))) Nkind (Unit_Declaration_Node (Entity (Name (N))))
= N_Subprogram_Body = N_Subprogram_Body
......
...@@ -140,7 +140,7 @@ package body Sem_Ch3 is ...@@ -140,7 +140,7 @@ package body Sem_Ch3 is
Derived_Type : Entity_Id); Derived_Type : Entity_Id);
-- Subsidiary procedure to Build_Derived_Type. For a derived enumeration -- Subsidiary procedure to Build_Derived_Type. For a derived enumeration
-- type, we must create a new list of literals. Types derived from -- type, we must create a new list of literals. Types derived from
-- Character and Wide_Character are special-cased. -- Character and [Wide_]Wide_Character are special-cased.
procedure Build_Derived_Numeric_Type procedure Build_Derived_Numeric_Type
(N : Node_Id; (N : Node_Id;
...@@ -4962,7 +4962,7 @@ package body Sem_Ch3 is ...@@ -4962,7 +4962,7 @@ package body Sem_Ch3 is
Rang_Expr : Node_Id; Rang_Expr : Node_Id;
begin begin
-- Since types Standard.Character and Standard.Wide_Character do -- Since types Standard.Character and Standard.[Wide_]Wide_Character do
-- not have explicit literals lists we need to process types derived -- not have explicit literals lists we need to process types derived
-- from them specially. This is handled by Derived_Standard_Character. -- from them specially. This is handled by Derived_Standard_Character.
-- If the parent type is a generic type, there are no literals either, -- If the parent type is a generic type, there are no literals either,
......
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