diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2007-08-14 10:50:51 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2007-08-14 10:50:51 +0200 |
commit | 33c423c8b24c3f68cb92f95b6d2e1b9dde16ab5d (patch) | |
tree | bc637fac407ff7e642e0541a6da74fc5d842ee43 /gcc/ada/exp_ch7.adb | |
parent | 6d64bc378c6d5f95f5f76ea3e42e8c009f4b9b4d (diff) | |
download | gcc-33c423c8b24c3f68cb92f95b6d2e1b9dde16ab5d.zip gcc-33c423c8b24c3f68cb92f95b6d2e1b9dde16ab5d.tar.gz gcc-33c423c8b24c3f68cb92f95b6d2e1b9dde16ab5d.tar.bz2 |
[multiple changes]
2007-08-14 Geert Bosch <bosch@adacore.com>
* i-forbla.ads, i-forbla.adb, a-ngcoar.adb, a-ngcoar.ads, i-forlap.ads,
s-gearop.adb, s-gecobl.adb, s-gecobl.ads, s-gerela.adb, s-gerela.ads:
Add required linker pragmas for automatically linking with the gnalasup
linear algebra support library, and the systems math library.
Rename cdot to cdotu and zdot to zdotu.
Update header comment to describe purpose of package.
2007-08-14 Thomas Quinot <quinot@adacore.com>
* exp_ch7.adb (Find_Final_List): For an anonymous access type that has
an explicitly specified Associated_Final_Chain, use that list.
(Expand_N_Package_Body): Build dispatch tables of library level tagged
types.
(Expand_N_Package_Declaration): Build dispatch tables of library level
tagged types. Minor code cleanup.
2007-08-14 Vincent Celier <celier@adacore.com>
* gnatchop.adb (Terminate_Program): Remove exception and use
Types.Terminate_Program instead.
* osint.ads, osint.adb (Current_Exit_Status): New global variable
(Find_Program_Name): Added protection against empty name.
(OS_Exit_Through_Exception): New procedure
* s-os_lib.ads, s-os_lib.adb (OS_Exit): New procedure body
(OS_Exit_Default): New procedure that contains the previous
implementation of procedure OS_Exit.
(Final_Value): Remove obsolete Interix stuff.
2007-08-14 Thomas Quinot <quinot@adacore.com>
* g-socket.ads: Reorganize example code so that it also works on
Windows XP.
2007-08-14 Tristan Gingold <gingold@adacore.com>
* g-trasym.ads: AIX now supports symbolic backtraces.
2007-08-14 Ed Schonberg <schonberg@adacore.com>
* lib-load.adb (From_Limited_With_Chain): Always scan the stack of
units being loaded to detect circularities. A circularity may be
present even if the current chain of pending units to load starts from
a limited_with_clause.
* lib-load.ads: Change profile of Load_Unit to use a with_clause
rather than a boolean flag, in order to detect circularities in
with_clauses.
* par-load.adb: Use current with_clause in calls to Load_Unit, rather
than propagating the From_Limited_With flag, in order to handle
properly circularities involving with_clauses.
2007-08-14 Nicolas Setton <setton@adacore.com>
* link.c (FreeBSD): Add "const" keyword where needed, to eliminate
warnings.
2007-08-14 Arnaud Charlet <charlet@adacore.com>
* Makefile.in: GNATRTL_LINEARALGEBRA_OBJS: New variable holding objects
to build for libgnala.
libgnat: Add rules to build libgnala.a
(LIBGNAT_TARGET_PAIRS for VxWorks): Remove s-osinte-vxworks.adb from
target pairs of the VxWorks 6 kernel runtime, use it only for VxWorks 5.
Add s-osinte-vxworks-kernel.adb to the target pairs of the
kernel run-time lib for VxWorks 6, which would provide a different
implementation for Task_Cont and Task_Stop than the VxWorks 5 version.
x86-solaris section (EH_MECHANISM): Set to -gcc, as this port is now
running ZCX by default.
Add g-sttsne-locking to LynxOS version.
Remove g-sttsne-vxworks.ads; use g-sttsne-locking.ads instead.
On x86/darwin, use a-numaux-x86.ad? and system-darwin-x86.ads.
* system-darwin-x86.ads: New file.
* Make-lang.in: Delete files before copying onto them, so if they are
read-only, the copy won't fail.
Update dependencies
2007-08-14 Pascal Obry <obry@adacore.com>
* mdll-fil.adb, * mdll.adb: Implement a more consistent libraries
naming scheme.
2007-08-14 Vincent Celier <celier@adacore.com>
* mlib-utl.adb (Gcc_Name): Change from constant String to String_Access
(Gcc): Initialize Gcc_Name at the first call
2007-08-14 Ed Schonberg <schonberg@adacore.com>
* sem_ch7.adb (Analyze_Package_Specification): Do not install private
with_clauses of the enclosing unit when analyzing the package
specification of a nested instance.
2007-08-14 Hristian Kirtchev <kirtchev@adacore.com>
* sinfo.ads, sinfo.adb (Is_Coextension, Set_Is_Coextension): Removed.
(Is_Dynamic_Coextension, Set_Is_Dynamic_Coextension): New routines.
Remove flag Is_Coextension. Add flag Is_Dynamic_Coextension. Update the
layout of N_Allocator.
2007-08-14 Thomas Quinot <quinot@adacore.com>
* rtsfind.adb (Check_RPC): Add PCS version check.
* gnatvsn.ads, gnatvsn.adb: Add PCS version.
(Gnat_Free_Software): New function.
* sem_dist.ads, sem_dist.adb (Get_PCS_Version): New subprogram. Returns
the PCS_Version value from s-parint, used to check that it is consistent
with what exp_dist expects.
* s-parint.ads (PCS_Version): New entity for checking consistency
between exp_dist and PCS.
* gen-soccon.c: (SO_REUSEPORT): New constant.
2007-08-14 Hristian Kirtchev <kirtchev@adacore.com>
* a-calfor.adb (Image (Duration; Boolean)): Change type of local
variable Sub_Second to Duration in order to accomodate a larger range
of arithmetic operations.
2007-08-14 Bob Duff <duff@adacore.com>
* g-sttsne-locking.ads: Move comments from spec to body.
* g-sttsne-locking.adb: Move comments from spec to body.
* g-sttsne-vxworks.ads: Removed.
* g-sttsne-vxworks.adb: Removed.
From-SVN: r127467
Diffstat (limited to 'gcc/ada/exp_ch7.adb')
-rw-r--r-- | gcc/ada/exp_ch7.adb | 87 |
1 files changed, 52 insertions, 35 deletions
diff --git a/gcc/ada/exp_ch7.adb b/gcc/ada/exp_ch7.adb index 6dcfae8..4dc1164 100644 --- a/gcc/ada/exp_ch7.adb +++ b/gcc/ada/exp_ch7.adb @@ -36,6 +36,7 @@ with Exp_Ch9; use Exp_Ch9; with Exp_Ch11; use Exp_Ch11; with Exp_Dbug; use Exp_Dbug; with Exp_Dist; use Exp_Dist; +with Exp_Disp; use Exp_Disp; with Exp_Tss; use Exp_Tss; with Exp_Util; use Exp_Util; with Freeze; use Freeze; @@ -310,7 +311,7 @@ package body Exp_Ch7 is -- Here is a simple example of the expansion of a controlled block : -- declare - -- X : Controlled ; + -- X : Controlled; -- Y : Controlled := Init; -- -- type R is record @@ -369,10 +370,10 @@ package body Exp_Ch7 is -- end; function Global_Flist_Ref (Flist_Ref : Node_Id) return Boolean; - -- Return True if Flist_Ref refers to a global final list, either - -- the object GLobal_Final_List which is used to attach standalone - -- objects, or any of the list controllers associated with library - -- level access to controlled objects + -- Return True if Flist_Ref refers to a global final list, either the + -- object Global_Final_List which is used to attach standalone objects, + -- or any of the list controllers associated with library-level access + -- to controlled objects. procedure Clean_Simple_Protected_Objects (N : Node_Id); -- Protected objects without entries are not controlled types, and the @@ -1415,12 +1416,12 @@ package body Exp_Ch7 is -- Start of processing for Expand_Ctrl_Function_Call begin - -- Optimization, if the returned value (which is on the sec-stack) - -- is returned again, no need to copy/readjust/finalize, we can just - -- pass the value thru (see Expand_N_Return_Statement), and thus no + -- Optimization, if the returned value (which is on the sec-stack) is + -- returned again, no need to copy/readjust/finalize, we can just pass + -- the value thru (see Expand_N_Simple_Return_Statement), and thus no -- attachment is needed - if Nkind (Parent (N)) = N_Return_Statement then + if Nkind (Parent (N)) = N_Simple_Return_Statement then return; end if; @@ -1579,6 +1580,13 @@ package body Exp_Ch7 is if Ekind (Ent) = E_Package then Push_Scope (Corresponding_Spec (N)); + + -- Build dispatch tables of library level tagged types + + if Is_Compilation_Unit (Ent) then + Build_Static_Dispatch_Tables (N); + end if; + Build_Task_Activation_Call (N); Pop_Scope; end if; @@ -1595,23 +1603,21 @@ package body Exp_Ch7 is -- Expand_N_Package_Declaration -- ---------------------------------- - -- Add call to Activate_Tasks if there are tasks declared and the - -- package has no body. Note that in Ada83, this may result in - -- premature activation of some tasks, given that we cannot tell - -- whether a body will eventually appear. + -- Add call to Activate_Tasks if there are tasks declared and the package + -- has no body. Note that in Ada83, this may result in premature activation + -- of some tasks, given that we cannot tell whether a body will eventually + -- appear. procedure Expand_N_Package_Declaration (N : Node_Id) is - Spec : constant Node_Id := Specification (N); + Spec : constant Node_Id := Specification (N); + Id : constant Entity_Id := Defining_Entity (N); Decls : List_Id; - - No_Body : Boolean; + No_Body : Boolean := False; -- True in the case of a package declaration that is a compilation unit -- and for which no associated body will be compiled in -- this compilation. - begin - - No_Body := False; + begin -- Case of a package declaration other than a compilation unit if Nkind (Parent (N)) /= N_Compilation_Unit then @@ -1620,7 +1626,7 @@ package body Exp_Ch7 is -- Case of a compilation unit that does not require a body elsif not Body_Required (Parent (N)) - and then not Unit_Requires_Body (Defining_Entity (N)) + and then not Unit_Requires_Body (Id) then No_Body := True; @@ -1631,7 +1637,7 @@ package body Exp_Ch7 is -- spec). elsif Parent (N) = Cunit (Main_Unit) - and then Is_Remote_Call_Interface (Defining_Entity (N)) + and then Is_Remote_Call_Interface (Id) and then Distribution_Stub_Mode = Generate_Caller_Stub_Body then No_Body := True; @@ -1642,9 +1648,9 @@ package body Exp_Ch7 is -- have a specific separate compilation unit for that). if No_Body then - Push_Scope (Defining_Entity (N)); + Push_Scope (Id); - if Has_RACW (Defining_Entity (N)) then + if Has_RACW (Id) then -- Generate RACW subprogram bodies @@ -1659,7 +1665,7 @@ package body Exp_Ch7 is Set_Visible_Declarations (Spec, Decls); end if; - Append_RACW_Bodies (Decls, Defining_Entity (N)); + Append_RACW_Bodies (Decls, Id); Analyze_List (Decls); end if; @@ -1673,6 +1679,15 @@ package body Exp_Ch7 is Pop_Scope; end if; + -- Build dispatch tables of library level tagged types + + if Is_Compilation_Unit (Id) + or else (Is_Generic_Instance (Id) + and then Is_Library_Level_Entity (Id)) + then + Build_Static_Dispatch_Tables (N); + end if; + -- Note: it is not necessary to worry about generating a subprogram -- descriptor, since the only way to get exception handlers into a -- package spec is to include instantiations, and that would cause @@ -1698,7 +1713,7 @@ package body Exp_Ch7 is begin -- Case of an internal component. The Final list is the record - -- controller of the enclosing record + -- controller of the enclosing record. if Present (Ref) then R := Ref; @@ -1741,7 +1756,9 @@ package body Exp_Ch7 is -- context is a declaration or an assignment. elsif Is_Access_Type (E) - and then Ekind (E) /= E_Anonymous_Access_Type + and then (Ekind (E) /= E_Anonymous_Access_Type + or else + Present (Associated_Final_Chain (E))) then if not From_With_Type (E) then return @@ -1775,15 +1792,15 @@ package body Exp_Ch7 is return New_Reference_To (RTE (RE_Global_Final_List), Sloc (E)); else if No (Finalization_Chain_Entity (S)) then - - Id := Make_Defining_Identifier (Sloc (S), - New_Internal_Name ('F')); + Id := + Make_Defining_Identifier (Sloc (S), + Chars => New_Internal_Name ('F')); Set_Finalization_Chain_Entity (S, Id); -- Set momentarily some semantics attributes to allow normal -- analysis of expansions containing references to this chain. -- Will be fully decorated during the expansion of the scope - -- itself + -- itself. Set_Ekind (Id, E_Variable); Set_Etype (Id, RTE (RE_Finalizable_Ptr)); @@ -1813,7 +1830,7 @@ package body Exp_Ch7 is -- Simple statement can be wrapped - when N_Pragma => + when N_Pragma => return The_Parent; -- Usually assignments are good candidate for wrapping @@ -1876,7 +1893,7 @@ package body Exp_Ch7 is N_Terminate_Alternative => return P; - when N_Attribute_Reference => + when N_Attribute_Reference => if Is_Procedure_Attribute_Name (Attribute_Name (The_Parent)) @@ -1888,7 +1905,7 @@ package body Exp_Ch7 is -- expression in a raise_with_expression uses the secondary -- stack, for example. - when N_Raise_Statement => + when N_Raise_Statement => return The_Parent; -- If the expression is within the iteration scheme of a loop, @@ -1909,7 +1926,7 @@ package body Exp_Ch7 is -- The return statement is not to be wrapped when the function -- itself needs wrapping at the outer-level - when N_Return_Statement => + when N_Simple_Return_Statement => declare Applies_To : constant Entity_Id := Return_Applies_To @@ -3139,7 +3156,7 @@ package body Exp_Ch7 is if VM_Target = No_VM and then Uses_Sec_Stack (Current_Scope) and then No (Flist) - and then Nkind (Action) /= N_Return_Statement + and then Nkind (Action) /= N_Simple_Return_Statement and then Nkind (Par) /= N_Exception_Handler then |