aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sinfo.adb
diff options
context:
space:
mode:
authorHristian Kirtchev <kirtchev@adacore.com>2017-11-16 13:17:19 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2017-11-16 13:17:19 +0000
commit7fb62ca1b7a7db0177e956b2d9f35d46789cfe70 (patch)
tree96292be8e6c39e5951bbadc87986bde4d634a44e /gcc/ada/sinfo.adb
parent403bc026aca65b22159955dd4df81eb9b2b407f4 (diff)
downloadgcc-7fb62ca1b7a7db0177e956b2d9f35d46789cfe70.zip
gcc-7fb62ca1b7a7db0177e956b2d9f35d46789cfe70.tar.gz
gcc-7fb62ca1b7a7db0177e956b2d9f35d46789cfe70.tar.bz2
opt.ads: Elaboration warnings are now on by default.
2017-11-16 Hristian Kirtchev <kirtchev@adacore.com> * opt.ads: Elaboration warnings are now on by default. Add a comment explaining why this is needed. * sem_ch9.adb (Analyze_Requeue): Preserve the status of elaboration warnings. * sem_ch12.adb (Analyze_Package_Instantiation): Preserve the status of elaboration warnings. (Analyze_Subprogram_Instantiation): Preserve the status of elaboration warnings. * sem_elab.adb: Update the structure of Call_Attributes and Instantiation_Attributes. (Build_Call_Marker): Propagate the status of elaboration warnings from the call to the marker. (Extract_Call_Attributes): Extract the status of elaboration warnings. (Extract_Instantiation_Attributes): Extract the status of elaboration warnings. (Process_Conditional_ABE_Activation_Impl): Elaboration diagnostics are now dependent on the status of elaboration warnings. (Process_Conditional_ABE_Call_Ada): Elaboration diagnostics are now dependent on the status of elaboration warnings. (Process_Conditional_ABE_Instantiation_Ada): Elaboration diagnostics are now dependent on the status of elaboration warnings. (Process_Guaranteed_ABE_Activation_Impl): Remove pragma Unreferenced for formal Call_Attrs. Elaboration diagnostics are now dependent on the status of elaboration warnings. (Process_Guaranteed_ABE_Call): Elaboration diagnostics are now dependent on the status of elaboration warnings. (Process_Guaranteed_ABE_Instantiation): Elaboration diagnostics are now dependent on the status of elaboration warnings. * sem_prag.adb (Analyze_Pragma): Remove the unjustified warning concerning pragma Elaborate. * sem_res.adb (Resolve_Call): Preserve the status of elaboration warnings. (Resolve_Entry_Call): Propagate flag Is_Elaboration_Warnings_OK_Node from the procedure call to the entry call. * sem_util.adb (Mark_Elaboration_Attributes): Add formal parameter Warnings. (Mark_Elaboration_Attributes_Node): Preserve the status of elaboration warnings * sem_util.ads (Mark_Elaboration_Attributes): Add formal parameter Warnings. Update the comment on usage. * sinfo.adb (Is_Dispatching_Call): Update to use Flag6. (Is_Elaboration_Warnings_OK_Node): New routine. (Set_Is_Dispatching_Call): Update to use Flag6. (Set_Is_Elaboration_Warnings_OK_Node): New routine. * sinfo.ads: Attribute Is_Dispatching_Call now uses Flag6. Add new attribute Is_Elaboration_Warnings_OK_Node along with occurrences in nodes. (Is_Elaboration_Warnings_OK_Node): New routine along with pragma Inline. (Set_Is_Elaboration_Warnings_OK_Node): New routine along with pragma Inline. * doc/gnat_ugn/elaboration_order_handling_in_gnat.rst: Update various sections to indicate how to suppress elaboration warnings. Document switches -gnatwl and -gnatwL. * gnat_ugn.texi: Regenerate. From-SVN: r254819
Diffstat (limited to 'gcc/ada/sinfo.adb')
-rw-r--r--gcc/ada/sinfo.adb34
1 files changed, 32 insertions, 2 deletions
diff --git a/gcc/ada/sinfo.adb b/gcc/ada/sinfo.adb
index 06f62c5..afb3ece 100644
--- a/gcc/ada/sinfo.adb
+++ b/gcc/ada/sinfo.adb
@@ -1886,7 +1886,7 @@ package body Sinfo is
begin
pragma Assert (False
or else NT (N).Nkind = N_Call_Marker);
- return Flag3 (N);
+ return Flag6 (N);
end Is_Dispatching_Call;
function Is_Dynamic_Coextension
@@ -1933,6 +1933,21 @@ package body Sinfo is
return Flag9 (N);
end Is_Elaboration_Code;
+ function Is_Elaboration_Warnings_OK_Node
+ (N : Node_Id) return Boolean is
+ begin
+ pragma Assert (False
+ or else NT (N).Nkind = N_Call_Marker
+ or else NT (N).Nkind = N_Entry_Call_Statement
+ or else NT (N).Nkind = N_Function_Call
+ or else NT (N).Nkind = N_Function_Instantiation
+ or else NT (N).Nkind = N_Package_Instantiation
+ or else NT (N).Nkind = N_Procedure_Call_Statement
+ or else NT (N).Nkind = N_Procedure_Instantiation
+ or else NT (N).Nkind = N_Requeue_Statement);
+ return Flag3 (N);
+ end Is_Elaboration_Warnings_OK_Node;
+
function Is_Elsif
(N : Node_Id) return Boolean is
begin
@@ -5322,7 +5337,7 @@ package body Sinfo is
begin
pragma Assert (False
or else NT (N).Nkind = N_Call_Marker);
- Set_Flag3 (N, Val);
+ Set_Flag6 (N, Val);
end Set_Is_Dispatching_Call;
procedure Set_Is_Dynamic_Coextension
@@ -5369,6 +5384,21 @@ package body Sinfo is
Set_Flag9 (N, Val);
end Set_Is_Elaboration_Code;
+ procedure Set_Is_Elaboration_Warnings_OK_Node
+ (N : Node_Id; Val : Boolean := True) is
+ begin
+ pragma Assert (False
+ or else NT (N).Nkind = N_Call_Marker
+ or else NT (N).Nkind = N_Entry_Call_Statement
+ or else NT (N).Nkind = N_Function_Call
+ or else NT (N).Nkind = N_Function_Instantiation
+ or else NT (N).Nkind = N_Package_Instantiation
+ or else NT (N).Nkind = N_Procedure_Call_Statement
+ or else NT (N).Nkind = N_Procedure_Instantiation
+ or else NT (N).Nkind = N_Requeue_Statement);
+ Set_Flag3 (N, Val);
+ end Set_Is_Elaboration_Warnings_OK_Node;
+
procedure Set_Is_Elsif
(N : Node_Id; Val : Boolean := True) is
begin