summaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-08 13:54:32 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-08 13:54:32 +0000
commitd7fb5ea8f8db283c774c2e8b49e89a0a0a7d8305 (patch)
tree4e1e065070a8b339462faa75aeb7ed75439b045a /gcc/ada
parent87de4c68bd9cc0b83d1665836ba4fbba9d96f17f (diff)
downloadgcc-d7fb5ea8f8db283c774c2e8b49e89a0a0a7d8305.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@145732 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/ChangeLog11
-rw-r--r--gcc/ada/gnat_rm.texi34
-rw-r--r--gcc/ada/inline.adb1
-rw-r--r--gcc/ada/sem_ch3.adb4
4 files changed, 46 insertions, 4 deletions
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 <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>
* 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,