Commit cfc839a4 by Eric Botcazou Committed by Eric Botcazou

trans.c (gigi): Fix formatting issues.

	* gcc-interface/trans.c (gigi): Fix formatting issues.
	(build_raise_check): Likewise.
	(gnat_to_gnu): Likewise.
	* gcc-interface/utils2.c (build_call_raise_range): Likewise.
	(build_call_raise_column): Likewise.

From-SVN: r166017
parent 4a8f6a63
2010-10-27 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.c (gigi): Fix formatting issues.
(build_raise_check): Likewise.
(gnat_to_gnu): Likewise.
* gcc-interface/utils2.c (build_call_raise_range): Likewise.
(build_call_raise_column): Likewise.
2010-10-26 Robert Dewar <dewar@adacore.com> 2010-10-26 Robert Dewar <dewar@adacore.com>
* exp_ch5.adb, exp_prag.adb, sem_ch3.adb, exp_atag.adb, layout.adb, * exp_ch5.adb, exp_prag.adb, sem_ch3.adb, exp_atag.adb, layout.adb,
......
...@@ -469,13 +469,12 @@ gigi (Node_Id gnat_root, int max_gnat_node, int number_name ATTRIBUTE_UNUSED, ...@@ -469,13 +469,12 @@ gigi (Node_Id gnat_root, int max_gnat_node, int number_name ATTRIBUTE_UNUSED,
integer_type_node, integer_type_node,
t))), t))),
NULL_TREE, false, true, true, NULL, Empty); NULL_TREE, false, true, true, NULL, Empty);
for (i = 0; i < (int) ARRAY_SIZE (gnat_raise_decls); i++)
gnat_raise_decls[i] = decl;
TREE_THIS_VOLATILE (decl) = 1; TREE_THIS_VOLATILE (decl) = 1;
TREE_SIDE_EFFECTS (decl) = 1; TREE_SIDE_EFFECTS (decl) = 1;
TREE_TYPE (decl) TREE_TYPE (decl)
= build_qualified_type (TREE_TYPE (decl), TYPE_QUAL_VOLATILE); = build_qualified_type (TREE_TYPE (decl), TYPE_QUAL_VOLATILE);
for (i = 0; i < (int) ARRAY_SIZE (gnat_raise_decls); i++)
gnat_raise_decls[i] = decl;
} }
else else
{ {
...@@ -647,37 +646,42 @@ build_raise_check (int check, tree void_tree, enum exception_info_kind kind) ...@@ -647,37 +646,42 @@ build_raise_check (int check, tree void_tree, enum exception_info_kind kind)
if (kind != exception_simple) if (kind != exception_simple)
{ {
sprintf (name, "__gnat_rcheck_%.2d_ext", check); sprintf (name, "__gnat_rcheck_%.2d_ext", check);
result = create_subprog_decl result
(get_identifier (name), NULL_TREE, = create_subprog_decl
build_function_type (get_identifier (name), NULL_TREE,
build_function_type
(void_type_node, (void_type_node,
tree_cons tree_cons
(NULL_TREE, (NULL_TREE, build_pointer_type (unsigned_char_type_node),
build_pointer_type (unsigned_char_type_node), tree_cons (NULL_TREE, integer_type_node,
tree_cons (NULL_TREE, integer_type_node, tree_cons (NULL_TREE, integer_type_node,
tree_cons (NULL_TREE, integer_type_node, kind == exception_column
kind == exception_column ? void_tree : ? void_tree
tree_cons (NULL_TREE, integer_type_node, : tree_cons (NULL_TREE, integer_type_node,
tree_cons (NULL_TREE, integer_type_node, void_tree)))))), tree_cons (NULL_TREE,
NULL_TREE, false, true, true, NULL, Empty); integer_type_node,
void_tree)))))),
NULL_TREE, false, true, true, NULL, Empty);
} }
else else
{ {
sprintf (name, "__gnat_rcheck_%.2d", check); sprintf (name, "__gnat_rcheck_%.2d", check);
result = create_subprog_decl result
(get_identifier (name), NULL_TREE, = create_subprog_decl
build_function_type (get_identifier (name), NULL_TREE,
build_function_type
(void_type_node, (void_type_node,
tree_cons tree_cons
(NULL_TREE, (NULL_TREE, build_pointer_type (unsigned_char_type_node),
build_pointer_type (unsigned_char_type_node), tree_cons (NULL_TREE, integer_type_node, void_tree))),
tree_cons (NULL_TREE, integer_type_node, void_tree))), NULL_TREE, false, true, true, NULL, Empty);
NULL_TREE, false, true, true, NULL, Empty);
} }
TREE_THIS_VOLATILE (result) = 1; TREE_THIS_VOLATILE (result) = 1;
TREE_SIDE_EFFECTS (result) = 1; TREE_SIDE_EFFECTS (result) = 1;
TREE_TYPE (result) TREE_TYPE (result)
= build_qualified_type (TREE_TYPE (result), TYPE_QUAL_VOLATILE); = build_qualified_type (TREE_TYPE (result), TYPE_QUAL_VOLATILE);
return result; return result;
} }
...@@ -5602,8 +5606,8 @@ gnat_to_gnu (Node_Id gnat_node) ...@@ -5602,8 +5606,8 @@ gnat_to_gnu (Node_Id gnat_node)
case N_Raise_Program_Error: case N_Raise_Program_Error:
case N_Raise_Storage_Error: case N_Raise_Storage_Error:
{ {
int reason = UI_To_Int (Reason (gnat_node)); const int reason = UI_To_Int (Reason (gnat_node));
Node_Id cond = Condition (gnat_node); const Node_Id cond = Condition (gnat_node);
bool handled = false; bool handled = false;
if (type_annotate_only) if (type_annotate_only)
...@@ -5622,8 +5626,8 @@ gnat_to_gnu (Node_Id gnat_node) ...@@ -5622,8 +5626,8 @@ gnat_to_gnu (Node_Id gnat_node)
{ {
if (reason == CE_Access_Check_Failed) if (reason == CE_Access_Check_Failed)
{ {
handled = true;
gnu_result = build_call_raise_column (reason, gnat_node); gnu_result = build_call_raise_column (reason, gnat_node);
handled = true;
} }
else if ((reason == CE_Index_Check_Failed else if ((reason == CE_Index_Check_Failed
|| reason == CE_Range_Check_Failed || reason == CE_Range_Check_Failed
...@@ -5640,12 +5644,14 @@ gnat_to_gnu (Node_Id gnat_node) ...@@ -5640,12 +5644,14 @@ gnat_to_gnu (Node_Id gnat_node)
&& Known_Esize (type) && Known_Esize (type)
&& UI_To_Int (Esize (type)) <= 32) && UI_To_Int (Esize (type)) <= 32)
{ {
Node_Id right_op = Right_Opnd (op);
gnu_result
= build_call_raise_range
(reason, gnat_node,
gnat_to_gnu (index), /* index */
gnat_to_gnu (Low_Bound (right_op)), /* first */
gnat_to_gnu (High_Bound (right_op))); /* last */
handled = true; handled = true;
gnu_result = build_call_raise_range
(reason, gnat_node,
gnat_to_gnu (index), /* index */
gnat_to_gnu (Low_Bound (Right_Opnd (op))), /* first */
gnat_to_gnu (High_Bound (Right_Opnd (op)))); /* last */
} }
} }
} }
...@@ -5654,20 +5660,18 @@ gnat_to_gnu (Node_Id gnat_node) ...@@ -5654,20 +5660,18 @@ gnat_to_gnu (Node_Id gnat_node)
{ {
set_expr_location_from_node (gnu_result, gnat_node); set_expr_location_from_node (gnu_result, gnat_node);
gnu_result = build3 (COND_EXPR, void_type_node, gnu_result = build3 (COND_EXPR, void_type_node,
gnat_to_gnu (cond), gnat_to_gnu (cond),
gnu_result, alloc_stmt_list ()); gnu_result, alloc_stmt_list ());
} }
else else
{ {
gnu_result = build_call_raise (reason, gnat_node, kind); gnu_result = build_call_raise (reason, gnat_node, kind);
/* If the type is VOID, this is a statement, so we need to /* If the type is VOID, this is a statement, so we need to generate
generate the code for the call. Handle a Condition, if there the code for the call. Handle a Condition, if there is one. */
is one. */
if (TREE_CODE (gnu_result_type) == VOID_TYPE) if (TREE_CODE (gnu_result_type) == VOID_TYPE)
{ {
set_expr_location_from_node (gnu_result, gnat_node); set_expr_location_from_node (gnu_result, gnat_node);
if (Present (cond)) if (Present (cond))
gnu_result = build3 (COND_EXPR, void_type_node, gnu_result = build3 (COND_EXPR, void_type_node,
gnat_to_gnu (cond), gnat_to_gnu (cond),
......
...@@ -1590,8 +1590,8 @@ build_call_raise_range (int msg, Node_Id gnat_node, ...@@ -1590,8 +1590,8 @@ build_call_raise_range (int msg, Node_Id gnat_node,
build_index_type (size_int (len))); build_index_type (size_int (len)));
call = build_call_nary (TREE_TYPE (TREE_TYPE (fndecl)), call = build_call_nary (TREE_TYPE (TREE_TYPE (fndecl)),
build_unary_op (ADDR_EXPR, NULL_TREE, fndecl), build_unary_op (ADDR_EXPR, NULL_TREE, fndecl),
6, 6,
build1 (ADDR_EXPR, build1 (ADDR_EXPR,
build_pointer_type (unsigned_char_type_node), build_pointer_type (unsigned_char_type_node),
filename), filename),
...@@ -1644,8 +1644,8 @@ build_call_raise_column (int msg, Node_Id gnat_node) ...@@ -1644,8 +1644,8 @@ build_call_raise_column (int msg, Node_Id gnat_node)
build_index_type (size_int (len))); build_index_type (size_int (len)));
call = build_call_nary (TREE_TYPE (TREE_TYPE (fndecl)), call = build_call_nary (TREE_TYPE (TREE_TYPE (fndecl)),
build_unary_op (ADDR_EXPR, NULL_TREE, fndecl), build_unary_op (ADDR_EXPR, NULL_TREE, fndecl),
3, 3,
build1 (ADDR_EXPR, build1 (ADDR_EXPR,
build_pointer_type (unsigned_char_type_node), build_pointer_type (unsigned_char_type_node),
filename), filename),
......
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