summaryrefslogtreecommitdiff
path: root/gcc/ada/inline.adb
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2011-03-26 09:34:40 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2011-03-26 09:34:40 +0000
commit6a93a17773d0bc14c84b6d9c1831df0e38c363e2 (patch)
tree26ba2a9b9f6a154eeaec3ba42d01da1e79061f7a /gcc/ada/inline.adb
parenta87256553df7c2af1590ace3a1b20c74da6af9c1 (diff)
downloadgcc-6a93a17773d0bc14c84b6d9c1831df0e38c363e2.tar.gz
* inline.adb (Back_End_Cannot_Inline): Lift restriction on calls to
subprograms without a previous spec declared in the same unit. * gcc-interface/trans.c (Compilation_Unit_to_gnu): Process inlined subprograms at the end of the unit instead of at the beginning. * gcc-interface/utils.c (create_subprog_decl): Check that the entity isn't public for the special handling of non-inline functions nested inside inline external functions. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@171551 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/inline.adb')
-rw-r--r--gcc/ada/inline.adb55
1 files changed, 1 insertions, 54 deletions
diff --git a/gcc/ada/inline.adb b/gcc/ada/inline.adb
index f40edd92d79..ddb4715ce13 100644
--- a/gcc/ada/inline.adb
+++ b/gcc/ada/inline.adb
@@ -368,12 +368,6 @@ package body Inline is
-- inlined under ZCX because the numeric suffix generated by gigi
-- will be different in the body and the place of the inlined call.
--
- -- If the body to be inlined contains calls to subprograms declared
- -- in the same body that have no previous spec, the back-end cannot
- -- inline either because the bodies to be inlined are processed before
- -- the rest of the enclosing package body, and gigi will then find
- -- references to entities that have not been elaborated yet.
- --
-- This procedure must be carefully coordinated with the back end.
----------------------------
@@ -384,41 +378,6 @@ package body Inline is
Decl : constant Node_Id := Unit_Declaration_Node (Subp);
Body_Ent : Entity_Id;
Ent : Entity_Id;
- Bad_Call : Node_Id;
-
- function Process (N : Node_Id) return Traverse_Result;
- -- Look for calls to subprograms with no previous spec, declared
- -- in the same enclosing package body.
-
- -------------
- -- Process --
- -------------
-
- function Process (N : Node_Id) return Traverse_Result is
- begin
- if Nkind (N) = N_Procedure_Call_Statement
- or else Nkind (N) = N_Function_Call
- then
- if Is_Entity_Name (Name (N))
- and then Comes_From_Source (Entity (Name (N)))
- and then
- Nkind (Unit_Declaration_Node (Entity (Name (N))))
- = N_Subprogram_Body
- and then In_Same_Extended_Unit (Subp, Entity (Name (N)))
- then
- Bad_Call := N;
- return Abandon;
- else
- return OK;
- end if;
- else
- return OK;
- end if;
- end Process;
-
- function Has_Exposed_Call is new Traverse_Func (Process);
-
- -- Start of processing for Back_End_Cannot_Inline
begin
if Nkind (Decl) = N_Subprogram_Declaration
@@ -454,19 +413,7 @@ package body Inline is
Next_Entity (Ent);
end loop;
- if Has_Exposed_Call
- (Unit_Declaration_Node (Corresponding_Body (Decl))) = Abandon
- then
- if Ineffective_Inline_Warnings then
- Error_Msg_N
- ("?call to subprogram with no separate spec"
- & " prevents inlining!!", Bad_Call);
- end if;
-
- return True;
- else
- return False;
- end if;
+ return False;
end Back_End_Cannot_Inline;
-- Start of processing for Add_Inlined_Subprogram