diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2021-01-05 18:32:05 +0100 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2021-05-04 05:17:31 -0400 |
commit | 43758c2cffeaa2eddd46ead7224a3dda24cab48f (patch) | |
tree | 32f4a391673f4d6463eecdcdebad505812800362 | |
parent | 13112239f8d4e4b2f27fdd9698df558614b4321c (diff) | |
download | gcc-43758c2cffeaa2eddd46ead7224a3dda24cab48f.zip gcc-43758c2cffeaa2eddd46ead7224a3dda24cab48f.tar.gz gcc-43758c2cffeaa2eddd46ead7224a3dda24cab48f.tar.bz2 |
[Ada] Simplify use of a global name buffer for Global/Depends errors
gcc/ada/
* sem_prag.adb (Role_Error, Usage_Error): Replace calls to
Name_Find and Get_Name_String with a call to To_String.
-rw-r--r-- | gcc/ada/sem_prag.adb | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index 86a9754..2e747ef 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -1477,8 +1477,6 @@ package body Sem_Prag is (Item_Is_Input : Boolean; Item_Is_Output : Boolean) is - Error_Msg : Name_Id; - begin Name_Len := 0; @@ -1491,8 +1489,7 @@ package body Sem_Prag is Add_Str_To_Name_Buffer (" & cannot appear in dependence relation"); - Error_Msg := Name_Find; - SPARK_Msg_NE (Get_Name_String (Error_Msg), Item, Item_Id); + SPARK_Msg_NE (To_String (Global_Name_Buffer), Item, Item_Id); Error_Msg_Name_1 := Chars (Spec_Id); SPARK_Msg_NE @@ -1521,8 +1518,8 @@ package body Sem_Prag is end if; Add_Str_To_Name_Buffer (" in dependence relation"); - Error_Msg := Name_Find; - SPARK_Msg_NE (Get_Name_String (Error_Msg), Item, Item_Id); + + SPARK_Msg_NE (To_String (Global_Name_Buffer), Item, Item_Id); end if; end Role_Error; @@ -1574,8 +1571,6 @@ package body Sem_Prag is ----------------- procedure Usage_Error (Item_Id : Entity_Id) is - Error_Msg : Name_Id; - begin -- Input case @@ -1593,8 +1588,7 @@ package body Sem_Prag is Add_Str_To_Name_Buffer (" & is missing from input dependence list"); - Error_Msg := Name_Find; - SPARK_Msg_NE (Get_Name_String (Error_Msg), N, Item_Id); + SPARK_Msg_NE (To_String (Global_Name_Buffer), N, Item_Id); SPARK_Msg_NE ("\add `null ='> &` dependency to ignore this input", N, Item_Id); @@ -1609,8 +1603,7 @@ package body Sem_Prag is Add_Str_To_Name_Buffer (" & is missing from output dependence list"); - Error_Msg := Name_Find; - SPARK_Msg_NE (Get_Name_String (Error_Msg), N, Item_Id); + SPARK_Msg_NE (To_String (Global_Name_Buffer), N, Item_Id); end if; end Usage_Error; |