aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_res.adb
diff options
context:
space:
mode:
authorJustin Squirek <squirek@adacore.com>2021-12-09 17:06:20 +0000
committerPierre-Marie de Rodat <derodat@adacore.com>2022-01-07 16:24:13 +0000
commit72a29376c63172540576bd9b1d20f5c7c0e42cf3 (patch)
treed89ba0df82e77fdccc8d5236f819bda97624049c /gcc/ada/sem_res.adb
parente2b07ba054daa896795e0932626f259c87417ec0 (diff)
downloadgcc-72a29376c63172540576bd9b1d20f5c7c0e42cf3.zip
gcc-72a29376c63172540576bd9b1d20f5c7c0e42cf3.tar.gz
gcc-72a29376c63172540576bd9b1d20f5c7c0e42cf3.tar.bz2
[Ada] Cleanup and modification of unreferenced warnings
gcc/ada/ * comperr.adb (Delete_SCIL_Files): Replace unnecessary Unreferenced pragma with specific pragma Warnings. * doc/gnat_rm/implementation_defined_pragmas.rst (Unreferenced): Add documentation for new behavior. * gnat_rm.texi: Regenerate. * erroutc.adb (Set_At): Remove useless assignment. * exp_ch2.adb (In_Assignment_Context): Deleted. (Is_Object_Renaming_Name): Replace calls to Is_LHS with calls to Known_To_Be_Assigned. (Expand_Current_Value): Replace calls to May_Be_Lvalue with calls to Known_To_Be_Assigned. (Expand_Entry_Paramter): Replace calls to In_Assignment_Context with calls to Known_To_Be_Assigned. * exp_ch4.adb (Expand_N_Op_Rem): Remove unnecessary Unreferenced pragma. * exp_imgv.adb (Build_Enumeration_Image_Tables): Default initialize S_N. * ghost.adb (Check_Ghost_Policy): Replace call to May_Be_Lvalue with call to Known_To_Be_Assigned. * lib-xref.adb (Is_On_LHS): Deleted. (OK_To_Set_Referenced): Rewrite subprogram to encompass the new pragma Unreferenced behavior. (Process_Deferred_References): Replace call to Is_LHS with call to Known_To_Be_Assigned. * libgnarl/s-taasde.adb, libgnarl/s-tasren.adb, libgnarl/s-tpobop.adb, libgnat/a-calend.adb, libgnat/a-calfor.adb, libgnat/a-cbdlli.adb, libgnat/a-cbhama.adb, libgnat/a-cbhase.adb, libgnat/a-cbmutr.adb, libgnat/a-cborma.adb, libgnat/a-cborse.adb, libgnat/a-cdlili.adb, libgnat/a-cfhama.adb, libgnat/a-cforse.adb, libgnat/a-cidlli.adb, libgnat/a-cihama.adb, libgnat/a-cihase.adb, libgnat/a-cimutr.adb, libgnat/a-ciorma.adb, libgnat/a-ciormu.adb, libgnat/a-ciorse.adb, libgnat/a-cohama.adb, libgnat/a-cohase.adb, libgnat/a-comutr.adb, libgnat/a-convec.adb, libgnat/a-coorma.adb, libgnat/a-coormu.adb, libgnat/a-coorse.adb, libgnat/a-crdlli.adb, libgnat/a-tigeau.adb, libgnat/a-wtgeau.adb, libgnat/a-ztgeau.adb, libgnat/g-calend.adb, libgnat/g-comlin.adb, libgnat/g-expect.adb, libgnat/g-mbflra.adb, libgnat/g-spipat.adb, libgnat/s-fatgen.adb, libgnat/s-fileio.adb, libgnat/s-os_lib.adb, libgnat/s-regpat.adb, libgnat/s-valued.adb, libgnat/s-valuer.adb: Remove unnecessary Unreferenced pragmas * sem_ch10.adb (Process_Spec_Clauses): Remove useless assignments. * sem_ch13.adb (Validate_Literal_Aspect): Default initialize I. * sem_ch3.adb (Build_Derived_Concurrent_Type): Default initialize Corr_Decl. * sem_ch8.adb (Undefined): Replace calls to Is_LHS with calls to Known_To_Be_Assigned. (In_Abstract_View_Pragma): Likewise. * sem_eval.adb (Eval_Selected_Component): Replace calls to Is_LHS with calls to Known_To_Be_Assigned. * sem_res.adb (Init_Component): Replace calls to May_Be_Lvalue with calls to Known_To_Be_Assigned. * sem_util.adb, sem_util.ads (End_Label_Loc): Default initialize Owner. (Explain_Limited_Type): Default initialize Expr_Func. (Find_Actual): Modified to handle entry families. (Is_LHS): Deleted. (May_Be_Lvalue): Deleted. (Known_To_Be_Assigned): Modified and improved to handle all cases. * sem_warn.adb (Traverse_Result): Replace calls to May_Be_Lvalue with calls to Known_To_Be_Assigned. (Check_Ref): Modify error on unreferenced out parameters to take into account different warning flags.
Diffstat (limited to 'gcc/ada/sem_res.adb')
-rw-r--r--gcc/ada/sem_res.adb4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index d05da0d..843e820 100644
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -11070,7 +11070,7 @@ package body Sem_Res is
-- resolution was complete to do this, since otherwise we can't tell if
-- we are an lvalue or not.
- if May_Be_Lvalue (N) then
+ if Known_To_Be_Assigned (N) then
Generate_Reference (Entity (S), S, 'm');
else
Generate_Reference (Entity (S), S, 'r');
@@ -11096,7 +11096,7 @@ package body Sem_Res is
if Is_Entity_Name (P)
and then Has_Deferred_Reference (Entity (P))
then
- if May_Be_Lvalue (N) then
+ if Known_To_Be_Assigned (N) then
Generate_Reference (Entity (P), P, 'm');
else
Generate_Reference (Entity (P), P, 'r');