diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2021-01-20 12:41:16 +0100 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2021-05-06 03:51:36 -0400 |
commit | ef4a0de035ac0eb7ede9e6581c3aa40f8596e8bf (patch) | |
tree | 173b0298c8492ebbafa12422946a691b95930295 | |
parent | e84d25c9955dfe71b401f85291a56fa7f6375b0c (diff) | |
download | gcc-ef4a0de035ac0eb7ede9e6581c3aa40f8596e8bf.zip gcc-ef4a0de035ac0eb7ede9e6581c3aa40f8596e8bf.tar.gz gcc-ef4a0de035ac0eb7ede9e6581c3aa40f8596e8bf.tar.bz2 |
[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.
-rw-r--r-- | gcc/ada/sem_case.adb | 17 | ||||
-rw-r--r-- | gcc/ada/sem_case.ads | 8 |
2 files changed, 13 insertions, 12 deletions
diff --git a/gcc/ada/sem_case.adb b/gcc/ada/sem_case.adb index df30610..f4a0716 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 00b7dd3..7bde09d 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 |