summaryrefslogtreecommitdiff
path: root/gcc/config/glibc-stdint.h
diff options
context:
space:
mode:
authorSteve Baird <baird@adacore.com>2021-06-30 16:42:54 -0700
committerPierre-Marie de Rodat <derodat@adacore.com>2021-09-21 15:24:56 +0000
commit3598c8db4045d17705f845561517f74bf877a2e4 (patch)
treece4f30b2ef15034be4d6da524d7fc2f93595679e /gcc/config/glibc-stdint.h
parent2528d0c7ce0536b3299f6a7452195362002c1a8c (diff)
downloadgcc-3598c8db4045d17705f845561517f74bf877a2e4.tar.gz
[Ada] Refactor sort procedures of doubly linked list containers
gcc/ada/ * libgnat/a-costso.ads, libgnat/a-costso.adb: A new library unit, Ada.Containers.Stable_Sorting, which exports a pair of generics (one within the other) which are instantiated by each of the 5 doubly-linked list container generics to implement their respective Sort procedures. We use a pair of generics, rather than a single generic, in order to further reduce code duplication. The outer generic takes a formal private Node_Ref type representing a reference to a linked list element. For some instances, the corresponding actual parameter will be an access type; for others, it will be the index type for an array. * Makefile.rtl: Include new Ada.Containers.Stable_Sorting unit. * libgnat/a-cbdlli.adb, libgnat/a-cdlili.adb, libgnat/a-cfdlli.adb, libgnat/a-cidlli.adb, libgnat/a-crdlli.adb (Sort): Replace existing Sort implementation with a call to an instance of Ada.Containers.Stable_Sorting.Doubly_Linked_List_Sort. Declare the (trivial) actual parameters needed to declare that instance. * libgnat/a-cfdlli.ads: Fix a bug encountered during testing in the postcondition for M_Elements_Sorted. With a partial ordering, it is possible for all three of (X < Y), (Y < X), and (X = Y) to be simultaneously false, so that case needs to handled correctly.
Diffstat (limited to 'gcc/config/glibc-stdint.h')
0 files changed, 0 insertions, 0 deletions