* gcc-interface/utils.c (create_label_decl): Add GNAT_NODE parameter
and invoke gnat_pushdecl on it. Remove obsolete settings.
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Label>: Adjust call to
create_label_decl.
* gcc-interface/trans.c (gnat_to_gnu) <N_Null): Likewise. Ignore the
label for debugging purposes.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@183606
138bc75d-0d04-0410-961f-
82ee72b054a4
2012-01-27 Eric Botcazou <ebotcazou@adacore.com>
2012-01-27 Eric Botcazou <ebotcazou@adacore.com>
+ * gcc-interface/gigi.h (create_label_decl): Adjust.
+ * gcc-interface/utils.c (create_label_decl): Add GNAT_NODE parameter
+ and invoke gnat_pushdecl on it. Remove obsolete settings.
+ * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Label>: Adjust call to
+ create_label_decl.
+ * gcc-interface/trans.c (gnat_to_gnu) <N_Null): Likewise. Ignore the
+ label for debugging purposes.
+
+2012-01-27 Eric Botcazou <ebotcazou@adacore.com>
+
* gcc-interface/decl.c (gnat_to_gnu_entity) <object>: For an aliased
object with an unconstrained nominal subtype and if optimization isn't
enabled, create a special VAR_DECL for debugging purposes.
* gcc-interface/decl.c (gnat_to_gnu_entity) <object>: For an aliased
object with an unconstrained nominal subtype and if optimization isn't
enabled, create a special VAR_DECL for debugging purposes.
- gnu_decl = create_label_decl (gnu_entity_name);
+ gnu_decl = create_label_decl (gnu_entity_name, gnat_entity);
extern tree create_param_decl (tree param_name, tree param_type,
bool readonly);
extern tree create_param_decl (tree param_name, tree param_type,
bool readonly);
-/* Return a LABEL_DECL node for LABEL_NAME. */
-extern tree create_label_decl (tree label_name);
+/* Return a LABEL_DECL with LABEL_NAME. GNAT_NODE is used for the position
+ of the decl. */
+extern tree create_label_decl (tree, Node_Id);
/* Return a FUNCTION_DECL node. SUBPROG_NAME is the name of the subprogram,
ASM_NAME is its assembler name, SUBPROG_TYPE is its type (a FUNCTION_TYPE
/* Return a FUNCTION_DECL node. SUBPROG_NAME is the name of the subprogram,
ASM_NAME is its assembler name, SUBPROG_TYPE is its type (a FUNCTION_TYPE
the next statement that the middle-end knows how to preserve. */
if (!optimize && Comes_From_Source (gnat_node))
{
the next statement that the middle-end knows how to preserve. */
if (!optimize && Comes_From_Source (gnat_node))
{
- tree stmt, label = create_label_decl (NULL_TREE);
+ tree stmt, label = create_label_decl (NULL_TREE, gnat_node);
+ DECL_IGNORED_P (label) = 1;
start_stmt_group ();
stmt = build1 (GOTO_EXPR, void_type_node, label);
set_expr_location_from_node (stmt, gnat_node);
start_stmt_group ();
stmt = build1 (GOTO_EXPR, void_type_node, label);
set_expr_location_from_node (stmt, gnat_node);
* *
* C Implementation File *
* *
* *
* C Implementation File *
* *
- * Copyright (C) 1992-2011, Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2012, Free Software Foundation, Inc. *
* *
* 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- *
* *
* 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- *
-/* Return a LABEL_DECL node for LABEL_NAME. */
+/* Return a LABEL_DECL with LABEL_NAME. GNAT_NODE is used for the position
+ of the decl. */
-create_label_decl (tree label_name)
+create_label_decl (tree label_name, Node_Id gnat_node)
- tree label_decl = build_decl (input_location,
- LABEL_DECL, label_name, void_type_node);
+ tree label_decl
+ = build_decl (input_location, LABEL_DECL, label_name, void_type_node);
- DECL_CONTEXT (label_decl) = current_function_decl;
- DECL_MODE (label_decl) = VOIDmode;
- DECL_SOURCE_LOCATION (label_decl) = input_location;
+ DECL_MODE (label_decl) = VOIDmode;
+
+ /* Add this decl to the current binding level. */
+ gnat_pushdecl (label_decl, gnat_node);