diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2017-02-09 12:43:08 -0500 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2017-02-09 12:43:08 -0500 |
| commit | 92ffcc84a9d5da32a645321eee8d33c179d03562 (patch) | |
| tree | ab9e581daac8893d8480f05ad63319378c41d3d1 /src/analyze.cpp | |
| parent | fc100d7b3b27bd514dca4e02c160e5b96d4da648 (diff) | |
| download | zig-92ffcc84a9d5da32a645321eee8d33c179d03562.tar.gz zig-92ffcc84a9d5da32a645321eee8d33c179d03562.zip | |
remove the depends_on_compile_var code
cleanup from the decision in commit 8a859afd580f438f549ee69a
to remove "unnecessary if statement" error
Diffstat (limited to 'src/analyze.cpp')
| -rw-r--r-- | src/analyze.cpp | 18 |
1 files changed, 0 insertions, 18 deletions
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); |
