aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/semantics.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/semantics.c')
-rw-r--r--gcc/cp/semantics.c49
1 files changed, 25 insertions, 24 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index adb6023..bacb09a 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -420,7 +420,7 @@ maybe_cleanup_point_expr_void (tree expr)
void
add_decl_expr (tree decl)
{
- tree r = build_stmt (DECL_EXPR, decl);
+ tree r = build_stmt (input_location, DECL_EXPR, decl);
if (DECL_INITIAL (decl)
|| (DECL_SIZE (decl) && TREE_SIDE_EFFECTS (DECL_SIZE (decl))))
r = maybe_cleanup_point_expr_void (r);
@@ -441,7 +441,7 @@ do_poplevel (tree stmt_list)
if (!processing_template_decl)
{
- stmt_list = c_build_bind_expr (block, stmt_list);
+ stmt_list = c_build_bind_expr (input_location, block, stmt_list);
/* ??? See c_end_compound_stmt re statement expressions. */
}
@@ -466,7 +466,7 @@ do_pushlevel (scope_kind sk)
void
push_cleanup (tree decl, tree cleanup, bool eh_only)
{
- tree stmt = build_stmt (CLEANUP_STMT, NULL, cleanup, decl);
+ tree stmt = build_stmt (input_location, CLEANUP_STMT, NULL, cleanup, decl);
CLEANUP_EH_ONLY (stmt) = eh_only;
add_stmt (stmt);
CLEANUP_BODY (stmt) = push_stmt_list ();
@@ -561,7 +561,7 @@ finish_goto_stmt (tree destination)
check_goto (destination);
- return add_stmt (build_stmt (GOTO_EXPR, destination));
+ return add_stmt (build_stmt (input_location, GOTO_EXPR, destination));
}
/* COND is the condition-expression for an if, while, etc.,
@@ -624,7 +624,7 @@ finish_expr_stmt (tree expr)
if (TREE_CODE (expr) != CLEANUP_POINT_EXPR)
{
if (TREE_CODE (expr) != EXPR_STMT)
- expr = build_stmt (EXPR_STMT, expr);
+ expr = build_stmt (input_location, EXPR_STMT, expr);
expr = maybe_cleanup_point_expr_void (expr);
}
@@ -645,7 +645,7 @@ begin_if_stmt (void)
{
tree r, scope;
scope = do_pushlevel (sk_block);
- r = build_stmt (IF_STMT, NULL_TREE, NULL_TREE, NULL_TREE);
+ r = build_stmt (input_location, IF_STMT, NULL_TREE, NULL_TREE, NULL_TREE);
TREE_CHAIN (r) = scope;
begin_cond (&IF_COND (r));
return r;
@@ -707,7 +707,7 @@ tree
begin_while_stmt (void)
{
tree r;
- r = build_stmt (WHILE_STMT, NULL_TREE, NULL_TREE);
+ r = build_stmt (input_location, WHILE_STMT, NULL_TREE, NULL_TREE);
add_stmt (r);
WHILE_BODY (r) = do_pushlevel (sk_block);
begin_cond (&WHILE_COND (r));
@@ -739,7 +739,7 @@ finish_while_stmt (tree while_stmt)
tree
begin_do_stmt (void)
{
- tree r = build_stmt (DO_STMT, NULL_TREE, NULL_TREE);
+ tree r = build_stmt (input_location, DO_STMT, NULL_TREE, NULL_TREE);
add_stmt (r);
DO_BODY (r) = push_stmt_list ();
return r;
@@ -801,7 +801,7 @@ finish_return_stmt (tree expr)
}
}
- r = build_stmt (RETURN_EXPR, expr);
+ r = build_stmt (input_location, RETURN_EXPR, expr);
TREE_NO_WARNING (r) |= no_warning;
r = maybe_cleanup_point_expr_void (r);
r = add_stmt (r);
@@ -817,7 +817,7 @@ begin_for_stmt (void)
{
tree r;
- r = build_stmt (FOR_STMT, NULL_TREE, NULL_TREE,
+ r = build_stmt (input_location, FOR_STMT, NULL_TREE, NULL_TREE,
NULL_TREE, NULL_TREE);
if (flag_new_for_scope > 0)
@@ -908,7 +908,7 @@ finish_for_stmt (tree for_stmt)
tree
finish_break_stmt (void)
{
- return add_stmt (build_stmt (BREAK_STMT));
+ return add_stmt (build_stmt (input_location, BREAK_STMT));
}
/* Finish a continue-statement. */
@@ -916,7 +916,7 @@ finish_break_stmt (void)
tree
finish_continue_stmt (void)
{
- return add_stmt (build_stmt (CONTINUE_STMT));
+ return add_stmt (build_stmt (input_location, CONTINUE_STMT));
}
/* Begin a switch-statement. Returns a new SWITCH_STMT if
@@ -927,7 +927,7 @@ begin_switch_stmt (void)
{
tree r, scope;
- r = build_stmt (SWITCH_STMT, NULL_TREE, NULL_TREE, NULL_TREE);
+ r = build_stmt (input_location, SWITCH_STMT, NULL_TREE, NULL_TREE, NULL_TREE);
scope = do_pushlevel (sk_block);
TREE_CHAIN (r) = scope;
@@ -997,7 +997,7 @@ finish_switch_stmt (tree switch_stmt)
tree
begin_try_block (void)
{
- tree r = build_stmt (TRY_BLOCK, NULL_TREE, NULL_TREE);
+ tree r = build_stmt (input_location, TRY_BLOCK, NULL_TREE, NULL_TREE);
add_stmt (r);
TRY_STMTS (r) = push_stmt_list ();
return r;
@@ -1087,7 +1087,7 @@ begin_handler (void)
{
tree r;
- r = build_stmt (HANDLER, NULL_TREE, NULL_TREE);
+ r = build_stmt (input_location, HANDLER, NULL_TREE, NULL_TREE);
add_stmt (r);
/* Create a binding level for the eh_info and the exception object
@@ -1307,7 +1307,7 @@ finish_asm_stmt (int volatile_p, tree string, tree output_operands,
}
}
- r = build_stmt (ASM_EXPR, string,
+ r = build_stmt (input_location, ASM_EXPR, string,
output_operands, input_operands,
clobbers);
ASM_VOLATILE_P (r) = volatile_p || noutputs == 0;
@@ -1325,7 +1325,7 @@ finish_label_stmt (tree name)
if (decl == error_mark_node)
return error_mark_node;
- add_stmt (build_stmt (LABEL_EXPR, decl));
+ add_stmt (build_stmt (input_location, LABEL_EXPR, decl));
return decl;
}
@@ -1718,7 +1718,7 @@ finish_stmt_expr_expr (tree expr, tree stmt_expr)
if (processing_template_decl)
{
- expr = build_stmt (EXPR_STMT, expr);
+ expr = build_stmt (input_location, EXPR_STMT, expr);
expr = add_stmt (expr);
/* Mark the last statement so that we can recognize it as such at
template-instantiation time. */
@@ -1990,7 +1990,7 @@ finish_call_expr (tree fn, VEC(tree,gc) **args, bool disallow_virtual,
if (TREE_CODE (fn) == FUNCTION_DECL
&& (DECL_BUILT_IN_CLASS (fn) == BUILT_IN_NORMAL
|| DECL_BUILT_IN_CLASS (fn) == BUILT_IN_MD))
- result = resolve_overloaded_builtin (fn, *args);
+ result = resolve_overloaded_builtin (input_location, fn, *args);
if (!result)
/* A call to a namespace-scope function. */
@@ -2137,7 +2137,7 @@ finish_unary_op_expr (enum tree_code code, tree expr)
TREE_NEGATED_INT (result) = 1;
}
if (TREE_OVERFLOW_P (result) && !TREE_OVERFLOW_P (expr))
- overflow_warning (result);
+ overflow_warning (input_location, result);
return result;
}
@@ -2250,7 +2250,8 @@ finish_template_type_parm (tree aggr, tree identifier)
tree
finish_template_template_parm (tree aggr, tree identifier)
{
- tree decl = build_decl (TYPE_DECL, identifier, NULL_TREE);
+ tree decl = build_decl (input_location,
+ TYPE_DECL, identifier, NULL_TREE);
tree tmpl = build_lang_decl (TEMPLATE_DECL, identifier, NULL_TREE);
DECL_TEMPLATE_PARMS (tmpl) = current_template_parms;
DECL_TEMPLATE_RESULT (tmpl) = decl;
@@ -3330,7 +3331,7 @@ finalize_nrv_r (tree* tp, int* walk_subtrees, void* data)
init = build2 (INIT_EXPR, void_type_node, dp->result,
DECL_INITIAL (dp->var));
else
- init = build_empty_stmt ();
+ init = build_empty_stmt (EXPR_LOCATION (*tp));
DECL_INITIAL (dp->var) = NULL_TREE;
SET_EXPR_LOCUS (init, EXPR_LOCUS (*tp));
*tp = init;
@@ -4136,7 +4137,7 @@ handle_omp_for_class_iterator (int i, location_t locus, tree declv, tree initv,
TREE_CODE (cond), decl, diff,
tf_warning_or_error);
incr = build_modify_expr (elocus, decl, NULL_TREE, PLUS_EXPR,
- incr, NULL_TREE);
+ elocus, incr, NULL_TREE);
orig_body = *body;
*body = push_stmt_list ();
@@ -4427,7 +4428,7 @@ finish_omp_atomic (enum tree_code code, tree lhs, tree rhs)
}
if (!dependent_p)
{
- stmt = c_finish_omp_atomic (code, lhs, rhs);
+ stmt = c_finish_omp_atomic (input_location, code, lhs, rhs);
if (stmt == error_mark_node)
return;
}