Commit 72da915b by Eric Botcazou Committed by Pierre-Marie de Rodat

[Ada] Minor cleanup in repinfo unit

This removes the Truth_Andif_Expr and Truth_Orif_Expr codes for expressions
handled by the repinfo unit, since they are redundant with Truth_And_Expr
and Truth_Or_Expr respectively in this context.  No functional changes.

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

gcc/ada/

	* repinfo.ads (TCode): Adjust range.
	(Truth_Andif_Expr): Remove.
	(Truth_Orif_Expr): Likewise.
	(Truth_And_Expr .. Dynamic_Val): Adjust value.
	* repinfo.adb (Print_Expr): Remove handling of Truth_{And,Or}if_Expr.
	(Rep_Value): Likewise.
	* repinfo.h (Truth_Andif_Expr): Remove.
	(Truth_Orif_Expr): Likewise.
	(Truth_And_Expr .. Dynamic_Val): Adjust value.
	* gcc-interface/decl.c (annotate_value) <TRUTH_ANDIF_EXPR>: Fall
	through to TRUTH_AND_EXPR case.
	<TRUTH_ORIF_EXPR>: Fall through to TRUTH_OR_EXPR case.

From-SVN: r260842
parent 184a6ba6
2018-05-28 Eric Botcazou <ebotcazou@adacore.com>
* repinfo.ads (TCode): Adjust range.
(Truth_Andif_Expr): Remove.
(Truth_Orif_Expr): Likewise.
(Truth_And_Expr .. Dynamic_Val): Adjust value.
* repinfo.adb (Print_Expr): Remove handling of Truth_{And,Or}if_Expr.
(Rep_Value): Likewise.
* repinfo.h (Truth_Andif_Expr): Remove.
(Truth_Orif_Expr): Likewise.
(Truth_And_Expr .. Dynamic_Val): Adjust value.
* gcc-interface/decl.c (annotate_value) <TRUTH_ANDIF_EXPR>: Fall
through to TRUTH_AND_EXPR case.
<TRUTH_ORIF_EXPR>: Fall through to TRUTH_OR_EXPR case.
2018-05-28 Ed Schonberg <schonberg@adacore.com> 2018-05-28 Ed Schonberg <schonberg@adacore.com>
* exp_unst.adb (Visit_Node): For indexed components and attribute * exp_unst.adb (Visit_Node): For indexed components and attribute
......
...@@ -8132,9 +8132,9 @@ annotate_value (tree gnu_size) ...@@ -8132,9 +8132,9 @@ annotate_value (tree gnu_size)
case MIN_EXPR: tcode = Min_Expr; break; case MIN_EXPR: tcode = Min_Expr; break;
case MAX_EXPR: tcode = Max_Expr; break; case MAX_EXPR: tcode = Max_Expr; break;
case ABS_EXPR: tcode = Abs_Expr; break; case ABS_EXPR: tcode = Abs_Expr; break;
case TRUTH_ANDIF_EXPR: tcode = Truth_Andif_Expr; break; case TRUTH_ANDIF_EXPR:
case TRUTH_ORIF_EXPR: tcode = Truth_Orif_Expr; break;
case TRUTH_AND_EXPR: tcode = Truth_And_Expr; break; case TRUTH_AND_EXPR: tcode = Truth_And_Expr; break;
case TRUTH_ORIF_EXPR:
case TRUTH_OR_EXPR: tcode = Truth_Or_Expr; break; case TRUTH_OR_EXPR: tcode = Truth_Or_Expr; break;
case TRUTH_XOR_EXPR: tcode = Truth_Xor_Expr; break; case TRUTH_XOR_EXPR: tcode = Truth_Xor_Expr; break;
case TRUTH_NOT_EXPR: tcode = Truth_Not_Expr; break; case TRUTH_NOT_EXPR: tcode = Truth_Not_Expr; break;
......
...@@ -621,12 +621,6 @@ package body Repinfo is ...@@ -621,12 +621,6 @@ package body Repinfo is
when Abs_Expr => when Abs_Expr =>
Unop ("abs "); Unop ("abs ");
when Truth_Andif_Expr =>
Binop (" and if ");
when Truth_Orif_Expr =>
Binop (" or if ");
when Truth_And_Expr => when Truth_And_Expr =>
Binop (" and "); Binop (" and ");
...@@ -1554,12 +1548,6 @@ package body Repinfo is ...@@ -1554,12 +1548,6 @@ package body Repinfo is
when Abs_Expr => when Abs_Expr =>
return UI_Abs (V (Node.Op1)); return UI_Abs (V (Node.Op1));
when Truth_Andif_Expr =>
return B (T (Node.Op1) and then T (Node.Op2));
when Truth_Orif_Expr =>
return B (T (Node.Op1) or else T (Node.Op2));
when Truth_And_Expr => when Truth_And_Expr =>
return B (T (Node.Op1) and then T (Node.Op2)); return B (T (Node.Op1) and then T (Node.Op2));
......
...@@ -136,7 +136,7 @@ package Repinfo is ...@@ -136,7 +136,7 @@ package Repinfo is
-- Subtype used for values that can either be a Node_Ref (negative) -- Subtype used for values that can either be a Node_Ref (negative)
-- or a value (non-negative) -- or a value (non-negative)
type TCode is range 0 .. 29; type TCode is range 0 .. 27;
-- Type used on Ada side to represent DEFTREECODE values defined in -- Type used on Ada side to represent DEFTREECODE values defined in
-- tree.def. Only a subset of these tree codes can actually appear. -- tree.def. Only a subset of these tree codes can actually appear.
-- The names are the names from tree.def in Ada casing. -- The names are the names from tree.def in Ada casing.
...@@ -153,24 +153,22 @@ package Repinfo is ...@@ -153,24 +153,22 @@ package Repinfo is
Trunc_Mod_Expr : constant TCode := 8; -- mod for trunc_div 2 Trunc_Mod_Expr : constant TCode := 8; -- mod for trunc_div 2
Ceil_Mod_Expr : constant TCode := 9; -- mod for ceil_div 2 Ceil_Mod_Expr : constant TCode := 9; -- mod for ceil_div 2
Floor_Mod_Expr : constant TCode := 10; -- mod for floor_div 2 Floor_Mod_Expr : constant TCode := 10; -- mod for floor_div 2
Exact_Div_Expr : constant TCode := 11; -- exact div 2 Exact_Div_Expr : constant TCode := 11; -- exact division 2
Negate_Expr : constant TCode := 12; -- negation 1 Negate_Expr : constant TCode := 12; -- negation 1
Min_Expr : constant TCode := 13; -- minimum 2 Min_Expr : constant TCode := 13; -- minimum 2
Max_Expr : constant TCode := 14; -- maximum 2 Max_Expr : constant TCode := 14; -- maximum 2
Abs_Expr : constant TCode := 15; -- absolute value 1 Abs_Expr : constant TCode := 15; -- absolute value 1
Truth_Andif_Expr : constant TCode := 16; -- Boolean and then 2 Truth_And_Expr : constant TCode := 16; -- boolean and 2
Truth_Orif_Expr : constant TCode := 17; -- Boolean or else 2 Truth_Or_Expr : constant TCode := 17; -- boolean or 2
Truth_And_Expr : constant TCode := 18; -- Boolean and 2 Truth_Xor_Expr : constant TCode := 18; -- boolean xor 2
Truth_Or_Expr : constant TCode := 19; -- Boolean or 2 Truth_Not_Expr : constant TCode := 19; -- boolean not 1
Truth_Xor_Expr : constant TCode := 20; -- Boolean xor 2 Lt_Expr : constant TCode := 20; -- comparison < 2
Truth_Not_Expr : constant TCode := 21; -- Boolean not 1 Le_Expr : constant TCode := 21; -- comparison <= 2
Lt_Expr : constant TCode := 22; -- comparison < 2 Gt_Expr : constant TCode := 22; -- comparison > 2
Le_Expr : constant TCode := 23; -- comparison <= 2 Ge_Expr : constant TCode := 23; -- comparison >= 2
Gt_Expr : constant TCode := 24; -- comparison > 2 Eq_Expr : constant TCode := 24; -- comparison = 2
Ge_Expr : constant TCode := 25; -- comparison >= 2 Ne_Expr : constant TCode := 25; -- comparison /= 2
Eq_Expr : constant TCode := 26; -- comparison = 2 Bit_And_Expr : constant TCode := 26; -- bitwise and 2
Ne_Expr : constant TCode := 27; -- comparison /= 2
Bit_And_Expr : constant TCode := 28; -- Binary and 2
-- The following entry is used to represent a discriminant value in -- The following entry is used to represent a discriminant value in
-- the tree. It has a special tree code that does not correspond -- the tree. It has a special tree code that does not correspond
...@@ -184,7 +182,7 @@ package Repinfo is ...@@ -184,7 +182,7 @@ package Repinfo is
-- has a special tree code that does not correspond directly to -- has a special tree code that does not correspond directly to
-- a GCC node. The single operand is an arbitrary index number. -- a GCC node. The single operand is an arbitrary index number.
Dynamic_Val : constant TCode := 29; -- dynamic value 1 Dynamic_Val : constant TCode := 27; -- dynamic value 1
------------------------ ------------------------
-- The gigi Interface -- -- The gigi Interface --
......
...@@ -58,20 +58,18 @@ typedef char TCode; ...@@ -58,20 +58,18 @@ typedef char TCode;
#define Min_Expr 13 #define Min_Expr 13
#define Max_Expr 14 #define Max_Expr 14
#define Abs_Expr 15 #define Abs_Expr 15
#define Truth_Andif_Expr 16 #define Truth_And_Expr 16
#define Truth_Orif_Expr 17 #define Truth_Or_Expr 17
#define Truth_And_Expr 18 #define Truth_Xor_Expr 18
#define Truth_Or_Expr 19 #define Truth_Not_Expr 19
#define Truth_Xor_Expr 20 #define Lt_Expr 20
#define Truth_Not_Expr 21 #define Le_Expr 21
#define Lt_Expr 22 #define Gt_Expr 22
#define Le_Expr 23 #define Ge_Expr 23
#define Gt_Expr 24 #define Eq_Expr 24
#define Ge_Expr 25 #define Ne_Expr 25
#define Eq_Expr 26 #define Bit_And_Expr 26
#define Ne_Expr 27 #define Dynamic_Val 27
#define Bit_And_Expr 28
#define Dynamic_Val 29
/* Creates a node using the tree code defined by Expr and from 1-3 /* Creates a node using the tree code defined by Expr and from 1-3
operands as required (unused operands set as shown to No_Uint) Note operands as required (unused operands set as shown to No_Uint) Note
......
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