aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/exp_dist.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2009-04-07 18:15:57 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2009-04-07 18:15:57 +0200
commitf16d05d91391edb8da0ac0091c8576c8724f8cdc (patch)
tree9c171f84305a0b31542ecb4136c605cc2fc2f573 /gcc/ada/exp_dist.adb
parent2fc05e3d5e8689d847e7392f7998a6e363e3918d (diff)
downloadgcc-f16d05d91391edb8da0ac0091c8576c8724f8cdc.zip
gcc-f16d05d91391edb8da0ac0091c8576c8724f8cdc.tar.gz
gcc-f16d05d91391edb8da0ac0091c8576c8724f8cdc.tar.bz2
[multiple changes]
2009-04-07 Thomas Quinot <quinot@adacore.com> * g-sothco.ads (Int_Access): Remove extraneous access type (use anonymous access instead). (Get_Socket_From_Set): Fix incorrectly reverted formals Last and Socket to match the underlying C routine. * g-socket.adb (Get): Use named parameter associations instead of positional ones in call go Get_Socket_From_Set, since this routine has two formals of the same type. * g-socthi-vms.adb, g-socthi-vms.ads, g-socthi-vxworks.adb, g-socthi-vxworks.ads, g-socthi-mingw.ads, g-socthi.adb, g-socthi.ads: (C_Ioctl, Syscall_Ioctl): use "access C.int" instead of "Int_Access" for type of Arg formal. * sem_warn.adb: Minor reformatting 2009-04-07 Ed Schonberg <schonberg@adacore.com> * sem_util.adb (Has_Tagged_Component): Fix typo in loop that iterates over record components. 2009-04-07 Nicolas Roche <roche@adacore.com> * gsocket.h: Don't include resolvLib.h on VxWorks 6 (kernel and rtp). This library has disappeared between VxWorks 6.4 and VxWorks 6.5 In RTP mode use time.h instead of times.h 2009-04-07 Robert Dewar <dewar@adacore.com> * exp_ch4.adb (Expand_N_Op_Concat): Improve lower bound handling 2009-04-07 Kevin Pouget <pouget@adacore.com> * exp_dist.adb: Modify Build_From_Any_Fonction procedure to correct expanded code for constrained types. 2009-04-07 Ed Schonberg <schonberg@adacore.com> * sem_ch4.adb (Analyze_Overloaded_Selected_Component): implement AI05-105: in an object renaming declaration, anonymousness is a name resolution rule. sem_ch8.adb (Analyze_Object_Renaming): Ditto. 2009-04-07 Arnaud Charlet <charlet@adacore.com> * g-comlin.adb (Expansion): Fix old regression: also return directory names when matching. From-SVN: r145689
Diffstat (limited to 'gcc/ada/exp_dist.adb')
-rw-r--r--gcc/ada/exp_dist.adb105
1 files changed, 74 insertions, 31 deletions
diff --git a/gcc/ada/exp_dist.adb b/gcc/ada/exp_dist.adb
index 546bbcc..14136fd 100644
--- a/gcc/ada/exp_dist.adb
+++ b/gcc/ada/exp_dist.adb
@@ -9114,39 +9114,82 @@ package body Exp_Dist is
New_Occurrence_Of (Any_Parameter, Loc),
New_Occurrence_Of (Strm, Loc))));
- -- declare
- -- Res : constant T := T'Input (Strm);
- -- begin
- -- Release_Buffer (Strm);
- -- return Res;
- -- end;
-
- Append_To (Stms, Make_Block_Statement (Loc,
- Declarations => New_List (
- Make_Object_Declaration (Loc,
- Defining_Identifier => Res,
- Constant_Present => True,
- Object_Definition => New_Occurrence_Of (Typ, Loc),
- Expression =>
- Make_Attribute_Reference (Loc,
- Prefix => New_Occurrence_Of (Typ, Loc),
- Attribute_Name => Name_Input,
- Expressions => New_List (
- Make_Attribute_Reference (Loc,
- Prefix => New_Occurrence_Of (Strm, Loc),
- Attribute_Name => Name_Access))))),
+ if Transmit_As_Unconstrained (Typ) then
+
+ -- declare
+ -- Res : constant T := T'Input (Strm);
+ -- begin
+ -- Release_Buffer (Strm);
+ -- return Res;
+ -- end;
+
+ Append_To (Stms, Make_Block_Statement (Loc,
+ Declarations => New_List (
+ Make_Object_Declaration (Loc,
+ Defining_Identifier => Res,
+ Constant_Present => True,
+ Object_Definition => New_Occurrence_Of (Typ, Loc),
+ Expression =>
+ Make_Attribute_Reference (Loc,
+ Prefix => New_Occurrence_Of (Typ, Loc),
+ Attribute_Name => Name_Input,
+ Expressions => New_List (
+ Make_Attribute_Reference (Loc,
+ Prefix =>
+ New_Occurrence_Of (Strm, Loc),
+ Attribute_Name => Name_Access))))),
+
+ Handled_Statement_Sequence =>
+ Make_Handled_Sequence_Of_Statements (Loc,
+ Statements => New_List (
+ Make_Procedure_Call_Statement (Loc,
+ Name =>
+ New_Occurrence_Of
+ (RTE (RE_Release_Buffer), Loc),
+ Parameter_Associations =>
+ New_List (New_Occurrence_Of (Strm, Loc))),
+ Make_Simple_Return_Statement (Loc,
+ Expression => New_Occurrence_Of (Res, Loc))))));
+ else
- Handled_Statement_Sequence =>
- Make_Handled_Sequence_Of_Statements (Loc,
- Statements => New_List (
- Make_Procedure_Call_Statement (Loc,
- Name =>
- New_Occurrence_Of (RTE (RE_Release_Buffer), Loc),
- Parameter_Associations =>
- New_List (New_Occurrence_Of (Strm, Loc))),
- Make_Simple_Return_Statement (Loc,
- Expression => New_Occurrence_Of (Res, Loc))))));
+ -- declare
+ -- Res : T;
+ -- begin
+ -- T'Read (Strm, Res);
+ -- Release_Buffer (Strm);
+ -- return Res;
+ -- end;
+
+ Append_To (Stms, Make_Block_Statement (Loc,
+ Declarations => New_List (
+ Make_Object_Declaration (Loc,
+ Defining_Identifier => Res,
+ Constant_Present => False,
+ Object_Definition =>
+ New_Occurrence_Of (Typ, Loc))),
+
+ Handled_Statement_Sequence =>
+ Make_Handled_Sequence_Of_Statements (Loc,
+ Statements => New_List (
+ Make_Attribute_Reference (Loc,
+ Prefix => New_Occurrence_Of (Typ, Loc),
+ Attribute_Name => Name_Read,
+ Expressions => New_List (
+ Make_Attribute_Reference (Loc,
+ Prefix =>
+ New_Occurrence_Of (Strm, Loc),
+ Attribute_Name => Name_Access),
+ New_Occurrence_Of (Res, Loc))),
+ Make_Procedure_Call_Statement (Loc,
+ Name =>
+ New_Occurrence_Of
+ (RTE (RE_Release_Buffer), Loc),
+ Parameter_Associations =>
+ New_List (New_Occurrence_Of (Strm, Loc))),
+ Make_Simple_Return_Statement (Loc,
+ Expression => New_Occurrence_Of (Res, Loc))))));
+ end if;
end;
end if;