aboutsummaryrefslogtreecommitdiff
path: root/gcc/go/gofrontend/parse.h
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2018-02-05 01:57:42 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2018-02-05 01:57:42 +0000
commit5dfb4d0f3339595881fba857ab5a4b57c681a8e3 (patch)
tree336c1452068533453093114132ffd040f836b06a /gcc/go/gofrontend/parse.h
parent33cdac3baa9e0c8da598d5124ac9196be30a3ccb (diff)
downloadgcc-5dfb4d0f3339595881fba857ab5a4b57c681a8e3.zip
gcc-5dfb4d0f3339595881fba857ab5a4b57c681a8e3.tar.gz
gcc-5dfb4d0f3339595881fba857ab5a4b57c681a8e3.tar.bz2
compiler: update iota handling, fix using iota in array length
CL 71750 changed the definition of how iota works. This patch updates gccgo for the new definition. We've been mishandling iota appearing in a type that appears in a const expression, as in `c = len([iota]int{})`. Correct that by copying type expressions when we copy an expression. For simplicity only copy when it can change the size of a type, as that is the only case where iota in a type can affect the value of a constant (I think). This is still a bunch of changes, but almost all boilerplate. Fixes golang/go#22341 Reviewed-on: https://go-review.googlesource.com/91475 From-SVN: r257379
Diffstat (limited to 'gcc/go/gofrontend/parse.h')
-rw-r--r--gcc/go/gofrontend/parse.h9
1 files changed, 1 insertions, 8 deletions
diff --git a/gcc/go/gofrontend/parse.h b/gcc/go/gofrontend/parse.h
index 2ba8457..f309ee0 100644
--- a/gcc/go/gofrontend/parse.h
+++ b/gcc/go/gofrontend/parse.h
@@ -7,7 +7,6 @@
#ifndef GO_PARSE_H
#define GO_PARSE_H
-class Set_iota_traverse;
class Lex;
class Gogo;
class Named_object;
@@ -185,7 +184,7 @@ class Parse
void decl(void (Parse::*)(void*, unsigned int), void*, unsigned int pragmas);
void list(void (Parse::*)(void*, unsigned int), void*, bool);
void const_decl();
- void const_spec(Type**, Expression_list**);
+ void const_spec(int, Type**, Expression_list**);
void type_decl(unsigned int pragmas);
void type_spec(void*, unsigned int pragmas);
void var_decl();
@@ -280,10 +279,6 @@ class Parse
void import_decl();
void import_spec(void*, unsigned int pragmas);
- void reset_iota();
- int iota_value();
- void increment_iota();
-
// Skip past an error looking for a semicolon or OP. Return true if
// all is well, false if we found EOF.
bool
@@ -319,8 +314,6 @@ class Parse
Bc_stack* break_stack_;
// A stack of statements for which continue may be used.
Bc_stack* continue_stack_;
- // The current iota value.
- int iota_;
// References from the local function to variables defined in
// enclosing functions.
Enclosing_vars enclosing_vars_;