Commit 7cfea2ef by Gabriel Charette Committed by Gabriel Charette

This hack to attach a line 0 source_location to the return statement of main...

This hack to attach a line 0 source_location to the
return statement of main, after parsing is over, was
creating a bug in the line_table, creating an extra
entry, which was creating problems now that we are
trying to serialize the line_table in pph.

* decl.c (finish_function): Remove unecessary line 0 hack.

From-SVN: r177485
parent 9911e25a
2011-08-05 Gabriel Charette <gchare@google.com>
* decl.c (finish_function): Remove unecessary line 0 hack.
2011-08-05 Jason Merrill <jason@redhat.com> 2011-08-05 Jason Merrill <jason@redhat.com>
PR c++/47453 PR c++/47453
......
...@@ -13227,22 +13227,13 @@ finish_function (int flags) ...@@ -13227,22 +13227,13 @@ finish_function (int flags)
{ {
if (DECL_MAIN_P (current_function_decl)) if (DECL_MAIN_P (current_function_decl))
{ {
tree stmt;
/* Make it so that `main' always returns 0 by default (or /* Make it so that `main' always returns 0 by default (or
1 for VMS). */ 1 for VMS). */
#if VMS_TARGET #if VMS_TARGET
stmt = finish_return_stmt (integer_one_node); finish_return_stmt (integer_one_node);
#else #else
stmt = finish_return_stmt (integer_zero_node); finish_return_stmt (integer_zero_node);
#endif #endif
/* Hack. We don't want the middle-end to warn that this
return is unreachable, so put the statement on the
special line 0. */
{
location_t linezero = linemap_line_start (line_table, 0, 1);
SET_EXPR_LOCATION (stmt, linezero);
}
} }
if (use_eh_spec_block (current_function_decl)) if (use_eh_spec_block (current_function_decl))
......
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