From: Arnaud Charlet Date: Wed, 8 Apr 2009 13:54:32 +0000 (+0200) Subject: [multiple changes] X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=94fd3dc67710fa4d44903375d6257101b1d9fa95;p=gcc.git [multiple changes] 2009-04-08 Robert Dewar * gnat_rm.texi: Add documentation for pragma Thread_Local_Storage * sem_ch3.adb: Minor comment updates 2009-04-08 Ed Schonberg * inline.adb (Back_End_Cannot_Inline): restrict warning to subprograms that come from source. From-SVN: r145732 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index c73aa0a3497..b6d0aca4a09 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,14 @@ +2009-04-08 Robert Dewar + + * gnat_rm.texi: Add documentation for pragma Thread_Local_Storage + + * sem_ch3.adb: Minor comment updates + +2009-04-08 Ed Schonberg + + * inline.adb (Back_End_Cannot_Inline): restrict warning to subprograms + that come from source. + 2009-04-08 Tristan Gingold * gcc-interface/utils.c, gcc-interface/decl.c, gcc-interface/gigi.h: diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi index 4d50a50cd41..f72a0d16093 100644 --- a/gcc/ada/gnat_rm.texi +++ b/gcc/ada/gnat_rm.texi @@ -194,6 +194,7 @@ Implementation Defined Pragmas * Pragma Task_Info:: * Pragma Task_Name:: * Pragma Task_Storage:: +* Pragma Thread_Local_Storage:: * Pragma Time_Slice:: * Pragma Title:: * Pragma Unchecked_Union:: @@ -683,8 +684,7 @@ compiler system. @noindent Ada defines a set of pragmas that can be used to supply additional information to the compiler. These language defined pragmas are -implemented in GNAT and work as described in the Ada Reference -Manual. +implemented in GNAT and work as described in the Ada Reference Manual. In addition, Ada allows implementations to define additional pragmas whose meaning is defined by the implementation. GNAT provides a number @@ -797,6 +797,7 @@ consideration, the use of these pragmas should be minimized. * Pragma Task_Info:: * Pragma Task_Name:: * Pragma Task_Storage:: +* Pragma Thread_Local_Storage:: * Pragma Time_Slice:: * Pragma Title:: * Pragma Unchecked_Union:: @@ -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 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 @unnumberedsec Pragma Time_Slice @findex Time_Slice diff --git a/gcc/ada/inline.adb b/gcc/ada/inline.adb index 7cda5d5a153..4a9b1f61e05 100644 --- a/gcc/ada/inline.adb +++ b/gcc/ada/inline.adb @@ -403,6 +403,7 @@ package body Inline is or else Nkind (N) = N_Function_Call then if Is_Entity_Name (Name (N)) + and then Comes_From_Source (Entity (Name (N))) and then Nkind (Unit_Declaration_Node (Entity (Name (N)))) = N_Subprogram_Body diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index 97fbb8198e0..106acec064e 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -140,7 +140,7 @@ package body Sem_Ch3 is Derived_Type : Entity_Id); -- Subsidiary procedure to Build_Derived_Type. For a derived enumeration -- 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 (N : Node_Id; @@ -4962,7 +4962,7 @@ package body Sem_Ch3 is Rang_Expr : Node_Id; 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 -- from them specially. This is handled by Derived_Standard_Character. -- If the parent type is a generic type, there are no literals either,