[Ada] Minor tweaks in Repinfo
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 11 Jun 2018 09:15:47 +0000 (09:15 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Mon, 11 Jun 2018 09:15:47 +0000 (09:15 +0000)
2018-06-11  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

* repinfo.ads (Rep_Value): Use a single line.
* repinfo.adb (Rep_Value): Likewise.
(List_Attr): Do not use string concatenation.

From-SVN: r261395

gcc/ada/ChangeLog
gcc/ada/repinfo.adb
gcc/ada/repinfo.ads

index ea2c131..e219120 100644 (file)
@@ -1,3 +1,9 @@
+2018-06-11  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * repinfo.ads (Rep_Value): Use a single line.
+       * repinfo.adb (Rep_Value): Likewise.
+       (List_Attr): Do not use string concatenation.
+
 2018-06-11  Ed Schonberg  <schonberg@adacore.com>
 
        * exp_unst.adb (Visit_Node): Check reference to formal parameter of
index 6c8af05..9b10a38 100644 (file)
@@ -1772,11 +1772,15 @@ package body Repinfo is
       begin
          if List_Representation_Info_To_JSON then
             Write_Line (",");
-            Write_Str ("  """ & Attr_Name & """: ""System.");
+            Write_Str ("  """);
+            Write_Str (Attr_Name);
+            Write_Str (""": ""System.");
          else
             Write_Str ("for ");
             List_Name (Ent);
-            Write_Str ("'" & Attr_Name & " use System.");
+            Write_Char (''');
+            Write_Str (Attr_Name);
+            Write_Str (" use System.");
          end if;
 
          if Bytes_Big_Endian xor Is_Reversed then
@@ -1962,10 +1966,8 @@ package body Repinfo is
    -- Rep_Value --
    ---------------
 
-   function Rep_Value
-     (Val : Node_Ref_Or_Val;
-      D   : Discrim_List) return Uint
-   is
+   function Rep_Value (Val : Node_Ref_Or_Val; D : Discrim_List) return Uint is
+
       function B (Val : Boolean) return Uint;
       --  Returns Uint_0 for False, Uint_1 for True
 
index 79f93f9..feda436 100644 (file)
@@ -379,9 +379,7 @@ package Repinfo is
    type Discrim_List is array (Pos range <>) of Uint;
    --  Type used to represent list of discriminant values
 
-   function Rep_Value
-     (Val : Node_Ref_Or_Val;
-      D   : Discrim_List) return Uint;
+   function Rep_Value (Val : Node_Ref_Or_Val; D : Discrim_List) return Uint;
    --  Given the contents of a First_Bit_Position or Esize field containing
    --  a node reference (i.e. a negative Uint value) and D, the list of
    --  discriminant values, returns the interpreted value of this field.