diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-12-11 16:21:39 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-12-11 16:21:39 +0000 |
commit | 723bead6da199c0d0263b70e2923bd7fadec3fc3 (patch) | |
tree | 64c0eb57dcbb9ffb0c50f048966f75d1cf517d45 /gcc/ada/sem_prag.adb | |
parent | 83c6c1460858efba95b28fff36bf193ea4a51cca (diff) | |
download | gcc-723bead6da199c0d0263b70e2923bd7fadec3fc3.tar.gz |
2003-12-11 Ed Falis <falis@gnat.com>
* 5zinit.adb: Clean up.
* 5zintman.adb (Notify_Exception): replaced case statement with a call
to __gnat_map_signal, imported from init.c to support
signal -> exception mappings that depend on the vxWorks version.
* init.c:
Created and exported __gnat_map_signal to support signal -> exception
mapping that is dependent on the VxWorks version.
Change mapping of SIGBUS from Program_Error to Storage_Error on VxWorks
2003-12-11 Vasiliy Fofanv <fofanov@act-europe.fr>
* 5wosinte.ads: Link with -mthreads switch.
2003-12-11 Arnaud Charlet <charlet@act-europe.fr>
* init.c (__gnat_install_handler [NetBSD]): Set
__gnat_handler_installed, as done on all other platforms.
Remove duplicated code.
2003-12-11 Jerome Guitton <guitton@act-europe.fr>
* Makefile.in (rts-zfp, rts-ravenscar): Create libgnat.a.
2003-12-11 Thomas Quinot <quinot@act-europe.fr>
* sinfo.ads: Fix inconsistent example code in comment.
2003-12-11 Robert Dewar <dewar@gnat.com>
* a-tiinau.adb: Add a couple of comments
* sem_ch3.adb: Minor reformatting
* sem_prag.adb:
Fix bad prototype of Same_Base_Type in body (code reading cleanup)
Minor reformatting throughout
2003-12-11 Ed Schonberg <schonberg@gnat.com>
* exp_ch7.adb (Establish_Transient_Scope): If the call is within the
bounds of a loop, create a separate block in order to generate proper
cleanup actions to prevent memory leaks.
* sem_res.adb (Resolve_Call): After a call to
Establish_Transient_Scope, the call may be rewritten and relocated, in
which case no further processing is needed.
* sem_util.adb: (Wrong_Type): Refine previous fix.
Fixes ACATS regressions.
PR ada/13353
* sem_prag.adb (Back_End_Cannot_Inline): A renaming_as_body can always
be inlined.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@74541 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_prag.adb')
-rw-r--r-- | gcc/ada/sem_prag.adb | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index 77235fd8502..f080512468b 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -432,8 +432,7 @@ package body Sem_Prag is function Is_Before_First_Decl (Pragma_Node : Node_Id; - Decls : List_Id) - return Boolean; + Decls : List_Id) return Boolean; -- Return True if Pragma_Node is before the first declarative item in -- Decls where Decls is the list of declarative items. @@ -1122,7 +1121,6 @@ package body Sem_Prag is when N_Index_Or_Discriminant_Constraint => declare IDC : Entity_Id := First (Constraints (Constr)); - begin while Present (IDC) loop Check_Static_Constraint (IDC); @@ -1506,8 +1504,7 @@ package body Sem_Prag is function Is_Before_First_Decl (Pragma_Node : Node_Id; - Decls : List_Id) - return Boolean + Decls : List_Id) return Boolean is Item : Node_Id := First (Decls); @@ -2185,8 +2182,7 @@ package body Sem_Prag is function Same_Base_Type (Ptype : Node_Id; - Formal : Entity_Id) - return Boolean; + Formal : Entity_Id) return Boolean; -- Determines if Ptype references the type of Formal. Note that -- only the base types need to match according to the spec. Ptype -- here is the argument from the pragma, which is either a type @@ -2196,7 +2192,10 @@ package body Sem_Prag is -- Same_Base_Type -- -------------------- - function Same_Base_Type (Ptype, Formal : Entity_Id) return Boolean is + function Same_Base_Type + (Ptype : Node_Id; + Formal : Entity_Id) return Boolean + is Ftyp : constant Entity_Id := Base_Type (Etype (Formal)); Pref : Node_Id; @@ -2823,9 +2822,8 @@ package body Sem_Prag is if Nkind (Parent (N)) = N_Compilation_Unit_Aux then declare Cunit : constant Node_Id := Parent (Parent (N)); - begin - Set_Body_Required (Cunit, False); + Set_Body_Required (Cunit, False); end; end if; end Process_Import_Or_Interface; @@ -2869,10 +2867,21 @@ package body Sem_Prag is elsif Nkind (Decl) = N_Subprogram_Declaration and then Present (Corresponding_Body (Decl)) then - return - Present (Exception_Handlers - (Handled_Statement_Sequence - (Unit_Declaration_Node (Corresponding_Body (Decl))))); + -- If the subprogram is a renaming as body, the body is + -- just a call to the renamed subprogram, and inlining is + -- trivially possible. + + if Nkind (Unit_Declaration_Node (Corresponding_Body (Decl))) = + N_Subprogram_Renaming_Declaration + then + return False; + + else + return + Present (Exception_Handlers + (Handled_Statement_Sequence + (Unit_Declaration_Node (Corresponding_Body (Decl))))); + end if; else -- If body is not available, assume the best, the check is -- performed again when compiling enclosing package bodies. @@ -3701,11 +3710,9 @@ package body Sem_Prag is declare Arg_Node : Node_Id; - begin Arg_Count := 0; Arg_Node := Arg1; - while Present (Arg_Node) loop Arg_Count := Arg_Count + 1; Next (Arg_Node); @@ -4480,7 +4487,6 @@ package body Sem_Prag is when Pragma_Convention => Convention : declare C : Convention_Id; E : Entity_Id; - begin Check_Ada_83_Warning; Check_Arg_Count (2); |