Patchwork [Ada] Remove redundant tests for N_Operator_Symbol

login
register
mail settings
Submitter Arnaud Charlet
Date Oct. 4, 2010, 2:10 p.m.
Message ID <20101004141020.GA8309@adacore.com>
Download mbox | patch
Permalink /patch/66681/
State New
Headers show

Comments

Arnaud Charlet - Oct. 4, 2010, 2:10 p.m.
This just removes redundant tests for N_Operator_Symbol used conjunction with
the Is_Entity_Name predicate, which already returns true on N_Operator_Symbol.

No functional changes.

Tested on x86_64-pc-linux-gnu, committed on trunk

2010-10-04  Eric Botcazou  <ebotcazou@adacore.com>

	* sem_ch4.adb (Analyze_Indexed_Component_Form): Remove redundant test
	for N_Operator_Symbol.
	(Indicate_Name_And_Type): Likewise.
	* sem_ch8.adb (Analyze_Subprogram_Renaming): Likewise.
	* sem_res.adb (Resolve): Likewise.
	* sem_type.adb (Add_One_Interp): Likewise.
	(Disambiguate): Likewise.

Patch

Index: sem_type.adb
===================================================================
--- sem_type.adb	(revision 164906)
+++ sem_type.adb	(working copy)
@@ -482,8 +482,7 @@  package body Sem_Type is
 
          elsif (Nkind (N) = N_Function_Call
                  or else Nkind (N) = N_Procedure_Call_Statement)
-           and then (Nkind (Name (N)) = N_Operator_Symbol
-                      or else Is_Entity_Name (Name (N)))
+           and then Is_Entity_Name (Name (N))
          then
             Add_Entry (Entity (Name (N)), Etype (N));
 
@@ -1622,9 +1621,7 @@  package body Sem_Type is
                   Arg1 := Left_Opnd  (N);
                   Arg2 := Right_Opnd (N);
 
-               elsif Is_Entity_Name (N)
-                 or else Nkind (N) = N_Operator_Symbol
-               then
+               elsif Is_Entity_Name (N) then
                   Arg1 := First_Entity (Entity (N));
                   Arg2 := Next_Entity (Arg1);
 
Index: sem_res.adb
===================================================================
--- sem_res.adb	(revision 164938)
+++ sem_res.adb	(working copy)
@@ -2290,8 +2290,7 @@  package body Sem_Res is
                --  and also the entity pointer for the prefix.
 
                elsif Nkind_In (N, N_Procedure_Call_Statement, N_Function_Call)
-                 and then (Is_Entity_Name (Name (N))
-                            or else Nkind (Name (N)) = N_Operator_Symbol)
+                 and then Is_Entity_Name (Name (N))
                then
                   Set_Etype  (Name (N), Expr_Type);
                   Set_Entity (Name (N), Seen);
Index: sem_ch4.adb
===================================================================
--- sem_ch4.adb	(revision 164906)
+++ sem_ch4.adb	(working copy)
@@ -2103,9 +2103,7 @@  package body Sem_Ch4 is
 
       P_T := Base_Type (Etype (P));
 
-      if Is_Entity_Name (P)
-        or else Nkind (P) = N_Operator_Symbol
-      then
+      if Is_Entity_Name (P) then
          U_N := Entity (P);
 
          if Is_Type (U_N) then
@@ -2526,9 +2524,7 @@  package body Sem_Ch4 is
          --  being called is noted on the selector.
 
          if not Is_Type (Nam) then
-            if Is_Entity_Name (Name (N))
-              or else Nkind (Name (N)) = N_Operator_Symbol
-            then
+            if Is_Entity_Name (Name (N)) then
                Set_Entity (Name (N), Nam);
 
             elsif Nkind (Name (N)) = N_Selected_Component then
Index: sem_ch8.adb
===================================================================
--- sem_ch8.adb	(revision 164933)
+++ sem_ch8.adb	(working copy)
@@ -2078,8 +2078,7 @@  package body Sem_Ch8 is
          Analyze_Renamed_Character (N, New_S, Present (Rename_Spec));
          return;
 
-      elsif (not Is_Entity_Name (Nam)
-              and then Nkind (Nam) /= N_Operator_Symbol)
+      elsif not Is_Entity_Name (Nam)
         or else not Is_Overloadable (Entity (Nam))
       then
          Error_Msg_N ("expect valid subprogram name in renaming", N);