]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Follow-on efficiency improvements
authorBob Duff <duff@adacore.com>
Fri, 30 Jul 2021 20:49:37 +0000 (16:49 -0400)
committerPierre-Marie de Rodat <derodat@adacore.com>
Thu, 23 Sep 2021 13:06:14 +0000 (13:06 +0000)
gcc/ada/

* gen_il-gen.adb: Set the number of concrete nodes that have the
Homonym field to a higher number than any other field. This
isn't true, but it forces Homonym's offset to be chosen first,
so it will be at offset zero and hence slot zero.

gcc/ada/gen_il-gen.adb

index 95fb526f5f2e26cf23af894ec70d99f5c7d21563..2fbec00e5486557fa90e97c34aa390a05e0ee3cc 100644 (file)
@@ -1036,6 +1036,13 @@ package body Gen_IL.Gen is
             Append (All_Fields, F);
          end loop;
 
+         --  Force Homonym to be at offset zero, which speeds up the
+         --  compiler. The Sort below will place Homonym first in
+         --  All_Fields.
+
+         Num_Concrete_Have_Field (Homonym) :=
+           Num_Concrete_Have_Field (Nkind) + 1;
+
          --  Sort All_Fields based on how many concrete types have the field.
          --  This is for efficiency; we want to choose the offsets of the most
          --  common fields first, so they get low numbers.