Commit b68a9b10 by Ian Lance Taylor

Fix missing type traversals.

From-SVN: r170427
parent 7fcf46f5
...@@ -2357,6 +2357,9 @@ class Const_expression : public Expression ...@@ -2357,6 +2357,9 @@ class Const_expression : public Expression
check_for_init_loop(); check_for_init_loop();
protected: protected:
int
do_traverse(Traverse*);
Expression* Expression*
do_lower(Gogo*, Named_object*, int); do_lower(Gogo*, Named_object*, int);
...@@ -2412,6 +2415,16 @@ class Const_expression : public Expression ...@@ -2412,6 +2415,16 @@ class Const_expression : public Expression
mutable bool seen_; mutable bool seen_;
}; };
// Traversal.
int
Const_expression::do_traverse(Traverse* traverse)
{
if (this->type_ != NULL)
return Type::traverse(this->type_, traverse);
return TRAVERSE_CONTINUE;
}
// Lower a constant expression. This is where we convert the // Lower a constant expression. This is where we convert the
// predeclared constant iota into an integer value. // predeclared constant iota into an integer value.
......
...@@ -318,6 +318,9 @@ Temporary_statement::get_decl() const ...@@ -318,6 +318,9 @@ Temporary_statement::get_decl() const
int int
Temporary_statement::do_traverse(Traverse* traverse) Temporary_statement::do_traverse(Traverse* traverse)
{ {
if (this->type_ != NULL
&& this->traverse_type(traverse, this->type_) == TRAVERSE_EXIT)
return TRAVERSE_EXIT;
if (this->init_ == NULL) if (this->init_ == NULL)
return TRAVERSE_CONTINUE; return TRAVERSE_CONTINUE;
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment