diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2014-10-31 12:02:55 +0100 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2014-10-31 12:02:55 +0100 |
commit | 71ff3d1820751c2e0f5dd265603ab8640b0cea63 (patch) | |
tree | 88c849bf8a2e08f492881bf9d2fb1ce284b34edf /gcc/ada/inline.adb | |
parent | 26b043e041529af951b20d4e94841e6433d9cc1c (diff) | |
download | gcc-71ff3d1820751c2e0f5dd265603ab8640b0cea63.zip gcc-71ff3d1820751c2e0f5dd265603ab8640b0cea63.tar.gz gcc-71ff3d1820751c2e0f5dd265603ab8640b0cea63.tar.bz2 |
[multiple changes]
2014-10-31 Ed Schonberg <schonberg@adacore.com>
* freeze.adb (Freeze_Record_Type): Do not check component size
if its type is generic.
2014-10-31 Bob Duff <duff@adacore.com>
* gnat_rm.texi: Fix documentation w.r.t -gnatw.w.
2014-10-31 Ed Schonberg <schonberg@adacore.com>
* sem_ch4.adb (Try_Container_Indexing): Use Check_Implicit_Dereference.
* sem_util.adb (Check_Implicit_Dereference): a) Handle generalized
indexing as well as function calls. b) If the context is a
selected component and whe are in an instance, remove entity from
selector name to force resolution of the node, so that explicit
dereferences can be generated in the instance if they were in
the generic unit.
2014-10-31 Eric Botcazou <ebotcazou@adacore.com>
* inline.adb (Back_End_Cannot_Inline): Delete.
(Add_Inlined_Subprogram): Do not call it.
From-SVN: r216956
Diffstat (limited to 'gcc/ada/inline.adb')
-rw-r--r-- | gcc/ada/inline.adb | 78 |
1 files changed, 6 insertions, 72 deletions
diff --git a/gcc/ada/inline.adb b/gcc/ada/inline.adb index 8e2df38..0b94277 100644 --- a/gcc/ada/inline.adb +++ b/gcc/ada/inline.adb @@ -445,20 +445,6 @@ package body Inline is E : constant Entity_Id := Inlined.Table (Index).Name; Pack : constant Entity_Id := Get_Code_Unit_Entity (E); - function Back_End_Cannot_Inline (Subp : Entity_Id) return Boolean; - -- There are various conditions under which back-end inlining cannot - -- be done reliably: - -- - -- a) If a body has handlers, it must not be inlined, because this - -- may violate program semantics, and because in zero-cost exception - -- mode it will lead to undefined symbols at link time. - -- - -- b) If a body contains inlined function instances, it cannot be - -- inlined under ZCX because the numeric suffix generated by gigi - -- will be different in the body and the place of the inlined call. - -- - -- This procedure must be carefully coordinated with the back end. - procedure Register_Backend_Inlined_Subprogram (Subp : Entity_Id); -- Append Subp to the list of subprograms inlined by the backend @@ -466,52 +452,6 @@ package body Inline is -- Append Subp to the list of subprograms that cannot be inlined by -- the backend. - ---------------------------- - -- Back_End_Cannot_Inline -- - ---------------------------- - - function Back_End_Cannot_Inline (Subp : Entity_Id) return Boolean is - Decl : constant Node_Id := Unit_Declaration_Node (Subp); - Body_Ent : Entity_Id; - Ent : Entity_Id; - - begin - if Nkind (Decl) = N_Subprogram_Declaration - and then Present (Corresponding_Body (Decl)) - then - Body_Ent := Corresponding_Body (Decl); - else - return False; - end if; - - -- If subprogram is marked Inline_Always, inlining is mandatory - - if Has_Pragma_Inline_Always (Subp) then - return False; - end if; - - if Present - (Exception_Handlers - (Handled_Statement_Sequence - (Unit_Declaration_Node (Corresponding_Body (Decl))))) - then - return True; - end if; - - Ent := First_Entity (Body_Ent); - while Present (Ent) loop - if Is_Subprogram (Ent) - and then Is_Generic_Instance (Ent) - then - return True; - end if; - - Next_Entity (Ent); - end loop; - - return False; - end Back_End_Cannot_Inline; - ----------------------------------------- -- Register_Backend_Inlined_Subprogram -- ----------------------------------------- @@ -547,21 +487,15 @@ package body Inline is and then not Is_Nested (E) and then not Has_Initialized_Type (E) then - if Back_End_Cannot_Inline (E) then - Set_Is_Inlined (E, False); - Register_Backend_Not_Inlined_Subprogram (E); + Register_Backend_Inlined_Subprogram (E); + if No (Last_Inlined) then + Set_First_Inlined_Subprogram (Cunit (Main_Unit), E); else - Register_Backend_Inlined_Subprogram (E); - - if No (Last_Inlined) then - Set_First_Inlined_Subprogram (Cunit (Main_Unit), E); - else - Set_Next_Inlined_Subprogram (Last_Inlined, E); - end if; - - Last_Inlined := E; + Set_Next_Inlined_Subprogram (Last_Inlined, E); end if; + + Last_Inlined := E; else Register_Backend_Not_Inlined_Subprogram (E); end if; |