summaryrefslogtreecommitdiff
path: root/gcc/ada/inline.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-02 12:36:58 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-02 12:36:58 +0000
commit04d6f660a83e974513b44f0a4dd4093fc9711a18 (patch)
treec4a919db02a75d3f2a5f6a7e7c6835ddca7877dd /gcc/ada/inline.adb
parentee3193465e4298addc2a2318a6089d0717b62d51 (diff)
downloadgcc-04d6f660a83e974513b44f0a4dd4093fc9711a18.tar.gz
2011-08-02 Eric Botcazou <ebotcazou@adacore.com>
* inline.adb (Add_Inlined_Body): Adjust check for library-level inlined functions to previous change. Reorganize code slightly. 2011-08-02 Geert Bosch <bosch@adacore.com> * back_end.ads (Register_Type_Proc): New call back procedure type for allowing the back end to provide information about available types. (Register_Back_End_Types): New procedure to register back end types. * back_end.adb (Register_Back_End_Types): Call the back end to enumerate available types. * cstand.adb (Back_End_Float_Types): New list for floating point types supported by the back end. (Build_Float_Type): Add extra parameter for Float_Rep_Kind. (Copy_Float_Type): New procedure to make new copies of predefined types. (Register_Float_Type): New call back procedure to populate the BEFT list (Find_Back_End_Float_Type): New procedure to find a BEFT by name (Create_Back_End_Float_Types): New procedure to populate the BEFT list. (Create_Float_Types): New procedure to create entities for floating point types predefined in Standard, and put these and any remaining BEFTs on the Predefined_Float_Types list. * stand.ads (Predefined_Float_Types): New list for predefined floating point types that do not have declarations in package Standard. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@177137 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/inline.adb')
-rw-r--r--gcc/ada/inline.adb39
1 files changed, 21 insertions, 18 deletions
diff --git a/gcc/ada/inline.adb b/gcc/ada/inline.adb
index 339c01fbaf1..6678057ff02 100644
--- a/gcc/ada/inline.adb
+++ b/gcc/ada/inline.adb
@@ -236,7 +236,6 @@ package body Inline is
----------------------
procedure Add_Inlined_Body (E : Entity_Id) is
- Pack : Entity_Id;
function Must_Inline return Boolean;
-- Inlining is only done if the call statement N is in the main unit,
@@ -318,35 +317,39 @@ package body Inline is
-- no enclosing package to retrieve. In this case, it is the body of
-- the function that will have to be loaded.
- if not Is_Abstract_Subprogram (E) and then not Is_Nested (E)
+ if not Is_Abstract_Subprogram (E)
+ and then not Is_Nested (E)
and then Convention (E) /= Convention_Protected
+ and then Must_Inline
then
- Pack := Get_Code_Unit_Entity (E);
-
- if Must_Inline
- and then Ekind (Pack) = E_Package
- then
- Set_Is_Called (E);
+ declare
+ Pack : constant Entity_Id := Get_Code_Unit_Entity (E);
- if Pack = Standard_Standard then
+ begin
+ if Pack = E then
-- Library-level inlined function. Add function itself to
-- list of needed units.
+ Set_Is_Called (E);
Inlined_Bodies.Increment_Last;
Inlined_Bodies.Table (Inlined_Bodies.Last) := E;
- elsif Is_Generic_Instance (Pack) then
- null;
+ elsif Ekind (Pack) = E_Package then
+ Set_Is_Called (E);
- elsif not Is_Inlined (Pack)
- and then not Has_Completion (E)
- then
- Set_Is_Inlined (Pack);
- Inlined_Bodies.Increment_Last;
- Inlined_Bodies.Table (Inlined_Bodies.Last) := Pack;
+ if Is_Generic_Instance (Pack) then
+ null;
+
+ elsif not Is_Inlined (Pack)
+ and then not Has_Completion (E)
+ then
+ Set_Is_Inlined (Pack);
+ Inlined_Bodies.Increment_Last;
+ Inlined_Bodies.Table (Inlined_Bodies.Last) := Pack;
+ end if;
end if;
- end if;
+ end;
end if;
end Add_Inlined_Body;