[Ada] Reuse standard expansion of 'First and 'Last in GNATprove mode
authorPiotr Trojanek <trojanek@adacore.com>
Wed, 12 Feb 2020 10:00:38 +0000 (11:00 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Mon, 8 Jun 2020 07:50:57 +0000 (03:50 -0400)
2020-06-08  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

* exp_spark.adb (Expand_SPARK_N_Attribute_Reference): Apply
standard expansion to attributes First and Last.

gcc/ada/exp_spark.adb

index 5257f29..a54a162 100644 (file)
@@ -295,6 +295,13 @@ package body Exp_SPARK is
                      Make_Explicit_Dereference (Loc, Relocate_Node (Pref)));
             Analyze_And_Resolve (N, Standard_Boolean);
          end if;
+
+      --  For attributes First and Last simply reuse the standard expansion
+
+      elsif Attr_Id = Attribute_First
+        or else Attr_Id = Attribute_Last
+      then
+         Exp_Attr.Expand_N_Attribute_Reference (N);
       end if;
    end Expand_SPARK_N_Attribute_Reference;