This patch to the Go frontend is really from Martin Jambor.  It adjusts
the Go frontend for changes in the main body of the compiler.  This code
in the Go frontend is slated to move out of gcc/go/gofrontend into
gcc/go, hopefully sooner rather than later.  Bootstrapped and ran Go
testsuite on x86_64-unknown-linux-gnu.  Committed to mainline.

Ian

diff -r fb054e3636c2 go/gogo-tree.cc
--- a/go/gogo-tree.cc	Thu Sep 20 09:28:23 2012 -0700
+++ b/go/gogo-tree.cc	Thu Sep 20 10:02:17 2012 -0700
@@ -476,7 +476,6 @@
 
   DECL_SAVED_TREE(fndecl) = init_stmt_list;
 
-  current_function_decl = fndecl;
   if (DECL_STRUCT_FUNCTION(fndecl) == NULL)
     push_struct_function(fndecl);
   else
@@ -487,7 +486,6 @@
 
   cgraph_add_new_function(fndecl, false);
 
-  current_function_decl = NULL_TREE;
   pop_cfun();
 }
 
@@ -864,17 +862,13 @@
 	      // means that we need an fndecl.
 	      if (init_fndecl == NULL_TREE)
 		init_fndecl = this->initialization_function_decl();
-	      current_function_decl = init_fndecl;
 	      if (DECL_STRUCT_FUNCTION(init_fndecl) == NULL)
 		push_struct_function(init_fndecl);
 	      else
 		push_cfun(DECL_STRUCT_FUNCTION(init_fndecl));
-
 	      tree var_decl = is_sink ? NULL_TREE : vec[i];
 	      var_init_tree = no->var_value()->get_init_block(this, NULL,
 							      var_decl);
-
-	      current_function_decl = NULL_TREE;
 	      pop_cfun();
 	    }
 
@@ -1126,15 +1120,12 @@
 		cfun->function_end_locus =
                   func->block()->end_location().gcc_location();
 
-		current_function_decl = decl;
-
 		func->build_tree(gogo, this);
 
 		gimplify_function_tree(decl);
 
 		cgraph_finalize_function(decl, true);
 
-		current_function_decl = NULL_TREE;
 		pop_cfun();
 	      }
 	  }

Reply via email to