aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch6.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2017-05-02 10:55:03 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2017-05-02 10:55:03 +0200
commit1804faa419c5a5ce91e60a5d67acd1e28c318944 (patch)
tree085ab1697c03fcae6f94d6adac74fa3b098fb621 /gcc/ada/sem_ch6.adb
parent62d40a7a4e9d8e16149d274f1370bd3024eb2bd5 (diff)
downloadgcc-1804faa419c5a5ce91e60a5d67acd1e28c318944.zip
gcc-1804faa419c5a5ce91e60a5d67acd1e28c318944.tar.gz
gcc-1804faa419c5a5ce91e60a5d67acd1e28c318944.tar.bz2
[multiple changes]
2017-05-02 Ed Schonberg <schonberg@adacore.com> * exp_ch3.adb (Build_Initialization_Call): Generate a null statement if the initialization call is a null procedure, as can happen with a controlled type with no explicit Initialize procedure, or an array of such. * exp_ch7.adb (Process_Object_Declaration): For a type with controlled components that has a trivial Initialize procedure, insert declaration for finalization counter after object declaration itself. (Make_Deep_Array_Body, Build_Initialize_statements): Do not create finalization block and attendant declarations if component has a trivial Initialize procedure. (Make_Init_Call): Do not generate a call if controlled type has a trivial Initialize procedure. 2017-05-02 Eric Botcazou <ebotcazou@adacore.com> * g-forstr.ads (Data): Move Format component last. * g-forstr.adb ("+"): Adjust for above change. * g-rewdat.ads (Buffer): Move Buffer, Current, Pattern and Value last. * g-sechas.ads (Context): Move Key last. * g-socket.ads (Service_Entry_Type): Move Aliases last. * s-fileio.adb (Temp_File_Record): Move Name last. * s-regexp.adb (Regexp_Value): Move Case_Sensitive last. * xr_tabls.ads (Project_File): Move Src_Dir and Obj_Dir last. 2017-05-02 Jerome Lambourg <lambourg@adacore.com> * bindusg.adb, bindgen.adb, gnatbind.adb, opt.ads: Remove the -nognarl switch introduced recently. finally not needed. 2017-05-02 Hristian Kirtchev <kirtchev@adacore.com> * sem_ch6.adb (Analyze_Null_Procedure): Set the Corresponding_Body link for a null procedure declaration. From-SVN: r247475
Diffstat (limited to 'gcc/ada/sem_ch6.adb')
-rw-r--r--gcc/ada/sem_ch6.adb7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb
index 61e4f86..760487f 100644
--- a/gcc/ada/sem_ch6.adb
+++ b/gcc/ada/sem_ch6.adb
@@ -1450,6 +1450,12 @@ package body Sem_Ch6 is
Is_Completion := False;
+ -- Link the body to the null procedure spec
+
+ if Nkind (N) = N_Subprogram_Declaration then
+ Set_Corresponding_Body (N, Defining_Entity (Null_Body));
+ end if;
+
-- Null procedures are always inlined, but generic formal subprograms
-- which appear as such in the internal instance of formal packages,
-- need no completion and are not marked Inline.
@@ -1457,7 +1463,6 @@ package body Sem_Ch6 is
if Expander_Active
and then Nkind (N) /= N_Formal_Concrete_Subprogram_Declaration
then
- Set_Corresponding_Body (N, Defining_Entity (Null_Body));
Set_Body_To_Inline (N, Null_Body);
Set_Is_Inlined (Designator);
end if;