diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2017-05-02 10:55:03 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2017-05-02 10:55:03 +0200 |
commit | 1804faa419c5a5ce91e60a5d67acd1e28c318944 (patch) | |
tree | 085ab1697c03fcae6f94d6adac74fa3b098fb621 /gcc/ada/exp_ch3.adb | |
parent | 62d40a7a4e9d8e16149d274f1370bd3024eb2bd5 (diff) | |
download | gcc-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/exp_ch3.adb')
-rw-r--r-- | gcc/ada/exp_ch3.adb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb index c127523..899accd 100644 --- a/gcc/ada/exp_ch3.adb +++ b/gcc/ada/exp_ch3.adb @@ -1431,6 +1431,15 @@ package body Exp_Ch3 is if Is_Null_Init_Proc (Proc) and then not Init_Or_Norm_Scalars then return Empty_List; + + -- Nothing to do for an array of controlled components that have only + -- the inherited Initialize primitive. This is a useful optimization + -- for CodePeer. + + elsif Is_Trivial_Subprogram (Proc) + and then Is_Array_Type (Full_Init_Type) + then + return New_List (Make_Null_Statement (Loc)); end if; -- Use the [underlying] full view when dealing with a private type. This |