diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2016-12-21 21:49:05 -0500 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2016-12-21 21:49:05 -0500 |
| commit | 9b616820370c08a97d95805ca31eae5f8ca554f3 (patch) | |
| tree | 02156ccb1d8a72c747a08b4312820e5ab649cdfa /src/analyze.cpp | |
| parent | 1f6dacbb2f9a91a20309b271a31e781f11f81819 (diff) | |
| download | zig-9b616820370c08a97d95805ca31eae5f8ca554f3.tar.gz zig-9b616820370c08a97d95805ca31eae5f8ca554f3.zip | |
IR: implement runtime enum init and switch on enum with variable
Diffstat (limited to 'src/analyze.cpp')
| -rw-r--r-- | src/analyze.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp index 221868debc..738c0b36d2 100644 --- a/src/analyze.cpp +++ b/src/analyze.cpp @@ -749,6 +749,7 @@ TypeTableEntry *get_fn_type(CodeGen *g, FnTypeId *fn_type_id) { // next, loop over the parameters again and compute debug information // and codegen information if (!skip_debug_info) { + ensure_complete_type(g, fn_type_id->return_type); bool first_arg_return = !fn_type_id->is_extern && handle_is_ptr(fn_type_id->return_type); // +1 for maybe making the first argument the return value LLVMTypeRef *gen_param_types = allocate<LLVMTypeRef>(1 + fn_type_id->param_count); @@ -2534,6 +2535,7 @@ bool handle_is_ptr(TypeTableEntry *type_entry) { case TypeTableEntryIdErrorUnion: return type_has_bits(type_entry->data.error.child_type); case TypeTableEntryIdEnum: + assert(type_entry->data.enumeration.complete); return type_entry->data.enumeration.gen_field_count != 0; case TypeTableEntryIdMaybe: return type_entry->data.maybe.child_type->id != TypeTableEntryIdPointer && |
