summaryrefslogtreecommitdiff
path: root/gcc/ada/layout.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2004-02-18 11:52:55 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2004-02-18 11:52:55 +0000
commit8b20af99cceb12742aa1581d0082be01934b3861 (patch)
treeab088861e5fc012e91fec0d42b6282779d593f5c /gcc/ada/layout.adb
parentbfacbdb8e407d7c37e6bd588b2390c683facafa7 (diff)
downloadgcc-8b20af99cceb12742aa1581d0082be01934b3861.tar.gz
2004-02-18 Emmanuel Briot <briot@act-europe.fr>
* ali.ads, ali.adb (First_Sdep_Entry): No longer a constant, so that Scan_ALI can be used for multiple ALI files without reinitializing between calls. 2004-02-18 Robert Dewar <dewar@gnat.com> * debug.adb: Minor reformatting. 2004-02-18 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * decl.c (gnat_to_gnu_entity, case object): Set DECL_POINTER_ALIAS_SET to zero if there is an address clause. 2004-02-18 Thomas Quinot <quinot@act-europe.fr> * exp_util.adb (Side_Effect_Free): Any literal is side effects free. 2004-02-18 Gary Dismukes <dismukes@gnat.com> * layout.adb (Layout_Component_List): Revise generation of call to discriminant-checking function to pass selections of all of the type's discriminants rather than just the variant-controlling discriminant. 2004-02-18 Olivier Hainque <hainque@act-europe.fr> * 5gmastop.adb (Pop_Frame): Do not call exc_unwind, which is bound to fail in the current setup and triggers spurious system error messages. Pretend it occurred and failed instead. 2004-02-18 Vincent Celier <celier@gnat.com> * bld.adb: Mark FLDFLAGS as saved (Process_Declarative_Items): Add Linker'Linker_Options to FLDFLAGS when it is not the root project. Put each directory to be extended between double quotes to prevent it to be expanded on Windows. (Recursive_Process): Reset CFLAGS/CXXFLAGS to nothing before processing the project file. Set them back to their initial values if they have not been set in the project file. * gprcmd.adb: (Gprdebug, Debug): New global variables (Display_Command): New procedure (Usage): Document new command "linkopts" Call Display_Command when env var GPRDEBUG has the value "TRUE" Implement new command "linkopts" Remove quotes that may be around arguments for "extend" Always call Normalize_Pathname with arguments formatted for the platform * Makefile.generic: Link C/C++ mains with $(FLDFLAGS) Change @echo to @$(display) in target clean to be able to clean silently * Makefile.prolog: Save FLDFLAGS and give it an initial empty value * prj-part.adb (Project_Path_Name_Of): Do not put final result in canonical case. * prj-part.adb (Parse_Single_Project): Always call with From_Extended = Extending_All when current project is an extending all project. * vms_conv.adb (Output_File_Expected): New Boolean global variable, set to True only for LINK command, after Unix switch -o. (Process_Arguments): Set Output_File_Expected to True for LINK command after Unix switch -o. When Output_File_Expected is True, never add an extension to a file name. * 5vml-tgt.adb (Build_Dynamic_Library): Do not append "/OPTIONS" to the option file name, only to the --for-linker= switch. (Option_File_Name): If option file name do not end with ".opt", append "/OPTIONS". 2004-02-18 GNAT Script <nobody@gnat.com> * Make-lang.in: Makefile automatically updated git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@78024 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/layout.adb')
-rw-r--r--gcc/ada/layout.adb55
1 files changed, 38 insertions, 17 deletions
diff --git a/gcc/ada/layout.adb b/gcc/ada/layout.adb
index df310323931..119d184041c 100644
--- a/gcc/ada/layout.adb
+++ b/gcc/ada/layout.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2001-2003 Free Software Foundation, Inc. --
+-- Copyright (C) 2001-2004 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -1980,11 +1980,13 @@ package body Layout is
else
declare
- EsizV : SO_Ref;
- RM_SizV : Node_Id;
- Dchoice : Node_Id;
- Discrim : Node_Id;
- Dtest : Node_Id;
+ EsizV : SO_Ref;
+ RM_SizV : Node_Id;
+ Dchoice : Node_Id;
+ Discrim : Node_Id;
+ Dtest : Node_Id;
+ D_List : List_Id;
+ D_Entity : Entity_Id;
begin
RM_Siz_Expr := Empty;
@@ -2052,16 +2054,6 @@ package body Layout is
-- Otherwise construct the appropriate test
else
- -- Discriminant to be tested
-
- Discrim :=
- Make_Selected_Component (Loc,
- Prefix =>
- Make_Identifier (Loc, Chars => Vname),
- Selector_Name =>
- New_Occurrence_Of
- (Entity (Name (Vpart)), Loc));
-
-- The test to be used in general is a call to the
-- discriminant checking function. However, it is
-- definitely worth special casing the very common
@@ -2072,6 +2064,16 @@ package body Layout is
if No (Next (Dchoice))
and then Nkind (Dchoice) /= N_Range
then
+ -- Discriminant to be tested
+
+ Discrim :=
+ Make_Selected_Component (Loc,
+ Prefix =>
+ Make_Identifier (Loc, Chars => Vname),
+ Selector_Name =>
+ New_Occurrence_Of
+ (Entity (Name (Vpart)), Loc));
+
Dtest :=
Make_Op_Eq (Loc,
Left_Opnd => Discrim,
@@ -2083,6 +2085,25 @@ package body Layout is
-- False when the passed discriminant value matches.
else
+ -- The checking function takes all of the type's
+ -- discriminants as parameters, so a list of all
+ -- the selected discriminants must be constructed.
+
+ D_List := New_List;
+ D_Entity := First_Discriminant (E);
+ while Present (D_Entity) loop
+ Append (
+ Make_Selected_Component (Loc,
+ Prefix =>
+ Make_Identifier (Loc, Chars => Vname),
+ Selector_Name =>
+ New_Occurrence_Of
+ (D_Entity, Loc)),
+ D_List);
+
+ D_Entity := Next_Discriminant (D_Entity);
+ end loop;
+
Dtest :=
Make_Op_Not (Loc,
Right_Opnd =>
@@ -2091,7 +2112,7 @@ package body Layout is
New_Occurrence_Of
(Dcheck_Function (Var), Loc),
Parameter_Associations =>
- New_List (Discrim)));
+ D_List));
end if;
RM_Siz_Expr :=