OSDN Git Service

This hack to attach a line 0 source_location to the
authorgchare <gchare@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 5 Aug 2011 21:28:11 +0000 (21:28 +0000)
committergchare <gchare@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 5 Aug 2011 21:28:11 +0000 (21:28 +0000)
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@177485 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/decl.c

index ea66fa1..9fe6450 100644 (file)
@@ -1,3 +1,7 @@
+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>
 
        PR c++/47453
index f0d1a1a..265ca98 100644 (file)
@@ -13227,22 +13227,13 @@ finish_function (int flags)
     {
       if (DECL_MAIN_P (current_function_decl))
        {
-         tree stmt;
-
          /* Make it so that `main' always returns 0 by default (or
             1 for VMS).  */
 #if VMS_TARGET
-         stmt = finish_return_stmt (integer_one_node);
+         finish_return_stmt (integer_one_node);
 #else
-         stmt = finish_return_stmt (integer_zero_node);
+         finish_return_stmt (integer_zero_node);
 #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))