diff options
author | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2017-05-22 09:24:24 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2017-05-22 09:24:24 +0000 |
commit | d327113612c1b089eee87f04cd517b7f7103c1ea (patch) | |
tree | 5b660c58c813d8aea1e713136d95cb2b70afe62d /gcc/ada/inline.adb | |
parent | 4c24ec6d58db238f64bda456ebdb0b5c82347d78 (diff) | |
download | gcc-d327113612c1b089eee87f04cd517b7f7103c1ea.zip gcc-d327113612c1b089eee87f04cd517b7f7103c1ea.tar.gz gcc-d327113612c1b089eee87f04cd517b7f7103c1ea.tar.bz2 |
sem_ch4.adb (Analyze_Call): In Ada2012 an incomplete type from a limited view may appear in the profile of...
* sem_ch4.adb (Analyze_Call): In Ada2012 an incomplete type from a
limited view may appear in the profile of a function, and a call to
that function in another unit in which the full view is available must
use this full view to spurious type errors at the point of call.
* inline.adb (Analyze_Inlined_Bodies): Remove restriction on loading
of parent body with a with clause for the main unit.
* gcc-interface/decl.c (defer_limited_with_list): Document new usage.
(gnat_to_gnu_entity) <E_Access_Type>: Handle completed Taft Amendment
types declared in external units like types from limited with clauses.
Adjust final processing of defer_limited_with_list accordingly.
* gcc-interface/trans.c (gnat_to_gnu) < N_Selected_Component>: Try
again to translate the prefix after the field if it is incomplete.
From-SVN: r248321
Diffstat (limited to 'gcc/ada/inline.adb')
-rw-r--r-- | gcc/ada/inline.adb | 90 |
1 files changed, 1 insertions, 89 deletions
diff --git a/gcc/ada/inline.adb b/gcc/ada/inline.adb index ac19c9d..9f2539a 100644 --- a/gcc/ada/inline.adb +++ b/gcc/ada/inline.adb @@ -667,57 +667,6 @@ package body Inline is Table_Name => "Pending_Inlined"); -- The workpile used to compute the transitive closure - function Is_Ancestor_Of_Main - (U_Name : Entity_Id; - Nam : Node_Id) return Boolean; - -- Determine whether the unit whose body is loaded is an ancestor of - -- the main unit, and has a with_clause on it. The body is not - -- analyzed yet, so the check is purely lexical: the name of the with - -- clause is a selected component, and names of ancestors must match. - - ------------------------- - -- Is_Ancestor_Of_Main -- - ------------------------- - - function Is_Ancestor_Of_Main - (U_Name : Entity_Id; - Nam : Node_Id) return Boolean - is - Pref : Node_Id; - - begin - if Nkind (Nam) /= N_Selected_Component then - return False; - - else - if Chars (Selector_Name (Nam)) /= - Chars (Cunit_Entity (Main_Unit)) - then - return False; - end if; - - Pref := Prefix (Nam); - if Nkind (Pref) = N_Identifier then - - -- Par is an ancestor of Par.Child. - - return Chars (Pref) = Chars (U_Name); - - elsif Nkind (Pref) = N_Selected_Component - and then Chars (Selector_Name (Pref)) = Chars (U_Name) - then - -- Par.Child is an ancestor of Par.Child.Grand. - - return True; -- should check that ancestor match - - else - -- A is an ancestor of A.B.C if it is an ancestor of A.B - - return Is_Ancestor_Of_Main (U_Name, Pref); - end if; - end if; - end Is_Ancestor_Of_Main; - -- Start of processing for Analyze_Inlined_Bodies begin @@ -766,7 +715,7 @@ package body Inline is begin if not Is_Loaded (Bname) then Style_Check := False; - Load_Needed_Body (Comp_Unit, OK, Do_Analyze => False); + Load_Needed_Body (Comp_Unit, OK); if not OK then @@ -780,43 +729,6 @@ package body Inline is Error_Msg_File_1 := Get_File_Name (Bname, Subunit => False); Error_Msg_N ("\but file{ was not found!??", Comp_Unit); - - else - -- If the package to be inlined is an ancestor unit of - -- the main unit, and it has a semantic dependence on - -- it, the inlining cannot take place to prevent an - -- elaboration circularity. The desired body is not - -- analyzed yet, to prevent the completion of Taft - -- amendment types that would lead to elaboration - -- circularities in gigi. - - declare - U_Id : constant Entity_Id := - Defining_Entity (Unit (Comp_Unit)); - Body_Unit : constant Node_Id := - Library_Unit (Comp_Unit); - Item : Node_Id; - - begin - Item := First (Context_Items (Body_Unit)); - while Present (Item) loop - if Nkind (Item) = N_With_Clause - and then - Is_Ancestor_Of_Main (U_Id, Name (Item)) - then - Set_Is_Inlined (U_Id, False); - exit; - end if; - - Next (Item); - end loop; - - -- If no suspicious with_clauses, analyze the body - - if Is_Inlined (U_Id) then - Semantics (Body_Unit); - end if; - end; end if; end if; end; |