diff options
| author | gingerBill <bill@gingerbill.org> | 2019-08-29 14:36:42 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2019-08-29 14:36:42 +0100 |
| commit | c89fc35e941275085332ba16b453432b5b7a5086 (patch) | |
| tree | 6da1a49448aeb7d6751d41aa2ce6e19a1f6a4e6e /src/ir.cpp | |
| parent | 614d209824f005aa11a399bbe1bbf2b3b9e76687 (diff) | |
Fix global variable initialization ordering
(related to #427)
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index 62519c259..26f787976 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -2226,18 +2226,9 @@ irDebugInfo *ir_add_debug_info_type_complex(irModule *module, Type *type) { Type *field_type = base_complex_elem_type(type); - // Field "real" - irDebugInfo *real_di = ir_add_debug_info_field_internal(module, str_lit("real"), field_type, - 0, - nullptr, - di); + irDebugInfo *real_di = ir_add_debug_info_field_internal(module, str_lit("real"), field_type, 0*cast(i32)type_size_of(field_type), nullptr, di); + irDebugInfo *imag_di = ir_add_debug_info_field_internal(module, str_lit("imag"), field_type, 1*cast(i32)type_size_of(field_type), nullptr, di); map_set(&module->debug_info, hash_pointer(real_di), real_di); - - // Field "imag" - irDebugInfo *imag_di = ir_add_debug_info_field_internal(module, str_lit("imag"), field_type, - real_di->DerivedType.size, - nullptr, - di); map_set(&module->debug_info, hash_pointer(imag_di), imag_di); irDebugInfo *elements_di = ir_add_debug_info_array(module, 0, 2); |