diff options
author | Robert Dewar <dewar@adacore.com> | 2007-10-15 15:53:48 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2007-10-15 15:53:48 +0200 |
commit | 67ce0d7e96fd6802815643dbfb8505fad5318e95 (patch) | |
tree | a52f2a80bd9bc0b3d34328c89d877fdc3113b84f /gcc/ada/sem_util.ads | |
parent | f3bc37238b942ce0e901d3bdc6c93a5b776a9a2b (diff) | |
download | gcc-67ce0d7e96fd6802815643dbfb8505fad5318e95.zip gcc-67ce0d7e96fd6802815643dbfb8505fad5318e95.tar.gz gcc-67ce0d7e96fd6802815643dbfb8505fad5318e95.tar.bz2 |
s-taprop-solaris.adb, [...]: Minor reformatting.
2007-10-15 Robert Dewar <dewar@adacore.com>
* s-taprop-solaris.adb, s-taprop-vms.adb, s-taprop-mingw.adb,
s-taprop-vxworks.adb, s-taprop-posix.adb, a-calend-vms.adb,
a-calend.adb, a-nuflra.adb, a-tigeau.adb, a-wtgeau.adb,
checks.adb, bindgen.adb, eval_fat.adb, exp_fixd.adb, fmap.adb,
freeze.adb, g-awk.adb, g-calend.adb, g-diopit.adb, g-expect.adb,
gnatchop.adb, gnatlink.adb, g-spipat.adb, g-thread.adb, make.adb,
mdll.adb, mlib.adb, mlib-prj.adb, osint.adb, par-ch3.adb, prj.adb,
prj-makr.adb, sem_prag.adb, sem_type.adb, s-fatgen.adb, s-fileio.adb,
sinfo.ads, sinput-d.adb, s-taasde.adb, s-tasdeb.ads, s-tasren.adb,
s-tassta.adb, s-tpobop.adb, s-tposen.adb, stylesw.adb, types.ads,
uintp.adb, validsw.adb, makegpr.adb, a-rbtgso.adb, a-crbtgo.adb,
a-coorse.adb, a-convec.adb, a-coinve.adb, a-cohama.adb, a-ciorse.adb,
a-cihama.adb, a-cidlli.adb, a-chtgop.adb, a-cdlili.adb, a-cdlili.adb,
a-coormu.adb, a-ciormu.adb, a-cihase.adb, a-cohase.adb, a-ciorma.adb,
a-coorma.adb, a-ztgeau.adb, symbols-vms.adb, a-crdlli.adb,
a-calari.adb, a-calfor.adb, s-os_lib.adb, s-regpat.adb, a-ngrear.adb:
Minor reformatting.
Add Unreferenced and Warnings (Off) pragmas for cases of
variables modified calls where they are IN OUT or OUT parameters and
the resulting values are not subsequently referenced. In a few cases,
we also remove redundant code found by the new warnings.
* ug_words, vms_data.ads, usage.adb, sem_util.adb, sem_util.ads,
sem_warn.adb, sem_warn.ads, sem_res.adb, sem_ch7.adb, sem_ch8.adb,
sem_ch5.adb, opt.ads, lib-xref.adb, lib-xref.ads, exp_smem.adb,
sem_ch11.adb, exp_ch6.adb, einfo.ads, einfo.adb: implement a new
warning controlled by -gnatw.o that warns on cases of out parameter
values being ignored.
From-SVN: r129318
Diffstat (limited to 'gcc/ada/sem_util.ads')
-rw-r--r-- | gcc/ada/sem_util.ads | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/gcc/ada/sem_util.ads b/gcc/ada/sem_util.ads index c0ce298..1e02325 100644 --- a/gcc/ada/sem_util.ads +++ b/gcc/ada/sem_util.ads @@ -283,6 +283,17 @@ package Sem_Util is -- adds additional continuation lines to the message explaining -- why type T is limited. Messages are placed at node N. + procedure Find_Actual_Mode + (N : Node_Id; + Kind : out Entity_Kind; + Call : out Node_Id); + -- Determines if the node N is an actual parameter of a procedure call. If + -- so, then Kind is E_In_Parameter, E_Out_Parameter, E_In_Out_Parameter on + -- return as appropriate, and Call is set to the node for the corresponding + -- call. If the node N is not an actual parameter, then Kind = E_Void, Call + -- = Empty. Note that this only applies to procedure calls, for function + -- calls, the result is always E_Void. + function Find_Corresponding_Discriminant (Id : Node_Id; Typ : Entity_Id) return Entity_Id; @@ -743,7 +754,7 @@ package Sem_Util is -- here is for something actually declared as volatile, not for an object -- that gets treated as volatile (see Einfo.Treat_As_Volatile). - procedure Kill_Current_Values; + procedure Kill_Current_Values (Last_Assignment_Only : Boolean := False); -- This procedure is called to clear all constant indications from all -- entities in the current scope and in any parent scopes if the current -- scope is a block or a package (and that recursion continues to the top @@ -756,11 +767,24 @@ package Sem_Util is -- Kill_All_Checks, since this is a special case of needing to forget saved -- values. This procedure also clears Is_Known_Non_Null flags in variables, -- constants or parameters since these are also not known to be valid. - - procedure Kill_Current_Values (Ent : Entity_Id); + -- + -- The Last_Assignment_Only flag is set True to clear only Last_Assignment + -- fields and leave other fields unchanged. This is used when we encounter + -- an unconditional flow of control change (return, goto, raise). In such + -- cases we don't need to clear the current values, since it may be that + -- the flow of control change occurs in a conditional context, and if it + -- is not taken, then it is just fine to keep the current values. But the + -- Last_Assignment field is different, if we have a sequence assign-to-v, + -- conditional-return, assign-to-v, we do not want to complain that the + -- second assignment clobbers the first. + + procedure Kill_Current_Values + (Ent : Entity_Id; + Last_Assignment_Only : Boolean := False); -- This performs the same processing as described above for the form with -- no argument, but for the specific entity given. The call has no effect - -- if the entity Ent is not for an object. + -- if the entity Ent is not for an object. Again, Last_Assignment_Only is + -- set if you want to clear only the Last_Assignment field (see above). procedure Kill_Size_Check_Code (E : Entity_Id); -- Called when an address clause or pragma Import is applied to an |