Commit 8c0d1865 by Ian Lance Taylor

Define go_unreachable to replace gcc_unreachable.

From Evan Shaw.

From-SVN: r172882
parent 632b4f8e
...@@ -24,8 +24,6 @@ Issues to be faced in this transition: ...@@ -24,8 +24,6 @@ Issues to be faced in this transition:
features such as %<%> for appropriate quoting. features such as %<%> for appropriate quoting.
+ Localization may be an issue. + Localization may be an issue.
* Use of gcc_unreachable.
This compiler works, but the code is a work in progress. Notably, the This compiler works, but the code is a work in progress. Notably, the
support for garbage collection is ineffective and needs a complete support for garbage collection is ineffective and needs a complete
rethinking. The frontend pays little attention to its memory usage rethinking. The frontend pays little attention to its memory usage
......
...@@ -201,7 +201,7 @@ Dataflow::Compare_vars::operator()(const Named_object* no1, ...@@ -201,7 +201,7 @@ Dataflow::Compare_vars::operator()(const Named_object* no1,
// We can't have two variables with the same name in the same // We can't have two variables with the same name in the same
// location. // location.
gcc_unreachable(); go_unreachable();
} }
// Class Dataflow. // Class Dataflow.
......
...@@ -877,15 +877,15 @@ class Parser_expression : public Expression ...@@ -877,15 +877,15 @@ class Parser_expression : public Expression
void void
do_determine_type(const Type_context*) do_determine_type(const Type_context*)
{ gcc_unreachable(); } { go_unreachable(); }
void void
do_check_types(Gogo*) do_check_types(Gogo*)
{ gcc_unreachable(); } { go_unreachable(); }
tree tree
do_get_tree(Translate_context*) do_get_tree(Translate_context*)
{ gcc_unreachable(); } { go_unreachable(); }
}; };
// An expression which is simply a variable. // An expression which is simply a variable.
......
...@@ -972,7 +972,7 @@ Named_object::get_tree(Gogo* gogo, Named_object* function) ...@@ -972,7 +972,7 @@ Named_object::get_tree(Gogo* gogo, Named_object* function)
case NAMED_OBJECT_VAR: case NAMED_OBJECT_VAR:
case NAMED_OBJECT_RESULT_VAR: case NAMED_OBJECT_RESULT_VAR:
case NAMED_OBJECT_SINK: case NAMED_OBJECT_SINK:
gcc_unreachable(); go_unreachable();
case NAMED_OBJECT_FUNC: case NAMED_OBJECT_FUNC:
{ {
...@@ -1005,7 +1005,7 @@ Named_object::get_tree(Gogo* gogo, Named_object* function) ...@@ -1005,7 +1005,7 @@ Named_object::get_tree(Gogo* gogo, Named_object* function)
break; break;
default: default:
gcc_unreachable(); go_unreachable();
} }
if (TREE_TYPE(decl) == error_mark_node) if (TREE_TYPE(decl) == error_mark_node)
...@@ -2424,7 +2424,7 @@ Gogo::interface_method_table_for_type(const Interface_type* interface, ...@@ -2424,7 +2424,7 @@ Gogo::interface_method_table_for_type(const Interface_type* interface,
fndecl = no->func_declaration_value()->get_or_make_decl(this, no, fndecl = no->func_declaration_value()->get_or_make_decl(this, no,
fnid); fnid);
else else
gcc_unreachable(); go_unreachable();
fndecl = build_fold_addr_expr(fndecl); fndecl = build_fold_addr_expr(fndecl);
elt = VEC_quick_push(constructor_elt, pointers, NULL); elt = VEC_quick_push(constructor_elt, pointers, NULL);
......
...@@ -748,7 +748,7 @@ Gogo::start_function(const std::string& name, Function_type* type, ...@@ -748,7 +748,7 @@ Gogo::start_function(const std::string& name, Function_type* type,
function); function);
} }
else else
gcc_unreachable(); go_unreachable();
} }
this->package_->bindings()->add_method(ret); this->package_->bindings()->add_method(ret);
} }
...@@ -849,7 +849,7 @@ Gogo::declare_function(const std::string& name, Function_type* type, ...@@ -849,7 +849,7 @@ Gogo::declare_function(const std::string& name, Function_type* type,
return ftype->add_method_declaration(name, type, location); return ftype->add_method_declaration(name, type, location);
} }
else else
gcc_unreachable(); go_unreachable();
} }
} }
...@@ -3211,7 +3211,7 @@ Block::traverse(Traverse* traverse) ...@@ -3211,7 +3211,7 @@ Block::traverse(Traverse* traverse)
case Named_object::NAMED_OBJECT_FUNC: case Named_object::NAMED_OBJECT_FUNC:
case Named_object::NAMED_OBJECT_FUNC_DECLARATION: case Named_object::NAMED_OBJECT_FUNC_DECLARATION:
// FIXME: Where will nested functions be found? // FIXME: Where will nested functions be found?
gcc_unreachable(); go_unreachable();
case Named_object::NAMED_OBJECT_TYPE: case Named_object::NAMED_OBJECT_TYPE:
if ((traverse_mask & Traverse::traverse_types) != 0 if ((traverse_mask & Traverse::traverse_types) != 0
...@@ -3229,10 +3229,10 @@ Block::traverse(Traverse* traverse) ...@@ -3229,10 +3229,10 @@ Block::traverse(Traverse* traverse)
case Named_object::NAMED_OBJECT_PACKAGE: case Named_object::NAMED_OBJECT_PACKAGE:
case Named_object::NAMED_OBJECT_SINK: case Named_object::NAMED_OBJECT_SINK:
gcc_unreachable(); go_unreachable();
default: default:
gcc_unreachable(); go_unreachable();
} }
} }
} }
...@@ -4109,7 +4109,7 @@ Named_object::location() const ...@@ -4109,7 +4109,7 @@ Named_object::location() const
{ {
default: default:
case NAMED_OBJECT_UNINITIALIZED: case NAMED_OBJECT_UNINITIALIZED:
gcc_unreachable(); go_unreachable();
case NAMED_OBJECT_UNKNOWN: case NAMED_OBJECT_UNKNOWN:
return this->unknown_value()->location(); return this->unknown_value()->location();
...@@ -4130,7 +4130,7 @@ Named_object::location() const ...@@ -4130,7 +4130,7 @@ Named_object::location() const
return this->result_var_value()->location(); return this->result_var_value()->location();
case NAMED_OBJECT_SINK: case NAMED_OBJECT_SINK:
gcc_unreachable(); go_unreachable();
case NAMED_OBJECT_FUNC: case NAMED_OBJECT_FUNC:
return this->func_value()->location(); return this->func_value()->location();
...@@ -4153,7 +4153,7 @@ Named_object::export_named_object(Export* exp) const ...@@ -4153,7 +4153,7 @@ Named_object::export_named_object(Export* exp) const
default: default:
case NAMED_OBJECT_UNINITIALIZED: case NAMED_OBJECT_UNINITIALIZED:
case NAMED_OBJECT_UNKNOWN: case NAMED_OBJECT_UNKNOWN:
gcc_unreachable(); go_unreachable();
case NAMED_OBJECT_CONST: case NAMED_OBJECT_CONST:
this->const_value()->export_const(exp, this->name_); this->const_value()->export_const(exp, this->name_);
...@@ -4179,7 +4179,7 @@ Named_object::export_named_object(Export* exp) const ...@@ -4179,7 +4179,7 @@ Named_object::export_named_object(Export* exp) const
case NAMED_OBJECT_RESULT_VAR: case NAMED_OBJECT_RESULT_VAR:
case NAMED_OBJECT_SINK: case NAMED_OBJECT_SINK:
gcc_unreachable(); go_unreachable();
case NAMED_OBJECT_FUNC: case NAMED_OBJECT_FUNC:
this->func_value()->export_func(exp, this->name_); this->func_value()->export_func(exp, this->name_);
...@@ -4199,7 +4199,7 @@ Named_object::get_backend_variable(Gogo* gogo, Named_object* function) ...@@ -4199,7 +4199,7 @@ Named_object::get_backend_variable(Gogo* gogo, Named_object* function)
return this->result_var_value()->get_backend_variable(gogo, function, return this->result_var_value()->get_backend_variable(gogo, function,
this->name_); this->name_);
else else
gcc_unreachable(); go_unreachable();
} }
// Class Bindings. // Class Bindings.
...@@ -4280,7 +4280,7 @@ Bindings::remove_binding(Named_object* no) ...@@ -4280,7 +4280,7 @@ Bindings::remove_binding(Named_object* no)
return; return;
} }
} }
gcc_unreachable(); go_unreachable();
} }
// Add a method to the list of objects. This is not added to the // Add a method to the list of objects. This is not added to the
...@@ -4346,7 +4346,7 @@ Bindings::new_definition(Named_object* old_object, Named_object* new_object) ...@@ -4346,7 +4346,7 @@ Bindings::new_definition(Named_object* old_object, Named_object* new_object)
{ {
default: default:
case Named_object::NAMED_OBJECT_UNINITIALIZED: case Named_object::NAMED_OBJECT_UNINITIALIZED:
gcc_unreachable(); go_unreachable();
case Named_object::NAMED_OBJECT_UNKNOWN: case Named_object::NAMED_OBJECT_UNKNOWN:
{ {
...@@ -4386,7 +4386,7 @@ Bindings::new_definition(Named_object* old_object, Named_object* new_object) ...@@ -4386,7 +4386,7 @@ Bindings::new_definition(Named_object* old_object, Named_object* new_object)
break; break;
case Named_object::NAMED_OBJECT_SINK: case Named_object::NAMED_OBJECT_SINK:
gcc_unreachable(); go_unreachable();
case Named_object::NAMED_OBJECT_FUNC: case Named_object::NAMED_OBJECT_FUNC:
if (new_object->is_function_declaration()) if (new_object->is_function_declaration())
...@@ -4595,7 +4595,7 @@ Bindings::traverse(Traverse* traverse, bool is_global) ...@@ -4595,7 +4595,7 @@ Bindings::traverse(Traverse* traverse, bool is_global)
case Named_object::NAMED_OBJECT_SINK: case Named_object::NAMED_OBJECT_SINK:
default: default:
gcc_unreachable(); go_unreachable();
} }
} }
...@@ -4756,41 +4756,41 @@ Traverse::remember_expression(const Expression* expression) ...@@ -4756,41 +4756,41 @@ Traverse::remember_expression(const Expression* expression)
int int
Traverse::variable(Named_object*) Traverse::variable(Named_object*)
{ {
gcc_unreachable(); go_unreachable();
} }
int int
Traverse::constant(Named_object*, bool) Traverse::constant(Named_object*, bool)
{ {
gcc_unreachable(); go_unreachable();
} }
int int
Traverse::function(Named_object*) Traverse::function(Named_object*)
{ {
gcc_unreachable(); go_unreachable();
} }
int int
Traverse::block(Block*) Traverse::block(Block*)
{ {
gcc_unreachable(); go_unreachable();
} }
int int
Traverse::statement(Block*, size_t*, Statement*) Traverse::statement(Block*, size_t*, Statement*)
{ {
gcc_unreachable(); go_unreachable();
} }
int int
Traverse::expression(Expression**) Traverse::expression(Expression**)
{ {
gcc_unreachable(); go_unreachable();
} }
int int
Traverse::type(Type*) Traverse::type(Type*)
{ {
gcc_unreachable(); go_unreachable();
} }
...@@ -198,7 +198,7 @@ Token::Token(const Token& tok) ...@@ -198,7 +198,7 @@ Token::Token(const Token& tok)
mpfr_init_set(this->u_.float_value, tok.u_.float_value, GMP_RNDN); mpfr_init_set(this->u_.float_value, tok.u_.float_value, GMP_RNDN);
break; break;
default: default:
gcc_unreachable(); go_unreachable();
} }
} }
...@@ -237,7 +237,7 @@ Token::operator=(const Token& tok) ...@@ -237,7 +237,7 @@ Token::operator=(const Token& tok)
mpfr_init_set(this->u_.float_value, tok.u_.float_value, GMP_RNDN); mpfr_init_set(this->u_.float_value, tok.u_.float_value, GMP_RNDN);
break; break;
default: default:
gcc_unreachable(); go_unreachable();
} }
return *this; return *this;
} }
...@@ -422,11 +422,11 @@ Token::print(FILE* file) const ...@@ -422,11 +422,11 @@ Token::print(FILE* file) const
fprintf(file, "]"); fprintf(file, "]");
break; break;
default: default:
gcc_unreachable(); go_unreachable();
} }
break; break;
default: default:
gcc_unreachable(); go_unreachable();
} }
} }
......
...@@ -35,7 +35,7 @@ Parse::Enclosing_var_comparison::operator()(const Enclosing_var& v1, ...@@ -35,7 +35,7 @@ Parse::Enclosing_var_comparison::operator()(const Enclosing_var& v1,
// If we get here it means that a single nested function refers to // If we get here it means that a single nested function refers to
// two different variables defined in enclosing functions, and both // two different variables defined in enclosing functions, and both
// variables have the same name. I think this is impossible. // variables have the same name. I think this is impossible.
gcc_unreachable(); go_unreachable();
} }
// Class Parse. // Class Parse.
...@@ -362,7 +362,7 @@ Parse::type_name(bool issue_error) ...@@ -362,7 +362,7 @@ Parse::type_name(bool issue_error)
else if (named_object->is_unknown() || named_object->is_type_declaration()) else if (named_object->is_unknown() || named_object->is_type_declaration())
return Type::make_forward_declaration(named_object); return Type::make_forward_declaration(named_object);
else else
gcc_unreachable(); go_unreachable();
} }
// ArrayType = "[" [ ArrayLength ] "]" ElementType . // ArrayType = "[" [ ArrayLength ] "]" ElementType .
...@@ -2323,10 +2323,10 @@ Parse::operand(bool may_be_sink) ...@@ -2323,10 +2323,10 @@ Parse::operand(bool may_be_sink)
case Named_object::NAMED_OBJECT_UNKNOWN: case Named_object::NAMED_OBJECT_UNKNOWN:
return Expression::make_unknown_reference(named_object, location); return Expression::make_unknown_reference(named_object, location);
default: default:
gcc_unreachable(); go_unreachable();
} }
} }
gcc_unreachable(); go_unreachable();
case Token::TOKEN_STRING: case Token::TOKEN_STRING:
ret = Expression::make_string(token->string_value(), token->location()); ret = Expression::make_string(token->string_value(), token->location());
...@@ -3068,7 +3068,7 @@ Parse::expression_may_start_here() ...@@ -3068,7 +3068,7 @@ Parse::expression_may_start_here()
case Token::TOKEN_IMAGINARY: case Token::TOKEN_IMAGINARY:
return true; return true;
default: default:
gcc_unreachable(); go_unreachable();
} }
} }
...@@ -3493,7 +3493,7 @@ Parse::inc_dec_stat(Expression* exp) ...@@ -3493,7 +3493,7 @@ Parse::inc_dec_stat(Expression* exp)
else if (token->is_op(OPERATOR_MINUSMINUS)) else if (token->is_op(OPERATOR_MINUSMINUS))
this->gogo_->add_statement(Statement::make_dec_statement(exp)); this->gogo_->add_statement(Statement::make_dec_statement(exp));
else else
gcc_unreachable(); go_unreachable();
this->advance_token(); this->advance_token();
} }
...@@ -4858,7 +4858,7 @@ Parse::break_stat() ...@@ -4858,7 +4858,7 @@ Parse::break_stat()
else if (enclosing->classification() == Statement::STATEMENT_SELECT) else if (enclosing->classification() == Statement::STATEMENT_SELECT)
label = enclosing->select_statement()->break_label(); label = enclosing->select_statement()->break_label();
else else
gcc_unreachable(); go_unreachable();
this->gogo_->add_statement(Statement::make_break_statement(label, this->gogo_->add_statement(Statement::make_break_statement(label,
location)); location));
...@@ -4907,7 +4907,7 @@ Parse::continue_stat() ...@@ -4907,7 +4907,7 @@ Parse::continue_stat()
else if (enclosing->classification() == Statement::STATEMENT_FOR_RANGE) else if (enclosing->classification() == Statement::STATEMENT_FOR_RANGE)
label = enclosing->for_range_statement()->continue_label(); label = enclosing->for_range_statement()->continue_label();
else else
gcc_unreachable(); go_unreachable();
this->gogo_->add_statement(Statement::make_continue_statement(label, this->gogo_->add_statement(Statement::make_continue_statement(label,
location)); location));
......
...@@ -86,7 +86,7 @@ runtime_function_type(Runtime_function_type bft) ...@@ -86,7 +86,7 @@ runtime_function_type(Runtime_function_type bft)
{ {
default: default:
case RFT_VOID: case RFT_VOID:
gcc_unreachable(); go_unreachable();
case RFT_BOOL: case RFT_BOOL:
t = Type::lookup_bool_type(); t = Type::lookup_bool_type();
...@@ -193,7 +193,7 @@ convert_to_runtime_function_type(Runtime_function_type bft, Expression* e, ...@@ -193,7 +193,7 @@ convert_to_runtime_function_type(Runtime_function_type bft, Expression* e,
{ {
default: default:
case RFT_VOID: case RFT_VOID:
gcc_unreachable(); go_unreachable();
case RFT_BOOL: case RFT_BOOL:
case RFT_BOOLPTR: case RFT_BOOLPTR:
......
...@@ -177,7 +177,7 @@ class Error_statement : public Statement ...@@ -177,7 +177,7 @@ class Error_statement : public Statement
Bstatement* Bstatement*
do_get_backend(Translate_context*) do_get_backend(Translate_context*)
{ gcc_unreachable(); } { go_unreachable(); }
}; };
// Make an error statement. // Make an error statement.
...@@ -595,14 +595,14 @@ class Assignment_operation_statement : public Statement ...@@ -595,14 +595,14 @@ class Assignment_operation_statement : public Statement
bool bool
do_traverse_assignments(Traverse_assignments*) do_traverse_assignments(Traverse_assignments*)
{ gcc_unreachable(); } { go_unreachable(); }
Statement* Statement*
do_lower(Gogo*, Named_object*, Block*); do_lower(Gogo*, Named_object*, Block*);
Bstatement* Bstatement*
do_get_backend(Translate_context*) do_get_backend(Translate_context*)
{ gcc_unreachable(); } { go_unreachable(); }
private: private:
// The operator (OPERATOR_PLUSEQ, etc.). // The operator (OPERATOR_PLUSEQ, etc.).
...@@ -677,7 +677,7 @@ Assignment_operation_statement::do_lower(Gogo*, Named_object*, ...@@ -677,7 +677,7 @@ Assignment_operation_statement::do_lower(Gogo*, Named_object*,
op = OPERATOR_BITCLEAR; op = OPERATOR_BITCLEAR;
break; break;
default: default:
gcc_unreachable(); go_unreachable();
} }
Expression* binop = Expression::make_binary(op, lval, this->rhs_, loc); Expression* binop = Expression::make_binary(op, lval, this->rhs_, loc);
...@@ -722,14 +722,14 @@ class Tuple_assignment_statement : public Statement ...@@ -722,14 +722,14 @@ class Tuple_assignment_statement : public Statement
bool bool
do_traverse_assignments(Traverse_assignments*) do_traverse_assignments(Traverse_assignments*)
{ gcc_unreachable(); } { go_unreachable(); }
Statement* Statement*
do_lower(Gogo*, Named_object*, Block*); do_lower(Gogo*, Named_object*, Block*);
Bstatement* Bstatement*
do_get_backend(Translate_context*) do_get_backend(Translate_context*)
{ gcc_unreachable(); } { go_unreachable(); }
private: private:
// Left hand side--a list of lvalues. // Left hand side--a list of lvalues.
...@@ -849,14 +849,14 @@ public: ...@@ -849,14 +849,14 @@ public:
bool bool
do_traverse_assignments(Traverse_assignments*) do_traverse_assignments(Traverse_assignments*)
{ gcc_unreachable(); } { go_unreachable(); }
Statement* Statement*
do_lower(Gogo*, Named_object*, Block*); do_lower(Gogo*, Named_object*, Block*);
Bstatement* Bstatement*
do_get_backend(Translate_context*) do_get_backend(Translate_context*)
{ gcc_unreachable(); } { go_unreachable(); }
private: private:
// Lvalue which receives the value from the map. // Lvalue which receives the value from the map.
...@@ -976,14 +976,14 @@ class Map_assignment_statement : public Statement ...@@ -976,14 +976,14 @@ class Map_assignment_statement : public Statement
bool bool
do_traverse_assignments(Traverse_assignments*) do_traverse_assignments(Traverse_assignments*)
{ gcc_unreachable(); } { go_unreachable(); }
Statement* Statement*
do_lower(Gogo*, Named_object*, Block*); do_lower(Gogo*, Named_object*, Block*);
Bstatement* Bstatement*
do_get_backend(Translate_context*) do_get_backend(Translate_context*)
{ gcc_unreachable(); } { go_unreachable(); }
private: private:
// A reference to the map index which should be set or deleted. // A reference to the map index which should be set or deleted.
...@@ -1090,14 +1090,14 @@ class Tuple_receive_assignment_statement : public Statement ...@@ -1090,14 +1090,14 @@ class Tuple_receive_assignment_statement : public Statement
bool bool
do_traverse_assignments(Traverse_assignments*) do_traverse_assignments(Traverse_assignments*)
{ gcc_unreachable(); } { go_unreachable(); }
Statement* Statement*
do_lower(Gogo*, Named_object*, Block*); do_lower(Gogo*, Named_object*, Block*);
Bstatement* Bstatement*
do_get_backend(Translate_context*) do_get_backend(Translate_context*)
{ gcc_unreachable(); } { go_unreachable(); }
private: private:
// Lvalue which receives the value from the channel. // Lvalue which receives the value from the channel.
...@@ -1214,14 +1214,14 @@ class Tuple_type_guard_assignment_statement : public Statement ...@@ -1214,14 +1214,14 @@ class Tuple_type_guard_assignment_statement : public Statement
bool bool
do_traverse_assignments(Traverse_assignments*) do_traverse_assignments(Traverse_assignments*)
{ gcc_unreachable(); } { go_unreachable(); }
Statement* Statement*
do_lower(Gogo*, Named_object*, Block*); do_lower(Gogo*, Named_object*, Block*);
Bstatement* Bstatement*
do_get_backend(Translate_context*) do_get_backend(Translate_context*)
{ gcc_unreachable(); } { go_unreachable(); }
private: private:
Call_expression* Call_expression*
...@@ -1510,14 +1510,14 @@ class Inc_dec_statement : public Statement ...@@ -1510,14 +1510,14 @@ class Inc_dec_statement : public Statement
bool bool
do_traverse_assignments(Traverse_assignments*) do_traverse_assignments(Traverse_assignments*)
{ gcc_unreachable(); } { go_unreachable(); }
Statement* Statement*
do_lower(Gogo*, Named_object*, Block*); do_lower(Gogo*, Named_object*, Block*);
Bstatement* Bstatement*
do_get_backend(Translate_context*) do_get_backend(Translate_context*)
{ gcc_unreachable(); } { go_unreachable(); }
private: private:
// The l-value to increment or decrement. // The l-value to increment or decrement.
...@@ -1830,7 +1830,7 @@ Thunk_statement::simplify_statement(Gogo* gogo, Named_object* function, ...@@ -1830,7 +1830,7 @@ Thunk_statement::simplify_statement(Gogo* gogo, Named_object* function,
vals->push_back(first_arg); vals->push_back(first_arg);
} }
else else
gcc_unreachable(); go_unreachable();
if (ce->args() != NULL) if (ce->args() != NULL)
{ {
...@@ -1866,7 +1866,7 @@ Thunk_statement::simplify_statement(Gogo* gogo, Named_object* function, ...@@ -1866,7 +1866,7 @@ Thunk_statement::simplify_statement(Gogo* gogo, Named_object* function,
else if (this->classification() == STATEMENT_DEFER) else if (this->classification() == STATEMENT_DEFER)
s = Statement::make_defer_statement(call, location); s = Statement::make_defer_statement(call, location);
else else
gcc_unreachable(); go_unreachable();
// The current block should end with the go statement. // The current block should end with the go statement.
go_assert(block->statements()->size() >= 1); go_assert(block->statements()->size() >= 1);
...@@ -2750,7 +2750,7 @@ Case_clauses::Hash_integer_value::operator()(Expression* pe) const ...@@ -2750,7 +2750,7 @@ Case_clauses::Hash_integer_value::operator()(Expression* pe) const
mpz_t ival; mpz_t ival;
mpz_init(ival); mpz_init(ival);
if (!pe->integer_constant_value(true, ival, &itype)) if (!pe->integer_constant_value(true, ival, &itype))
gcc_unreachable(); go_unreachable();
size_t ret = mpz_get_ui(ival); size_t ret = mpz_get_ui(ival);
mpz_clear(ival); mpz_clear(ival);
return ret; return ret;
...@@ -2776,7 +2776,7 @@ Case_clauses::Eq_integer_value::operator()(Expression* a, Expression* b) const ...@@ -2776,7 +2776,7 @@ Case_clauses::Eq_integer_value::operator()(Expression* a, Expression* b) const
mpz_init(bval); mpz_init(bval);
if (!a->integer_constant_value(true, aval, &atype) if (!a->integer_constant_value(true, aval, &atype)
|| !b->integer_constant_value(true, bval, &btype)) || !b->integer_constant_value(true, bval, &btype))
gcc_unreachable(); go_unreachable();
bool ret = mpz_cmp(aval, bval) == 0; bool ret = mpz_cmp(aval, bval) == 0;
mpz_clear(aval); mpz_clear(aval);
mpz_clear(bval); mpz_clear(bval);
...@@ -4597,7 +4597,7 @@ For_range_statement::do_lower(Gogo* gogo, Named_object*, Block* enclosing) ...@@ -4597,7 +4597,7 @@ For_range_statement::do_lower(Gogo* gogo, Named_object*, Block* enclosing)
index_temp, value_temp, &init, &cond, &iter_init, index_temp, value_temp, &init, &cond, &iter_init,
&post); &post);
else else
gcc_unreachable(); go_unreachable();
if (iter_init != NULL) if (iter_init != NULL)
body->add_statement(Statement::make_block_statement(iter_init, loc)); body->add_statement(Statement::make_block_statement(iter_init, loc));
......
...@@ -990,14 +990,14 @@ class For_statement : public Statement ...@@ -990,14 +990,14 @@ class For_statement : public Statement
bool bool
do_traverse_assignments(Traverse_assignments*) do_traverse_assignments(Traverse_assignments*)
{ gcc_unreachable(); } { go_unreachable(); }
Statement* Statement*
do_lower(Gogo*, Named_object*, Block*); do_lower(Gogo*, Named_object*, Block*);
Bstatement* Bstatement*
do_get_backend(Translate_context*) do_get_backend(Translate_context*)
{ gcc_unreachable(); } { go_unreachable(); }
private: private:
// The initialization statements. This may be NULL. // The initialization statements. This may be NULL.
...@@ -1048,14 +1048,14 @@ class For_range_statement : public Statement ...@@ -1048,14 +1048,14 @@ class For_range_statement : public Statement
bool bool
do_traverse_assignments(Traverse_assignments*) do_traverse_assignments(Traverse_assignments*)
{ gcc_unreachable(); } { go_unreachable(); }
Statement* Statement*
do_lower(Gogo*, Named_object*, Block*); do_lower(Gogo*, Named_object*, Block*);
Bstatement* Bstatement*
do_get_backend(Translate_context*) do_get_backend(Translate_context*)
{ gcc_unreachable(); } { go_unreachable(); }
private: private:
Expression* Expression*
...@@ -1284,7 +1284,7 @@ class Switch_statement : public Statement ...@@ -1284,7 +1284,7 @@ class Switch_statement : public Statement
Bstatement* Bstatement*
do_get_backend(Translate_context*) do_get_backend(Translate_context*)
{ gcc_unreachable(); } { go_unreachable(); }
private: private:
// The value to switch on. This may be NULL. // The value to switch on. This may be NULL.
...@@ -1430,7 +1430,7 @@ class Type_switch_statement : public Statement ...@@ -1430,7 +1430,7 @@ class Type_switch_statement : public Statement
Bstatement* Bstatement*
do_get_backend(Translate_context*) do_get_backend(Translate_context*)
{ gcc_unreachable(); } { go_unreachable(); }
private: private:
// The variable holding the value we are switching on. // The variable holding the value we are switching on.
......
...@@ -157,7 +157,7 @@ Type::is_basic_type() const ...@@ -157,7 +157,7 @@ Type::is_basic_type() const
return this->base()->is_basic_type(); return this->base()->is_basic_type();
default: default:
gcc_unreachable(); go_unreachable();
} }
} }
...@@ -202,7 +202,7 @@ Type::make_non_abstract_type() ...@@ -202,7 +202,7 @@ Type::make_non_abstract_type()
case TYPE_BOOLEAN: case TYPE_BOOLEAN:
return Type::lookup_bool_type(); return Type::lookup_bool_type();
default: default:
gcc_unreachable(); go_unreachable();
} }
} }
...@@ -407,7 +407,7 @@ Type::are_identical(const Type* t1, const Type* t2, bool errors_are_identical, ...@@ -407,7 +407,7 @@ Type::are_identical(const Type* t1, const Type* t2, bool errors_are_identical,
return false; return false;
default: default:
gcc_unreachable(); go_unreachable();
} }
} }
...@@ -774,7 +774,7 @@ Type::hash_string(const std::string& s, unsigned int h) ...@@ -774,7 +774,7 @@ Type::hash_string(const std::string& s, unsigned int h)
bool bool
Type::do_check_make_expression(Expression_list*, source_location) Type::do_check_make_expression(Expression_list*, source_location)
{ {
gcc_unreachable(); go_unreachable();
} }
// Return whether an expression has an integer value. Report an error // Return whether an expression has an integer value. Report an error
...@@ -929,7 +929,7 @@ tree ...@@ -929,7 +929,7 @@ tree
Type::do_make_expression_tree(Translate_context*, Expression_list*, Type::do_make_expression_tree(Translate_context*, Expression_list*,
source_location) source_location)
{ {
gcc_unreachable(); go_unreachable();
} }
// Return a pointer to the type descriptor for this type. // Return a pointer to the type descriptor for this type.
...@@ -1194,10 +1194,10 @@ Type::type_functions(const char** hash_fn, const char** equal_fn) const ...@@ -1194,10 +1194,10 @@ Type::type_functions(const char** hash_fn, const char** equal_fn) const
case Type::TYPE_NAMED: case Type::TYPE_NAMED:
case Type::TYPE_FORWARD: case Type::TYPE_FORWARD:
gcc_unreachable(); go_unreachable();
default: default:
gcc_unreachable(); go_unreachable();
} }
} }
...@@ -1543,7 +1543,7 @@ Type::mangled_name(Gogo* gogo) const ...@@ -1543,7 +1543,7 @@ Type::mangled_name(Gogo* gogo) const
void void
Type::do_export(Export*) const Type::do_export(Export*) const
{ {
gcc_unreachable(); go_unreachable();
} }
// Import a type. // Import a type.
...@@ -1627,11 +1627,11 @@ class Void_type : public Type ...@@ -1627,11 +1627,11 @@ class Void_type : public Type
tree tree
do_get_init_tree(Gogo*, tree, bool) do_get_init_tree(Gogo*, tree, bool)
{ gcc_unreachable(); } { go_unreachable(); }
Expression* Expression*
do_type_descriptor(Gogo*, Named_type*) do_type_descriptor(Gogo*, Named_type*)
{ gcc_unreachable(); } { go_unreachable(); }
void void
do_reflection(Gogo*, std::string*) const do_reflection(Gogo*, std::string*) const
...@@ -2363,23 +2363,23 @@ class Sink_type : public Type ...@@ -2363,23 +2363,23 @@ class Sink_type : public Type
protected: protected:
tree tree
do_get_tree(Gogo*) do_get_tree(Gogo*)
{ gcc_unreachable(); } { go_unreachable(); }
tree tree
do_get_init_tree(Gogo*, tree, bool) do_get_init_tree(Gogo*, tree, bool)
{ gcc_unreachable(); } { go_unreachable(); }
Expression* Expression*
do_type_descriptor(Gogo*, Named_type*) do_type_descriptor(Gogo*, Named_type*)
{ gcc_unreachable(); } { go_unreachable(); }
void void
do_reflection(Gogo*, std::string*) const do_reflection(Gogo*, std::string*) const
{ gcc_unreachable(); } { go_unreachable(); }
void void
do_mangled_name(Gogo*, std::string*) const do_mangled_name(Gogo*, std::string*) const
{ gcc_unreachable(); } { go_unreachable(); }
}; };
// Make the sink type. // Make the sink type.
...@@ -3298,11 +3298,11 @@ class Nil_type : public Type ...@@ -3298,11 +3298,11 @@ class Nil_type : public Type
Expression* Expression*
do_type_descriptor(Gogo*, Named_type*) do_type_descriptor(Gogo*, Named_type*)
{ gcc_unreachable(); } { go_unreachable(); }
void void
do_reflection(Gogo*, std::string*) const do_reflection(Gogo*, std::string*) const
{ gcc_unreachable(); } { go_unreachable(); }
void void
do_mangled_name(Gogo*, std::string* ret) const do_mangled_name(Gogo*, std::string* ret) const
...@@ -3434,7 +3434,7 @@ Struct_field::field_name() const ...@@ -3434,7 +3434,7 @@ Struct_field::field_name() const
else if (t->named_type() != NULL) else if (t->named_type() != NULL)
return t->named_type()->name(); return t->named_type()->name();
else else
gcc_unreachable(); go_unreachable();
} }
} }
} }
...@@ -5837,7 +5837,7 @@ Interface_type::method_index(const std::string& name) const ...@@ -5837,7 +5837,7 @@ Interface_type::method_index(const std::string& name) const
++p, ++ret) ++p, ++ret)
if (p->name() == name) if (p->name() == name)
return ret; return ret;
gcc_unreachable(); go_unreachable();
} }
// Return whether NAME is an unexported method, for better error // Return whether NAME is an unexported method, for better error
...@@ -6621,7 +6621,7 @@ Named_method::do_type() const ...@@ -6621,7 +6621,7 @@ Named_method::do_type() const
else if (this->named_object_->is_function_declaration()) else if (this->named_object_->is_function_declaration())
return this->named_object_->func_declaration_value()->type(); return this->named_object_->func_declaration_value()->type();
else else
gcc_unreachable(); go_unreachable();
} }
// Return the location of the method receiver. // Return the location of the method receiver.
...@@ -7024,7 +7024,7 @@ Find_type_use::type(Type* type) ...@@ -7024,7 +7024,7 @@ Find_type_use::type(Type* type)
case Type::TYPE_NAMED: case Type::TYPE_NAMED:
case Type::TYPE_FORWARD: case Type::TYPE_FORWARD:
default: default:
gcc_unreachable(); go_unreachable();
} }
} }
...@@ -7190,7 +7190,7 @@ Named_type::convert(Gogo* gogo) ...@@ -7190,7 +7190,7 @@ Named_type::convert(Gogo* gogo)
case TYPE_CALL_MULTIPLE_RESULT: case TYPE_CALL_MULTIPLE_RESULT:
case TYPE_NAMED: case TYPE_NAMED:
case TYPE_FORWARD: case TYPE_FORWARD:
gcc_unreachable(); go_unreachable();
} }
this->named_tree_ = t; this->named_tree_ = t;
...@@ -7294,7 +7294,7 @@ Named_type::create_placeholder(Gogo* gogo) ...@@ -7294,7 +7294,7 @@ Named_type::create_placeholder(Gogo* gogo)
case TYPE_CALL_MULTIPLE_RESULT: case TYPE_CALL_MULTIPLE_RESULT:
case TYPE_NAMED: case TYPE_NAMED:
case TYPE_FORWARD: case TYPE_FORWARD:
gcc_unreachable(); go_unreachable();
} }
// Create the named type. // Create the named type.
...@@ -7424,10 +7424,10 @@ Named_type::do_get_tree(Gogo* gogo) ...@@ -7424,10 +7424,10 @@ Named_type::do_get_tree(Gogo* gogo)
case TYPE_CALL_MULTIPLE_RESULT: case TYPE_CALL_MULTIPLE_RESULT:
case TYPE_NAMED: case TYPE_NAMED:
case TYPE_FORWARD: case TYPE_FORWARD:
gcc_unreachable(); go_unreachable();
} }
gcc_unreachable(); go_unreachable();
} }
// Build a type descriptor for a named type. // Build a type descriptor for a named type.
...@@ -7964,7 +7964,7 @@ Type::method_expects_pointer(const Named_object* no) ...@@ -7964,7 +7964,7 @@ Type::method_expects_pointer(const Named_object* no)
else if (no->is_function_declaration()) else if (no->is_function_declaration())
fntype = no->func_declaration_value()->type(); fntype = no->func_declaration_value()->type();
else else
gcc_unreachable(); go_unreachable();
return fntype->receiver()->type()->points_to() != NULL; return fntype->receiver()->type()->points_to() != NULL;
} }
...@@ -8061,7 +8061,7 @@ Type::bind_field_or_method(Gogo* gogo, const Type* type, Expression* expr, ...@@ -8061,7 +8061,7 @@ Type::bind_field_or_method(Gogo* gogo, const Type* type, Expression* expr,
else if (st != NULL) else if (st != NULL)
m = st->method_function(name, NULL); m = st->method_function(name, NULL);
else else
gcc_unreachable(); go_unreachable();
go_assert(m != NULL); go_assert(m != NULL);
if (!m->is_value_method() && expr->type()->points_to() == NULL) if (!m->is_value_method() && expr->type()->points_to() == NULL)
expr = Expression::make_unary(OPERATOR_AND, expr, location); expr = Expression::make_unary(OPERATOR_AND, expr, location);
......
...@@ -272,7 +272,7 @@ class Interface_method : public Method ...@@ -272,7 +272,7 @@ class Interface_method : public Method
// called, as we always create a stub. // called, as we always create a stub.
Named_object* Named_object*
do_named_object() const do_named_object() const
{ gcc_unreachable(); } { go_unreachable(); }
// The type of the method. // The type of the method.
Function_type* Function_type*
......
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