SSO_Default_Specified := False;
Task_Dispatching_Policy_Specified := ' ';
Unreserve_All_Interrupts_Specified := False;
- Frontend_Exceptions_Specified := False;
Zero_Cost_Exceptions_Specified := False;
end Initialize_ALI;
Unit_Exception_Table => False,
Ver => (others => ' '),
Ver_Len => 0,
- Frontend_Exceptions => False,
Zero_Cost_Exceptions => False);
-- Now we acquire the input lines from the ALI file. Note that the
elsif C = 'F' then
C := Getc;
+ -- Old front-end exceptions marker, ignore
+
if C = 'X' then
- ALIs.Table (Id).Frontend_Exceptions := True;
- Frontend_Exceptions_Specified := True;
+ null;
else
Fatal_Error_Ignore;
end if;
-- Set to True if unit exception table pointer generated. Not set if 'P'
-- appears in Ignore_Lines.
- Frontend_Exceptions : Boolean;
- -- Set to True if file was compiled with front-end exceptions. Not set
- -- if 'P' appears in Ignore_Lines.
-
Zero_Cost_Exceptions : Boolean;
-- Set to True if file was compiled with zero cost exceptions. Not set
-- if 'P' appears in Ignore_Lines.
-- Set to False by Initialize_ALI. Set to True if Scan_ALI reads
-- a unit for which dynamic elaboration checking is enabled.
- Frontend_Exceptions_Specified : Boolean := False;
- -- Set to False by Initialize_ALI. Set to True if an ali file is read that
- -- has a P line specifying the generation of front-end exceptions.
-
GNATprove_Mode_Specified : Boolean := False;
-- Set to True if an ali file was produced in GNATprove mode.
Check_Consistent_SSO_Default;
end if;
- if Zero_Cost_Exceptions_Specified
- or else Frontend_Exceptions_Specified
- then
+ if Zero_Cost_Exceptions_Specified then
Check_Consistent_Exception_Handling;
end if;
procedure Check_Consistent_Exception_Handling is
begin
Check_Mechanism : for A1 in ALIs.First + 1 .. ALIs.Last loop
- if (ALIs.Table (A1).Zero_Cost_Exceptions /=
- ALIs.Table (ALIs.First).Zero_Cost_Exceptions)
- or else
- (ALIs.Table (A1).Frontend_Exceptions /=
- ALIs.Table (ALIs.First).Frontend_Exceptions)
+ if ALIs.Table (A1).Zero_Cost_Exceptions /=
+ ALIs.Table (ALIs.First).Zero_Cost_Exceptions
then
Error_Msg_File_1 := ALIs.Table (A1).Sfile;
Error_Msg_File_2 := ALIs.Table (ALIs.First).Sfile;
with Rident; use Rident;
with Rtsfind; use Rtsfind;
with Sem; use Sem;
-with Sem_Ch8; use Sem_Ch8;
with Sem_Res; use Sem_Res;
with Sem_Util; use Sem_Util;
with Sinfo; use Sinfo;
---------------------------
-- For a handled statement sequence that has a cleanup (At_End_Proc
- -- field set), an exception handler of the following form is required:
+ -- field set), perform any needed expansion.
- -- exception
- -- when all others =>
- -- cleanup call
- -- raise;
-
- -- Note: this exception handler is treated rather specially by
- -- subsequent expansion in two respects:
-
- -- The normal call to Undefer_Abort is omitted
- -- The raise call does not do Defer_Abort
-
- -- This is because the current tasking code seems to assume that
- -- the call to the cleanup routine that is made from an exception
- -- handler for the abort signal is called with aborts deferred.
-
- -- This expansion is only done if we have front end exception handling.
- -- If we have back end exception handling, then the AT END handler is
- -- left alone, and cleanups (including the exceptional case) are handled
- -- by the back end.
-
- -- In the front end case, the exception handler described above handles
- -- the exceptional case. The AT END handler is left in the generated tree
- -- and the code generator (e.g. gigi) must still handle proper generation
- -- of cleanup calls for the non-exceptional case.
+ -- Do nothing by default. We used to perform a special expansion for
+ -- front-end SJLJ, and we may want to customize this processing in
+ -- the future for new back-ends.
procedure Expand_At_End_Handler (HSS : Node_Id; Blk_Id : Entity_Id) is
- Clean : constant Entity_Id := Entity (At_End_Proc (HSS));
- Ohandle : Node_Id;
- Stmnts : List_Id;
-
- Loc : constant Source_Ptr := No_Location;
- -- Location used for expansion. We quite deliberately do not set a
- -- specific source location for the expanded handler. This makes
- -- sense since really the handler is not associated with specific
- -- source. We used to set this to Sloc (Clean), but that caused
- -- useless and annoying bouncing around of line numbers in the
- -- debugger in some circumstances.
-
+ pragma Unreferenced (Blk_Id);
begin
- pragma Assert (Present (Clean));
+ pragma Assert (Present (Entity (At_End_Proc (HSS))));
pragma Assert (No (Exception_Handlers (HSS)));
-
- -- Back end exception schemes don't need explicit handlers to
- -- trigger AT-END actions on exceptional paths.
-
- if Back_End_Exceptions then
- return;
- end if;
-
- -- Don't expand an At End handler if we have already had configurable
- -- run-time violations, since likely this will just be a matter of
- -- generating useless cascaded messages
-
- if Configurable_Run_Time_Violations > 0 then
- return;
- end if;
-
- -- Don't expand an At End handler if we are not allowing exceptions
- -- or if exceptions are transformed into local gotos, and never
- -- propagated (No_Exception_Propagation).
-
- if No_Exception_Handlers_Set then
- return;
- end if;
-
- if Present (Blk_Id) then
- Push_Scope (Blk_Id);
- end if;
-
- Ohandle :=
- Make_Others_Choice (Loc);
- Set_All_Others (Ohandle);
-
- Stmnts := New_List (
- Make_Procedure_Call_Statement (Loc,
- Name => New_Occurrence_Of (Clean, Loc)));
-
- -- Generate reraise statement as last statement of AT-END handler,
- -- unless we are under control of No_Exception_Propagation, in which
- -- case no exception propagation is possible anyway, so we do not need
- -- a reraise (the AT END handler in this case is only for normal exits
- -- not for exceptional exits). Also, we flag the Reraise statement as
- -- being part of an AT END handler to prevent signalling this reraise
- -- as a violation of the restriction when it is not set.
-
- if not Restriction_Active (No_Exception_Propagation) then
- declare
- Rstm : constant Node_Id := Make_Raise_Statement (Loc);
- begin
- Set_From_At_End (Rstm);
- Append_To (Stmnts, Rstm);
- end;
- end if;
-
- Set_Exception_Handlers (HSS, New_List (
- Make_Implicit_Exception_Handler (Loc,
- Exception_Choices => New_List (Ohandle),
- Statements => Stmnts)));
-
- Analyze_List (Stmnts, Suppress => All_Checks);
- Expand_Exception_Handlers (HSS);
-
- if Present (Blk_Id) then
- Pop_Scope;
- end if;
+ return;
end Expand_At_End_Handler;
-------------------------------
-- ...
-- end;
- -- This expansion is only performed when using front-end
- -- exceptions. Gigi will insert a call to initialize the
- -- choice parameter.
+ -- This expansion is only performed when using CodePeer.
+ -- Gigi will insert a call to initialize the choice parameter.
if Present (Choice_Parameter (Handler))
- and then (Front_End_Exceptions
- or else CodePeer_Mode)
+ and then CodePeer_Mode
then
declare
Cparm : constant Entity_Id := Choice_Parameter (Handler);
-- GNATprove all code with exceptions falls outside the subset of
-- code which can be formally analyzed.
- if not CodePeer_Mode
- and then Back_End_Exceptions
- then
+ if not CodePeer_Mode then
return;
end if;
} Ada_Version_Type;
typedef enum {
- Front_End_SJLJ, Back_End_ZCX, Back_End_SJLJ
+ Back_End_ZCX, Back_End_SJLJ
} Exception_Mechanism_Type;
extern Ada_Version_Type Ada_Version;
#define ZCX_Exceptions opt__zcx_exceptions
#define SJLJ_Exceptions opt__sjlj_exceptions
-#define Front_End_Exceptions opt__front_end_exceptions
-#define Back_End_Exceptions opt__back_end_exceptions
extern Boolean ZCX_Exceptions (void);
extern Boolean SJLJ_Exceptions (void);
-extern Boolean Front_End_Exceptions (void);
-extern Boolean Back_End_Exceptions (void);
/* restrict: */
if (TREE_CODE (gnu_decl) == CONST_DECL)
DECL_CONST_ADDRESS_P (gnu_decl) = constructor_address_p (gnu_expr);
- /* If this object is declared in a block that contains a block with an
- exception handler, and we aren't using the GCC exception mechanism,
- we must force this variable in memory in order to avoid an invalid
- optimization. */
- if (Front_End_Exceptions ()
- && Has_Nested_Block_With_Handler (Scope (gnat_entity)))
- TREE_ADDRESSABLE (gnu_decl) = 1;
-
/* If this is a local variable with non-BLKmode and aggregate type,
and optimization isn't enabled, then force it in memory so that
a register won't be allocated to it with possible subparts left
&& !optimize)
TREE_ADDRESSABLE (gnu_decl) = 1;
- /* If we are defining an object with variable size or an object with
- fixed size that will be dynamically allocated, and we are using the
- front-end setjmp/longjmp exception mechanism, update the setjmp
- buffer. */
- if (definition
- && Exception_Mechanism == Front_End_SJLJ
- && get_block_jmpbuf_decl ()
- && DECL_SIZE_UNIT (gnu_decl)
- && (TREE_CODE (DECL_SIZE_UNIT (gnu_decl)) != INTEGER_CST
- || (flag_stack_check == GENERIC_STACK_CHECK
- && compare_tree_int (DECL_SIZE_UNIT (gnu_decl),
- STACK_CHECK_MAX_VAR_SIZE) > 0)))
- add_stmt_with_node (build_call_n_expr
- (update_setjmp_buf_decl, 1,
- build_unary_op (ADDR_EXPR, NULL_TREE,
- get_block_jmpbuf_decl ())),
- gnat_entity);
-
/* Back-annotate Esize and Alignment of the object if not already
known. Note that we pick the values of the type, not those of
the object, to shield ourselves from low-level platform-dependent
circuitry from it, we need to declare that calls to pure Ada subprograms
that can throw have side effects, since they can trigger an "abnormal"
transfer of control; therefore they cannot be "pure" in the GCC sense. */
- bool pure_flag = Is_Pure (gnat_subprog) && Back_End_Exceptions ();
+ bool pure_flag = Is_Pure (gnat_subprog);
bool return_by_direct_ref_p = false;
bool return_by_invisi_ref_p = false;
bool return_unconstrained_p = false;
main_identifier_node = get_identifier ("main");
- /* If we are using the GCC exception mechanism, let GCC know. */
- if (Back_End_Exceptions ())
- gnat_init_gcc_eh ();
+ gnat_init_gcc_eh ();
/* Initialize the GCC support for FP operations. */
gnat_init_gcc_fp ();
{
/* If just annotating, ignore all EH and cleanups. */
const bool gcc_eh
- = (!type_annotate_only
- && Present (Exception_Handlers (gnat_node))
- && Back_End_Exceptions ());
- const bool fe_sjlj_eh
- = (!type_annotate_only
- && Present (Exception_Handlers (gnat_node))
- && Exception_Mechanism == Front_End_SJLJ);
+ = !type_annotate_only && Present (Exception_Handlers (gnat_node));
const bool at_end = !type_annotate_only && Present (At_End_Proc (gnat_node));
- const bool binding_for_block = (at_end || gcc_eh || fe_sjlj_eh);
- tree gnu_jmpsave_decl = NULL_TREE;
- tree gnu_jmpbuf_decl = NULL_TREE;
+ const bool binding_for_block = (at_end || gcc_eh);
tree gnu_inner_block; /* The statement(s) for the block itself. */
tree gnu_result;
- tree gnu_expr;
Node_Id gnat_temp;
- /* The GCC exception handling mechanism can handle both ZCX and SJLJ schemes
- and the front-end has its own SJLJ mechanism. To call the GCC mechanism,
- we call add_cleanup, and when we leave the binding, end_stmt_group will
- create the TRY_FINALLY_EXPR construct.
+ /* The GCC exception handling mechanism can handle both ZCX and SJLJ schemes.
+ To call the GCC mechanism, we call add_cleanup, and when we leave the
+ binding, end_stmt_group will create the TRY_FINALLY_EXPR construct.
??? The region level calls down there have been specifically put in place
for a ZCX context and currently the order in which things are emitted
condition to make it not ZCX specific.
If there are any exceptions or cleanup processing involved, we need an
- outer statement group (for front-end SJLJ) and binding level. */
+ outer statement group and binding level. */
if (binding_for_block)
{
start_stmt_group ();
gnat_pushlevel ();
}
- /* If using fe_sjlj_eh, make the variables for the setjmp buffer and save
- area for address of previous buffer. Do this first since we need to have
- the setjmp buf known for any decls in this block. */
- if (fe_sjlj_eh)
- {
- gnu_jmpsave_decl
- = create_var_decl (get_identifier ("JMPBUF_SAVE"), NULL_TREE,
- jmpbuf_ptr_type,
- build_call_n_expr (get_jmpbuf_decl, 0),
- false, false, false, false, false, true, false,
- NULL, gnat_node);
-
- /* The __builtin_setjmp receivers will immediately reinstall it. Now
- because of the unstructured form of EH used by fe_sjlj_eh, there
- might be forward edges going to __builtin_setjmp receivers on which
- it is uninitialized, although they will never be actually taken. */
- suppress_warning (gnu_jmpsave_decl, OPT_Wuninitialized);
- gnu_jmpbuf_decl
- = create_var_decl (get_identifier ("JMP_BUF"), NULL_TREE,
- jmpbuf_type,
- NULL_TREE,
- false, false, false, false, false, true, false,
- NULL, gnat_node);
-
- set_block_jmpbuf_decl (gnu_jmpbuf_decl);
-
- /* When we exit this block, restore the saved value. */
- add_cleanup (build_call_n_expr (set_jmpbuf_decl, 1, gnu_jmpsave_decl),
- Present (End_Label (gnat_node))
- ? End_Label (gnat_node) : gnat_node);
- }
-
/* If we are to call a function when exiting this block, add a cleanup
to the binding level we made above. Note that add_cleanup is FIFO
so we must register this cleanup after the EH cleanup just above. */
? End_Label (gnat_node) : At_End_Proc (gnat_node));
}
- /* Now build the tree for the declarations and statements inside this block.
- If this is SJLJ, set our jmp_buf as the current buffer. */
+ /* Now build the tree for the declarations and statements inside this
+ block. */
start_stmt_group ();
- if (fe_sjlj_eh)
- {
- gnu_expr = build_call_n_expr (set_jmpbuf_decl, 1,
- build_unary_op (ADDR_EXPR, NULL_TREE,
- gnu_jmpbuf_decl));
- set_expr_location_from_node (gnu_expr, gnat_node);
- add_stmt (gnu_expr);
- }
-
if (Present (First_Real_Statement (gnat_node)))
process_decls (Statements (gnat_node), Empty,
First_Real_Statement (gnat_node), true, true);
gnu_inner_block = end_stmt_group ();
- /* Now generate code for the two exception models, if either is relevant for
- this block. */
- if (fe_sjlj_eh)
- {
- tree *gnu_else_ptr = 0;
- tree gnu_handler;
-
- /* Make a binding level for the exception handling declarations and code
- and set up gnu_except_ptr_stack for the handlers to use. */
- start_stmt_group ();
- gnat_pushlevel ();
-
- vec_safe_push (gnu_except_ptr_stack,
- create_var_decl (get_identifier ("EXCEPT_PTR"), NULL_TREE,
- build_pointer_type (except_type_node),
- build_call_n_expr (get_excptr_decl, 0),
- false, false, false, false, false,
- true, false, NULL, gnat_node));
-
- /* Generate code for each handler. The N_Exception_Handler case does the
- real work and returns a COND_EXPR for each handler, which we chain
- together here. */
- for (gnat_temp = First_Non_Pragma (Exception_Handlers (gnat_node));
- Present (gnat_temp); gnat_temp = Next_Non_Pragma (gnat_temp))
- {
- gnu_expr = gnat_to_gnu (gnat_temp);
-
- /* If this is the first one, set it as the outer one. Otherwise,
- point the "else" part of the previous handler to us. Then point
- to our "else" part. */
- if (!gnu_else_ptr)
- add_stmt (gnu_expr);
- else
- *gnu_else_ptr = gnu_expr;
-
- gnu_else_ptr = &COND_EXPR_ELSE (gnu_expr);
- }
-
- /* If none of the exception handlers did anything, re-raise but do not
- defer abortion. */
- gnu_expr = build_call_n_expr (raise_nodefer_decl, 1,
- gnu_except_ptr_stack->last ());
- set_expr_location_from_node
- (gnu_expr,
- Present (End_Label (gnat_node)) ? End_Label (gnat_node) : gnat_node);
-
- if (gnu_else_ptr)
- *gnu_else_ptr = gnu_expr;
- else
- add_stmt (gnu_expr);
-
- /* End the binding level dedicated to the exception handlers and get the
- whole statement group. */
- gnu_except_ptr_stack->pop ();
- gnat_poplevel ();
- gnu_handler = end_stmt_group ();
-
- /* If the setjmp returns 1, we restore our incoming longjmp value and
- then check the handlers. */
- start_stmt_group ();
- add_stmt_with_node (build_call_n_expr (set_jmpbuf_decl, 1,
- gnu_jmpsave_decl),
- gnat_node);
- add_stmt (gnu_handler);
- gnu_handler = end_stmt_group ();
-
- /* This block is now "if (setjmp) ... <handlers> else <block>". */
- gnu_result = build3 (COND_EXPR, void_type_node,
- (build_call_n_expr
- (setjmp_decl, 1,
- build_unary_op (ADDR_EXPR, NULL_TREE,
- gnu_jmpbuf_decl))),
- gnu_handler, gnu_inner_block);
- }
- else if (gcc_eh)
+ if (gcc_eh)
{
tree gnu_handlers;
location_t locus;
return gnu_result;
}
-/* Subroutine of gnat_to_gnu to translate gnat_node, an N_Exception_Handler,
- to a GCC tree, which is returned. This is the variant for front-end sjlj
- exception handling. */
-
-static tree
-Exception_Handler_to_gnu_fe_sjlj (Node_Id gnat_node)
-{
- /* Unless this is "Others" or the special "Non-Ada" exception for Ada, make
- an "if" statement to select the proper exceptions. For "Others", exclude
- exceptions where Handled_By_Others is nonzero unless the All_Others flag
- is set. For "Non-ada", accept an exception if "Lang" is 'V'. */
- tree gnu_choice = boolean_false_node;
- tree gnu_body = build_stmt_group (Statements (gnat_node), false);
- Node_Id gnat_temp;
-
- for (gnat_temp = First (Exception_Choices (gnat_node));
- gnat_temp; gnat_temp = Next (gnat_temp))
- {
- tree this_choice;
-
- if (Nkind (gnat_temp) == N_Others_Choice)
- {
- if (All_Others (gnat_temp))
- this_choice = boolean_true_node;
- else
- this_choice
- = build_binary_op
- (EQ_EXPR, boolean_type_node,
- convert
- (integer_type_node,
- build_component_ref
- (build_unary_op
- (INDIRECT_REF, NULL_TREE,
- gnu_except_ptr_stack->last ()),
- not_handled_by_others_decl,
- false)),
- integer_zero_node);
- }
-
- else if (Nkind (gnat_temp) == N_Identifier
- || Nkind (gnat_temp) == N_Expanded_Name)
- {
- Entity_Id gnat_ex_id = Entity (gnat_temp);
- tree gnu_expr;
-
- /* Exception may be a renaming. Recover original exception which is
- the one elaborated and registered. */
- if (Present (Renamed_Object (gnat_ex_id)))
- gnat_ex_id = Renamed_Object (gnat_ex_id);
-
- gnu_expr = gnat_to_gnu_entity (gnat_ex_id, NULL_TREE, false);
-
- this_choice
- = build_binary_op
- (EQ_EXPR, boolean_type_node,
- gnu_except_ptr_stack->last (),
- convert (TREE_TYPE (gnu_except_ptr_stack->last ()),
- build_unary_op (ADDR_EXPR, NULL_TREE, gnu_expr)));
- }
- else
- gcc_unreachable ();
-
- gnu_choice = build_binary_op (TRUTH_ORIF_EXPR, boolean_type_node,
- gnu_choice, this_choice);
- }
-
- return build3 (COND_EXPR, void_type_node, gnu_choice, gnu_body, NULL_TREE);
-}
-
/* Return true if no statement in GNAT_LIST can alter the control flow. */
static bool
/***************************/
case N_Handled_Sequence_Of_Statements:
- /* If there is an At_End procedure attached to this node, and the EH
- mechanism is front-end, we must have at least a corresponding At_End
- handler, unless the No_Exception_Handlers restriction is set. */
- gcc_assert (type_annotate_only
- || !Front_End_Exceptions ()
- || No (At_End_Proc (gnat_node))
- || Present (Exception_Handlers (gnat_node))
- || No_Exception_Handlers_Set ());
-
gnu_result = Handled_Sequence_Of_Statements_to_gnu (gnat_node);
break;
case N_Exception_Handler:
- if (Back_End_Exceptions ())
- gnu_result = Exception_Handler_to_gnu_gcc (gnat_node);
- else if (Exception_Mechanism == Front_End_SJLJ)
- gnu_result = Exception_Handler_to_gnu_fe_sjlj (gnat_node);
- else
- gcc_unreachable ();
+ gnu_result = Exception_Handler_to_gnu_gcc (gnat_node);
break;
case N_Raise_Statement:
/* Only for reraise in back-end exceptions mode. */
- gcc_assert (No (Name (gnat_node)) && Back_End_Exceptions ());
+ gcc_assert (No (Name (gnat_node)));
start_stmt_group ();
-- generating code.
if Operating_Mode = Generate_Code then
- case Targparm.Frontend_Exceptions_On_Target is
- when True =>
- case Targparm.ZCX_By_Default_On_Target is
- when True =>
- Write_Line
- ("Run-time library configured incorrectly");
- Write_Line
- ("(requesting support for Frontend ZCX exceptions)");
- raise Unrecoverable_Error;
-
- when False =>
- Exception_Mechanism := Front_End_SJLJ;
- end case;
-
- when False =>
- case Targparm.ZCX_By_Default_On_Target is
- when True =>
- Exception_Mechanism := Back_End_ZCX;
- when False =>
- Exception_Mechanism := Back_End_SJLJ;
- end case;
- end case;
+ if Targparm.ZCX_By_Default_On_Target then
+ Exception_Mechanism := Back_End_ZCX;
+ else
+ Exception_Mechanism := Back_End_SJLJ;
+ end if;
end if;
-- Set proper status for overflow check mechanism
Write_Info_Str (" UA");
end if;
- if Front_End_Exceptions then
- Write_Info_Str (" FX");
- end if;
-
if ZCX_Exceptions then
Write_Info_Str (" ZX");
end if;
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := False;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
end System;
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := False;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
end System;
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := False;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
end System;
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := False;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
end System;
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := False;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
end System;
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := False;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
end System;
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := False;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
end System;
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := False;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
end System;
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := False;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
--------------------------
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := False;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
end System;
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := False;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
end System;
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := False;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
end System;
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := False;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
end System;
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := False;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
end System;
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := False;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
end System;
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := False;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
end System;
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := False;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
end System;
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := False;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
end System;
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := False;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
end System;
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := False;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
end System;
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := False;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
end System;
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := False;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := False;
end System;
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := False;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := False;
end System;
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := False;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
---------------------------
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := False;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
end System;
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := False;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
end System;
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := False;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
end System;
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := False;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
end System;
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := False;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
Executable_Extension : constant String := ".vxe";
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := False;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
Executable_Extension : constant String := ".vxe";
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := True;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
Executable_Extension : constant String := ".out";
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := True;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
Executable_Extension : constant String := ".out";
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := False;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
Executable_Extension : constant String := ".vxe";
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := False;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
Executable_Extension : constant String := ".vxe";
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := True;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
Executable_Extension : constant String := ".out";
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := False;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
Executable_Extension : constant String := ".vxe";
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := False;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
Executable_Extension : constant String := ".vxe";
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := True;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
Executable_Extension : constant String := ".out";
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := False;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
Executable_Extension : constant String := ".vxe";
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := False;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
Executable_Extension : constant String := ".vxe";
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := False;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
Executable_Extension : constant String := ".vxe";
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := True;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
Executable_Extension : constant String := ".out";
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := False;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
Executable_Extension : constant String := ".vxe";
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := True;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
Executable_Extension : constant String := ".out";
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := True;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
Executable_Extension : constant String := ".out";
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := False;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
Executable_Extension : constant String := ".vxe";
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := False;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
Executable_Extension : constant String := ".vxe";
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := True;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
Executable_Extension : constant String := ".out";
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := False;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
Executable_Extension : constant String := ".vxe";
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := False;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
Executable_Extension : constant String := ".vxe";
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := True;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
Executable_Extension : constant String := ".out";
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := False;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
Executable_Extension : constant String := ".vxe";
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := True;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
Executable_Extension : constant String := ".out";
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := False;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
Executable_Extension : constant String := ".vxe";
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := False;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
Executable_Extension : constant String := ".vxe";
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := True;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
Executable_Extension : constant String := ".out";
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := False;
- Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
Executable_Extension : constant String := ".vxe";
package body Opt is
- -------------------------
- -- Back_End_Exceptions --
- -------------------------
-
- function Back_End_Exceptions return Boolean is
- begin
- return
- Exception_Mechanism = Back_End_SJLJ
- or else
- Exception_Mechanism = Back_End_ZCX;
- end Back_End_Exceptions;
-
- -------------------------
- -- Front_End_Exceptions --
- -------------------------
-
- function Front_End_Exceptions return Boolean is
- begin
- return Exception_Mechanism = Front_End_SJLJ;
- end Front_End_Exceptions;
-
--------------------
-- SJLJ_Exceptions --
--------------------
function SJLJ_Exceptions return Boolean is
begin
- return
- Exception_Mechanism = Back_End_SJLJ
- or else
- Exception_Mechanism = Front_End_SJLJ;
+ return Exception_Mechanism = Back_End_SJLJ;
end SJLJ_Exceptions;
--------------------
type Exception_Mechanism_Type is
-- Determines the kind of mechanism used to handle exceptions
--
- (Front_End_SJLJ,
- -- Exceptions use setjmp/longjmp generated explicitly by the front end
- -- (this includes gigi or other equivalent parts of the code generator).
- -- AT END handlers are converted into exception handlers by the front
- -- end in this mode.
-
- Back_End_ZCX,
+ (Back_End_ZCX,
-- Exceptions are handled by the back end. The front end simply
-- generates the handlers as they appear in the source, and AT END
-- handlers are left untouched (they are not converted into exception
-- WARNING: There is a matching C declaration of this type in fe.h
- Exception_Mechanism : Exception_Mechanism_Type := Front_End_SJLJ;
+ Exception_Mechanism : Exception_Mechanism_Type := Back_End_SJLJ;
-- GNAT
-- Set to the appropriate value depending on the flags in system.ads
- -- (Frontend_Exceptions + ZCX_By_Default). The C convention is there to
- -- allow access by gigi.
+ -- (ZCX_By_Default). The C convention is there to allow access by gigi.
-- WARNING: There is a matching C declaration of this variable in fe.h
- function Back_End_Exceptions return Boolean;
- function Front_End_Exceptions return Boolean;
function ZCX_Exceptions return Boolean;
function SJLJ_Exceptions return Boolean;
-- GNAT
D32, -- Duration_32_Bits
DEN, -- Denorm
EXS, -- Exit_Status_Supported
- FEX, -- Frontend_Exceptions
MOV, -- Machine_Overflows
MRN, -- Machine_Rounds
PAS, -- Preallocated_Stacks
D32_Str : aliased constant Source_Buffer := "Duration_32_Bits";
DEN_Str : aliased constant Source_Buffer := "Denorm";
EXS_Str : aliased constant Source_Buffer := "Exit_Status_Supported";
- FEX_Str : aliased constant Source_Buffer := "Frontend_Exceptions";
MOV_Str : aliased constant Source_Buffer := "Machine_Overflows";
MRN_Str : aliased constant Source_Buffer := "Machine_Rounds";
PAS_Str : aliased constant Source_Buffer := "Preallocated_Stacks";
D32 => D32_Str'Access,
DEN => DEN_Str'Access,
EXS => EXS_Str'Access,
- FEX => FEX_Str'Access,
MOV => MOV_Str'Access,
MRN => MRN_Str'Access,
PAS => PAS_Str'Access,
when D32 => Duration_32_Bits_On_Target := Result;
when DEN => Denorm_On_Target := Result;
when EXS => Exit_Status_Supported_On_Target := Result;
- when FEX => Frontend_Exceptions_On_Target := Result;
when MOV => Machine_Overflows_On_Target := Result;
when MRN => Machine_Rounds_On_Target := Result;
when PAS => Preallocated_Stacks_On_Target := Result;
ZCX_By_Default_On_Target : Boolean := False;
-- Indicates if zero cost scheme for exceptions
- Frontend_Exceptions_On_Target : Boolean := True;
- -- Indicates if we're using a front-end scheme for exceptions
-
------------------------------------
-- Run-Time Library Configuration --
------------------------------------