diff options
-rw-r--r-- | gcc/ada/ChangeLog | 22 | ||||
-rw-r--r-- | gcc/ada/a-reatim.adb | 8 | ||||
-rw-r--r-- | gcc/ada/exp_ch3.adb | 6 | ||||
-rw-r--r-- | gcc/ada/exp_pakd.adb | 6 | ||||
-rw-r--r-- | gcc/ada/i-cpoint.adb | 2 | ||||
-rw-r--r-- | gcc/ada/make.adb | 4 | ||||
-rw-r--r-- | gcc/ada/s-linux-alpha.ads | 1 | ||||
-rw-r--r-- | gcc/ada/s-linux-hppa.ads | 1 | ||||
-rw-r--r-- | gcc/ada/s-linux-mipsel.ads | 1 | ||||
-rw-r--r-- | gcc/ada/s-linux-sparc.ads | 1 | ||||
-rw-r--r-- | gcc/ada/s-linux-x32.ads | 5 | ||||
-rw-r--r-- | gcc/ada/s-linux.ads | 1 | ||||
-rw-r--r-- | gcc/ada/s-osinte-linux.ads | 14 | ||||
-rw-r--r-- | gcc/ada/s-taprop-linux.adb | 9 | ||||
-rw-r--r-- | gcc/ada/sem_ch8.adb | 13 | ||||
-rw-r--r-- | gcc/ada/sem_warn.adb | 7 |
16 files changed, 77 insertions, 24 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index c0e8fc2..ed5e352 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,25 @@ +2015-01-07 Robert Dewar <dewar@adacore.com> + + * a-reatim.adb, make.adb, exp_pakd.adb, i-cpoint.adb, sem_ch8.adb, + exp_ch3.adb: Minor reformatting. + +2015-01-07 Doug Rupp <rupp@adacore.com> + + * s-linux.ads (clockid_t): New subtype. + * s-osinte-linux.ads (pragma Linker Options): Add -lrt. + (clockid_t): New subtype. + (clock_getres): Import system call. + * s-taprop-linux.adb (System.OS_Constants): With and rename. + (RT_Resolution): Remove + hardcoded value and call clock_getres. + * s-linux-sparc.ads, s-linux-mipsel.ads, s-linux-hppa.ads, + s-linux-alpha.ads, s-linux-x32.ads (clockid_t): Add new subtype. + +2015-01-07 Robert Dewar <dewar@adacore.com> + + * sem_warn.adb (Check_One_Unit): Guard against context item + with no Entity field. + 2015-01-07 Vincent Celier <celier@adacore.com> * clean.adb (Gnatclean): Warn that 'gnatclean -P' is obsolete. diff --git a/gcc/ada/a-reatim.adb b/gcc/ada/a-reatim.adb index 1a233c4..4597dc3 100644 --- a/gcc/ada/a-reatim.adb +++ b/gcc/ada/a-reatim.adb @@ -222,8 +222,8 @@ package body Ada.Real_Time is -- the intermediate result Time (SC) we take advantage of the different -- signs in SC and TS (when that is the case). - -- If signs of SC and TS are different then we avoid converting SC to - -- Time (as we do in the else part). The reason for that is that SC + -- If the signs of SC and TS are different then we avoid converting SC + -- to Time (as we do in the else part). The reason for that is that SC -- converted to Time may overflow the range of Time, while the addition -- of SC plus TS does not overflow (because of their different signs). -- The approach is to add and remove the greatest value of time @@ -231,9 +231,7 @@ package body Ada.Real_Time is -- signs, so we add the positive constant to the negative value, and the -- negative constant to the positive value, to prevent overflows. - if (SC > 0 and then TS < 0.0) - or else (SC < 0 and then TS > 0.0) - then + if (SC > 0 and then TS < 0.0) or else (SC < 0 and then TS > 0.0) then declare Closest_Boundary : constant Seconds_Count := (if TS >= 0.0 then diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb index 74afb60..3ee51ef 100644 --- a/gcc/ada/exp_ch3.adb +++ b/gcc/ada/exp_ch3.adb @@ -2395,14 +2395,16 @@ package body Exp_Ch3 is declare Parent_IP : constant Name_Id := Make_Init_Proc_Name (Etype (Rec_Ent)); - Stmt : Node_Id := First (Stmts); - IP_Call : Node_Id := Empty; + Stmt : Node_Id; + IP_Call : Node_Id; IP_Stmts : List_Id; begin -- Look for a call to the parent IP at the beginning -- of Stmts associated with the record extension + Stmt := First (Stmts); + IP_Call := Empty; while Present (Stmt) loop if Nkind (Stmt) = N_Procedure_Call_Statement and then Chars (Name (Stmt)) = Parent_IP diff --git a/gcc/ada/exp_pakd.adb b/gcc/ada/exp_pakd.adb index cd592dc..d083611 100644 --- a/gcc/ada/exp_pakd.adb +++ b/gcc/ada/exp_pakd.adb @@ -765,9 +765,9 @@ package body Exp_Pakd is elsif not Is_Constrained (Typ) then -- When generating standard DWARF, the ___XP suffix will be stripped - -- by the back-end, but generate it anyway to ease compiler - -- debugging: this will help to distinguish implementation types from - -- original packed arrays. + -- by the back-end but generate it anyway to ease compiler debugging. + -- This will help to distinguish implementation types from original + -- packed arrays. PAT := Make_Defining_Identifier (Loc, diff --git a/gcc/ada/i-cpoint.adb b/gcc/ada/i-cpoint.adb index 39c7bef..8da412b 100644 --- a/gcc/ada/i-cpoint.adb +++ b/gcc/ada/i-cpoint.adb @@ -145,12 +145,14 @@ package body Interfaces.C.Pointers is is L : ptrdiff_t; S : Pointer := Source; + begin if Source = null or Target = null then raise Dereference_Error; end if; -- Compute array length (including the terminator) + L := 1; while S.all /= Terminator and then L < Limit loop L := L + 1; diff --git a/gcc/ada/make.adb b/gcc/ada/make.adb index 8bbe094..8fc4763 100644 --- a/gcc/ada/make.adb +++ b/gcc/ada/make.adb @@ -6490,8 +6490,8 @@ package body Make is if Project_File_Name /= null then Write_Line - ("warning: gnatmake -P is obsolete and will not be available " & - "in the next release. Use gprbuild instead."); + ("warning: gnatmake -P is obsolete and will not be available " + & "in the next release; use gprbuild instead"); end if; -- If --subdirs= is specified, but not -P, this is equivalent to -D, diff --git a/gcc/ada/s-linux-alpha.ads b/gcc/ada/s-linux-alpha.ads index e1c97ad..23ca44a 100644 --- a/gcc/ada/s-linux-alpha.ads +++ b/gcc/ada/s-linux-alpha.ads @@ -47,6 +47,7 @@ package System.Linux is subtype long is Interfaces.C.long; subtype suseconds_t is Interfaces.C.long; subtype time_t is Interfaces.C.long; + subtype clockid_t is Interfaces.C.int; type timespec is record tv_sec : time_t; diff --git a/gcc/ada/s-linux-hppa.ads b/gcc/ada/s-linux-hppa.ads index 8f7d811..d72c96e 100644 --- a/gcc/ada/s-linux-hppa.ads +++ b/gcc/ada/s-linux-hppa.ads @@ -47,6 +47,7 @@ package System.Linux is subtype long is Interfaces.C.long; subtype suseconds_t is Interfaces.C.long; subtype time_t is Interfaces.C.long; + subtype clockid_t is Interfaces.C.int; type timespec is record tv_sec : time_t; diff --git a/gcc/ada/s-linux-mipsel.ads b/gcc/ada/s-linux-mipsel.ads index 1799a55..17a3375 100644 --- a/gcc/ada/s-linux-mipsel.ads +++ b/gcc/ada/s-linux-mipsel.ads @@ -46,6 +46,7 @@ package System.Linux is subtype long is Interfaces.C.long; subtype suseconds_t is Interfaces.C.long; subtype time_t is Interfaces.C.long; + subtype clockid_t is Interfaces.C.int; type timespec is record tv_sec : time_t; diff --git a/gcc/ada/s-linux-sparc.ads b/gcc/ada/s-linux-sparc.ads index ae813e6..96c6714 100644 --- a/gcc/ada/s-linux-sparc.ads +++ b/gcc/ada/s-linux-sparc.ads @@ -47,6 +47,7 @@ package System.Linux is subtype long is Interfaces.C.long; subtype suseconds_t is Interfaces.C.long; subtype time_t is Interfaces.C.long; + subtype clockid_t is Interfaces.C.int; type timespec is record tv_sec : time_t; diff --git a/gcc/ada/s-linux-x32.ads b/gcc/ada/s-linux-x32.ads index 1b2d46e..6fb453c 100644 --- a/gcc/ada/s-linux-x32.ads +++ b/gcc/ada/s-linux-x32.ads @@ -36,6 +36,8 @@ -- PLEASE DO NOT add any with-clauses to this package or remove the pragma -- Preelaborate. This package is designed to be a bottom-level (leaf) package +with Interfaces.C; + package System.Linux is pragma Preelaborate; @@ -43,7 +45,8 @@ package System.Linux is -- Time -- ---------- - type time_t is new Long_Long_Integer; + type time_t is new Long_Long_Integer; + subtype clockid_t is Interfaces.C.int; type timespec is record tv_sec : time_t; diff --git a/gcc/ada/s-linux.ads b/gcc/ada/s-linux.ads index 8a49e8c..3b48284 100644 --- a/gcc/ada/s-linux.ads +++ b/gcc/ada/s-linux.ads @@ -47,6 +47,7 @@ package System.Linux is subtype long is Interfaces.C.long; subtype suseconds_t is Interfaces.C.long; subtype time_t is Interfaces.C.long; + subtype clockid_t is Interfaces.C.int; type timespec is record tv_sec : time_t; diff --git a/gcc/ada/s-osinte-linux.ads b/gcc/ada/s-osinte-linux.ads index d6930de..c71bebc 100644 --- a/gcc/ada/s-osinte-linux.ads +++ b/gcc/ada/s-osinte-linux.ads @@ -47,6 +47,8 @@ package System.OS_Interface is pragma Preelaborate; pragma Linker_Options ("-lpthread"); + pragma Linker_Options ("-lrt"); + -- Needed for clock_getres with glibc versions prior to 2.17 subtype int is Interfaces.C.int; subtype char is Interfaces.C.char; @@ -217,9 +219,15 @@ package System.OS_Interface is -- Time -- ---------- - subtype time_t is System.Linux.time_t; - subtype timespec is System.Linux.timespec; - subtype timeval is System.Linux.timeval; + subtype time_t is System.Linux.time_t; + subtype timespec is System.Linux.timespec; + subtype timeval is System.Linux.timeval; + subtype clockid_t is System.Linux.clockid_t; + + function clock_getres + (clock_id : clockid_t; + res : access timespec) return int; + pragma Import (C, clock_getres, "clock_getres"); function To_Duration (TS : timespec) return Duration; pragma Inline (To_Duration); diff --git a/gcc/ada/s-taprop-linux.adb b/gcc/ada/s-taprop-linux.adb index a95013f..bf5e992 100644 --- a/gcc/ada/s-taprop-linux.adb +++ b/gcc/ada/s-taprop-linux.adb @@ -44,6 +44,7 @@ with Interfaces.C.Extensions; with System.Task_Info; with System.Tasking.Debug; with System.Interrupt_Management; +with System.OS_Constants; with System.OS_Primitives; with System.Stack_Checking.Operations; with System.Multiprocessors; @@ -56,6 +57,7 @@ with System.Soft_Links; package body System.Task_Primitives.Operations is + package OSC renames System.OS_Constants; package SSL renames System.Soft_Links; package SC renames System.Stack_Checking.Operations; @@ -658,8 +660,13 @@ package body System.Task_Primitives.Operations is ------------------- function RT_Resolution return Duration is + TS : aliased timespec; + Result : int; begin - return 10#1.0#E-6; + Result := clock_getres (OSC.CLOCK_REALTIME, TS'Unchecked_Access); + pragma Assert (Result = 0); + + return To_Duration (TS); end RT_Resolution; ------------ diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb index 2b4f528..bd01588 100644 --- a/gcc/ada/sem_ch8.adb +++ b/gcc/ada/sem_ch8.adb @@ -2710,16 +2710,15 @@ package body Sem_Ch8 is -- Check whether the renaming is for a defaulted actual subprogram -- with a class-wide actual. - -- The class-wide wrapper is not needed when we are in - -- GNATprove_Mode and there is an external axiomatization on the - -- package. + -- The class-wide wrapper is not needed in GNATprove_Mode and there + -- is an external axiomatization on the package. if CW_Actual and then Box_Present (Inst_Node) - and then not (GNATprove_Mode - and then - Present (Containing_Package_With_Ext_Axioms - (Formal_Spec))) + and then not + (GNATprove_Mode + and then + Present (Containing_Package_With_Ext_Axioms (Formal_Spec))) then Build_Class_Wide_Wrapper (New_S, Old_S); diff --git a/gcc/ada/sem_warn.adb b/gcc/ada/sem_warn.adb index 7bdda64..4845096 100644 --- a/gcc/ada/sem_warn.adb +++ b/gcc/ada/sem_warn.adb @@ -2350,6 +2350,13 @@ package body Sem_Warn is if Nkind (Item) = N_With_Clause and then not Implicit_With (Item) and then In_Extended_Main_Source_Unit (Item) + + -- Guard for no entity present. Not clear under what conditions + -- this happens, but it does occur, and since this is only a + -- warning, we just suppress the warning in this case. + + and then Nkind (Name (Item)) in N_Has_Entity + and then Present (Entity (Name (Item))) then Lunit := Entity (Name (Item)); |