Commit 02886c2e by Arnaud Charlet

2015-10-26 Joel Brobecker <brobecker@adacore.com brobecker>

	* adaint.c (__gnat_lwp_self): Replace current implementation re-using
	the Linux one, which uses an __NR_gettid syscall rather than
	pthread_self.

2015-10-26  Arnaud Charlet  <charlet@adacore.com>

	* sinfo.ads, exp_ch3.adb (Build_Array_Init_Proc,
	Build_Record_Init_Proc): Do not inline init procs when
	Modify_Tree_For_C is True.

2015-10-26  Bob Duff  <duff@adacore.com>

	* errout.ads: Minor comment fix.
	* einfo.ads: Minor style fix.

2015-10-26  Bob Duff  <duff@adacore.com>

	* sem_ch3.adb (Derive_Interface_Subprogram): Fix
	Is_Abstract_Subprogram, which might have been calculated
	incorrectly, because we're passing Ultimate_Alias (Subp) (and
	its dispatching type) to Derive_Subprogram, instead of the true
	parent subprogram and type.

2015-10-26  Bob Duff  <duff@adacore.com>

	* sem_ch13.adb (Check_Iterator_Functions): When
	printing the "default iterator must be unique" error message,
	also print references to the places where the duplicates are
	declared. This makes the message clearer.

From-SVN: r229320
parent 51022ff7
2015-10-26 Joel Brobecker <brobecker@adacore.com brobecker>
* adaint.c (__gnat_lwp_self): Replace current implementation re-using
the Linux one, which uses an __NR_gettid syscall rather than
pthread_self.
2015-10-26 Arnaud Charlet <charlet@adacore.com>
* sinfo.ads, exp_ch3.adb (Build_Array_Init_Proc,
Build_Record_Init_Proc): Do not inline init procs when
Modify_Tree_For_C is True.
2015-10-26 Bob Duff <duff@adacore.com>
* errout.ads: Minor comment fix.
* einfo.ads: Minor style fix.
2015-10-26 Bob Duff <duff@adacore.com>
* sem_ch3.adb (Derive_Interface_Subprogram): Fix
Is_Abstract_Subprogram, which might have been calculated
incorrectly, because we're passing Ultimate_Alias (Subp) (and
its dispatching type) to Derive_Subprogram, instead of the true
parent subprogram and type.
2015-10-26 Bob Duff <duff@adacore.com>
* sem_ch13.adb (Check_Iterator_Functions): When
printing the "default iterator must be unique" error message,
also print references to the places where the duplicates are
declared. This makes the message clearer.
2015-10-26 Ed Schonberg <schonberg@adacore.com>
* sem_ch12.adb (Analyze_Formal_Package_Declaration): Do not set
......
......@@ -3061,17 +3061,7 @@ __gnat_sals_init_using_constructors (void)
#endif
}
#if defined (__ANDROID__)
#include <pthread.h>
void *
__gnat_lwp_self (void)
{
return (void *) pthread_self ();
}
#elif defined (__linux__)
#if defined (__linux__) || defined (__ANDROID__)
/* There is no function in the glibc to retrieve the LWP of the current
thread. We need to do a system call in order to retrieve this
information. */
......@@ -3081,7 +3071,9 @@ __gnat_lwp_self (void)
{
return (void *) syscall (__NR_gettid);
}
#endif
#if defined (__linux__)
#include <sched.h>
/* glibc versions earlier than 2.7 do not define the routines to handle
......
......@@ -111,9 +111,6 @@ package Errout is
-- This normal suppression action may be overridden in cases 2-5 (but not
-- in case 1 or 7 by setting All_Errors mode, or by setting the special
-- unconditional message insertion character (!) as described below.
-- This normal suppression action may be overridden in cases 2-5 (but
-- not in case 1) by setting All_Errors mode, or by setting the special
-- unconditional message insertion character (!) as described below.
---------------------------------------------------------
-- Error Message Text and Message Insertion Characters --
......
......@@ -760,8 +760,10 @@ package body Exp_Ch3 is
-- want to inline, because nested stuff may cause difficulties in
-- inter-unit inlining, and furthermore there is in any case no
-- point in inlining such complex init procs.
-- Also do not inline in case of Modify_Tree_For_C where front-end
-- inlining is used and may not always play well with init procs.
if not Has_Task (Proc_Id) then
if not Has_Task (Proc_Id) and then not Modify_Tree_For_C then
Set_Is_Inlined (Proc_Id);
end if;
......@@ -3598,9 +3600,12 @@ package body Exp_Ch3 is
-- In addition, when compiled for another unit for inlining purposes,
-- it may make reference to entities that have not been elaborated
-- yet. Similar considerations apply to task types.
-- Also do not inline in case of Modify_Tree_For_C where front-end
-- inlining is used and may not always play well with init procs.
if not Is_Concurrent_Type (Rec_Type)
and then not Has_Task (Rec_Type)
and then not Modify_Tree_For_C
then
Set_Is_Inlined (Proc_Id);
end if;
......
......@@ -4219,8 +4219,6 @@ package body Sem_Ch13 is
------------------------------
procedure Check_Iterator_Functions is
Default : Entity_Id;
function Valid_Default_Iterator (Subp : Entity_Id) return Boolean;
-- Check one possible interpretation for validity
......@@ -4277,8 +4275,8 @@ package body Sem_Ch13 is
end if;
else
Default := Empty;
declare
Default : Entity_Id := Empty;
I : Interp_Index;
It : Interp;
......@@ -4292,6 +4290,10 @@ package body Sem_Ch13 is
elsif Present (Default) then
Error_Msg_N ("default iterator must be unique", Expr);
Error_Msg_Sloc := Sloc (Default);
Error_Msg_N ("\\possible interpretation#", Expr);
Error_Msg_Sloc := Sloc (It.Nam);
Error_Msg_N ("\\possible interpretation#", Expr);
else
Default := It.Nam;
......@@ -4299,12 +4301,12 @@ package body Sem_Ch13 is
Get_Next_Interp (I, It);
end loop;
end;
if Present (Default) then
Set_Entity (Expr, Default);
Set_Is_Overloaded (Expr, False);
end if;
if Present (Default) then
Set_Entity (Expr, Default);
Set_Is_Overloaded (Expr, False);
end if;
end;
end if;
end Check_Iterator_Functions;
......
......@@ -15012,11 +15012,27 @@ package body Sem_Ch3 is
-- Given that this new interface entity corresponds with a primitive
-- of the parent that was not overridden we must leave it associated
-- with its parent primitive to ensure that it will share the same
-- dispatch table slot when overridden.
-- dispatch table slot when overridden. We must set the Alias to Subp
-- (instead of Iface_Subp), and we must fix Is_Abstract_Subprogram
-- (in case we inherited Subp from Iface_Type via a nonabstract
-- generic formal type).
if No (Actual_Subp) then
Set_Alias (New_Subp, Subp);
declare
T : Entity_Id := Find_Dispatching_Type (Subp);
begin
while Etype (T) /= T loop
if Is_Generic_Type (T) and then not Is_Abstract_Type (T) then
Set_Is_Abstract_Subprogram (New_Subp, False);
exit;
end if;
T := Etype (T);
end loop;
end;
-- For instantiations this is not needed since the previous call to
-- Derive_Subprogram leaves the entity well decorated.
......
......@@ -735,6 +735,9 @@ package Sinfo is
-- they are systematically expanded into loops (for arrays) and
-- individual assignments (for records).
-- Initialization procedures (init procs) for records and arrays are
-- not inlined.
------------------------------------
-- Description of Semantic Fields --
------------------------------------
......
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