Commit 5207696c by Arnaud Charlet

[multiple changes]

2011-08-04  Nicolas Roche  <roche@adacore.com>

	* alfa_test.adb: Not all ali files are containing alfa information even
	if compiled with -gnatd.F. So suppress warning about missing ALFA
	information.

2011-08-04  Yannick Moy  <moy@adacore.com>

	* lib-xref-alfa.adb (Add_ALFA_Scope): use non-empty unique name for
	scope.
	* put_alfa.adb: Check that scope name is not empty.

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

	* exp_ch3.adb (Stream_Operation_Ok): new predicate
	Needs_Elementary_Stream_Operation, to determine whether user-defined
	Read and Write attributes are available for the elementary components
	of the given type. If only the predefined attributes are available,
	then when restriction No_Default_Stream_Attributes is active the
	predefined stream attributes for the composite type cannot be created.

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

	* bindgen.adb: Fix obsolete comments and names from Ada/C days.
	Put routines in alpha order

From-SVN: r177399
parent 2bd2d858
2011-08-04 Nicolas Roche <roche@adacore.com>
* alfa_test.adb: Not all ali files are containing alfa information even
if compiled with -gnatd.F. So suppress warning about missing ALFA
information.
2011-08-04 Yannick Moy <moy@adacore.com>
* lib-xref-alfa.adb (Add_ALFA_Scope): use non-empty unique name for
scope.
* put_alfa.adb: Check that scope name is not empty.
2011-08-04 Ed Schonberg <schonberg@adacore.com>
* exp_ch3.adb (Stream_Operation_Ok): new predicate
Needs_Elementary_Stream_Operation, to determine whether user-defined
Read and Write attributes are available for the elementary components
of the given type. If only the predefined attributes are available,
then when restriction No_Default_Stream_Attributes is active the
predefined stream attributes for the composite type cannot be created.
2011-08-04 Robert Dewar <dewar@adacore.com>
* bindgen.adb: Fix obsolete comments and names from Ada/C days.
Put routines in alpha order
2011-08-04 Jose Ruiz <ruiz@adacore.com>
* gcc-interface/Makefile.in: Remove xenomai specific versions of system.
......
......@@ -251,8 +251,6 @@ begin
C := Get_Char (Infile);
if C = EOF then
Ada.Text_IO.Put_Line
(Argument (1) & ": no SCO found, recompile with -gnateS");
raise Stop;
elsif C = LF or else C = CR then
......
......@@ -8964,7 +8964,60 @@ package body Exp_Ch3 is
is
Has_Predefined_Or_Specified_Stream_Attribute : Boolean := False;
function Needs_Elementary_Stream_Operation
(T : Entity_Id) return Boolean;
-- AI05-0161 : if the restriction No_Default_Stream_Attributes is active
-- then we can generate stream subprograms for records that have scalar
-- subcomponents only if those subcomponents have user-defined stream
-- subprograms. For elementary types only 'Read and 'Write are needed.
---------------------------------------
-- Needs_Elementary_Stream_Operation --
---------------------------------------
function Needs_Elementary_Stream_Operation
(T : Entity_Id) return Boolean
is
begin
if not Restriction_Active (No_Default_Stream_Attributes) then
return False;
elsif Is_Elementary_Type (T) then
return No (TSS (T, TSS_Stream_Read))
or else No (TSS (T, TSS_Stream_Write));
elsif Is_Array_Type (T) then
return Needs_Elementary_Stream_Operation (Component_Type (T));
elsif Is_Record_Type (T) then
declare
Comp : Entity_Id;
begin
Comp := First_Component (T);
while Present (Comp) loop
if Needs_Elementary_Stream_Operation (Etype (Comp)) then
return True;
end if;
Next_Component (Comp);
end loop;
return False;
end;
elsif Is_Private_Type (T)
and then Present (Full_View (T))
then
return Needs_Elementary_Stream_Operation (Full_View (T));
else
return False;
end if;
end Needs_Elementary_Stream_Operation;
-- Start processing for Stream_Operation_OK
begin
-- Special case of a limited type extension: a default implementation
-- of the stream attributes Read or Write exists if that attribute
-- has been specified or is available for an ancestor type; a default
......@@ -9057,6 +9110,7 @@ package body Exp_Ch3 is
and then not Restriction_Active (No_Dispatch)
and then not No_Run_Time_Mode
and then RTE_Available (RE_Tag)
and then not Needs_Elementary_Stream_Operation (Typ)
and then RTE_Available (RE_Root_Stream_Type)
and then not Is_RTE (Typ, RE_Finalization_Collection);
end Stream_Operation_OK;
......
......@@ -321,7 +321,7 @@ package body ALFA is
-- filled even later, but are initialized to represent an empty range.
ALFA_Scope_Table.Append (
(Scope_Name => new String'(Exact_Source_Name (Sloc (E))),
(Scope_Name => new String'(Unique_Name (E)),
File_Num => 0,
Scope_Num => 0,
Spec_File_Num => 0,
......
......@@ -74,6 +74,7 @@ begin
Write_Info_Nat (S.Col);
Write_Info_Char (' ');
pragma Assert (S.Scope_Name.all /= "");
for N in S.Scope_Name'Range loop
Write_Info_Char (S.Scope_Name (N));
end loop;
......
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