From 92ffcc84a9d5da32a645321eee8d33c179d03562 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 9 Feb 2017 12:43:08 -0500 Subject: remove the depends_on_compile_var code cleanup from the decision in commit 8a859afd580f438f549ee69a to remove "unnecessary if statement" error --- src/analyze.cpp | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'src/analyze.cpp') diff --git a/src/analyze.cpp b/src/analyze.cpp index 984fa32a83..232fae69e1 100644 --- a/src/analyze.cpp +++ b/src/analyze.cpp @@ -1146,9 +1146,6 @@ static void resolve_enum_type(CodeGen *g, TypeTableEntry *enum_type) { continue; } - enum_type->size_depends_on_compile_var = enum_type->size_depends_on_compile_var || - field_type->size_depends_on_compile_var; - if (!type_has_bits(field_type)) continue; @@ -1320,9 +1317,6 @@ static void resolve_struct_type(CodeGen *g, TypeTableEntry *struct_type) { continue; } - struct_type->size_depends_on_compile_var = struct_type->size_depends_on_compile_var || - field_type->size_depends_on_compile_var; - if (!type_has_bits(field_type)) continue; @@ -3348,17 +3342,6 @@ bool const_values_equal(ConstExprValue *a, ConstExprValue *b) { zig_unreachable(); } -static bool int_type_depends_on_compile_var(CodeGen *g, TypeTableEntry *int_type) { - assert(int_type->id == TypeTableEntryIdInt); - - for (size_t i = 0; i < CIntTypeCount; i += 1) { - if (int_type == g->builtin_types.entry_c_int[i]) { - return true; - } - } - return false; -} - static uint64_t max_unsigned_val(TypeTableEntry *type_entry) { assert(type_entry->id == TypeTableEntryIdInt); if (type_entry->data.integral.bit_count == 64) { @@ -3407,7 +3390,6 @@ static int64_t min_signed_val(TypeTableEntry *type_entry) { void eval_min_max_value(CodeGen *g, TypeTableEntry *type_entry, ConstExprValue *const_val, bool is_max) { if (type_entry->id == TypeTableEntryIdInt) { const_val->special = ConstValSpecialStatic; - const_val->depends_on_compile_var = int_type_depends_on_compile_var(g, type_entry); if (is_max) { if (type_entry->data.integral.is_signed) { int64_t val = max_signed_val(type_entry); -- cgit v1.2.3