| author | |
| committer | |
| log | 1d92700d089eb2e225d1db6de780e4288fa68452 |
| tree | 643871fe14f6391b2989750cd0b9e5a6d1dc3634 |
| parent | e18170ee0bf32996635397e8e919a14a21c88b56 |
4 files changed, 17 insertions(+), 5 deletions(-)
src/analyze.cpp+5-1| ... | ... | @@ -183,6 +183,7 @@ static bool type_is_complete(TypeTableEntry *type_entry) { |
| 183 | 183 | case TypeTableEntryIdTypeDecl: |
| 184 | 184 | return true; |
| 185 | 185 | } |
| 186 | zig_unreachable(); | |
| 186 | 187 | } |
| 187 | 188 | |
| 188 | 189 | TypeTableEntry *get_smallest_unsigned_int_type(CodeGen *g, uint64_t x) { |
| ... | ... | @@ -1593,6 +1594,7 @@ static bool type_has_codegen_value(TypeTableEntry *type_entry) { |
| 1593 | 1594 | case TypeTableEntryIdTypeDecl: |
| 1594 | 1595 | return type_has_codegen_value(type_entry->data.type_decl.canonical_type); |
| 1595 | 1596 | } |
| 1597 | zig_unreachable(); | |
| 1596 | 1598 | } |
| 1597 | 1599 | |
| 1598 | 1600 | static void add_global_const_expr(CodeGen *g, AstNode *expr_node) { |
| ... | ... | @@ -4671,6 +4673,7 @@ static TypeTableEntry *analyze_return_expr(CodeGen *g, ImportTableEntry *import, |
| 4671 | 4673 | case ReturnKindMaybe: |
| 4672 | 4674 | zig_panic("TODO"); |
| 4673 | 4675 | } |
| 4676 | zig_unreachable(); | |
| 4674 | 4677 | } |
| 4675 | 4678 | |
| 4676 | 4679 | static void validate_voided_expr(CodeGen *g, AstNode *source_node, TypeTableEntry *type_entry) { |
| ... | ... | @@ -5916,7 +5919,7 @@ bool type_has_bits(TypeTableEntry *type_entry) { |
| 5916 | 5919 | |
| 5917 | 5920 | static TypeTableEntry *first_struct_field_type(TypeTableEntry *type_entry) { |
| 5918 | 5921 | assert(type_entry->id == TypeTableEntryIdStruct); |
| 5919 | for (int i = 0; i < type_entry->data.structure.src_field_count; i += 1) { | |
| 5922 | for (uint32_t i = 0; i < type_entry->data.structure.src_field_count; i += 1) { | |
| 5920 | 5923 | TypeStructField *tsf = &type_entry->data.structure.fields[i]; |
| 5921 | 5924 | if (tsf->gen_index == 0) { |
| 5922 | 5925 | return tsf->type_entry; |
| ... | ... | @@ -5956,6 +5959,7 @@ static TypeTableEntry *type_of_first_thing_in_memory(TypeTableEntry *type_entry) |
| 5956 | 5959 | case TypeTableEntryIdPointer: |
| 5957 | 5960 | return type_entry; |
| 5958 | 5961 | } |
| 5962 | zig_unreachable(); | |
| 5959 | 5963 | } |
| 5960 | 5964 | |
| 5961 | 5965 | uint64_t get_memcpy_align(CodeGen *g, TypeTableEntry *type_entry) { |
src/ast_render.cpp+6| ... | ... | @@ -39,6 +39,7 @@ static const char *bin_op_str(BinOpType bin_op) { |
| 39 | 39 | case BinOpTypeUnwrapMaybe: return "??"; |
| 40 | 40 | case BinOpTypeStrCat: return "++"; |
| 41 | 41 | } |
| 42 | zig_unreachable(); | |
| 42 | 43 | } |
| 43 | 44 | |
| 44 | 45 | static const char *prefix_op_str(PrefixOp prefix_op) { |
| ... | ... | @@ -55,6 +56,7 @@ static const char *prefix_op_str(PrefixOp prefix_op) { |
| 55 | 56 | case PrefixOpUnwrapError: return "%%"; |
| 56 | 57 | case PrefixOpUnwrapMaybe: return "??"; |
| 57 | 58 | } |
| 59 | zig_unreachable(); | |
| 58 | 60 | } |
| 59 | 61 | |
| 60 | 62 | static const char *return_prefix_str(ReturnKind kind) { |
| ... | ... | @@ -63,6 +65,7 @@ static const char *return_prefix_str(ReturnKind kind) { |
| 63 | 65 | case ReturnKindMaybe: return "?"; |
| 64 | 66 | case ReturnKindUnconditional: return ""; |
| 65 | 67 | } |
| 68 | zig_unreachable(); | |
| 66 | 69 | } |
| 67 | 70 | |
| 68 | 71 | static const char *visib_mod_string(VisibMod mod) { |
| ... | ... | @@ -71,6 +74,7 @@ static const char *visib_mod_string(VisibMod mod) { |
| 71 | 74 | case VisibModPrivate: return ""; |
| 72 | 75 | case VisibModExport: return "export "; |
| 73 | 76 | } |
| 77 | zig_unreachable(); | |
| 74 | 78 | } |
| 75 | 79 | |
| 76 | 80 | static const char *extern_string(bool is_extern) { |
| ... | ... | @@ -90,6 +94,7 @@ static const char *container_string(ContainerKind kind) { |
| 90 | 94 | case ContainerKindEnum: return "enum"; |
| 91 | 95 | case ContainerKindStruct: return "struct"; |
| 92 | 96 | } |
| 97 | zig_unreachable(); | |
| 93 | 98 | } |
| 94 | 99 | |
| 95 | 100 | static const char *node_type_str(NodeType node_type) { |
| ... | ... | @@ -191,6 +196,7 @@ static const char *node_type_str(NodeType node_type) { |
| 191 | 196 | case NodeTypeTypeLiteral: |
| 192 | 197 | return "TypeLiteral"; |
| 193 | 198 | } |
| 199 | zig_unreachable(); | |
| 194 | 200 | } |
| 195 | 201 | |
| 196 | 202 |
src/codegen.cpp+5-4| ... | ... | @@ -1733,6 +1733,7 @@ static LLVMValueRef gen_return_expr(CodeGen *g, AstNode *node) { |
| 1733 | 1733 | case ReturnKindMaybe: |
| 1734 | 1734 | zig_panic("TODO"); |
| 1735 | 1735 | } |
| 1736 | zig_unreachable(); | |
| 1736 | 1737 | } |
| 1737 | 1738 | |
| 1738 | 1739 | static LLVMValueRef gen_defer(CodeGen *g, AstNode *node) { |
| ... | ... | @@ -2685,7 +2686,7 @@ static LLVMValueRef gen_const_val(CodeGen *g, TypeTableEntry *type_entry, ConstE |
| 2685 | 2686 | case TypeTableEntryIdStruct: |
| 2686 | 2687 | { |
| 2687 | 2688 | LLVMValueRef *fields = allocate<LLVMValueRef>(type_entry->data.structure.gen_field_count); |
| 2688 | for (int i = 0; i < type_entry->data.structure.src_field_count; i += 1) { | |
| 2689 | for (uint32_t i = 0; i < type_entry->data.structure.src_field_count; i += 1) { | |
| 2689 | 2690 | TypeStructField *type_struct_field = &type_entry->data.structure.fields[i]; |
| 2690 | 2691 | if (type_struct_field->gen_index == -1) { |
| 2691 | 2692 | continue; |
| ... | ... | @@ -2701,7 +2702,7 @@ static LLVMValueRef gen_const_val(CodeGen *g, TypeTableEntry *type_entry, ConstE |
| 2701 | 2702 | TypeTableEntry *child_type = type_entry->data.array.child_type; |
| 2702 | 2703 | uint64_t len = type_entry->data.array.len; |
| 2703 | 2704 | LLVMValueRef *values = allocate<LLVMValueRef>(len); |
| 2704 | for (int i = 0; i < len; i += 1) { | |
| 2705 | for (uint64_t i = 0; i < len; i += 1) { | |
| 2705 | 2706 | ConstExprValue *field_value = const_val->data.x_array.fields[i]; |
| 2706 | 2707 | values[i] = gen_const_val(g, child_type, field_value); |
| 2707 | 2708 | } |
| ... | ... | @@ -2793,6 +2794,7 @@ static LLVMValueRef gen_const_val(CodeGen *g, TypeTableEntry *type_entry, ConstE |
| 2793 | 2794 | zig_unreachable(); |
| 2794 | 2795 | |
| 2795 | 2796 | } |
| 2797 | zig_unreachable(); | |
| 2796 | 2798 | } |
| 2797 | 2799 | |
| 2798 | 2800 | static void gen_const_globals(CodeGen *g) { |
| ... | ... | @@ -3259,8 +3261,7 @@ static void define_builtin_types(CodeGen *g) { |
| 3259 | 3261 | uint64_t debug_size_in_bits = 8*LLVMStoreSizeOfType(g->target_data_ref, entry->type_ref); |
| 3260 | 3262 | uint64_t debug_align_in_bits = 8*LLVMABISizeOfType(g->target_data_ref, entry->type_ref); |
| 3261 | 3263 | entry->di_type = LLVMZigCreateDebugBasicType(g->dbuilder, buf_ptr(&entry->name), |
| 3262 | debug_size_in_bits, debug_align_in_bits, | |
| 3263 | is_signed ? LLVMZigEncoding_DW_ATE_signed() : LLVMZigEncoding_DW_ATE_unsigned()); | |
| 3264 | debug_size_in_bits, debug_align_in_bits, dwarf_tag); | |
| 3264 | 3265 | entry->data.integral.is_signed = is_signed; |
| 3265 | 3266 | entry->data.integral.bit_count = size_in_bits; |
| 3266 | 3267 | g->primitive_type_table.put(&entry->name, entry); |
src/parseh.cpp+1| ... | ... | @@ -606,6 +606,7 @@ static TypeTableEntry *resolve_type_with_table(Context *c, const Type *ty, const |
| 606 | 606 | emit_warning(c, decl, "missed a '%s' type", ty->getTypeClassName()); |
| 607 | 607 | return c->codegen->builtin_types.entry_invalid; |
| 608 | 608 | } |
| 609 | zig_unreachable(); | |
| 609 | 610 | } |
| 610 | 611 | |
| 611 | 612 | static TypeTableEntry *resolve_qual_type_with_table(Context *c, QualType qt, const Decl *decl, |