From: Ian Lance Taylor Date: Wed, 23 Feb 2011 04:54:27 +0000 (+0000) Subject: Fix missing type traversals. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b68a9b10c8081a0e4b4811bbbbfa39749d167c09;p=gcc.git Fix missing type traversals. From-SVN: r170427 --- diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc index 6440ee1393e..264dd579b6f 100644 --- a/gcc/go/gofrontend/expressions.cc +++ b/gcc/go/gofrontend/expressions.cc @@ -2357,6 +2357,9 @@ class Const_expression : public Expression check_for_init_loop(); protected: + int + do_traverse(Traverse*); + Expression* do_lower(Gogo*, Named_object*, int); @@ -2412,6 +2415,16 @@ class Const_expression : public Expression 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 // predeclared constant iota into an integer value. diff --git a/gcc/go/gofrontend/statements.cc b/gcc/go/gofrontend/statements.cc index 99ed6653914..45e45a381b7 100644 --- a/gcc/go/gofrontend/statements.cc +++ b/gcc/go/gofrontend/statements.cc @@ -318,6 +318,9 @@ Temporary_statement::get_decl() const int 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) return TRAVERSE_CONTINUE; else