From: Piotr Trojanek Date: Wed, 20 Jan 2021 11:41:16 +0000 (+0100) Subject: [Ada] Use high-level Make_Character_Literal instead of low-level New_Node X-Git-Tag: basepoints/gcc-13~7766 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ef4a0de035ac0eb7ede9e6581c3aa40f8596e8bf;p=thirdparty%2Fgcc.git [Ada] Use high-level Make_Character_Literal instead of low-level New_Node gcc/ada/ * sem_case.adb (Missing_Choice): Fix typo in comment. (Lit_Of): Simplify with Make_Character_Literal. (Check_Choices): Remove extra spaces in parameter specifications. * sem_case.ads: Same reformatting. --- diff --git a/gcc/ada/sem_case.adb b/gcc/ada/sem_case.adb index df30610170ba..f4a0716a7e95 100644 --- a/gcc/ada/sem_case.adb +++ b/gcc/ada/sem_case.adb @@ -696,7 +696,7 @@ package body Sem_Case is elsif Value1 > Value2 then return; - -- If predicate is already known to be violated, do no check for + -- If predicate is already known to be violated, do not check for -- coverage error, to prevent cascaded messages. elsif Predicate_Error then @@ -1069,9 +1069,10 @@ package body Sem_Case is if Is_Standard_Character_Type (Choice_Type) then Set_Character_Literal_Name (Char_Code (UI_To_Int (Value))); - Lit := New_Node (N_Character_Literal, Loc); - Set_Chars (Lit, Name_Find); - Set_Char_Literal_Value (Lit, Value); + Lit := + Make_Character_Literal (Loc, + Chars => Name_Find, + Char_Literal_Value => Value); Set_Etype (Lit, Choice_Type); Set_Is_Static_Expression (Lit, True); return Lit; @@ -1319,10 +1320,10 @@ package body Sem_Case is ------------------- procedure Check_Choices - (N : Node_Id; - Alternatives : List_Id; - Subtyp : Entity_Id; - Others_Present : out Boolean) + (N : Node_Id; + Alternatives : List_Id; + Subtyp : Entity_Id; + Others_Present : out Boolean) is E : Entity_Id; diff --git a/gcc/ada/sem_case.ads b/gcc/ada/sem_case.ads index 00b7dd3fcd0d..7bde09da3b63 100644 --- a/gcc/ada/sem_case.ads +++ b/gcc/ada/sem_case.ads @@ -125,10 +125,10 @@ package Sem_Case is package Generic_Check_Choices is procedure Check_Choices - (N : Node_Id; - Alternatives : List_Id; - Subtyp : Entity_Id; - Others_Present : out Boolean); + (N : Node_Id; + Alternatives : List_Id; + Subtyp : Entity_Id; + Others_Present : out Boolean); -- From a case expression, case statement, or record variant N, this -- routine analyzes the corresponding list of discrete choices which -- appear in each element of the list Alternatives (for the variant