Commit a49c3e16 by Jose Ruiz Committed by Arnaud Charlet

fe.h: Add entry for Opt.Exception_Locations_Suppressed so that gigi can determine...

2005-06-14  Jose Ruiz  <ruiz@adacore.com>

	* fe.h: Add entry for Opt.Exception_Locations_Suppressed so that gigi
	can determine whether pragma Suppress_Exception_Locations is in effect.

	* utils2.c (build_call_raise): Do not pass the file name to the
	exception handler if pragma Suppress_Exception_Locations is in effect.
	(build_allocator): Add and process arg IGNORE_INIT_TYPE.

From-SVN: r101037
parent 84f8ad69
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* * * *
* C Header File * * C Header File *
* * * *
* Copyright (C) 1992-2004 Free Software Foundation, Inc. * * Copyright (C) 1992-2005 Free Software Foundation, Inc. *
* * * *
* GNAT is free software; you can redistribute it and/or modify it under * * GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- * * terms of the GNU General Public License as published by the Free Soft- *
...@@ -151,12 +151,14 @@ extern Boolean In_Same_Source_Unit (Node_Id, Node_Id); ...@@ -151,12 +151,14 @@ extern Boolean In_Same_Source_Unit (Node_Id, Node_Id);
/* opt: */ /* opt: */
#define Global_Discard_Names opt__global_discard_names #define Global_Discard_Names opt__global_discard_names
#define Exception_Locations_Suppressed opt__exception_locations_suppressed
#define Exception_Mechanism opt__exception_mechanism #define Exception_Mechanism opt__exception_mechanism
#define Back_Annotate_Rep_Info opt__back_annotate_rep_info #define Back_Annotate_Rep_Info opt__back_annotate_rep_info
typedef enum {Setjmp_Longjmp, Front_End_ZCX, GCC_ZCX} Exception_Mechanism_Type; typedef enum {Setjmp_Longjmp, Front_End_ZCX, GCC_ZCX} Exception_Mechanism_Type;
extern Boolean Global_Discard_Names; extern Boolean Global_Discard_Names;
extern Boolean Exception_Locations_Suppressed;
extern Exception_Mechanism_Type Exception_Mechanism; extern Exception_Mechanism_Type Exception_Mechanism;
extern Boolean Back_Annotate_Rep_Info; extern Boolean Back_Annotate_Rep_Info;
......
...@@ -1430,7 +1430,8 @@ tree ...@@ -1430,7 +1430,8 @@ tree
build_call_raise (int msg) build_call_raise (int msg)
{ {
tree fndecl = gnat_raise_decls[msg]; tree fndecl = gnat_raise_decls[msg];
const char *str = Debug_Flag_NN ? "" : ref_filename; const char *str
= (Debug_Flag_NN || Exception_Locations_Suppressed) ? "" : ref_filename;
int len = strlen (str) + 1; int len = strlen (str) + 1;
tree filename = build_string (len, str); tree filename = build_string (len, str);
...@@ -1751,11 +1752,15 @@ build_call_alloc_dealloc (tree gnu_obj, tree gnu_size, unsigned align, ...@@ -1751,11 +1752,15 @@ build_call_alloc_dealloc (tree gnu_obj, tree gnu_size, unsigned align,
initial value is INIT, if INIT is nonzero. Convert the expression to initial value is INIT, if INIT is nonzero. Convert the expression to
RESULT_TYPE, which must be some type of pointer. Return the tree. RESULT_TYPE, which must be some type of pointer. Return the tree.
GNAT_PROC and GNAT_POOL optionally give the procedure to call and GNAT_PROC and GNAT_POOL optionally give the procedure to call and
the storage pool to use. */ the storage pool to use. GNAT_NODE is used to provide an error
location for restriction violations messages. If IGNORE_INIT_TYPE is
true, ignore the type of INIT for the purpose of determining the size;
this will cause the maximum size to be allocated if TYPE is of
self-referential size. */
tree tree
build_allocator (tree type, tree init, tree result_type, Entity_Id gnat_proc, build_allocator (tree type, tree init, tree result_type, Entity_Id gnat_proc,
Entity_Id gnat_pool, Node_Id gnat_node) Entity_Id gnat_pool, Node_Id gnat_node, bool ignore_init_type)
{ {
tree size = TYPE_SIZE_UNIT (type); tree size = TYPE_SIZE_UNIT (type);
tree result; tree result;
...@@ -1839,7 +1844,7 @@ build_allocator (tree type, tree init, tree result_type, Entity_Id gnat_proc, ...@@ -1839,7 +1844,7 @@ build_allocator (tree type, tree init, tree result_type, Entity_Id gnat_proc,
/* If we have an initializing expression, see if its size is simpler /* If we have an initializing expression, see if its size is simpler
than the size from the type. */ than the size from the type. */
if (init && TYPE_SIZE_UNIT (TREE_TYPE (init)) if (!ignore_init_type && init && TYPE_SIZE_UNIT (TREE_TYPE (init))
&& (TREE_CODE (TYPE_SIZE_UNIT (TREE_TYPE (init))) == INTEGER_CST && (TREE_CODE (TYPE_SIZE_UNIT (TREE_TYPE (init))) == INTEGER_CST
|| CONTAINS_PLACEHOLDER_P (size))) || CONTAINS_PLACEHOLDER_P (size)))
size = TYPE_SIZE_UNIT (TREE_TYPE (init)); size = TYPE_SIZE_UNIT (TREE_TYPE (init));
...@@ -1850,7 +1855,7 @@ build_allocator (tree type, tree init, tree result_type, Entity_Id gnat_proc, ...@@ -1850,7 +1855,7 @@ build_allocator (tree type, tree init, tree result_type, Entity_Id gnat_proc,
the maximum size. */ the maximum size. */
if (CONTAINS_PLACEHOLDER_P (size)) if (CONTAINS_PLACEHOLDER_P (size))
{ {
if (init) if (!ignore_init_type && init)
size = substitute_placeholder_in_expr (size, init); size = substitute_placeholder_in_expr (size, init);
else else
size = max_size (size, true); size = max_size (size, true);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment