]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
compiler: Really only make descriptors when needed.
authorIan Lance Taylor <ian@gcc.gnu.org>
Fri, 21 Jun 2013 00:29:54 +0000 (00:29 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Fri, 21 Jun 2013 00:29:54 +0000 (00:29 +0000)
From-SVN: r200280

gcc/go/gofrontend/expressions.cc
gcc/go/gofrontend/expressions.h

index 240e4558d9d83c26fc22da2bf55e385d426bcdfa..9f3b6f5184829ae8e333ed65a322e011917d98ae 100644 (file)
@@ -1242,24 +1242,6 @@ Func_expression::do_traverse(Traverse* traverse)
          : Expression::traverse(&this->closure_, traverse));
 }
 
-// Lower a function reference.  If this reference is not called
-// directly, make sure there is a function descriptor.
-
-Expression*
-Func_expression::do_lower(Gogo* gogo, Named_object*, Statement_inserter*, int)
-{
-  // Make sure that the descriptor exists.  FIXME: If the function is
-  // only ever called, and is never referenced otherwise, then we
-  // don't need the descriptor.  We could do that with another pass
-  // over the tree.
-  if (this->closure_ == NULL
-      && this->function_->is_function()
-      && !this->function_->func_value()->is_method())
-    this->function_->func_value()->descriptor(gogo, this->function_);
-
-  return this;
-}
-
 // Return the type of a function expression.
 
 Type*
index 133b23789b55a286331a2c900f1f99c5a5c40263..dd00286f4df6192f14e08fb5b6d759074394dea7 100644 (file)
@@ -1524,9 +1524,6 @@ class Func_expression : public Expression
   int
   do_traverse(Traverse*);
 
-  Expression*
-  do_lower(Gogo*, Named_object*, Statement_inserter*, int);
-
   Type*
   do_type();