Commit 76b382d9 by Eric Botcazou Committed by Pierre-Marie de Rodat

[Ada] Minor cleanup in repinfo unit

This factors out the various cases where a marker for an unknown value is
output by the -gnatR switches.  No functional changes.

2018-05-29  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* repinfo.adb (Write_Unknown_Val): New procedure.
	(List_GCC_Expression): Call it.
	(List_Record_Layout): Likewise.
	(Write_Val): Likewise.

From-SVN: r260866
parent c35c40e7
2018-05-29 Eric Botcazou <ebotcazou@adacore.com>
* repinfo.adb (Write_Unknown_Val): New procedure.
(List_GCC_Expression): Call it.
(List_Record_Layout): Likewise.
(Write_Val): Likewise.
2018-05-29 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* exp_ch4.adb (Expand_N_Op_Abs): Clear Do_Overflow_Check when inserting
......
......@@ -189,6 +189,9 @@ package body Repinfo is
procedure Write_Mechanism (M : Mechanism_Type);
-- Writes symbolic string for mechanism represented by M
procedure Write_Unknown_Val;
-- Writes symbolic string for an unknown or non-representable value
procedure Write_Val (Val : Node_Ref_Or_Val; Paren : Boolean := False);
-- Given a representation value, write it out. No_Uint values or values
-- dependent on discriminants are written as two question marks. If the
......@@ -653,7 +656,7 @@ package body Repinfo is
begin
if U = No_Uint then
Write_Str ("??");
Write_Unknown_Val;
else
Print_Expr (U);
end if;
......@@ -1111,7 +1114,7 @@ package body Repinfo is
-- Otherwise we can continue
else
Write_Str ("??");
Write_Unknown_Val;
end if;
end if;
......@@ -1128,8 +1131,8 @@ package body Repinfo is
-- Allowing Uint_0 here is an annoying special case. Really
-- this should be a fine Esize value but currently it means
-- unknown, except that we know after gigi has back annotated
-- that a size of zero is real, since otherwise gigi back
-- annotates using No_Uint as the value to indicate unknown).
-- that a size of zero is real, since otherwise gigi back
-- annotates using No_Uint as the value to indicate unknown.
if (Esize (Comp) = Uint_0 or else Known_Static_Esize (Comp))
and then Known_Static_Normalized_First_Bit (Comp)
......@@ -1151,7 +1154,7 @@ package body Repinfo is
elsif List_Representation_Info < 3
or else (Esize (Comp) /= Uint_0 and then Unknown_Esize (Comp))
then
Write_Str ("??");
Write_Unknown_Val;
-- List_Representation >= 3 and Known_Esize (Comp)
......@@ -1674,6 +1677,15 @@ package body Repinfo is
end case;
end Write_Mechanism;
-----------------------
-- Write_Unknown_Val --
-----------------------
procedure Write_Unknown_Val is
begin
Write_Str ("??");
end Write_Unknown_Val;
---------------
-- Write_Val --
---------------
......@@ -1682,7 +1694,7 @@ package body Repinfo is
begin
if Rep_Not_Constant (Val) then
if List_Representation_Info < 3 or else Val = No_Uint then
Write_Str ("??");
Write_Unknown_Val;
else
if Paren then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment