Named_object* no = types.front();
types.pop_front();
- std::vector<const Named_object*> requires;
+ std::vector<const Named_object*> needs;
std::vector<const Named_object*> declare;
- if (!no->type_value()->struct_type()->can_write_to_c_header(&requires,
+ if (!no->type_value()->struct_type()->can_write_to_c_header(&needs,
&declare))
continue;
bool ok = true;
for (std::vector<const Named_object*>::const_iterator pr
- = requires.begin();
- pr != requires.end() && ok;
+ = needs.begin();
+ pr != needs.end() && ok;
++pr)
{
for (std::list<Named_object*>::const_iterator pt = types.begin();
if (*pd == no)
continue;
- std::vector<const Named_object*> drequires;
+ std::vector<const Named_object*> dneeds;
std::vector<const Named_object*> ddeclare;
if (!(*pd)->type_value()->struct_type()->
- can_write_to_c_header(&drequires, &ddeclare))
+ can_write_to_c_header(&dneeds, &ddeclare))
continue;
bool done = false;
bool
Struct_type::can_write_to_c_header(
- std::vector<const Named_object*>* requires,
+ std::vector<const Named_object*>* needs,
std::vector<const Named_object*>* declare) const
{
const Struct_field_list* fields = this->fields_;
p != fields->end();
++p)
{
- if (!this->can_write_type_to_c_header(p->type(), requires, declare))
+ if (!this->can_write_type_to_c_header(p->type(), needs, declare))
return false;
if (Gogo::message_name(p->field_name()) == "_")
sinks++;
bool
Struct_type::can_write_type_to_c_header(
const Type* t,
- std::vector<const Named_object*>* requires,
+ std::vector<const Named_object*>* needs,
std::vector<const Named_object*>* declare) const
{
t = t->forwarded();
return true;
case TYPE_STRUCT:
- return t->struct_type()->can_write_to_c_header(requires, declare);
+ return t->struct_type()->can_write_to_c_header(needs, declare);
case TYPE_ARRAY:
if (t->is_slice_type())
return true;
return this->can_write_type_to_c_header(t->array_type()->element_type(),
- requires, declare);
+ needs, declare);
case TYPE_NAMED:
{
// We will accept empty struct fields, but not print them.
if (t->struct_type()->total_field_count() == 0)
return true;
- requires->push_back(no);
- return t->struct_type()->can_write_to_c_header(requires, declare);
+ needs->push_back(no);
+ return t->struct_type()->can_write_to_c_header(needs, declare);
}
- return this->can_write_type_to_c_header(t->base(), requires, declare);
+ return this->can_write_type_to_c_header(t->base(), needs, declare);
}
case TYPE_CALL_MULTIPLE_RESULT:
case TYPE_POINTER:
{
- std::vector<const Named_object*> requires;
+ std::vector<const Named_object*> needs;
std::vector<const Named_object*> declare;
- if (!this->can_write_type_to_c_header(t->points_to(), &requires,
+ if (!this->can_write_type_to_c_header(t->points_to(), &needs,
&declare))
os << "void*";
else