mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Remove dead code
This commit is contained in:
+2
-19
@@ -291,27 +291,9 @@ gb_internal isize cg_global_const_calculate_region_count(ExactValue const &value
|
|||||||
if (sel.index.count == 1) {
|
if (sel.index.count == 1) {
|
||||||
count += cg_global_const_calculate_region_count(fv->value->tav.value, f->type);
|
count += cg_global_const_calculate_region_count(fv->value->tav.value, f->type);
|
||||||
} else {
|
} else {
|
||||||
TEMPORARY_ALLOCATOR_GUARD();
|
|
||||||
isize idx_list_len = sel.index.count-1;
|
|
||||||
isize *idx_list = gb_alloc_array(temporary_allocator(), isize, idx_list_len);
|
|
||||||
|
|
||||||
count += 1; // just in case
|
count += 1; // just in case
|
||||||
if (cg_is_nested_possibly_constant(type, sel, fv->value)) {
|
if (cg_is_nested_possibly_constant(type, sel, fv->value)) {
|
||||||
Type *cv_type = f->type;
|
Type *cv_type = sel.entity->type;
|
||||||
for (isize j = 1; j < sel.index.count; j++) {
|
|
||||||
i32 index = sel.index[j];
|
|
||||||
Type *cvt = base_type(cv_type);
|
|
||||||
|
|
||||||
idx_list[j-1] = index;
|
|
||||||
if (cvt->kind == Type_Struct) {
|
|
||||||
cv_type = cvt->Struct.fields[index]->type;
|
|
||||||
} else if (cvt->kind == Type_Array) {
|
|
||||||
cv_type = cvt->Array.elem;
|
|
||||||
} else {
|
|
||||||
GB_PANIC("UNKNOWN TYPE: %s", type_to_string(cv_type));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
count += cg_global_const_calculate_region_count(fv->value->tav.value, cv_type);
|
count += cg_global_const_calculate_region_count(fv->value->tav.value, cv_type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -475,6 +457,7 @@ gb_internal bool cg_global_const_add_region(cgModule *m, ExactValue const &value
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GB_ASSERT(!is_type_array_like(bt));
|
||||||
|
|
||||||
switch (value.kind) {
|
switch (value.kind) {
|
||||||
case ExactValue_Bool:
|
case ExactValue_Bool:
|
||||||
|
|||||||
Reference in New Issue
Block a user