// A Go function type is a pointer to a struct type.
Location loc = this->function_type()->location();
bt = gogo->backend()->placeholder_pointer_type("", loc, false);
+ Type::placeholder_pointers.push_back(this);
}
break;
{
Location loc = Linemap::unknown_location();
bt = gogo->backend()->placeholder_pointer_type("", loc, false);
- Pointer_type* pt = this->convert<Pointer_type, TYPE_POINTER>();
- Type::placeholder_pointers.push_back(pt);
+ Type::placeholder_pointers.push_back(this);
}
break;
Type::Pointer_type_table Type::pointer_types;
-// A list of placeholder pointer types. We keep this so we can ensure
-// they are finalized.
+// A list of placeholder pointer types; items on this list will be either be
+// Pointer_type or Function_type. We keep this so we can ensure they are
+// finalized.
-std::vector<Pointer_type*> Type::placeholder_pointers;
+std::vector<Type*> Type::placeholder_pointers;
// Make a pointer type.
// placeholder pointer types as we finalized existing ones.
for (size_t i = 0; i < Type::placeholder_pointers.size(); i++)
{
- Pointer_type* pt = Type::placeholder_pointers[i];
- Type_btypes::iterator tbti = Type::type_btypes.find(pt);
+ Type* typ = Type::placeholder_pointers[i];
+ Type_btypes::iterator tbti = Type::type_btypes.find(typ);
if (tbti != Type::type_btypes.end() && tbti->second.is_placeholder)
{
- pt->finish_backend(gogo, tbti->second.btype);
+ typ->finish_backend(gogo, tbti->second.btype);
tbti->second.is_placeholder = false;
}
}
static Pointer_type_table pointer_types;
// List of placeholder pointer types.
- static std::vector<Pointer_type*> placeholder_pointers;
+ static std::vector<Type*> placeholder_pointers;
// The type classification.
Type_classification classification_;