Remove using in arrays; Remove _ non-exported struct fields

Start determining slow parts of the compiler
This commit is contained in:
gingerBill
2017-11-28 22:12:33 +00:00
parent 91b534d128
commit cfabc0e61f
9 changed files with 299 additions and 369 deletions

View File

@@ -950,7 +950,18 @@ bool is_type_valid_for_keys(Type *t) {
bool is_type_indexable(Type *t) {
return is_type_array(t) || is_type_slice(t) || is_type_vector(t) || is_type_string(t);
Type *bt = base_type(t);
switch (bt->kind) {
case Type_Basic:
return is_type_string(bt);
case Type_Array:
case Type_Slice:
case Type_Vector:
case Type_DynamicArray:
case Type_Map:
return true;
}
return false;
}
bool is_type_polymorphic_struct(Type *t) {