Commit 2ae30b14 by Ian Lance Taylor

compiler: fix comments + fieldnames to match libgo source

    
    A couple of the comments in the type descriptor code were out of date
    with respect to the names in libgo/go/runtime/type.go.  Fix up the
    comments and field names to bring them into sync.
    
    Reviewed-on: https://go-review.googlesource.com/34472

From-SVN: r243735
parent 6f9ad634
ae57b28b3caf1f6670e0f663235f1bf7655db870 310862eb11ec0705f21a375c0dd16f46a8d901c1
The first line of this file holds the git revision number of the last The first line of this file holds the git revision number of the last
merge done from the gofrontend repository. merge done from the gofrontend repository.
...@@ -1471,8 +1471,8 @@ Type::convert_builtin_named_types(Gogo* gogo) ...@@ -1471,8 +1471,8 @@ Type::convert_builtin_named_types(Gogo* gogo)
} }
// Return the type of a type descriptor. We should really tie this to // Return the type of a type descriptor. We should really tie this to
// runtime.Type rather than copying it. This must match commonType in // runtime.Type rather than copying it. This must match the struct "_type"
// libgo/go/runtime/type.go. // declared in libgo/go/runtime/type.go.
Type* Type*
Type::make_type_descriptor_type() Type::make_type_descriptor_type()
...@@ -1519,7 +1519,7 @@ Type::make_type_descriptor_type() ...@@ -1519,7 +1519,7 @@ Type::make_type_descriptor_type()
// Forward declaration for the type descriptor type. // Forward declaration for the type descriptor type.
Named_object* named_type_descriptor_type = Named_object* named_type_descriptor_type =
Named_object::make_type_declaration("commonType", NULL, bloc); Named_object::make_type_declaration("_type", NULL, bloc);
Type* ft = Type::make_forward_declaration(named_type_descriptor_type); Type* ft = Type::make_forward_declaration(named_type_descriptor_type);
Type* pointer_type_descriptor_type = Type::make_pointer_type(ft); Type* pointer_type_descriptor_type = Type::make_pointer_type(ft);
...@@ -1565,7 +1565,7 @@ Type::make_type_descriptor_type() ...@@ -1565,7 +1565,7 @@ Type::make_type_descriptor_type()
"ptrToThis", "ptrToThis",
pointer_type_descriptor_type); pointer_type_descriptor_type);
Named_type* named = Type::make_builtin_named_type("commonType", Named_type* named = Type::make_builtin_named_type("_type",
type_descriptor_type); type_descriptor_type);
named_type_descriptor_type->set_type_value(named); named_type_descriptor_type->set_type_value(named);
...@@ -3882,7 +3882,7 @@ Function_type::do_type_descriptor(Gogo* gogo, Named_type* name) ...@@ -3882,7 +3882,7 @@ Function_type::do_type_descriptor(Gogo* gogo, Named_type* name)
vals->reserve(4); vals->reserve(4);
Struct_field_list::const_iterator p = fields->begin(); Struct_field_list::const_iterator p = fields->begin();
go_assert(p->is_field_name("commonType")); go_assert(p->is_field_name("_type"));
vals->push_back(this->type_descriptor_constructor(gogo, vals->push_back(this->type_descriptor_constructor(gogo,
RUNTIME_TYPE_KIND_FUNC, RUNTIME_TYPE_KIND_FUNC,
name, NULL, true)); name, NULL, true));
...@@ -4395,7 +4395,7 @@ Pointer_type::do_type_descriptor(Gogo* gogo, Named_type* name) ...@@ -4395,7 +4395,7 @@ Pointer_type::do_type_descriptor(Gogo* gogo, Named_type* name)
vals->reserve(2); vals->reserve(2);
Struct_field_list::const_iterator p = fields->begin(); Struct_field_list::const_iterator p = fields->begin();
go_assert(p->is_field_name("commonType")); go_assert(p->is_field_name("_type"));
vals->push_back(this->type_descriptor_constructor(gogo, vals->push_back(this->type_descriptor_constructor(gogo,
RUNTIME_TYPE_KIND_PTR, RUNTIME_TYPE_KIND_PTR,
name, methods, false)); name, methods, false));
...@@ -5305,7 +5305,7 @@ Struct_type::do_type_descriptor(Gogo* gogo, Named_type* name) ...@@ -5305,7 +5305,7 @@ Struct_type::do_type_descriptor(Gogo* gogo, Named_type* name)
go_assert(methods == NULL || name == NULL); go_assert(methods == NULL || name == NULL);
Struct_field_list::const_iterator ps = fields->begin(); Struct_field_list::const_iterator ps = fields->begin();
go_assert(ps->is_field_name("commonType")); go_assert(ps->is_field_name("_type"));
vals->push_back(this->type_descriptor_constructor(gogo, vals->push_back(this->type_descriptor_constructor(gogo,
RUNTIME_TYPE_KIND_STRUCT, RUNTIME_TYPE_KIND_STRUCT,
name, methods, true)); name, methods, true));
...@@ -6719,7 +6719,7 @@ Array_type::array_type_descriptor(Gogo* gogo, Named_type* name) ...@@ -6719,7 +6719,7 @@ Array_type::array_type_descriptor(Gogo* gogo, Named_type* name)
vals->reserve(3); vals->reserve(3);
Struct_field_list::const_iterator p = fields->begin(); Struct_field_list::const_iterator p = fields->begin();
go_assert(p->is_field_name("commonType")); go_assert(p->is_field_name("_type"));
vals->push_back(this->type_descriptor_constructor(gogo, vals->push_back(this->type_descriptor_constructor(gogo,
RUNTIME_TYPE_KIND_ARRAY, RUNTIME_TYPE_KIND_ARRAY,
name, NULL, true)); name, NULL, true));
...@@ -6758,7 +6758,7 @@ Array_type::slice_type_descriptor(Gogo* gogo, Named_type* name) ...@@ -6758,7 +6758,7 @@ Array_type::slice_type_descriptor(Gogo* gogo, Named_type* name)
vals->reserve(2); vals->reserve(2);
Struct_field_list::const_iterator p = fields->begin(); Struct_field_list::const_iterator p = fields->begin();
go_assert(p->is_field_name("commonType")); go_assert(p->is_field_name("_type"));
vals->push_back(this->type_descriptor_constructor(gogo, vals->push_back(this->type_descriptor_constructor(gogo,
RUNTIME_TYPE_KIND_SLICE, RUNTIME_TYPE_KIND_SLICE,
name, NULL, true)); name, NULL, true));
...@@ -7243,7 +7243,7 @@ Map_type::do_type_descriptor(Gogo* gogo, Named_type* name) ...@@ -7243,7 +7243,7 @@ Map_type::do_type_descriptor(Gogo* gogo, Named_type* name)
vals->reserve(12); vals->reserve(12);
Struct_field_list::const_iterator p = fields->begin(); Struct_field_list::const_iterator p = fields->begin();
go_assert(p->is_field_name("commonType")); go_assert(p->is_field_name("_type"));
vals->push_back(this->type_descriptor_constructor(gogo, vals->push_back(this->type_descriptor_constructor(gogo,
RUNTIME_TYPE_KIND_MAP, RUNTIME_TYPE_KIND_MAP,
name, NULL, true)); name, NULL, true));
...@@ -7681,7 +7681,7 @@ Channel_type::do_type_descriptor(Gogo* gogo, Named_type* name) ...@@ -7681,7 +7681,7 @@ Channel_type::do_type_descriptor(Gogo* gogo, Named_type* name)
vals->reserve(3); vals->reserve(3);
Struct_field_list::const_iterator p = fields->begin(); Struct_field_list::const_iterator p = fields->begin();
go_assert(p->is_field_name("commonType")); go_assert(p->is_field_name("_type"));
vals->push_back(this->type_descriptor_constructor(gogo, vals->push_back(this->type_descriptor_constructor(gogo,
RUNTIME_TYPE_KIND_CHAN, RUNTIME_TYPE_KIND_CHAN,
name, NULL, true)); name, NULL, true));
...@@ -8570,7 +8570,7 @@ Interface_type::do_type_descriptor(Gogo* gogo, Named_type* name) ...@@ -8570,7 +8570,7 @@ Interface_type::do_type_descriptor(Gogo* gogo, Named_type* name)
ivals->reserve(2); ivals->reserve(2);
Struct_field_list::const_iterator pif = ifields->begin(); Struct_field_list::const_iterator pif = ifields->begin();
go_assert(pif->is_field_name("commonType")); go_assert(pif->is_field_name("_type"));
const int rt = RUNTIME_TYPE_KIND_INTERFACE; const int rt = RUNTIME_TYPE_KIND_INTERFACE;
ivals->push_back(this->type_descriptor_constructor(gogo, rt, name, NULL, ivals->push_back(this->type_descriptor_constructor(gogo, rt, name, NULL,
true)); true));
......
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