aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2018-09-26 09:16:54 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2018-09-26 09:16:54 +0000
commit738b83cd32bc4ebf651ef517cd880f04500d07af (patch)
tree2a5a822894fcb5b28e5cbe09f5dced2ca199f022 /gcc/ada/gcc-interface
parent3b9d159401751981118415b472dd0bdb68e862f6 (diff)
downloadgcc-738b83cd32bc4ebf651ef517cd880f04500d07af.zip
gcc-738b83cd32bc4ebf651ef517cd880f04500d07af.tar.gz
gcc-738b83cd32bc4ebf651ef517cd880f04500d07af.tar.bz2
[Ada] Set Current_Error_Node directly
This changes gigi to set Current_Error_Node directly, which should result in a more robust error handling. 2018-09-26 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * gcc-interface/gigi.h (error_gnat_node): Delete. * gcc-interface/trans.c (error_gnat_node): Likewise. (gigi): Replace it with Current_Error_Node. (gnat_to_gnu): Likewise. * gcc-interface/utils.c (rest_of_subprog_body_compilation): Likewise. * gcc-interface/misc.c (internal_error_function): Do not set it. From-SVN: r264607
Diffstat (limited to 'gcc/ada/gcc-interface')
-rw-r--r--gcc/ada/gcc-interface/gigi.h3
-rw-r--r--gcc/ada/gcc-interface/misc.c1
-rw-r--r--gcc/ada/gcc-interface/trans.c7
-rw-r--r--gcc/ada/gcc-interface/utils.c2
4 files changed, 3 insertions, 10 deletions
diff --git a/gcc/ada/gcc-interface/gigi.h b/gcc/ada/gcc-interface/gigi.h
index eb64a8b..3029732 100644
--- a/gcc/ada/gcc-interface/gigi.h
+++ b/gcc/ada/gcc-interface/gigi.h
@@ -214,9 +214,6 @@ extern void destroy_gnat_decl (void);
/* Highest number in the front-end node table. */
extern int max_gnat_nodes;
-/* Current node being treated, in case abort called. */
-extern Node_Id error_gnat_node;
-
/* True when gigi is being called on an analyzed but unexpanded
tree, and the only purpose of the call is to properly annotate
types with representation information. */
diff --git a/gcc/ada/gcc-interface/misc.c b/gcc/ada/gcc-interface/misc.c
index 9ee73b9..16a9d2c 100644
--- a/gcc/ada/gcc-interface/misc.c
+++ b/gcc/ada/gcc-interface/misc.c
@@ -347,7 +347,6 @@ internal_error_function (diagnostic_context *context, const char *msgid,
sp_loc.Bounds = &temp_loc;
sp_loc.Array = loc;
- Current_Error_Node = error_gnat_node;
Compiler_Abort (sp, sp_loc, true);
}
diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c
index 3e129b6..12f6a87 100644
--- a/gcc/ada/gcc-interface/trans.c
+++ b/gcc/ada/gcc-interface/trans.c
@@ -86,9 +86,6 @@ struct List_Header *List_Headers_Ptr;
/* Highest number in the front-end node table. */
int max_gnat_nodes;
-/* Current node being treated, in case abort called. */
-Node_Id error_gnat_node;
-
/* True when gigi is being called on an analyzed but unexpanded
tree, and the only purpose of the call is to properly annotate
types with representation information. */
@@ -719,7 +716,7 @@ gigi (Node_Id gnat_root,
destroy_gnat_utils ();
/* We cannot track the location of errors past this point. */
- error_gnat_node = Empty;
+ Current_Error_Node = Empty;
}
/* Return a subprogram decl corresponding to __gnat_rcheck_xx for the given
@@ -5910,7 +5907,7 @@ gnat_to_gnu (Node_Id gnat_node)
bool sync = false;
/* Save node number for error message and set location information. */
- error_gnat_node = gnat_node;
+ Current_Error_Node = gnat_node;
Sloc_to_locus (Sloc (gnat_node), &input_location);
/* If we are only annotating types and this node is a statement, return
diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c
index 313d984..73ab562b 100644
--- a/gcc/ada/gcc-interface/utils.c
+++ b/gcc/ada/gcc-interface/utils.c
@@ -3389,7 +3389,7 @@ void
rest_of_subprog_body_compilation (tree subprog_decl)
{
/* We cannot track the location of errors past this point. */
- error_gnat_node = Empty;
+ Current_Error_Node = Empty;
/* If we're only annotating types, don't actually compile this function. */
if (type_annotate_only)