diff options
| author | Bob Duff <duff@adacore.com> | 2007-10-15 15:55:27 +0200 |
|---|---|---|
| committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2007-10-15 15:55:27 +0200 |
| commit | d4731b80de2a377fdbfa24dec34b15b5b680691c (patch) | |
| tree | 4b05e6da4711a3ed03e4096c21cd8542543f6ae5 /gcc/ada/sem_ch13.adb | |
| parent | 28eba57cf2cbcbce62d2551b53e057a76a5f1d89 (diff) | |
| download | gcc-d4731b80de2a377fdbfa24dec34b15b5b680691c.zip gcc-d4731b80de2a377fdbfa24dec34b15b5b680691c.tar.gz gcc-d4731b80de2a377fdbfa24dec34b15b5b680691c.tar.bz2 | |
sem_case.adb, [...]: Replace use of Heap_Sort_A (passing'Unrestricted_Access of nested subprograms...
2007-10-15 Bob Duff <duff@adacore.com>
* sem_case.adb, sem_ch13.adb, lib-sort.adb: Replace use of Heap_Sort_A
(passing'Unrestricted_Access of nested subprograms to Sort) with use of
the generic Heap_Sort_G, in order to avoid trampolines.
From-SVN: r129327
Diffstat (limited to 'gcc/ada/sem_ch13.adb')
| -rw-r--r-- | gcc/ada/sem_ch13.adb | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index a632d0d..df61a8e 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -54,7 +54,7 @@ with Ttypes; use Ttypes; with Tbuild; use Tbuild; with Urealp; use Urealp; -with GNAT.Heap_Sort_A; use GNAT.Heap_Sort_A; +with GNAT.Heap_Sort_G; package body Sem_Ch13 is @@ -296,13 +296,15 @@ package body Sem_Ch13 is declare Comps : array (0 .. Num_CC) of Entity_Id; -- Array to collect component and discrimninant entities. The data - -- starts at index 1, the 0'th entry is for GNAT.Heap_Sort_A. + -- starts at index 1, the 0'th entry is for the sort routine. function CP_Lt (Op1, Op2 : Natural) return Boolean; - -- Compare routine for Sort (See GNAT.Heap_Sort_A) + -- Compare routine for Sort procedure CP_Move (From : Natural; To : Natural); - -- Move routine for Sort (see GNAT.Heap_Sort_A) + -- Move routine for Sort + + package Sorting is new GNAT.Heap_Sort_G (CP_Move, CP_Lt); Start : Natural; Stop : Natural; @@ -353,7 +355,7 @@ package body Sem_Ch13 is -- Sort by ascending position number - Sort (Num_CC, CP_Move'Unrestricted_Access, CP_Lt'Unrestricted_Access); + Sorting.Sort (Num_CC); -- We now have all the components whose size does not exceed the max -- machine scalar value, sorted by starting position. In this loop @@ -1107,7 +1109,7 @@ package body Sem_Ch13 is if VM_Target = No_VM then Set_Has_External_Tag_Rep_Clause (U_Ent); - else + elsif not Inspector_Mode then Error_Msg_Name_1 := Attr; Error_Msg_N ("% attribute unsupported in this configuration", Nam); @@ -1169,8 +1171,10 @@ package body Sem_Ch13 is -- Object_Size attribute definition clause when Attribute_Object_Size => Object_Size : declare - Size : constant Uint := Static_Integer (Expr); + Size : constant Uint := Static_Integer (Expr); + Biased : Boolean; + pragma Warnings (Off, Biased); begin if not Is_Type (U_Ent) then @@ -2438,10 +2442,12 @@ package body Sem_Ch13 is -- Count of entries in OC_Fbit and OC_Lbit function OC_Lt (Op1, Op2 : Natural) return Boolean; - -- Compare routine for Sort (See GNAT.Heap_Sort_A) + -- Compare routine for Sort procedure OC_Move (From : Natural; To : Natural); - -- Move routine for Sort (see GNAT.Heap_Sort_A) + -- Move routine for Sort + + package Sorting is new GNAT.Heap_Sort_G (OC_Move, OC_Lt); function OC_Lt (Op1, Op2 : Natural) return Boolean is begin @@ -2476,10 +2482,7 @@ package body Sem_Ch13 is Next (CC); end loop; - Sort - (OC_Count, - OC_Move'Unrestricted_Access, - OC_Lt'Unrestricted_Access); + Sorting.Sort (OC_Count); Overlap_Check_Required := False; for J in 1 .. OC_Count - 1 loop |
