compiler: don't pass iota value to lowering pass

It is no longer used.  The iota value is now handled in the
determine-types pass.

Change-Id: I321802161f7d922dacaa2427da72e90c869e6f64
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/536644
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
diff --git a/go/expressions.cc b/go/expressions.cc
index a09d33b..51ff020 100644
--- a/go/expressions.cc
+++ b/go/expressions.cc
@@ -1007,7 +1007,7 @@
 
 Expression*
 Var_expression::do_lower(Gogo* gogo, Named_object* function,
-			 Statement_inserter* inserter, int)
+			 Statement_inserter* inserter)
 {
   if (this->variable_->is_variable())
     {
@@ -1158,7 +1158,7 @@
 
 Expression*
 Enclosed_var_expression::do_lower(Gogo* gogo, Named_object* function,
-				  Statement_inserter* inserter, int)
+				  Statement_inserter* inserter)
 {
   gogo->lower_expression(function, inserter, &this->reference_);
   return this;
@@ -2097,7 +2097,7 @@
 // Lower a reference to an unknown name.
 
 Expression*
-Unknown_expression::do_lower(Gogo*, Named_object*, Statement_inserter*, int)
+Unknown_expression::do_lower(Gogo*, Named_object*, Statement_inserter*)
 {
   if (this->is_error_expression())
     return Expression::make_error(this->location());
@@ -3642,7 +3642,7 @@
 // predeclared constant iota into an integer value.
 
 Expression*
-Const_expression::do_lower(Gogo* gogo, Named_object*, Statement_inserter*, int)
+Const_expression::do_lower(Gogo* gogo, Named_object*, Statement_inserter*)
 {
   Location loc = this->location();
 
@@ -4120,7 +4120,7 @@
   { }
 
   Expression*
-  do_lower(Gogo*, Named_object*, Statement_inserter*, int)
+  do_lower(Gogo*, Named_object*, Statement_inserter*)
   { go_unreachable(); }
 
   // There should only ever be one of these.
@@ -4171,7 +4171,7 @@
 
 Expression*
 Type_conversion_expression::do_lower(Gogo* gogo, Named_object*,
-				     Statement_inserter* inserter, int)
+				     Statement_inserter* inserter)
 {
   Type* type = this->type_;
   Expression* val = this->expr_;
@@ -4997,7 +4997,7 @@
 // instead.
 
 Expression*
-Unary_expression::do_lower(Gogo* gogo, Named_object*, Statement_inserter*, int)
+Unary_expression::do_lower(Gogo* gogo, Named_object*, Statement_inserter*)
 {
   Location loc = this->location();
 
@@ -6677,7 +6677,7 @@
 
 Expression*
 Binary_expression::do_lower(Gogo* gogo, Named_object*,
-			    Statement_inserter* inserter, int)
+			    Statement_inserter* inserter)
 {
   Location location = this->location();
 
@@ -8955,7 +8955,7 @@
   do_issue_nil_check();
 
   Expression*
-  do_lower(Gogo*, Named_object*, Statement_inserter*, int);
+  do_lower(Gogo*, Named_object*, Statement_inserter*);
 
   Expression*
   do_copy()
@@ -9030,7 +9030,7 @@
 // Lower a selector expression to the resolved value.
 
 Expression*
-Selector_expression::do_lower(Gogo*, Named_object*, Statement_inserter*, int)
+Selector_expression::do_lower(Gogo*, Named_object*, Statement_inserter*)
 {
   if (this->is_error_expression() || this->resolved_ == NULL)
     return Expression::make_error(this->location());
@@ -9360,7 +9360,7 @@
 
 Expression*
 Builtin_call_expression::do_lower(Gogo* gogo, Named_object* function,
-				  Statement_inserter* inserter, int)
+				  Statement_inserter* inserter)
 {
   if (this->is_error_expression())
     return this;
@@ -12564,7 +12564,7 @@
 
 Expression*
 Call_expression::do_lower(Gogo* gogo, Named_object*,
-			  Statement_inserter* inserter, int)
+			  Statement_inserter* inserter)
 {
   if (this->lowered_ != NULL)
     return this->lowered_;
@@ -14836,7 +14836,7 @@
 // expression into an array index, a string index, or a map index.
 
 Expression*
-Index_expression::do_lower(Gogo*, Named_object*, Statement_inserter*, int)
+Index_expression::do_lower(Gogo*, Named_object*, Statement_inserter*)
 {
   if (this->is_error_expression())
     return Expression::make_error(this->location());
@@ -16211,7 +16211,7 @@
 
 Expression*
 Field_reference_expression::do_lower(Gogo* gogo, Named_object* function,
-				     Statement_inserter* inserter, int)
+				     Statement_inserter* inserter)
 {
   Struct_type* struct_type = this->expr_->type()->struct_type();
   if (struct_type == NULL)
@@ -18018,7 +18018,7 @@
   do_determine_type(Gogo*, const Type_context*);
 
   Expression*
-  do_lower(Gogo*, Named_object*, Statement_inserter*, int);
+  do_lower(Gogo*, Named_object*, Statement_inserter*);
 
   Expression*
   do_copy()
@@ -18084,7 +18084,7 @@
 
 Expression*
 Composite_literal_key_expression::do_lower(Gogo*, Named_object*,
-					   Statement_inserter*, int)
+					   Statement_inserter*)
 {
   if (this->is_error_expression())
     return Expression::make_error(this->location());
@@ -18658,7 +18658,7 @@
 
 Expression*
 Composite_literal_expression::do_lower(Gogo* gogo, Named_object* function,
-				       Statement_inserter* inserter, int)
+				       Statement_inserter* inserter)
 {
   if (this->is_error_expression() || this->type_->is_error())
     return Expression::make_error(this->location());
diff --git a/go/expressions.h b/go/expressions.h
index 8763772..0eddb58 100644
--- a/go/expressions.h
+++ b/go/expressions.h
@@ -990,9 +990,8 @@
   // which could not be fully parsed into their final form.  It
   // returns the same Expression or a new one.
   Expression*
-  lower(Gogo* gogo, Named_object* function, Statement_inserter* inserter,
-	int iota_value)
-  { return this->do_lower(gogo, function, inserter, iota_value); }
+  lower(Gogo* gogo, Named_object* function, Statement_inserter* inserter)
+  { return this->do_lower(gogo, function, inserter); }
 
   // Flatten an expression. This is called after order_evaluation.
   // FUNCTION is the function we are in; it will be NULL for an
@@ -1162,7 +1161,7 @@
 
   // Return a lowered expression.
   virtual Expression*
-  do_lower(Gogo*, Named_object*, Statement_inserter*, int)
+  do_lower(Gogo*, Named_object*, Statement_inserter*)
   { return this; }
 
   // Return a flattened expression.
@@ -1472,7 +1471,7 @@
 
  protected:
   virtual Expression*
-  do_lower(Gogo*, Named_object*, Statement_inserter*, int) = 0;
+  do_lower(Gogo*, Named_object*, Statement_inserter*) = 0;
 
   Bexpression*
   do_get_backend(Translate_context*)
@@ -1511,7 +1510,7 @@
   do_traverse(Traverse*);
 
   Expression*
-  do_lower(Gogo*, Named_object*, Statement_inserter*, int);
+  do_lower(Gogo*, Named_object*, Statement_inserter*);
 
   bool
   do_is_constant() const
@@ -1599,7 +1598,7 @@
 
  protected:
   Expression*
-  do_lower(Gogo*, Named_object*, Statement_inserter*, int);
+  do_lower(Gogo*, Named_object*, Statement_inserter*);
 
   Type*
   do_type();
@@ -1663,7 +1662,7 @@
   do_traverse(Traverse*);
 
   Expression*
-  do_lower(Gogo*, Named_object*, Statement_inserter*, int);
+  do_lower(Gogo*, Named_object*, Statement_inserter*);
 
   Expression*
   do_flatten(Gogo*, Named_object*, Statement_inserter*);
@@ -1953,7 +1952,7 @@
   do_traverse(Traverse* traverse);
 
   Expression*
-  do_lower(Gogo*, Named_object*, Statement_inserter*, int);
+  do_lower(Gogo*, Named_object*, Statement_inserter*);
 
   Expression*
   do_flatten(Gogo*, Named_object*, Statement_inserter*);
@@ -2154,7 +2153,7 @@
   { return Expression::traverse(&this->expr_, traverse); }
 
   Expression*
-  do_lower(Gogo*, Named_object*, Statement_inserter*, int);
+  do_lower(Gogo*, Named_object*, Statement_inserter*);
 
   Expression*
   do_flatten(Gogo*, Named_object*, Statement_inserter*);
@@ -2315,7 +2314,7 @@
   do_traverse(Traverse* traverse);
 
   Expression*
-  do_lower(Gogo*, Named_object*, Statement_inserter*, int);
+  do_lower(Gogo*, Named_object*, Statement_inserter*);
 
   Expression*
   do_flatten(Gogo*, Named_object*, Statement_inserter*);
@@ -2440,7 +2439,7 @@
   { return this->exprs_->traverse(traverse); }
 
   Expression*
-  do_lower(Gogo*, Named_object*, Statement_inserter*, int)
+  do_lower(Gogo*, Named_object*, Statement_inserter*)
   { return this; }
 
   Expression*
@@ -2628,7 +2627,7 @@
   do_traverse(Traverse*);
 
   virtual Expression*
-  do_lower(Gogo*, Named_object*, Statement_inserter*, int);
+  do_lower(Gogo*, Named_object*, Statement_inserter*);
 
   virtual Expression*
   do_flatten(Gogo*, Named_object*, Statement_inserter*);
@@ -2823,7 +2822,7 @@
  protected:
   // This overrides Call_expression::do_lower.
   Expression*
-  do_lower(Gogo*, Named_object*, Statement_inserter*, int);
+  do_lower(Gogo*, Named_object*, Statement_inserter*);
 
   Expression*
   do_flatten(Gogo*, Named_object*, Statement_inserter*);
@@ -3169,7 +3168,7 @@
   do_is_addressable() const;
 
   Expression*
-  do_lower(Gogo*, Named_object*, Statement_inserter*, int);
+  do_lower(Gogo*, Named_object*, Statement_inserter*);
 
   Expression*
   do_copy()
@@ -3238,7 +3237,7 @@
   do_is_addressable() const;
 
   Expression*
-  do_lower(Gogo*, Named_object*, Statement_inserter*, int);
+  do_lower(Gogo*, Named_object*, Statement_inserter*s);
 
   Expression*
   do_copy()
@@ -3739,7 +3738,7 @@
   { return Expression::traverse(&this->expr_, traverse); }
 
   Expression*
-  do_lower(Gogo*, Named_object*, Statement_inserter*, int);
+  do_lower(Gogo*, Named_object*, Statement_inserter*);
 
   Type*
   do_type();
@@ -3965,7 +3964,7 @@
   do_check_types(Gogo*);
 
   Expression*
-  do_lower(Gogo*, Named_object*, Statement_inserter*, int);
+  do_lower(Gogo*, Named_object*, Statement_inserter*);
 
   Expression*
   do_copy();
diff --git a/go/gogo.cc b/go/gogo.cc
index 7a6b9e3..71988dc 100644
--- a/go/gogo.cc
+++ b/go/gogo.cc
@@ -2914,7 +2914,7 @@
 	       | traverse_functions
 	       | traverse_statements
 	       | traverse_expressions),
-      gogo_(gogo), function_(function), iota_value_(-1), inserter_()
+      gogo_(gogo), function_(function), inserter_()
   { }
 
   void
@@ -2941,8 +2941,6 @@
   Gogo* gogo_;
   // The function we are traversing.
   Named_object* function_;
-  // Value to use for the predeclared constant iota.
-  int iota_value_;
   // Current statement inserter for use by expressions.
   Statement_inserter inserter_;
 };
@@ -3086,7 +3084,7 @@
     {
       Expression* e = *pexpr;
       Expression* enew = e->lower(this->gogo_, this->function_,
-				  &this->inserter_, this->iota_value_);
+				  &this->inserter_);
       if (enew == e)
 	break;
       if (enew->traverse_subexpressions(this) == TRAVERSE_EXIT)