aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch6.adb
diff options
context:
space:
mode:
authorJustin Squirek <squirek@adacore.com>2021-02-27 21:57:32 -0500
committerPierre-Marie de Rodat <derodat@adacore.com>2021-06-17 10:32:10 -0400
commit1326b0e896e34ca2a43b71f4e6f02b71b5c0c98c (patch)
tree8f3aa594ef64658b1914895ca0f5e1c68fd99bfe /gcc/ada/sem_ch6.adb
parent8863c3aa86c4dffd1869c04c7df7b5065751235d (diff)
[Ada] Removal of technical debt
gcc/ada/ * exp_ch3.adb (Check_Missing_Others): Add comment. (Build_Initialization_Call): Remove inaccurate accessibility comment. * sem_ch12.adb (Analyze_Generic_Subprogram_Declaration): Remove test for Ada2012. (Analyze_Package_Instantiation): Remove speculative comment. (Inline_Instance_Body): Add comments for loops. (Build_Subprogram_Renaming): Remove comment about fix being partial and "ugly." (Instantiate_Subprogram_Body): Remove comment referencing DEC related internal issue. (Subtypes_Match): Add comment and simplify anonymous access test. (Is_Global): Add test for when E is an expanded name, and calculate the scope accordingly. * sem_ch6.adb (Analyze_Function_Return): Update comment regarding accessibility, and add check for Warn_On_Ada_2012_Compatibility. (Mask_Type_Refs): Add comments. (Analyze_Subprogram_Declaration): Remove mysterious suppression of elaboration checks. * sem_ch7.adb (Preserve_Full_Attributes): Preserve Is_Atomic value. * sem_ch8.adb (Most_Descendant_Use_Clause): Remove comment. (Note_Redundant_Use): Fix calls to Find_First_Use to be Find_Most_Prev. (Get_Object_Name): Modify error message to be more descriptive. (Known_But_Visible): Remove mysterious special case for GNAT_Mode. (Find_First_Use): Removed. (Find_Most_Prev): Renamed from Find_First_Use. * sem_prag.adb (Check_Static_Constraint): Add comments to routine.
Diffstat (limited to 'gcc/ada/sem_ch6.adb')
-rw-r--r--gcc/ada/sem_ch6.adb33
1 files changed, 11 insertions, 22 deletions
diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb
index 8bf309f95f9..68e10afc7cc 100644
--- a/gcc/ada/sem_ch6.adb
+++ b/gcc/ada/sem_ch6.adb
@@ -1535,14 +1535,12 @@ package body Sem_Ch6 is
-- Check RM 6.5 (5.9/3)
if Has_Aliased then
- if Ada_Version < Ada_2012 then
-
- -- Shouldn't this test Warn_On_Ada_2012_Compatibility ???
- -- Can it really happen (extended return???)
-
+ if Ada_Version < Ada_2012
+ and then Warn_On_Ada_2012_Compatibility
+ then
Error_Msg_N
("ALIASED only allowed for limited return objects "
- & "in Ada 2012??", N);
+ & "in Ada 2012?y?", N);
elsif not Is_Limited_View (R_Type) then
Error_Msg_N
@@ -1674,9 +1672,9 @@ package body Sem_Ch6 is
Related_Nod => N);
end if;
- -- ??? A real run-time accessibility check is needed in cases
- -- involving dereferences of access parameters. For now we just
- -- check the static cases.
+ -- Perform static accessibility checks for cases involving
+ -- dereferences of access parameters. Runtime accessibility checks
+ -- get generated elsewhere.
if (Ada_Version < Ada_2005 or else Debug_Flag_Dot_L)
and then Is_Limited_View (Etype (Scope_Id))
@@ -3827,7 +3825,8 @@ package body Sem_Ch6 is
Result : Elist_Id := No_Elist;
function Mask_Type_Refs (Node : Node_Id) return Traverse_Result;
- -- Mask all types referenced in the subtree rooted at Node
+ -- Mask all types referenced in the subtree rooted at Node as
+ -- formally frozen.
--------------------
-- Mask_Type_Refs --
@@ -3835,7 +3834,8 @@ package body Sem_Ch6 is
function Mask_Type_Refs (Node : Node_Id) return Traverse_Result is
procedure Mask_Type (Typ : Entity_Id);
- -- ??? what does this do?
+ -- Mask a given type as formally frozen when outside the current
+ -- scope, or else freeze the type.
---------------
-- Mask_Type --
@@ -5665,17 +5665,6 @@ package body Sem_Ch6 is
end;
end if;
- -- What is the following code for, it used to be
-
- -- ??? Set_Suppress_Elaboration_Checks
- -- ??? (Designator, Elaboration_Checks_Suppressed (Designator));
-
- -- The following seems equivalent, but a bit dubious
-
- if Elaboration_Checks_Suppressed (Designator) then
- Set_Kill_Elaboration_Checks (Designator);
- end if;
-
-- For a compilation unit, set body required. This flag will only be
-- reset if a valid Import or Interface pragma is processed later on.