aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/exp_ch2.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2009-07-27 15:20:37 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2009-07-27 15:20:37 +0200
commit75ba322d4b345347a789f169532e50c9bd388971 (patch)
tree6e8682c976a9051e2545f9219739a10e43057474 /gcc/ada/exp_ch2.adb
parentb1c44a93c7ab94df11875c0e3d8a086e7860869f (diff)
downloadgcc-75ba322d4b345347a789f169532e50c9bd388971.zip
gcc-75ba322d4b345347a789f169532e50c9bd388971.tar.gz
gcc-75ba322d4b345347a789f169532e50c9bd388971.tar.bz2
[multiple changes]
2009-07-27 Robert Dewar <dewar@adacore.com> * exp_ch6.adb (Expand_Call): Reset Is_Known_Valid after call * sem_ch3.adb, sem_eval.adb, sem_aux.adb: Minor comment reformatting 2009-07-27 Geert Bosch <bosch@adacore.com> * checks.adb (Find_Check): Minor streamlining of logic. * gnat1drv.adb(Gnat1drv): Put Check_Rep_Info in its alphabetical order. * debug.adb: Document -gnatdX debug flag * exp_ch2.adb(Expand_Entity_Reference): Implement new -gnatdX flag to list information about reads from scalar entities. Also slightly simplify condition for Expand_Current_Value. * sem_util.ads, sem_util.adb (Is_LHS, Is_Actual_Out_Parameter): New functions. From-SVN: r150110
Diffstat (limited to 'gcc/ada/exp_ch2.adb')
-rw-r--r--gcc/ada/exp_ch2.adb32
1 files changed, 27 insertions, 5 deletions
diff --git a/gcc/ada/exp_ch2.adb b/gcc/ada/exp_ch2.adb
index 5d1822d..9d475e2 100644
--- a/gcc/ada/exp_ch2.adb
+++ b/gcc/ada/exp_ch2.adb
@@ -24,6 +24,7 @@
------------------------------------------------------------------------------
with Atree; use Atree;
+with Debug; use Debug;
with Einfo; use Einfo;
with Elists; use Elists;
with Errout; use Errout;
@@ -34,12 +35,14 @@ with Exp_VFpt; use Exp_VFpt;
with Namet; use Namet;
with Nmake; use Nmake;
with Opt; use Opt;
+with Output; use Output;
with Sem; use Sem;
with Sem_Eval; use Sem_Eval;
with Sem_Res; use Sem_Res;
with Sem_Util; use Sem_Util;
with Sem_Warn; use Sem_Warn;
with Sinfo; use Sinfo;
+with Sinput; use Sinput;
with Snames; use Snames;
with Tbuild; use Tbuild;
with Uintp; use Uintp;
@@ -370,13 +373,32 @@ package body Exp_Ch2 is
Expand_Shared_Passive_Variable (N);
end if;
+ -- Test code for implementing the pragma Reviewable requirement of
+ -- classifying reads of scalars as referencing potentially uninitialized
+ -- objects or not.
+
+ if Debug_Flag_XX
+ and then Is_Scalar_Type (Etype (N))
+ and then (Is_Assignable (E) or else Is_Constant_Object (E))
+ and then Comes_From_Source (N)
+ and then not Is_LHS (N)
+ and then not Is_Actual_Out_Parameter (N)
+ and then (Nkind (Parent (N)) /= N_Attribute_Reference
+ or else Attribute_Name (Parent (N)) /= Name_Valid)
+ then
+ Write_Location (Sloc (N));
+ Write_Str (": Read from scalar """);
+ Write_Name (Chars (N));
+ Write_Str ("""");
+ if Is_Known_Valid (E) then
+ Write_Str (", Is_Known_Valid");
+ end if;
+ Write_Eol;
+ end if;
+
-- Interpret possible Current_Value for variable case
- if (Ekind (E) = E_Variable
- or else
- Ekind (E) = E_In_Out_Parameter
- or else
- Ekind (E) = E_Out_Parameter)
+ if Is_Assignable (E)
and then Present (Current_Value (E))
then
Expand_Current_Value (N);