diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/all_types.hpp | 2 | ||||
| -rw-r--r-- | src/analyze.cpp | 4 | ||||
| -rw-r--r-- | src/codegen.cpp | 6 | ||||
| -rw-r--r-- | src/ir.cpp | 12 | ||||
| -rw-r--r-- | src/ir_print.cpp | 2 | ||||
| -rw-r--r-- | src/translate_c.cpp | 8 |
6 files changed, 17 insertions, 17 deletions
diff --git a/src/all_types.hpp b/src/all_types.hpp index e364b3d362..747655987c 100644 --- a/src/all_types.hpp +++ b/src/all_types.hpp @@ -2393,7 +2393,7 @@ struct ScopeFnDef { ZigFn *fn_entry; }; -// This scope is created for a @typeOf. +// This scope is created for a @TypeOf. // All runtime side-effects are elided within it. // NodeTypeFnCallExpr struct ScopeTypeOf { diff --git a/src/analyze.cpp b/src/analyze.cpp index 64a0f14372..f46c4fc07c 100644 --- a/src/analyze.cpp +++ b/src/analyze.cpp @@ -121,7 +121,7 @@ static ScopeExpr *find_expr_scope(Scope *scope) { } static void update_progress_display(CodeGen *g) { - stage2_progress_update_node(g->sub_progress_node, + stage2_progress_update_node(g->sub_progress_node, g->resolve_queue_index + g->fn_defs_index, g->resolve_queue.length + g->fn_defs.length); } @@ -1732,7 +1732,7 @@ Error type_allowed_in_extern(CodeGen *g, ZigType *type_entry, bool *result) { ZigType *get_auto_err_set_type(CodeGen *g, ZigFn *fn_entry) { ZigType *err_set_type = new_type_table_entry(ZigTypeIdErrorSet); buf_resize(&err_set_type->name, 0); - buf_appendf(&err_set_type->name, "@typeOf(%s).ReturnType.ErrorSet", buf_ptr(&fn_entry->symbol_name)); + buf_appendf(&err_set_type->name, "@TypeOf(%s).ReturnType.ErrorSet", buf_ptr(&fn_entry->symbol_name)); err_set_type->data.error_set.err_count = 0; err_set_type->data.error_set.errors = nullptr; err_set_type->data.error_set.infer_fn = fn_entry; diff --git a/src/codegen.cpp b/src/codegen.cpp index a7bf7a50c4..5b0899544d 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -1647,7 +1647,7 @@ static void gen_assign_raw(CodeGen *g, LLVMValueRef ptr, ZigType *ptr_type, ptr_type->data.pointer.vector_index, false); LLVMValueRef loaded_vector = gen_load(g, ptr, ptr_type, ""); LLVMValueRef new_vector = LLVMBuildInsertElement(g->builder, loaded_vector, value, - index_val, ""); + index_val, ""); gen_store(g, new_vector, ptr, ptr_type); return; } @@ -8067,7 +8067,7 @@ static void define_builtin_fns(CodeGen *g) { create_builtin_fn(g, BuiltinFnIdTypeInfo, "typeInfo", 1); create_builtin_fn(g, BuiltinFnIdType, "Type", 1); create_builtin_fn(g, BuiltinFnIdHasField, "hasField", 2); - create_builtin_fn(g, BuiltinFnIdTypeof, "typeOf", 1); // TODO rename to TypeOf + create_builtin_fn(g, BuiltinFnIdTypeof, "TypeOf", 1); create_builtin_fn(g, BuiltinFnIdAddWithOverflow, "addWithOverflow", 4); create_builtin_fn(g, BuiltinFnIdSubWithOverflow, "subWithOverflow", 4); create_builtin_fn(g, BuiltinFnIdMulWithOverflow, "mulWithOverflow", 4); @@ -8407,7 +8407,7 @@ Buf *codegen_generate_builtin_source(CodeGen *g) { break; } buf_appendf(contents, "pub const output_mode = OutputMode.%s;\n", out_type); - const char *link_type = g->is_dynamic ? "Dynamic" : "Static"; + const char *link_type = g->is_dynamic ? "Dynamic" : "Static"; buf_appendf(contents, "pub const link_mode = LinkMode.%s;\n", link_type); buf_appendf(contents, "pub const is_test = %s;\n", bool_to_str(g->is_test_build)); buf_appendf(contents, "pub const single_threaded = %s;\n", bool_to_str(g->is_single_threaded)); 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 < diff --git a/src/ir_print.cpp b/src/ir_print.cpp index d1ea15f016..06dbe0f2b5 100644 --- a/src/ir_print.cpp +++ b/src/ir_print.cpp @@ -873,7 +873,7 @@ static void ir_print_vector_store_elem(IrPrint *irp, IrInstructionVectorStoreEle } static void ir_print_typeof(IrPrint *irp, IrInstructionTypeOf *instruction) { - fprintf(irp->f, "@typeOf("); + fprintf(irp->f, "@TypeOf("); ir_print_other_instruction(irp, instruction->value); fprintf(irp->f, ")"); } diff --git a/src/translate_c.cpp b/src/translate_c.cpp index 3fe5fced07..eb207231f0 100644 --- a/src/translate_c.cpp +++ b/src/translate_c.cpp @@ -4230,7 +4230,7 @@ static AstNode *resolve_typedef_decl(Context *c, const ZigClangTypedefNameDecl * emit_warning(c, ZigClangTypedefNameDecl_getLocation(typedef_decl), "typedef %s - unresolved child type", buf_ptr(type_name)); c->decl_table.put(typedef_decl, nullptr); - // TODO add global var with type_name equal to @compileError("unable to resolve C type") + // TODO add global var with type_name equal to @compileError("unable to resolve C type") return nullptr; } add_global_var(c, type_name, type_node); @@ -4919,9 +4919,9 @@ static AstNode *parse_ctok_primary_expr(Context *c, CTokenize *ctok, size_t *tok *tok_i += 1; - //if (@typeId(@typeOf(x)) == @import("builtin").TypeId.Pointer) + //if (@typeId(@TypeOf(x)) == @import("builtin").TypeId.Pointer) // @ptrCast(dest, x) - //else if (@typeId(@typeOf(x)) == @import("builtin").TypeId.Integer) + //else if (@typeId(@TypeOf(x)) == @import("builtin").TypeId.Integer) // @intToPtr(dest, x) //else // (dest)(x) @@ -4931,7 +4931,7 @@ static AstNode *parse_ctok_primary_expr(Context *c, CTokenize *ctok, size_t *tok AstNode *typeid_type = trans_create_node_field_access_str(c, import_builtin, "TypeId"); AstNode *typeid_pointer = trans_create_node_field_access_str(c, typeid_type, "Pointer"); AstNode *typeid_integer = trans_create_node_field_access_str(c, typeid_type, "Int"); - AstNode *typeof_x = trans_create_node_builtin_fn_call_str(c, "typeOf"); + AstNode *typeof_x = trans_create_node_builtin_fn_call_str(c, "TypeOf"); typeof_x->data.fn_call_expr.params.append(node_to_cast); AstNode *typeid_value = trans_create_node_builtin_fn_call_str(c, "typeId"); typeid_value->data.fn_call_expr.params.append(typeof_x); |
