summaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authoraldyh <aldyh@138bc75d-0d04-0410-961f-82ee72b054a4>2009-06-13 17:12:50 +0000
committeraldyh <aldyh@138bc75d-0d04-0410-961f-82ee72b054a4>2009-06-13 17:12:50 +0000
commitf3c9930a316a2884d172638420a4aea9cbf7dc4c (patch)
treeb009cefe74ecc29902a3fe07b35f69de0385e7ae /gcc/ada
parent286fa50886ae02104bc82d300ec2379b478f917e (diff)
downloadgcc-f3c9930a316a2884d172638420a4aea9cbf7dc4c.tar.gz
* gcc-interface/utils.c (record_builtin_type): Pass location
argument to build_decl. (create_type_stub_decl): Same. (create_type_decl): Same. (create_var_decl_1): Same. (create_field_decl): Same. (create_param_decl): Same. (create_label_decl): Same. (build_decl): Same. (create_subprog_decl): Same. * gcc-interface/decl.c (gnat_to_gnu_entity): Same. * gcc-interface/trans.c (Case_Statement_to_gnu): Pass location argument to create_artificial_label. (Case_Statement_to_gnu): Same. (Loop_Statement_to_gnu): Same. (Subprogram_Body_to_gnu): Same. (gnat_gimplify_stmt): Same. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@148459 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/ChangeLog20
-rw-r--r--gcc/ada/gcc-interface/decl.c6
-rw-r--r--gcc/ada/gcc-interface/trans.c17
-rw-r--r--gcc/ada/gcc-interface/utils.c27
4 files changed, 52 insertions, 18 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index b3a38faf220..cd160a21891 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,23 @@
+2009-06-13 Aldy Hernandez <aldyh@redhat.com>
+
+ * gcc-interface/utils.c (record_builtin_type): Pass location
+ argument to build_decl.
+ (create_type_stub_decl): Same.
+ (create_type_decl): Same.
+ (create_var_decl_1): Same.
+ (create_field_decl): Same.
+ (create_param_decl): Same.
+ (create_label_decl): Same.
+ (build_decl): Same.
+ (create_subprog_decl): Same.
+ * gcc-interface/decl.c (gnat_to_gnu_entity): Same.
+ * gcc-interface/trans.c (Case_Statement_to_gnu): Pass location
+ argument to create_artificial_label.
+ (Case_Statement_to_gnu): Same.
+ (Loop_Statement_to_gnu): Same.
+ (Subprogram_Body_to_gnu): Same.
+ (gnat_gimplify_stmt): Same.
+
2009-06-11 Richard Henderson <rth@redhat.com>
* gcc-interface/misc.c (gnat_handle_option): Rename
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index 14a0cd19914..63ade27c5e9 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -574,7 +574,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
if (Present (Debug_Renaming_Link (gnat_entity)))
{
rtx addr;
- gnu_decl = build_decl (VAR_DECL, gnu_entity_name, gnu_type);
+ gnu_decl = build_decl (input_location,
+ VAR_DECL, gnu_entity_name, gnu_type);
/* The (MEM (CONST (0))) pattern is prescribed by STABS. */
if (global_bindings_p ())
addr = gen_rtx_CONST (VOIDmode, const0_rtx);
@@ -2833,7 +2834,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
base type of the parent subtype. */
gnu_get_parent = build3 (COMPONENT_REF, void_type_node,
build0 (PLACEHOLDER_EXPR, gnu_type),
- build_decl (FIELD_DECL, NULL_TREE,
+ build_decl (input_location,
+ FIELD_DECL, NULL_TREE,
void_type_node),
NULL_TREE);
diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c
index d37e3c1971f..b59af8cdb19 100644
--- a/gcc/ada/gcc-interface/trans.c
+++ b/gcc/ada/gcc-interface/trans.c
@@ -1843,7 +1843,8 @@ Case_Statement_to_gnu (Node_Id gnat_node)
/* We build a SWITCH_EXPR that contains the code with interspersed
CASE_LABEL_EXPRs for each label. */
- push_stack (&gnu_switch_label_stack, NULL_TREE, create_artificial_label ());
+ push_stack (&gnu_switch_label_stack, NULL_TREE,
+ create_artificial_label (input_location));
start_stmt_group ();
for (gnat_when = First_Non_Pragma (Alternatives (gnat_node));
Present (gnat_when);
@@ -1908,9 +1909,10 @@ Case_Statement_to_gnu (Node_Id gnat_node)
if ((!gnu_low || TREE_CODE (gnu_low) == INTEGER_CST)
&& (!gnu_high || TREE_CODE (gnu_high) == INTEGER_CST))
{
- add_stmt_with_node (build3 (CASE_LABEL_EXPR, void_type_node,
- gnu_low, gnu_high,
- create_artificial_label ()),
+ add_stmt_with_node (build3
+ (CASE_LABEL_EXPR, void_type_node,
+ gnu_low, gnu_high,
+ create_artificial_label (input_location)),
gnat_choice);
choices_added++;
}
@@ -1953,7 +1955,7 @@ Loop_Statement_to_gnu (Node_Id gnat_node)
TREE_TYPE (gnu_loop_stmt) = void_type_node;
TREE_SIDE_EFFECTS (gnu_loop_stmt) = 1;
- LOOP_STMT_LABEL (gnu_loop_stmt) = create_artificial_label ();
+ LOOP_STMT_LABEL (gnu_loop_stmt) = create_artificial_label (input_location);
set_expr_location_from_node (gnu_loop_stmt, gnat_node);
Sloc_to_locus (Sloc (End_Label (gnat_node)),
&DECL_SOURCE_LOCATION (LOOP_STMT_LABEL (gnu_loop_stmt)));
@@ -2213,7 +2215,8 @@ Subprogram_Body_to_gnu (Node_Id gnat_node)
properly copies them out. We do this by making a new block and converting
any inner return into a goto to a label at the end of the block. */
push_stack (&gnu_return_label_stack, NULL_TREE,
- gnu_cico_list ? create_artificial_label () : NULL_TREE);
+ gnu_cico_list ? create_artificial_label (input_location)
+ : NULL_TREE);
/* Get a tree corresponding to the code for the subprogram. */
start_stmt_group ();
@@ -5875,7 +5878,7 @@ gnat_gimplify_stmt (tree *stmt_p)
case LOOP_STMT:
{
- tree gnu_start_label = create_artificial_label ();
+ tree gnu_start_label = create_artificial_label (input_location);
tree gnu_end_label = LOOP_STMT_LABEL (stmt);
tree t;
diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c
index f3755a01631..922e2941506 100644
--- a/gcc/ada/gcc-interface/utils.c
+++ b/gcc/ada/gcc-interface/utils.c
@@ -547,7 +547,8 @@ gnat_init_decl_processing (void)
void
record_builtin_type (const char *name, tree type)
{
- tree type_decl = build_decl (TYPE_DECL, get_identifier (name), type);
+ tree type_decl = build_decl (input_location,
+ TYPE_DECL, get_identifier (name), type);
gnat_pushdecl (type_decl, Empty);
@@ -1244,7 +1245,8 @@ create_type_stub_decl (tree type_name, tree type)
/* Using a named TYPE_DECL ensures that a type name marker is emitted in
STABS while setting DECL_ARTIFICIAL ensures that no DW_TAG_typedef is
emitted in DWARF. */
- tree type_decl = build_decl (TYPE_DECL, type_name, type);
+ tree type_decl = build_decl (input_location,
+ TYPE_DECL, type_name, type);
DECL_ARTIFICIAL (type_decl) = 1;
return type_decl;
}
@@ -1274,7 +1276,8 @@ create_type_decl (tree type_name, tree type, struct attrib *attr_list,
DECL_NAME (type_decl) = type_name;
}
else
- type_decl = build_decl (TYPE_DECL, type_name, type);
+ type_decl = build_decl (input_location,
+ TYPE_DECL, type_name, type);
DECL_ARTIFICIAL (type_decl) = artificial_p;
gnat_pushdecl (type_decl, gnat_node);
@@ -1352,7 +1355,8 @@ create_var_decl_1 (tree var_name, tree asm_name, tree type, tree var_init,
/* The actual DECL node. CONST_DECL was initially intended for enumerals
and may be used for scalars in general but not for aggregates. */
tree var_decl
- = build_decl ((constant_p && const_decl_allowed_p
+ = build_decl (input_location,
+ (constant_p && const_decl_allowed_p
&& !AGGREGATE_TYPE_P (type)) ? CONST_DECL : VAR_DECL,
var_name, type);
@@ -1465,7 +1469,8 @@ tree
create_field_decl (tree field_name, tree field_type, tree record_type,
int packed, tree size, tree pos, int addressable)
{
- tree field_decl = build_decl (FIELD_DECL, field_name, field_type);
+ tree field_decl = build_decl (input_location,
+ FIELD_DECL, field_name, field_type);
DECL_CONTEXT (field_decl) = record_type;
TREE_READONLY (field_decl) = TYPE_READONLY (field_type);
@@ -1606,7 +1611,8 @@ create_field_decl (tree field_name, tree field_type, tree record_type,
tree
create_param_decl (tree param_name, tree param_type, bool readonly)
{
- tree param_decl = build_decl (PARM_DECL, param_name, param_type);
+ tree param_decl = build_decl (input_location,
+ PARM_DECL, param_name, param_type);
/* Honor TARGET_PROMOTE_PROTOTYPES like the C compiler, as not doing so
can lead to various ABI violations. */
@@ -1786,7 +1792,8 @@ potential_alignment_gap (tree prev_field, tree curr_field, tree offset)
tree
create_label_decl (tree label_name)
{
- tree label_decl = build_decl (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;
@@ -1810,7 +1817,8 @@ create_subprog_decl (tree subprog_name, tree asm_name,
struct attrib *attr_list, Node_Id gnat_node)
{
tree return_type = TREE_TYPE (subprog_type);
- tree subprog_decl = build_decl (FUNCTION_DECL, subprog_name, subprog_type);
+ tree subprog_decl = build_decl (input_location,
+ FUNCTION_DECL, subprog_name, subprog_type);
/* If this is a non-inline function nested inside an inlined external
function, we cannot honor both requests without cloning the nested
@@ -1831,7 +1839,8 @@ create_subprog_decl (tree subprog_name, tree asm_name,
TREE_SIDE_EFFECTS (subprog_decl) = TYPE_VOLATILE (subprog_type);
DECL_DECLARED_INLINE_P (subprog_decl) = inline_flag;
DECL_ARGUMENTS (subprog_decl) = param_decl_list;
- DECL_RESULT (subprog_decl) = build_decl (RESULT_DECL, 0, return_type);
+ DECL_RESULT (subprog_decl) = build_decl (input_location,
+ RESULT_DECL, 0, return_type);
DECL_ARTIFICIAL (DECL_RESULT (subprog_decl)) = 1;
DECL_IGNORED_P (DECL_RESULT (subprog_decl)) = 1;