diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-12-10 11:13:39 -0500 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-12-10 11:13:39 -0500 |
| commit | 9561e7c6b9fb2d9ebcbfd611196db698372ae7bd (patch) | |
| tree | 6b4fd0751e80a9c4128756d59d3c0bfecd230498 /src/ir.cpp | |
| parent | cd4d638d10365e47bcb371119dcee22581355ac4 (diff) | |
| parent | 30715560c829d5636734edf7eabff3ee4d170e5d (diff) | |
| download | zig-9561e7c6b9fb2d9ebcbfd611196db698372ae7bd.tar.gz zig-9561e7c6b9fb2d9ebcbfd611196db698372ae7bd.zip | |
Merge branch 'Snektron-typeOf-to-TypeOf'
closes #3875
closes #1348
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index 154b258327..5a15b64549 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -9267,7 +9267,7 @@ static ZigValue *ir_exec_const_result(CodeGen *codegen, IrExecutable *exec) { } } if (get_scope_typeof(instruction->scope) != nullptr) { - // doesn't count, it's inside a @typeOf() + // doesn't count, it's inside a @TypeOf() continue; } exec_add_error_node(codegen, exec, instruction->source_node, @@ -10413,7 +10413,7 @@ static ConstCastOnly types_match_const_cast_only(IrAnalyze *ira, ZigType *wanted return result; } - bool ok_cv_qualifiers = + bool ok_cv_qualifiers = (!actual_ptr_type->data.pointer.is_const || wanted_ptr_type->data.pointer.is_const) && (!actual_ptr_type->data.pointer.is_volatile || wanted_ptr_type->data.pointer.is_volatile); if (!ok_cv_qualifiers) { @@ -13779,7 +13779,7 @@ static IrInstruction *ir_analyze_cast(IrAnalyze *ira, IrInstruction *source_inst (wanted_type->id == ZigTypeIdOptional && wanted_type->data.maybe.child_type->id == ZigTypeIdEnum)) { IrInstruction *result = ir_analyze_enum_literal(ira, source_instr, value, wanted_type->data.maybe.child_type); - if (result == ira->codegen->invalid_instruction) + if (result == ira->codegen->invalid_instruction) return result; return ir_analyze_optional_wrap(ira, result, value, wanted_type, nullptr); @@ -13790,9 +13790,9 @@ static IrInstruction *ir_analyze_cast(IrAnalyze *ira, IrInstruction *source_inst (wanted_type->id == ZigTypeIdErrorUnion && wanted_type->data.error_union.payload_type->id == ZigTypeIdEnum)) { IrInstruction *result = ir_analyze_enum_literal(ira, source_instr, value, wanted_type->data.error_union.payload_type); - if (result == ira->codegen->invalid_instruction) + if (result == ira->codegen->invalid_instruction) return result; - + return ir_analyze_err_wrap_payload(ira, result, value, wanted_type, nullptr); } @@ -19328,7 +19328,7 @@ static IrInstruction *ir_analyze_instruction_elem_ptr(IrAnalyze *ira, IrInstruct { size_t offset = ptr_field->data.x_ptr.data.base_array.elem_index; uint64_t new_index = offset + index; - if (ptr_field->data.x_ptr.data.base_array.array_val->data.x_array.special != + if (ptr_field->data.x_ptr.data.base_array.array_val->data.x_array.special != ConstArraySpecialBuf) { ir_assert(new_index < |
