Commit 6f7e0b57 by Chris Manghane Committed by Ian Lance Taylor

compiler: Use backend interface for expressions.

	* go-gcc.cc (Gcc_backend::nil_pointer_expression): New method.
	(Gcc_backend::boolean_constant_expression): New method.
	(Gcc_backend::zero_expression): Use this->make_expression rather
	than tree_to_expr.
	(Gcc_backend::var_expression): Likewise.
	(Gcc_backend::integer_constant_expression): Likewise.
	(Gcc_backend::float_constant_expression): Likewise.
	(Gcc_backend::complex_constant_expression): Likewise.
	(Gcc_backend::struct_field_expression): Likewise.
	(tree_to_type, tree_to_expr, tree_to_stat): Remove functions.
	(tree_to_function, tree_to_block): Remove functions.
	(type_to_tree, expr_to_tree, stat_to_tree): Remove functions.
	(block_to_tree, var_to_tree, function_to_tree): Remove functions.

From-SVN: r210122
parent 3379b71f
2014-05-06 Chris Manghane <cmang@google.com>
* go-gcc.cc (Gcc_backend::nil_pointer_expression): New method.
(Gcc_backend::boolean_constant_expression): New method.
(Gcc_backend::zero_expression): Use this->make_expression rather
than tree_to_expr.
(Gcc_backend::var_expression): Likewise.
(Gcc_backend::integer_constant_expression): Likewise.
(Gcc_backend::float_constant_expression): Likewise.
(Gcc_backend::complex_constant_expression): Likewise.
(Gcc_backend::struct_field_expression): Likewise.
(tree_to_type, tree_to_expr, tree_to_stat): Remove functions.
(tree_to_function, tree_to_block): Remove functions.
(type_to_tree, expr_to_tree, stat_to_tree): Remove functions.
(block_to_tree, var_to_tree, function_to_tree): Remove functions.
2014-05-06 Kenneth Zadeck <zadeck@naturalbridge.com> 2014-05-06 Kenneth Zadeck <zadeck@naturalbridge.com>
Mike Stump <mikestump@comcast.net> Mike Stump <mikestump@comcast.net>
Richard Sandiford <rdsandiford@googlemail.com> Richard Sandiford <rdsandiford@googlemail.com>
......
...@@ -226,6 +226,10 @@ class Gcc_backend : public Backend ...@@ -226,6 +226,10 @@ class Gcc_backend : public Backend
{ return this->make_expression(error_mark_node); } { return this->make_expression(error_mark_node); }
Bexpression* Bexpression*
nil_pointer_expression()
{ return this->make_expression(null_pointer_node); }
Bexpression*
var_expression(Bvariable* var, Location); var_expression(Bvariable* var, Location);
Bexpression* Bexpression*
...@@ -248,6 +252,9 @@ class Gcc_backend : public Backend ...@@ -248,6 +252,9 @@ class Gcc_backend : public Backend
string_constant_expression(const std::string& val); string_constant_expression(const std::string& val);
Bexpression* Bexpression*
boolean_constant_expression(bool val);
Bexpression*
real_part_expression(Bexpression* bcomplex, Location); real_part_expression(Bexpression* bcomplex, Location);
Bexpression* Bexpression*
...@@ -1129,7 +1136,7 @@ Gcc_backend::zero_expression(Btype* btype) ...@@ -1129,7 +1136,7 @@ Gcc_backend::zero_expression(Btype* btype)
ret = error_mark_node; ret = error_mark_node;
else else
ret = build_zero_cst(t); ret = build_zero_cst(t);
return tree_to_expr(ret); return this->make_expression(ret);
} }
// An expression that references a variable. // An expression that references a variable.
...@@ -1140,7 +1147,7 @@ Gcc_backend::var_expression(Bvariable* var, Location) ...@@ -1140,7 +1147,7 @@ Gcc_backend::var_expression(Bvariable* var, Location)
tree ret = var->get_tree(); tree ret = var->get_tree();
if (ret == error_mark_node) if (ret == error_mark_node)
return this->error_expression(); return this->error_expression();
return tree_to_expr(ret); return this->make_expression(ret);
} }
// An expression that indirectly references an expression. // An expression that indirectly references an expression.
...@@ -1201,7 +1208,7 @@ Gcc_backend::integer_constant_expression(Btype* btype, mpz_t val) ...@@ -1201,7 +1208,7 @@ Gcc_backend::integer_constant_expression(Btype* btype, mpz_t val)
return this->error_expression(); return this->error_expression();
tree ret = double_int_to_tree(t, mpz_get_double_int(t, val, true)); tree ret = double_int_to_tree(t, mpz_get_double_int(t, val, true));
return tree_to_expr(ret); return this->make_expression(ret);
} }
// Return a typed value as a constant floating-point number. // Return a typed value as a constant floating-point number.
...@@ -1219,7 +1226,7 @@ Gcc_backend::float_constant_expression(Btype* btype, mpfr_t val) ...@@ -1219,7 +1226,7 @@ Gcc_backend::float_constant_expression(Btype* btype, mpfr_t val)
REAL_VALUE_TYPE r2; REAL_VALUE_TYPE r2;
real_convert(&r2, TYPE_MODE(t), &r1); real_convert(&r2, TYPE_MODE(t), &r1);
ret = build_real(t, r2); ret = build_real(t, r2);
return tree_to_expr(ret); return this->make_expression(ret);
} }
// Return a typed real and imaginary value as a constant complex number. // Return a typed real and imaginary value as a constant complex number.
...@@ -1244,7 +1251,7 @@ Gcc_backend::complex_constant_expression(Btype* btype, mpfr_t real, mpfr_t imag) ...@@ -1244,7 +1251,7 @@ Gcc_backend::complex_constant_expression(Btype* btype, mpfr_t real, mpfr_t imag)
ret = build_complex(t, build_real(TREE_TYPE(t), r2), ret = build_complex(t, build_real(TREE_TYPE(t), r2),
build_real(TREE_TYPE(t), r4)); build_real(TREE_TYPE(t), r4));
return tree_to_expr(ret); return this->make_expression(ret);
} }
// Make a constant string expression. // Make a constant string expression.
...@@ -1264,6 +1271,15 @@ Gcc_backend::string_constant_expression(const std::string& val) ...@@ -1264,6 +1271,15 @@ Gcc_backend::string_constant_expression(const std::string& val)
return this->make_expression(string_val); return this->make_expression(string_val);
} }
// Make a constant boolean expression.
Bexpression*
Gcc_backend::boolean_constant_expression(bool val)
{
tree bool_cst = val ? boolean_true_node : boolean_false_node;
return this->make_expression(bool_cst);
}
// Return the real part of a complex expression. // Return the real part of a complex expression.
Bexpression* Bexpression*
...@@ -1407,7 +1423,7 @@ Gcc_backend::struct_field_expression(Bexpression* bstruct, size_t index, ...@@ -1407,7 +1423,7 @@ Gcc_backend::struct_field_expression(Bexpression* bstruct, size_t index,
NULL_TREE); NULL_TREE);
if (TREE_CONSTANT(struct_tree)) if (TREE_CONSTANT(struct_tree))
TREE_CONSTANT(ret) = 1; TREE_CONSTANT(ret) = 1;
return tree_to_expr(ret); return this->make_expression(ret);
} }
// Return an expression that executes BSTAT before BEXPR. // Return an expression that executes BSTAT before BEXPR.
...@@ -2923,73 +2939,3 @@ go_get_backend() ...@@ -2923,73 +2939,3 @@ go_get_backend()
{ {
return new Gcc_backend(); return new Gcc_backend();
} }
// FIXME: Temporary functions while converting to the new backend
// interface.
Btype*
tree_to_type(tree t)
{
return new Btype(t);
}
Bexpression*
tree_to_expr(tree t)
{
return new Bexpression(t);
}
Bstatement*
tree_to_stat(tree t)
{
return new Bstatement(t);
}
Bfunction*
tree_to_function(tree t)
{
return new Bfunction(t);
}
Bblock*
tree_to_block(tree t)
{
gcc_assert(TREE_CODE(t) == BIND_EXPR);
return new Bblock(t);
}
tree
type_to_tree(Btype* bt)
{
return bt->get_tree();
}
tree
expr_to_tree(Bexpression* be)
{
return be->get_tree();
}
tree
stat_to_tree(Bstatement* bs)
{
return bs->get_tree();
}
tree
block_to_tree(Bblock* bb)
{
return bb->get_tree();
}
tree
var_to_tree(Bvariable* bv)
{
return bv->get_tree();
}
tree
function_to_tree(Bfunction* bf)
{
return bf->get_tree();
}
...@@ -247,6 +247,10 @@ class Backend ...@@ -247,6 +247,10 @@ class Backend
virtual Bexpression* virtual Bexpression*
error_expression() = 0; error_expression() = 0;
// Create a nil pointer expression.
virtual Bexpression*
nil_pointer_expression() = 0;
// Create a reference to a variable. // Create a reference to a variable.
virtual Bexpression* virtual Bexpression*
var_expression(Bvariable* var, Location) = 0; var_expression(Bvariable* var, Location) = 0;
...@@ -281,6 +285,10 @@ class Backend ...@@ -281,6 +285,10 @@ class Backend
virtual Bexpression* virtual Bexpression*
string_constant_expression(const std::string& val) = 0; string_constant_expression(const std::string& val) = 0;
// Return an expression for the boolean value VAL.
virtual Bexpression*
boolean_constant_expression(bool val) = 0;
// Return an expression for the real part of BCOMPLEX. // Return an expression for the real part of BCOMPLEX.
virtual Bexpression* virtual Bexpression*
real_part_expression(Bexpression* bcomplex, Location) = 0; real_part_expression(Bexpression* bcomplex, Location) = 0;
...@@ -687,19 +695,4 @@ class Backend ...@@ -687,19 +695,4 @@ class Backend
extern Backend* go_get_backend(); extern Backend* go_get_backend();
// FIXME: Temporary helper functions while converting to new backend
// interface.
extern Btype* tree_to_type(tree);
extern Bexpression* tree_to_expr(tree);
extern Bstatement* tree_to_stat(tree);
extern Bfunction* tree_to_function(tree);
extern Bblock* tree_to_block(tree);
extern tree type_to_tree(Btype*);
extern tree expr_to_tree(Bexpression*);
extern tree stat_to_tree(Bstatement*);
extern tree block_to_tree(Bblock*);
extern tree var_to_tree(Bvariable*);
extern tree function_to_tree(Bfunction*);
#endif // !defined(GO_BACKEND_H) #endif // !defined(GO_BACKEND_H)
...@@ -747,9 +747,9 @@ class Expression ...@@ -747,9 +747,9 @@ class Expression
return this->do_must_eval_subexpressions_in_order(skip); return this->do_must_eval_subexpressions_in_order(skip);
} }
// Return the tree for this expression. // Return the backend representation for this expression.
tree Bexpression*
get_tree(Translate_context*); get_backend(Translate_context*);
// Return an expression handling any conversions which must be done during // Return an expression handling any conversions which must be done during
// assignment. // assignment.
...@@ -883,9 +883,9 @@ class Expression ...@@ -883,9 +883,9 @@ class Expression
do_must_eval_subexpressions_in_order(int* /* skip */) const do_must_eval_subexpressions_in_order(int* /* skip */) const
{ return false; } { return false; }
// Child class implements conversion to tree. // Child class implements conversion to backend representation.
virtual tree virtual Bexpression*
do_get_tree(Translate_context*) = 0; do_get_backend(Translate_context*) = 0;
// Child class implements export. // Child class implements export.
virtual void virtual void
...@@ -1068,8 +1068,8 @@ class Parser_expression : public Expression ...@@ -1068,8 +1068,8 @@ class Parser_expression : public Expression
do_check_types(Gogo*) do_check_types(Gogo*)
{ go_unreachable(); } { go_unreachable(); }
tree Bexpression*
do_get_tree(Translate_context*) do_get_backend(Translate_context*)
{ go_unreachable(); } { go_unreachable(); }
}; };
...@@ -1109,8 +1109,8 @@ class Var_expression : public Expression ...@@ -1109,8 +1109,8 @@ class Var_expression : public Expression
void void
do_address_taken(bool); do_address_taken(bool);
tree Bexpression*
do_get_tree(Translate_context*); do_get_backend(Translate_context*);
void void
do_dump_expression(Ast_dump_context*) const; do_dump_expression(Ast_dump_context*) const;
...@@ -1161,8 +1161,8 @@ class Temporary_reference_expression : public Expression ...@@ -1161,8 +1161,8 @@ class Temporary_reference_expression : public Expression
void void
do_address_taken(bool); do_address_taken(bool);
tree Bexpression*
do_get_tree(Translate_context*); do_get_backend(Translate_context*);
void void
do_dump_expression(Ast_dump_context*) const; do_dump_expression(Ast_dump_context*) const;
...@@ -1221,8 +1221,8 @@ class Set_and_use_temporary_expression : public Expression ...@@ -1221,8 +1221,8 @@ class Set_and_use_temporary_expression : public Expression
void void
do_address_taken(bool); do_address_taken(bool);
tree Bexpression*
do_get_tree(Translate_context*); do_get_backend(Translate_context*);
void void
do_dump_expression(Ast_dump_context*) const; do_dump_expression(Ast_dump_context*) const;
...@@ -1277,8 +1277,8 @@ class String_expression : public Expression ...@@ -1277,8 +1277,8 @@ class String_expression : public Expression
do_copy() do_copy()
{ return this; } { return this; }
tree Bexpression*
do_get_tree(Translate_context*); do_get_backend(Translate_context*);
// Write string literal to a string dump. // Write string literal to a string dump.
static void static void
...@@ -1410,8 +1410,8 @@ class Unary_expression : public Expression ...@@ -1410,8 +1410,8 @@ class Unary_expression : public Expression
do_is_addressable() const do_is_addressable() const
{ return this->op_ == OPERATOR_MULT; } { return this->op_ == OPERATOR_MULT; }
tree Bexpression*
do_get_tree(Translate_context*); do_get_backend(Translate_context*);
void void
do_export(Export*) const; do_export(Export*) const;
...@@ -1534,8 +1534,8 @@ class Binary_expression : public Expression ...@@ -1534,8 +1534,8 @@ class Binary_expression : public Expression
this->right_->copy(), this->location()); this->right_->copy(), this->location());
} }
tree Bexpression*
do_get_tree(Translate_context*); do_get_backend(Translate_context*);
void void
do_export(Export*) const; do_export(Export*) const;
...@@ -1715,8 +1715,8 @@ class Call_expression : public Expression ...@@ -1715,8 +1715,8 @@ class Call_expression : public Expression
bool bool
do_must_eval_in_order() const; do_must_eval_in_order() const;
virtual tree virtual Bexpression*
do_get_tree(Translate_context*); do_get_backend(Translate_context*);
virtual bool virtual bool
do_is_recover_call() const; do_is_recover_call() const;
...@@ -1834,8 +1834,8 @@ class Func_expression : public Expression ...@@ -1834,8 +1834,8 @@ class Func_expression : public Expression
this->location()); this->location());
} }
tree Bexpression*
do_get_tree(Translate_context*); do_get_backend(Translate_context*);
void void
do_dump_expression(Ast_dump_context*) const; do_dump_expression(Ast_dump_context*) const;
...@@ -1881,8 +1881,8 @@ class Func_descriptor_expression : public Expression ...@@ -1881,8 +1881,8 @@ class Func_descriptor_expression : public Expression
do_is_addressable() const do_is_addressable() const
{ return true; } { return true; }
tree Bexpression*
do_get_tree(Translate_context*); do_get_backend(Translate_context*);
void void
do_dump_expression(Ast_dump_context* context) const; do_dump_expression(Ast_dump_context* context) const;
...@@ -2124,8 +2124,8 @@ class Map_index_expression : public Expression ...@@ -2124,8 +2124,8 @@ class Map_index_expression : public Expression
// A map index expression is an lvalue but it is not addressable. // A map index expression is an lvalue but it is not addressable.
tree Bexpression*
do_get_tree(Translate_context*); do_get_backend(Translate_context*);
void void
do_dump_expression(Ast_dump_context*) const; do_dump_expression(Ast_dump_context*) const;
...@@ -2210,8 +2210,8 @@ class Bound_method_expression : public Expression ...@@ -2210,8 +2210,8 @@ class Bound_method_expression : public Expression
this->function_, this->location()); this->function_, this->location());
} }
tree Bexpression*
do_get_tree(Translate_context*); do_get_backend(Translate_context*);
void void
do_dump_expression(Ast_dump_context*) const; do_dump_expression(Ast_dump_context*) const;
...@@ -2313,8 +2313,8 @@ class Field_reference_expression : public Expression ...@@ -2313,8 +2313,8 @@ class Field_reference_expression : public Expression
do_issue_nil_check() do_issue_nil_check()
{ this->expr_->issue_nil_check(); } { this->expr_->issue_nil_check(); }
tree Bexpression*
do_get_tree(Translate_context*); do_get_backend(Translate_context*);
void void
do_dump_expression(Ast_dump_context*) const; do_dump_expression(Ast_dump_context*) const;
...@@ -2392,8 +2392,8 @@ class Interface_field_reference_expression : public Expression ...@@ -2392,8 +2392,8 @@ class Interface_field_reference_expression : public Expression
this->location()); this->location());
} }
tree Bexpression*
do_get_tree(Translate_context*); do_get_backend(Translate_context*);
void void
do_dump_expression(Ast_dump_context*) const; do_dump_expression(Ast_dump_context*) const;
...@@ -2458,8 +2458,8 @@ class Type_guard_expression : public Expression ...@@ -2458,8 +2458,8 @@ class Type_guard_expression : public Expression
this->location()); this->location());
} }
tree Bexpression*
do_get_tree(Translate_context*); do_get_backend(Translate_context*);
void void
do_dump_expression(Ast_dump_context*) const; do_dump_expression(Ast_dump_context*) const;
...@@ -2518,8 +2518,8 @@ class Receive_expression : public Expression ...@@ -2518,8 +2518,8 @@ class Receive_expression : public Expression
do_must_eval_in_order() const do_must_eval_in_order() const
{ return true; } { return true; }
tree Bexpression*
do_get_tree(Translate_context*); do_get_backend(Translate_context*);
void void
do_dump_expression(Ast_dump_context*) const; do_dump_expression(Ast_dump_context*) const;
......
...@@ -729,7 +729,7 @@ Gogo::register_gc_vars(const std::vector<Named_object*>& var_gc, ...@@ -729,7 +729,7 @@ Gogo::register_gc_vars(const std::vector<Named_object*>& var_gc,
builtin_loc, 1, root_addr); builtin_loc, 1, root_addr);
Translate_context context(this, NULL, NULL, NULL); Translate_context context(this, NULL, NULL, NULL);
Bexpression* bcall = tree_to_expr(register_roots->get_tree(&context)); Bexpression* bcall = register_roots->get_backend(&context);
init_stmts.push_back(this->backend()->expression_statement(bcall)); init_stmts.push_back(this->backend()->expression_statement(bcall));
} }
...@@ -4065,8 +4065,8 @@ Build_method_tables::type(Type* type) ...@@ -4065,8 +4065,8 @@ Build_method_tables::type(Type* type)
if ((*p)->implements_interface(Type::make_pointer_type(nt), if ((*p)->implements_interface(Type::make_pointer_type(nt),
NULL)) NULL))
{ {
nt->interface_method_table(*p, false)->get_tree(&context); nt->interface_method_table(*p, false)->get_backend(&context);
nt->interface_method_table(*p, true)->get_tree(&context); nt->interface_method_table(*p, true)->get_backend(&context);
} }
} }
else else
...@@ -4074,8 +4074,8 @@ Build_method_tables::type(Type* type) ...@@ -4074,8 +4074,8 @@ Build_method_tables::type(Type* type)
if ((*p)->implements_interface(Type::make_pointer_type(st), if ((*p)->implements_interface(Type::make_pointer_type(st),
NULL)) NULL))
{ {
st->interface_method_table(*p, false)->get_tree(&context); st->interface_method_table(*p, false)->get_backend(&context);
st->interface_method_table(*p, true)->get_tree(&context); st->interface_method_table(*p, true)->get_backend(&context);
} }
} }
} }
...@@ -4916,7 +4916,7 @@ Function_declaration::build_backend_descriptor(Gogo* gogo) ...@@ -4916,7 +4916,7 @@ Function_declaration::build_backend_descriptor(Gogo* gogo)
if (this->descriptor_ != NULL) if (this->descriptor_ != NULL)
{ {
Translate_context context(gogo, NULL, NULL, NULL); Translate_context context(gogo, NULL, NULL, NULL);
this->descriptor_->get_tree(&context); this->descriptor_->get_backend(&context);
} }
} }
...@@ -4975,7 +4975,7 @@ Function::build(Gogo* gogo, Named_object* named_function) ...@@ -4975,7 +4975,7 @@ Function::build(Gogo* gogo, Named_object* named_function)
parm_ref = Expression::make_unary(OPERATOR_MULT, parm_ref, loc); parm_ref = Expression::make_unary(OPERATOR_MULT, parm_ref, loc);
if ((*p)->var_value()->is_in_heap()) if ((*p)->var_value()->is_in_heap())
parm_ref = Expression::make_heap_expression(parm_ref, loc); parm_ref = Expression::make_heap_expression(parm_ref, loc);
var_inits.push_back(tree_to_expr(parm_ref->get_tree(&context))); var_inits.push_back(parm_ref->get_backend(&context));
} }
else if ((*p)->var_value()->is_in_heap()) else if ((*p)->var_value()->is_in_heap())
{ {
...@@ -4992,7 +4992,7 @@ Function::build(Gogo* gogo, Named_object* named_function) ...@@ -4992,7 +4992,7 @@ Function::build(Gogo* gogo, Named_object* named_function)
Expression* var_ref = Expression* var_ref =
Expression::make_var_reference(parm_no, loc); Expression::make_var_reference(parm_no, loc);
var_ref = Expression::make_heap_expression(var_ref, loc); var_ref = Expression::make_heap_expression(var_ref, loc);
var_inits.push_back(tree_to_expr(var_ref->get_tree(&context))); var_inits.push_back(var_ref->get_backend(&context));
} }
param_vars.push_back(parm_bvar); param_vars.push_back(parm_bvar);
} }
...@@ -5008,10 +5008,8 @@ Function::build(Gogo* gogo, Named_object* named_function) ...@@ -5008,10 +5008,8 @@ Function::build(Gogo* gogo, Named_object* named_function)
init = gogo->backend()->zero_expression(btype); init = gogo->backend()->zero_expression(btype);
} }
else else
{ init = Expression::make_allocation(type,
Expression* alloc = Expression::make_allocation(type, loc); loc)->get_backend(&context);
init = tree_to_expr(alloc->get_tree(&context));
}
vars.push_back(bvar); vars.push_back(bvar);
var_inits.push_back(init); var_inits.push_back(init);
...@@ -5034,7 +5032,7 @@ Function::build(Gogo* gogo, Named_object* named_function) ...@@ -5034,7 +5032,7 @@ Function::build(Gogo* gogo, Named_object* named_function)
Expression* closure = Expression* closure =
Runtime::make_call(Runtime::GET_CLOSURE, this->location_, 0); Runtime::make_call(Runtime::GET_CLOSURE, this->location_, 0);
var_inits.push_back(tree_to_expr(closure->get_tree(&context))); var_inits.push_back(closure->get_backend(&context));
} }
if (this->block_ != NULL) if (this->block_ != NULL)
...@@ -5115,7 +5113,7 @@ Function::build(Gogo* gogo, Named_object* named_function) ...@@ -5115,7 +5113,7 @@ Function::build(Gogo* gogo, Named_object* named_function)
if (this->descriptor_ != NULL) if (this->descriptor_ != NULL)
{ {
Translate_context context(gogo, NULL, NULL, NULL); Translate_context context(gogo, NULL, NULL, NULL);
this->descriptor_->get_tree(&context); this->descriptor_->get_backend(&context);
} }
} }
...@@ -5138,7 +5136,7 @@ Function::build_defer_wrapper(Gogo* gogo, Named_object* named_function, ...@@ -5138,7 +5136,7 @@ Function::build_defer_wrapper(Gogo* gogo, Named_object* named_function,
Expression* call = Runtime::make_call(Runtime::CHECK_DEFER, end_loc, 1, Expression* call = Runtime::make_call(Runtime::CHECK_DEFER, end_loc, 1,
this->defer_stack(end_loc)); this->defer_stack(end_loc));
Translate_context context(gogo, named_function, NULL, NULL); Translate_context context(gogo, named_function, NULL, NULL);
Bexpression* defer = tree_to_expr(call->get_tree(&context)); Bexpression* defer = call->get_backend(&context);
stmts.push_back(gogo->backend()->expression_statement(defer)); stmts.push_back(gogo->backend()->expression_statement(defer));
Bstatement* ret_bstmt = this->return_value(gogo, named_function, end_loc); Bstatement* ret_bstmt = this->return_value(gogo, named_function, end_loc);
...@@ -5150,11 +5148,11 @@ Function::build_defer_wrapper(Gogo* gogo, Named_object* named_function, ...@@ -5150,11 +5148,11 @@ Function::build_defer_wrapper(Gogo* gogo, Named_object* named_function,
call = Runtime::make_call(Runtime::CHECK_DEFER, end_loc, 1, call = Runtime::make_call(Runtime::CHECK_DEFER, end_loc, 1,
this->defer_stack(end_loc)); this->defer_stack(end_loc));
defer = tree_to_expr(call->get_tree(&context)); defer = call->get_backend(&context);
call = Runtime::make_call(Runtime::UNDEFER, end_loc, 1, call = Runtime::make_call(Runtime::UNDEFER, end_loc, 1,
this->defer_stack(end_loc)); this->defer_stack(end_loc));
Bexpression* undefer = tree_to_expr(call->get_tree(&context)); Bexpression* undefer = call->get_backend(&context);
Bstatement* function_defer = Bstatement* function_defer =
gogo->backend()->function_defer_statement(this->fndecl_, undefer, defer, gogo->backend()->function_defer_statement(this->fndecl_, undefer, defer,
end_loc); end_loc);
...@@ -5170,13 +5168,12 @@ Function::build_defer_wrapper(Gogo* gogo, Named_object* named_function, ...@@ -5170,13 +5168,12 @@ Function::build_defer_wrapper(Gogo* gogo, Named_object* named_function,
// variable to true if we are returning from this function. // variable to true if we are returning from this function.
ret_bstmt = this->return_value(gogo, named_function, end_loc); ret_bstmt = this->return_value(gogo, named_function, end_loc);
Bexpression* nil = Bexpression* nil = Expression::make_nil(end_loc)->get_backend(&context);
tree_to_expr(Expression::make_nil(end_loc)->get_tree(&context));
Bexpression* ret = Bexpression* ret =
gogo->backend()->compound_expression(ret_bstmt, nil, end_loc); gogo->backend()->compound_expression(ret_bstmt, nil, end_loc);
Expression* ref = Expression* ref =
Expression::make_temporary_reference(this->defer_stack_, end_loc); Expression::make_temporary_reference(this->defer_stack_, end_loc);
Bexpression* bref = tree_to_expr(ref->get_tree(&context)); Bexpression* bref = ref->get_backend(&context);
ret = gogo->backend()->conditional_expression(NULL, bref, ret, NULL, ret = gogo->backend()->conditional_expression(NULL, bref, ret, NULL,
end_loc); end_loc);
stmts.push_back(gogo->backend()->expression_statement(ret)); stmts.push_back(gogo->backend()->expression_statement(ret));
...@@ -5982,7 +5979,7 @@ Variable::get_init(Gogo* gogo, Named_object* function) ...@@ -5982,7 +5979,7 @@ Variable::get_init(Gogo* gogo, Named_object* function)
{ {
Translate_context context(gogo, function, NULL, NULL); Translate_context context(gogo, function, NULL, NULL);
Expression* init = Expression::make_cast(this->type(), this->init_, loc); Expression* init = Expression::make_cast(this->type(), this->init_, loc);
return tree_to_expr(init->get_tree(&context)); return init->get_backend(&context);
} }
} }
...@@ -6008,8 +6005,7 @@ Variable::get_init_block(Gogo* gogo, Named_object* function, ...@@ -6008,8 +6005,7 @@ Variable::get_init_block(Gogo* gogo, Named_object* function,
{ {
if (var_decl == NULL) if (var_decl == NULL)
{ {
Bexpression* init_bexpr = Bexpression* init_bexpr = this->init_->get_backend(&context);
tree_to_expr(this->init_->get_tree(&context));
decl_init = gogo->backend()->expression_statement(init_bexpr); decl_init = gogo->backend()->expression_statement(init_bexpr);
} }
else else
...@@ -6017,7 +6013,7 @@ Variable::get_init_block(Gogo* gogo, Named_object* function, ...@@ -6017,7 +6013,7 @@ Variable::get_init_block(Gogo* gogo, Named_object* function,
Location loc = this->location(); Location loc = this->location();
Expression* val_expr = Expression* val_expr =
Expression::make_cast(this->type(), this->init_, loc); Expression::make_cast(this->type(), this->init_, loc);
Bexpression* val = tree_to_expr(val_expr->get_tree(&context)); Bexpression* val = val_expr->get_backend(&context);
Bexpression* var_ref = gogo->backend()->var_expression(var_decl, loc); Bexpression* var_ref = gogo->backend()->var_expression(var_decl, loc);
decl_init = gogo->backend()->assignment_statement(var_ref, val, loc); decl_init = gogo->backend()->assignment_statement(var_ref, val, loc);
} }
...@@ -6241,8 +6237,7 @@ Named_constant::get_backend(Gogo* gogo, Named_object* const_no) ...@@ -6241,8 +6237,7 @@ Named_constant::get_backend(Gogo* gogo, Named_object* const_no)
Location loc = this->location(); Location loc = this->location();
Expression* const_ref = Expression::make_const_reference(const_no, loc); Expression* const_ref = Expression::make_const_reference(const_no, loc);
Bexpression* const_decl = Bexpression* const_decl = const_ref->get_backend(&subcontext);
tree_to_expr(const_ref->get_tree(&subcontext));
if (type != NULL && type->is_numeric_type()) if (type != NULL && type->is_numeric_type())
{ {
Btype* btype = type->get_backend(gogo); Btype* btype = type->get_backend(gogo);
......
...@@ -1096,7 +1096,7 @@ class Function ...@@ -1096,7 +1096,7 @@ class Function
Bstatement* Bstatement*
return_value(Gogo*, Named_object*, Location) const; return_value(Gogo*, Named_object*, Location) const;
// Get a tree for the variable holding the defer stack. // Get an expression for the variable holding the defer stack.
Expression* Expression*
defer_stack(Location); defer_stack(Location);
......
...@@ -291,12 +291,12 @@ Variable_declaration_statement::do_get_backend(Translate_context* context) ...@@ -291,12 +291,12 @@ Variable_declaration_statement::do_get_backend(Translate_context* context)
{ {
Expression* e = Expression::make_temporary_reference(temp, loc); Expression* e = Expression::make_temporary_reference(temp, loc);
e = Expression::make_unary(OPERATOR_MULT, e, loc); e = Expression::make_unary(OPERATOR_MULT, e, loc);
Bexpression* be = tree_to_expr(e->get_tree(context)); Bexpression* be = e->get_backend(context);
set = context->backend()->assignment_statement(be, binit, loc); set = context->backend()->assignment_statement(be, binit, loc);
} }
Expression* ref = Expression::make_temporary_reference(temp, loc); Expression* ref = Expression::make_temporary_reference(temp, loc);
Bexpression* bref = tree_to_expr(ref->get_tree(context)); Bexpression* bref = ref->get_backend(context);
Bstatement* sinit = context->backend()->init_statement(bvar, bref); Bstatement* sinit = context->backend()->init_statement(bvar, bref);
std::vector<Bstatement*> stats; std::vector<Bstatement*> stats;
...@@ -443,13 +443,13 @@ Temporary_statement::do_get_backend(Translate_context* context) ...@@ -443,13 +443,13 @@ Temporary_statement::do_get_backend(Translate_context* context)
if (this->init_ == NULL) if (this->init_ == NULL)
binit = NULL; binit = NULL;
else if (this->type_ == NULL) else if (this->type_ == NULL)
binit = tree_to_expr(this->init_->get_tree(context)); binit = this->init_->get_backend(context);
else else
{ {
Expression* init = Expression::make_cast(this->type_, this->init_, Expression* init = Expression::make_cast(this->type_, this->init_,
this->location()); this->location());
context->gogo()->lower_expression(context->function(), NULL, &init); context->gogo()->lower_expression(context->function(), NULL, &init);
binit = tree_to_expr(init->get_tree(context)); binit = init->get_backend(context);
} }
Bstatement* statement; Bstatement* statement;
...@@ -633,18 +633,16 @@ Assignment_statement::do_get_backend(Translate_context* context) ...@@ -633,18 +633,16 @@ Assignment_statement::do_get_backend(Translate_context* context)
{ {
if (this->lhs_->is_sink_expression()) if (this->lhs_->is_sink_expression())
{ {
tree rhs_tree = this->rhs_->get_tree(context); Bexpression* rhs = this->rhs_->get_backend(context);
return context->backend()->expression_statement(tree_to_expr(rhs_tree)); return context->backend()->expression_statement(rhs);
} }
tree lhs_tree = this->lhs_->get_tree(context); Bexpression* lhs = this->lhs_->get_backend(context);
Expression* rhs = Expression* conv =
Expression::convert_for_assignment(context->gogo(), this->lhs_->type(), Expression::convert_for_assignment(context->gogo(), this->lhs_->type(),
this->rhs_, this->location()); this->rhs_, this->location());
tree rhs_tree = rhs->get_tree(context); Bexpression* rhs = conv->get_backend(context);
return context->backend()->assignment_statement(tree_to_expr(lhs_tree), return context->backend()->assignment_statement(lhs, rhs, this->location());
tree_to_expr(rhs_tree),
this->location());
} }
// Dump the AST representation for an assignment statement. // Dump the AST representation for an assignment statement.
...@@ -1748,8 +1746,8 @@ Expression_statement::do_may_fall_through() const ...@@ -1748,8 +1746,8 @@ Expression_statement::do_may_fall_through() const
Bstatement* Bstatement*
Expression_statement::do_get_backend(Translate_context* context) Expression_statement::do_get_backend(Translate_context* context)
{ {
tree expr_tree = this->expr_->get_tree(context); Bexpression* bexpr = this->expr_->get_backend(context);
return context->backend()->expression_statement(tree_to_expr(expr_tree)); return context->backend()->expression_statement(bexpr);
} }
// Dump the AST representation for an expression statement // Dump the AST representation for an expression statement
...@@ -2537,9 +2535,8 @@ Go_statement::do_get_backend(Translate_context* context) ...@@ -2537,9 +2535,8 @@ Go_statement::do_get_backend(Translate_context* context)
Expression* call = Runtime::make_call(Runtime::GO, this->location(), 2, Expression* call = Runtime::make_call(Runtime::GO, this->location(), 2,
fn, arg); fn, arg);
tree call_tree = call->get_tree(context); Bexpression* bcall = call->get_backend(context);
Bexpression* call_bexpr = tree_to_expr(call_tree); return context->backend()->expression_statement(bcall);
return context->backend()->expression_statement(call_bexpr);
} }
// Dump the AST representation for go statement. // Dump the AST representation for go statement.
...@@ -2576,9 +2573,8 @@ Defer_statement::do_get_backend(Translate_context* context) ...@@ -2576,9 +2573,8 @@ Defer_statement::do_get_backend(Translate_context* context)
Expression* call = Runtime::make_call(Runtime::DEFER, loc, 3, Expression* call = Runtime::make_call(Runtime::DEFER, loc, 3,
ds, fn, arg); ds, fn, arg);
tree call_tree = call->get_tree(context); Bexpression* bcall = call->get_backend(context);
Bexpression* call_bexpr = tree_to_expr(call_tree); return context->backend()->expression_statement(bcall);
return context->backend()->expression_statement(call_bexpr);
} }
// Dump the AST representation for defer statement. // Dump the AST representation for defer statement.
...@@ -2785,7 +2781,7 @@ Return_statement::do_get_backend(Translate_context* context) ...@@ -2785,7 +2781,7 @@ Return_statement::do_get_backend(Translate_context* context)
p++) p++)
{ {
Expression* vr = Expression::make_var_reference(*p, loc); Expression* vr = Expression::make_var_reference(*p, loc);
retvals.push_back(tree_to_expr(vr->get_tree(context))); retvals.push_back(vr->get_backend(context));
} }
} }
...@@ -3201,14 +3197,13 @@ If_statement::do_get_backend(Translate_context* context) ...@@ -3201,14 +3197,13 @@ If_statement::do_get_backend(Translate_context* context)
{ {
go_assert(this->cond_->type()->is_boolean_type() go_assert(this->cond_->type()->is_boolean_type()
|| this->cond_->type()->is_error()); || this->cond_->type()->is_error());
tree cond_tree = this->cond_->get_tree(context); Bexpression* cond = this->cond_->get_backend(context);
Bexpression* cond_expr = tree_to_expr(cond_tree);
Bblock* then_block = this->then_block_->get_backend(context); Bblock* then_block = this->then_block_->get_backend(context);
Bblock* else_block = (this->else_block_ == NULL Bblock* else_block = (this->else_block_ == NULL
? NULL ? NULL
: this->else_block_->get_backend(context)); : this->else_block_->get_backend(context));
return context->backend()->if_statement(cond_expr, then_block, return context->backend()->if_statement(cond, then_block, else_block,
else_block, this->location()); this->location());
} }
// Dump the AST representation for an if statement // Dump the AST representation for an if statement
...@@ -3485,10 +3480,7 @@ Case_clauses::Case_clause::get_backend(Translate_context* context, ...@@ -3485,10 +3480,7 @@ Case_clauses::Case_clause::get_backend(Translate_context* context,
error_at(this->location_, "duplicate case in switch"); error_at(this->location_, "duplicate case in switch");
e = Expression::make_error(this->location_); e = Expression::make_error(this->location_);
} }
cases->push_back(e->get_backend(context));
tree case_tree = e->get_tree(context);
Bexpression* case_expr = tree_to_expr(case_tree);
cases->push_back(case_expr);
} }
} }
...@@ -3783,8 +3775,7 @@ Constant_switch_statement::do_check_types(Gogo*) ...@@ -3783,8 +3775,7 @@ Constant_switch_statement::do_check_types(Gogo*)
Bstatement* Bstatement*
Constant_switch_statement::do_get_backend(Translate_context* context) Constant_switch_statement::do_get_backend(Translate_context* context)
{ {
tree switch_val_tree = this->val_->get_tree(context); Bexpression* switch_val_expr = this->val_->get_backend(context);
Bexpression* switch_val_expr = tree_to_expr(switch_val_tree);
Unnamed_label* break_label = this->break_label_; Unnamed_label* break_label = this->break_label_;
if (break_label == NULL) if (break_label == NULL)
...@@ -4519,7 +4510,7 @@ Send_statement::do_get_backend(Translate_context* context) ...@@ -4519,7 +4510,7 @@ Send_statement::do_get_backend(Translate_context* context)
Expression* call = Runtime::make_call(code, loc, 3, td, this->channel_, val); Expression* call = Runtime::make_call(code, loc, 3, td, this->channel_, val);
context->gogo()->lower_expression(context->function(), NULL, &call); context->gogo()->lower_expression(context->function(), NULL, &call);
Bexpression* bcall = tree_to_expr(call->get_tree(context)); Bexpression* bcall = call->get_backend(context);
Bstatement* s = context->backend()->expression_statement(bcall); Bstatement* s = context->backend()->expression_statement(bcall);
if (btemp == NULL) if (btemp == NULL)
...@@ -4948,7 +4939,7 @@ Select_clauses::get_backend(Translate_context* context, ...@@ -4948,7 +4939,7 @@ Select_clauses::get_backend(Translate_context* context,
Expression* index_expr = Expression::make_integer(&ival, int32_type, Expression* index_expr = Expression::make_integer(&ival, int32_type,
location); location);
mpz_clear(ival); mpz_clear(ival);
cases[i].push_back(tree_to_expr(index_expr->get_tree(context))); cases[i].push_back(index_expr->get_backend(context));
Bstatement* s = p->get_statements_backend(context); Bstatement* s = p->get_statements_backend(context);
Location gloc = (p->statements() == NULL Location gloc = (p->statements() == NULL
...@@ -4966,7 +4957,7 @@ Select_clauses::get_backend(Translate_context* context, ...@@ -4966,7 +4957,7 @@ Select_clauses::get_backend(Translate_context* context,
Expression* call = Runtime::make_call(Runtime::SELECTGO, location, 1, Expression* call = Runtime::make_call(Runtime::SELECTGO, location, 1,
selref); selref);
context->gogo()->lower_expression(context->function(), NULL, &call); context->gogo()->lower_expression(context->function(), NULL, &call);
Bexpression* bcall = tree_to_expr(call->get_tree(context)); Bexpression* bcall = call->get_backend(context);
if (count == 0) if (count == 0)
return context->backend()->expression_statement(bcall); return context->backend()->expression_statement(bcall);
......
...@@ -6,12 +6,6 @@ ...@@ -6,12 +6,6 @@
#include "go-system.h" #include "go-system.h"
#include "toplev.h"
#include "intl.h"
#include "tree.h"
#include "real.h"
#include "convert.h"
#include "go-c.h" #include "go-c.h"
#include "gogo.h" #include "gogo.h"
#include "operator.h" #include "operator.h"
...@@ -897,7 +891,7 @@ Type::hash_string(const std::string& s, unsigned int h) ...@@ -897,7 +891,7 @@ Type::hash_string(const std::string& s, unsigned int h)
Type::Type_btypes Type::type_btypes; Type::Type_btypes Type::type_btypes;
// Return a tree representing this type. // Return the backend representation for this type.
Btype* Btype*
Type::get_backend(Gogo* gogo) Type::get_backend(Gogo* gogo)
...@@ -952,7 +946,7 @@ Type::get_backend(Gogo* gogo) ...@@ -952,7 +946,7 @@ Type::get_backend(Gogo* gogo)
// We have already created a backend representation for this // We have already created a backend representation for this
// type. This can happen when an unnamed type is defined using // type. This can happen when an unnamed type is defined using
// a named type which in turns uses an identical unnamed type. // a named type which in turns uses an identical unnamed type.
// Use the tree we created earlier and ignore the one we just // Use the representation we created earlier and ignore the one we just
// built. // built.
if (this->btype_ == bt) if (this->btype_ == bt)
this->btype_ = ins.first->second.btype; this->btype_ = ins.first->second.btype;
...@@ -1301,7 +1295,7 @@ Type::make_type_descriptor_var(Gogo* gogo) ...@@ -1301,7 +1295,7 @@ Type::make_type_descriptor_var(Gogo* gogo)
Translate_context context(gogo, NULL, NULL, NULL); Translate_context context(gogo, NULL, NULL, NULL);
context.set_is_const(); context.set_is_const();
Bexpression* binitializer = tree_to_expr(initializer->get_tree(&context)); Bexpression* binitializer = initializer->get_backend(&context);
gogo->backend()->immutable_struct_set_init(this->type_descriptor_var_, gogo->backend()->immutable_struct_set_init(this->type_descriptor_var_,
var_name, false, is_common, var_name, false, is_common,
...@@ -4936,7 +4930,7 @@ get_backend_struct_fields(Gogo* gogo, const Struct_field_list* fields, ...@@ -4936,7 +4930,7 @@ get_backend_struct_fields(Gogo* gogo, const Struct_field_list* fields,
go_assert(i == fields->size()); go_assert(i == fields->size());
} }
// Get the tree for a struct type. // Get the backend representation for a struct type.
Btype* Btype*
Struct_type::do_get_backend(Gogo* gogo) Struct_type::do_get_backend(Gogo* gogo)
...@@ -5877,9 +5871,9 @@ get_backend_slice_fields(Gogo* gogo, Array_type* type, bool use_placeholder, ...@@ -5877,9 +5871,9 @@ get_backend_slice_fields(Gogo* gogo, Array_type* type, bool use_placeholder,
p->location = ploc; p->location = ploc;
} }
// Get a tree for the type of this array. A fixed array is simply // Get the backend representation for the type of this array. A fixed array is
// represented as ARRAY_TYPE with the appropriate index--i.e., it is // simply represented as ARRAY_TYPE with the appropriate index--i.e., it is
// just like an array in C. A slice is a struct with three // just like an array in C. An open array is a struct with three
// fields: a data pointer, the length, and the capacity. // fields: a data pointer, the length, and the capacity.
Btype* Btype*
...@@ -5943,7 +5937,7 @@ Array_type::get_backend_length(Gogo* gogo) ...@@ -5943,7 +5937,7 @@ Array_type::get_backend_length(Gogo* gogo)
// Make up a translation context for the array length // Make up a translation context for the array length
// expression. FIXME: This won't work in general. // expression. FIXME: This won't work in general.
Translate_context context(gogo, NULL, NULL, NULL); Translate_context context(gogo, NULL, NULL, NULL);
this->blength_ = tree_to_expr(this->length_->get_tree(&context)); this->blength_ = this->length_->get_backend(&context);
Btype* ibtype = Type::lookup_integer_type("int")->get_backend(gogo); Btype* ibtype = Type::lookup_integer_type("int")->get_backend(gogo);
this->blength_ = this->blength_ =
...@@ -6466,7 +6460,7 @@ Map_type::map_descriptor(Gogo* gogo) ...@@ -6466,7 +6460,7 @@ Map_type::map_descriptor(Gogo* gogo)
Translate_context context(gogo, NULL, NULL, NULL); Translate_context context(gogo, NULL, NULL, NULL);
context.set_is_const(); context.set_is_const();
Bexpression* binitializer = tree_to_expr(initializer->get_tree(&context)); Bexpression* binitializer = initializer->get_backend(&context);
gogo->backend()->immutable_struct_set_init(bvar, mangled_name, false, true, gogo->backend()->immutable_struct_set_init(bvar, mangled_name, false, true,
map_descriptor_btype, bloc, map_descriptor_btype, bloc,
...@@ -6581,8 +6575,8 @@ Channel_type::is_identical(const Channel_type* t, ...@@ -6581,8 +6575,8 @@ Channel_type::is_identical(const Channel_type* t,
&& this->may_receive_ == t->may_receive_); && this->may_receive_ == t->may_receive_);
} }
// Return the tree for a channel type. A channel is a pointer to a // Return the backend representation for a channel type. A channel is a pointer
// __go_channel struct. The __go_channel struct is defined in // to a __go_channel struct. The __go_channel struct is defined in
// libgo/runtime/channel.h. // libgo/runtime/channel.h.
Btype* Btype*
...@@ -7364,8 +7358,8 @@ get_backend_interface_fields(Gogo* gogo, Interface_type* type, ...@@ -7364,8 +7358,8 @@ get_backend_interface_fields(Gogo* gogo, Interface_type* type,
(*bfields)[1].location = Linemap::predeclared_location(); (*bfields)[1].location = Linemap::predeclared_location();
} }
// Return a tree for an interface type. An interface is a pointer to // Return the backend representation for an interface type. An interface is a
// a struct. The struct has three fields. The first field is a // pointer to a struct. The struct has three fields. The first field is a
// pointer to the type descriptor for the dynamic type of the object. // pointer to the type descriptor for the dynamic type of the object.
// The second field is a pointer to a table of methods for the // The second field is a pointer to a table of methods for the
// interface to be used with the object. The third field is the value // interface to be used with the object. The third field is the value
...@@ -8416,7 +8410,7 @@ Named_type::convert(Gogo* gogo) ...@@ -8416,7 +8410,7 @@ Named_type::convert(Gogo* gogo)
this->verify(); this->verify();
// Convert all the dependencies. If they refer indirectly back to // Convert all the dependencies. If they refer indirectly back to
// this type, they will pick up the intermediate tree we just // this type, they will pick up the intermediate representation we just
// created. // created.
for (std::vector<Named_type*>::const_iterator p = this->dependencies_.begin(); for (std::vector<Named_type*>::const_iterator p = this->dependencies_.begin();
p != this->dependencies_.end(); p != this->dependencies_.end();
...@@ -8612,7 +8606,7 @@ Named_type::create_placeholder(Gogo* gogo) ...@@ -8612,7 +8606,7 @@ Named_type::create_placeholder(Gogo* gogo)
} }
} }
// Get a tree for a named type. // Get the backend representation for a named type.
Btype* Btype*
Named_type::do_get_backend(Gogo* gogo) Named_type::do_get_backend(Gogo* gogo)
...@@ -8648,7 +8642,7 @@ Named_type::do_get_backend(Gogo* gogo) ...@@ -8648,7 +8642,7 @@ Named_type::do_get_backend(Gogo* gogo)
go_assert(bt != NULL); go_assert(bt != NULL);
// Complete the tree. // Complete the backend representation.
Type* base = this->type_->base(); Type* base = this->type_->base();
Btype* bt1; Btype* bt1;
switch (base->classification()) switch (base->classification())
......
...@@ -1168,9 +1168,6 @@ class Type ...@@ -1168,9 +1168,6 @@ class Type
method_constructor(Gogo*, Type* method_type, const std::string& name, method_constructor(Gogo*, Type* method_type, const std::string& name,
const Method*, bool only_value_methods) const; const Method*, bool only_value_methods) const;
static tree
build_receive_return_type(tree type);
// Add all methods for TYPE to the list of methods for THIS. // Add all methods for TYPE to the list of methods for THIS.
static void static void
add_methods_for_type(const Type* type, const Method::Field_indexes*, add_methods_for_type(const Type* type, const Method::Field_indexes*,
...@@ -2755,9 +2752,9 @@ class Interface_type : public Type ...@@ -2755,9 +2752,9 @@ class Interface_type : public Type
}; };
// The value we keep for a named type. This lets us get the right // The value we keep for a named type. This lets us get the right
// name when we convert to trees. Note that we don't actually keep // name when we convert to backend. Note that we don't actually keep
// the name here; the name is in the Named_object which points to // the name here; the name is in the Named_object which points to
// this. This object exists to hold a unique tree which represents // this. This object exists to hold a unique backend representation for
// the type. // the type.
class Named_type : public Type class Named_type : public 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