-- If the unit where the type is declared is the main unit, and the
-- number of literals is greater than Threshold_For_Size when we are
-- optimizing for size, and the restriction No_Implicit_Loops is not
- -- active, and -gnatd_h is not specified, generate the hash function.
+ -- active, and -gnatd_h is not specified, and not GNAT_Mode, generate
+ -- the hash function.
if In_Main_Unit
and then (Optimize_Size = 0 or else Nlit > Threshold_For_Size)
and then not Restriction_Active (No_Implicit_Loops)
and then not Debug_Flag_Underscore_H
+ and then not GNAT_Mode
then
declare
LB : constant Positive := 2 * Positive (Nlit) + 1;
--------------------------------
procedure Check_Loop_Pragma_Grouping (Loop_Stmt : Node_Id) is
- Stop_Search : exception;
- -- This exception is used to terminate the recursive descent of
- -- routine Check_Grouping.
-
- procedure Check_Grouping (L : List_Id);
+ function Check_Grouping (L : List_Id) return Boolean;
-- Find the first group of pragmas in list L and if successful,
-- ensure that the current pragma is part of that group. The
- -- routine raises Stop_Search once such a check is performed to
- -- halt the recursive descent.
+ -- routine returns True once such a check is performed to
+ -- stop the analysis.
procedure Grouping_Error (Prag : Node_Id);
pragma No_Return (Grouping_Error);
-- Check_Grouping --
--------------------
- procedure Check_Grouping (L : List_Id) is
+ function Check_Grouping (L : List_Id) return Boolean is
HSS : Node_Id;
Stmt : Node_Id;
Prag : Node_Id := Empty; -- init to avoid warning
-- Stop the search as the placement is legal.
if Stmt = N then
- raise Stop_Search;
+ return True;
-- Skip group members, but keep track of the
-- last pragma in the group.
elsif Nkind (Stmt) = N_Block_Statement then
HSS := Handled_Statement_Sequence (Stmt);
- Check_Grouping (Declarations (Stmt));
+ if Check_Grouping (Declarations (Stmt)) then
+ return True;
+ end if;
if Present (HSS) then
- Check_Grouping (Statements (HSS));
+ if Check_Grouping (Statements (HSS)) then
+ return True;
+ end if;
end if;
end if;
Next (Stmt);
end loop;
+
+ return False;
end Check_Grouping;
--------------------
Error_Pragma ("pragma% must appear next to pragma#");
end Grouping_Error;
+ Ignore : Boolean;
+
-- Start of processing for Check_Loop_Pragma_Grouping
begin
-- within to determine whether the current pragma is part of the
-- first topmost grouping of Loop_Invariant and Loop_Variant.
- Check_Grouping (Statements (Loop_Stmt));
-
- exception
- when Stop_Search => null;
+ Ignore := Check_Grouping (Statements (Loop_Stmt));
end Check_Loop_Pragma_Grouping;
--------------------
Check_First_Subtype (Task_Type);
if Rep_Item_Too_Late (Ent, N) then
- raise Pragma_Exit;
+ return;
end if;
end Task_Storage;
or else
Rep_Item_Too_Late (E, N)
then
- raise Pragma_Exit;
+ return;
end if;
Set_Has_Pragma_Thread_Local_Storage (E);
if CodePeer_Mode or GNATprove_Mode then
Rewrite (N, Make_Null_Statement (Loc));
Analyze (N);
- raise Pragma_Exit;
+ return;
end if;
elsif Chars (Argx) = Name_Gnatprove then
if not GNATprove_Mode then
Rewrite (N, Make_Null_Statement (Loc));
Analyze (N);
- raise Pragma_Exit;
+ return;
end if;
-
else
raise Program_Error;
end if;
Chars => Name_Warnings,
Pragma_Argument_Associations => Shifted_Args));
Analyze (N);
- raise Pragma_Exit;
+ return;
end if;
-- One argument case