[Ada] Minor tweak in pretty-printing of expressions
authorYannick Moy <moy@adacore.com>
Fri, 8 Jan 2021 08:38:59 +0000 (09:38 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Tue, 4 May 2021 09:17:35 +0000 (05:17 -0400)
gcc/ada/

* pprint.adb (Expression_Image): Special case for
expression-with-actions.

gcc/ada/pprint.adb

index 696d4b3..5091a86 100644 (file)
@@ -682,7 +682,7 @@ package body Pprint is
          end case;
       end Expr_Name;
 
-   --  Start of processing for Expression_Name
+   --  Start of processing for Expression_Image
 
    begin
       if not From_Source then
@@ -697,6 +697,12 @@ package body Pprint is
          end;
       end if;
 
+      --  Reach to the underlying expression for an expression-with-actions
+
+      if Nkind (Expr) = N_Expression_With_Actions then
+         return Expression_Image (Expression (Expr), Default);
+      end if;
+
       --  Compute left (start) and right (end) slocs for the expression
       --  Consider using Sinput.Sloc_Range instead, except that it does not
       --  work properly currently???